@patternfly/documentation-framework 6.19.0 → 6.21.0

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 CHANGED
@@ -3,6 +3,28 @@
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
+ # 6.21.0 (2025-09-02)
7
+
8
+
9
+ ### Features
10
+
11
+ * **Feedback:** Add a feedback button with qualtrics form ([#4755](https://github.com/patternfly/patternfly-org/issues/4755)) ([21a8823](https://github.com/patternfly/patternfly-org/commit/21a88238b7187e3c98fbb2f4d8c94483796dfcf0))
12
+
13
+
14
+
15
+
16
+
17
+ # 6.20.0 (2025-08-28)
18
+
19
+
20
+ ### Features
21
+
22
+ * **theme:** Add high contrast switcher feature flag ([#4761](https://github.com/patternfly/patternfly-org/issues/4761)) ([94b1bf1](https://github.com/patternfly/patternfly-org/commit/94b1bf11fdf0f9daa230671b9ea6cb8258190db2))
23
+
24
+
25
+
26
+
27
+
6
28
  # 6.19.0 (2025-08-26)
7
29
 
8
30
 
package/app.js CHANGED
@@ -11,6 +11,7 @@ import './components/cssVariables/cssVariables.css';
11
11
  import './components/tableOfContents/tableOfContents.css';
12
12
  import './components/example/example.css';
13
13
  import './components/footer/footer.css';
14
+ import './components/feedbackButton/feedbackButton.css';
14
15
  import './layouts/sideNavLayout/sideNavLayout.css';
15
16
 
16
17
  const AppRoute = ({ child, title, path }) => {
@@ -0,0 +1,48 @@
1
+ .ws-feedback-button-container {
2
+ position: fixed;
3
+ right: 0;
4
+ top: 50vh;
5
+ transform: translateY(-50%);
6
+ transform: rotate(-90deg);
7
+ z-index: 9999;
8
+ pointer-events: auto;
9
+ }
10
+
11
+ .ws-feedback-button {
12
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
13
+ }
14
+
15
+ /* Ensure the button is visible on all screen sizes */
16
+ @media (max-width: 768px) {
17
+ .ws-feedback-button-container {
18
+ right: -20px;
19
+ }
20
+ }
21
+
22
+ /* Ensure the button doesn't interfere with other elements */
23
+ .ws-feedback-button-container .pf-v6-c-button {
24
+ min-width: auto;
25
+ }
26
+
27
+ /* Make the feedback modal taller */
28
+ .ws-feedback-modal {
29
+ max-height: 90vh !important;
30
+ }
31
+
32
+ .ws-feedback-modal .pf-v6-c-modal-box {
33
+ max-height: 90vh !important;
34
+ height: 90vh !important;
35
+ }
36
+
37
+ .ws-feedback-modal .pf-v6-c-modal-box__body {
38
+ height: calc(90vh - 120px) !important;
39
+ overflow-y: auto;
40
+ }
41
+
42
+ /* Make the iframe fill the modal body */
43
+ .ws-feedback-iframe {
44
+ width: 100% !important;
45
+ height: 100% !important;
46
+ border: none;
47
+ display: block;
48
+ }
@@ -0,0 +1,44 @@
1
+ import React, { useState } from 'react';
2
+ import {
3
+ Button,
4
+ Modal,
5
+ ModalBody,
6
+ ModalHeader,
7
+ ModalFooter,
8
+ ModalVariant,
9
+ Label
10
+ } from '@patternfly/react-core';
11
+ import './feedbackButton.css';
12
+
13
+ export const FeedbackButton = () => {
14
+ const [isModalOpen, setIsModalOpen] = useState(false);
15
+
16
+ const handleModalToggle = () => {
17
+ setIsModalOpen(!isModalOpen);
18
+ };
19
+
20
+ return (
21
+ <>
22
+ <div className="ws-feedback-button-container">
23
+ <Button variant="primary" size="sm" className="ws-feedback-button" onClick={handleModalToggle}>Give feedback</Button>
24
+ </div>
25
+
26
+ <Modal
27
+ variant={ModalVariant.large}
28
+ isOpen={isModalOpen}
29
+ onClose={handleModalToggle}
30
+ aria-label="PatternFly feedback modal"
31
+ aria-describedby="feedback-modal-description"
32
+ className="ws-feedback-modal"
33
+ >
34
+ <ModalBody tabIndex="0" id="feedback-modal-description">
35
+ <iframe
36
+ src="https://www.feedback.redhat.com/jfe/form/SV_9MKBjq8H7muINMy"
37
+ title="Give PatternFly feedback"
38
+ className="ws-feedback-iframe"
39
+ ></iframe>
40
+ </ModalBody>
41
+ </Modal>
42
+ </>
43
+ );
44
+ };
@@ -10,4 +10,5 @@ export * from './topNav/topNav';
10
10
  export * from './link/link';
11
11
  export * from './tableOfContents/tableOfContents';
12
12
  export * from './inlineAlert/inlineAlert';
13
- export * from './themeSelector/themeSelector';
13
+ export * from './themeSelector/themeSelector';
14
+ export * from './feedbackButton/feedbackButton';
@@ -84,6 +84,7 @@ export const ThemeSelector = ({ id }) => {
84
84
  return DesktopIcon;
85
85
  }
86
86
  };
87
+
87
88
  return (
88
89
  <Select
89
90
  id={id}
@@ -116,6 +117,7 @@ export const ThemeSelector = ({ id }) => {
116
117
  </SelectOption>
117
118
  </SelectList>
118
119
  </SelectGroup>
120
+ {process.env.hasHighContrastSwitcher && (<>
119
121
  <Divider />
120
122
  <SelectGroup label="High Contrast">
121
123
  <MenuSearch>
@@ -143,6 +145,8 @@ export const ThemeSelector = ({ id }) => {
143
145
  </MenuSearchInput>
144
146
  </MenuSearch>
145
147
  </SelectGroup>
148
+ </>
149
+ )}
146
150
  </Select>
147
151
  );
148
152
  };
package/hooks/useTheme.js CHANGED
@@ -39,7 +39,8 @@ class ThemeManager {
39
39
  if (!this.isBrowser) {
40
40
  return;
41
41
  }
42
- return localStorage.getItem(this.storageKey);
42
+ const storedValue = localStorage.getItem(this.storageKey);
43
+ return storedValue || this.defaultMode;
43
44
  }
44
45
 
45
46
  setStoredValue(value) {
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": "6.19.0",
4
+ "version": "6.21.0",
5
5
  "author": "Red Hat",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -12,7 +12,7 @@
12
12
  "@babel/preset-env": "7.27.1",
13
13
  "@babel/preset-react": "^7.24.1",
14
14
  "@mdx-js/util": "1.6.16",
15
- "@patternfly/ast-helpers": "^1.4.0-alpha.266",
15
+ "@patternfly/ast-helpers": "^1.4.0-alpha.268",
16
16
  "@reach/router": "npm:@gatsbyjs/reach-router@1.3.9",
17
17
  "autoprefixer": "10.4.19",
18
18
  "babel-loader": "^9.1.3",
@@ -87,5 +87,5 @@
87
87
  "braces": ">=3.0.3",
88
88
  "ssri": ">=8.0.1"
89
89
  },
90
- "gitHead": "60954ecaf27cf8c2449a5284f3991bc3059870d7"
90
+ "gitHead": "5569289688e8b1f4742359cb5879631cc85169d1"
91
91
  }
@@ -13,7 +13,9 @@ module.exports = (_env, argv) => {
13
13
  hasVersionSwitcher = false,
14
14
  hasDesignGuidelines = false,
15
15
  hasThemeSwitcher = false,
16
+ hasHighContrastSwitcher = false,
16
17
  hasRTLSwitcher = false,
18
+ hasFeedbackButton = false,
17
19
  componentsData = {},
18
20
  sideNavItems = [],
19
21
  topNavItems = [],
@@ -142,7 +144,9 @@ module.exports = (_env, argv) => {
142
144
  'process.env.hasVersionSwitcher': JSON.stringify(hasVersionSwitcher),
143
145
  'process.env.hasDesignGuidelines': JSON.stringify(hasDesignGuidelines),
144
146
  'process.env.hasThemeSwitcher': JSON.stringify(hasThemeSwitcher),
147
+ 'process.env.hasHighContrastSwitcher': JSON.stringify(hasHighContrastSwitcher),
145
148
  'process.env.hasRTLSwitcher': JSON.stringify(hasRTLSwitcher),
149
+ 'process.env.hasFeedbackButton': JSON.stringify(hasFeedbackButton),
146
150
  'process.env.componentsData': JSON.stringify(componentsData),
147
151
  'process.env.sideNavItems': JSON.stringify(sideNavItems),
148
152
  'process.env.topNavItems': JSON.stringify(topNavItems),
package/templates/mdx.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  import { css } from '@patternfly/react-styles';
19
19
  import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon';
20
20
  import { Router, useLocation } from '@reach/router';
21
- import { CSSVariables, PropsTable, TableOfContents, Link, AutoLinkHeader, InlineAlert } from '../components';
21
+ import { CSSVariables, PropsTable, TableOfContents, Link, AutoLinkHeader, InlineAlert, FeedbackButton } from '../components';
22
22
  import { capitalize, getTitle, slugger, trackEvent } from '../helpers';
23
23
  import './mdx.css';
24
24
  import { convertToReactComponent } from '@patternfly/ast-helpers';
@@ -167,6 +167,7 @@ const MDXChildTemplate = ({ Component, source, toc = [], index = 0, id }) => {
167
167
  };
168
168
 
169
169
  export const MDXTemplate = ({ title, sources = [], path, id, componentsData }) => {
170
+ const hasFeedbackButton = process.env.hasFeedbackButton;
170
171
  const isDeprecated =
171
172
  sources.some((source) => source.source === 'react-deprecated' || source.source === 'html-deprecated') &&
172
173
  !sources.some((source) => source.source === 'react' || source.source === 'html');
@@ -339,6 +340,7 @@ export const MDXTemplate = ({ title, sources = [], path, id, componentsData }) =
339
340
  )}
340
341
  </PageSection>
341
342
  <BackToTop className="ws-back-to-top" scrollableSelector="#ws-page-main" />
343
+ {hasFeedbackButton && <FeedbackButton />}
342
344
  </PageGroup>
343
345
  </React.Fragment>
344
346
  );