Skip to content

Commit 12f0192

Browse files
committed
feat(ver): add support for react 19
1 parent ad688a3 commit 12f0192

File tree

17 files changed

+760
-25377
lines changed

17 files changed

+760
-25377
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"plugin:react/recommended",
1010
"plugin:react-hooks/recommended",
1111
"plugin:@typescript-eslint/recommended",
12+
"plugin:react/jsx-runtime",
1213
"prettier"
1314
],
1415
"overrides": [

package-lock.json

Lines changed: 0 additions & 24993 deletions
This file was deleted.

packages/module/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"@patternfly/react-icons": "^6.0.0"
3737
},
3838
"peerDependencies": {
39-
"react": "^17 || ^18",
40-
"react-dom": "^17 || ^18"
39+
"react": "^17 || ^18 || ^19",
40+
"react-dom": "^17 || ^18 || ^19"
4141
},
4242
"devDependencies": {
4343
"copyfiles": "2.4.1",

packages/module/patternfly-docs/content/examples/Advanced.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* eslint-disable no-console */
2-
import React from 'react';
2+
import { FunctionComponent, useState } from 'react';
33
import { FeedbackModal} from '@patternfly/react-user-feedback';
44
import { Button } from '@patternfly/react-core';
55
import feedbackImage from '@patternfly/react-user-feedback/dist/esm/images/rh_feedback.svg';
66

7-
export const AdvancedExample: React.FunctionComponent = () => {
8-
const [isOpen, setIsOpen] = React.useState<boolean>(false);
7+
export const AdvancedExample: FunctionComponent = () => {
8+
const [isOpen, setIsOpen] = useState<boolean>(false);
99
const handleButtonClicked = () => {setIsOpen(true)};
1010
return <>
1111
<Button onClick={handleButtonClicked}>Show Modal</Button>

packages/module/patternfly-docs/content/examples/AdvancedWithEmail.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* eslint-disable no-console */
2-
import React from 'react';
2+
import { FunctionComponent, useState } from 'react';
33
import { FeedbackModal} from '@patternfly/react-user-feedback';
44
import { Button } from '@patternfly/react-core';
55
import feedbackImage from '@patternfly/react-user-feedback/dist/esm/images/rh_feedback.svg';
66

7-
export const AdvancedStaticEmailExample: React.FunctionComponent = () => {
8-
const [isOpen, setIsOpen] = React.useState<boolean>(false);
7+
export const AdvancedStaticEmailExample: FunctionComponent = () => {
8+
const [isOpen, setIsOpen] = useState<boolean>(false);
99
const handleButtonClicked = () => {setIsOpen(true)};
1010
return <>
1111
<Button onClick={handleButtonClicked}>Show Modal</Button>

packages/module/patternfly-docs/content/examples/Async.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* eslint-disable no-console */
2-
import React from 'react';
2+
import { FunctionComponent, useState } from 'react';
33
import { FeedbackModal} from '@patternfly/react-user-feedback';
44
import { Button } from '@patternfly/react-core';
55

6-
export const AsyncExample: React.FunctionComponent = () => {
7-
const [isOpen, setIsOpen] = React.useState<boolean>(false);
6+
export const AsyncExample: FunctionComponent = () => {
7+
const [isOpen, setIsOpen] = useState<boolean>(false);
88

99
const fakeNetworkCall = (email:string, feedback:string, bug:string) => new Promise<boolean>(resolve => {
1010
setTimeout(() => {

packages/module/patternfly-docs/content/examples/basic.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,26 @@ propComponents: ['FeedbackModalProps']
1414
sourceLink: https://github.com/patternfly/react-user-feedback/blob/c0c51c751abf0b798f511806409f25d2a2e87a60/packages/module/patternfly-docs/content/examples/basic.md
1515
---
1616

17+
import { FunctionComponent, useState } from 'react';
1718
import { FeedbackModal } from "@patternfly/react-user-feedback";
1819
import feedbackImage from '@patternfly/react-user-feedback/dist/esm/images/rh_feedback.svg';
1920

2021
## About
21-
22+
2223
The user feedback extension is a PatternFly React based component used to collect user feedback. Examples of how to use this extension are documented below. This extensions allows users to submit feedback, report a bug, request support, as well as join a mailing list to stay updated on the latest news and research opportunities.
2324

2425
## Examples
2526

2627
### Basic modal
28+
2729
To collect data, you can link modal items to external sources instead of a built in form. For example, you can link to a custom form, which will be opened in a new tab.
2830

2931
```js file="./URL.tsx"
3032

3133
```
3234

3335
### Advanced modal
36+
3437
User feedback offers additional modal items that support different types of feedback. To allow users to report a bug, use the `onReportABug` property. To allow users to join a mailing list, such as one dedicated to future research participation, use the `onJoinMailingList` property. To allow users to open a support case, use the `onOpenSupportCase` property and link users to your support team.
3538

3639
The following example demonstrates each of these modal items. The "Share feedback", "Report a bug", and "Inform the direction of products" items all point to built-in forms.
@@ -40,20 +43,26 @@ The following example demonstrates each of these modal items. The "Share feedbac
4043
```
4144

4245
### Advanced that autofills an email address
46+
4347
To automatically pass a user's email address into a feedback modal, use the email property. This allows you to pre-populate the modal's email field.
48+
4449
```js file="./AdvancedWithEmail.tsx"
4550

4651
```
52+
4753
### Modal with asynchronous call support
48-
User feedback supports the ability to make asynchronous calls to send data collected from the modal to a backend service.
49-
54+
55+
User feedback supports the ability to make asynchronous calls to send data collected from the modal to a backend service.
5056
The following example demonstrates how to use the `async` function to send data to a backend service.
57+
5158
```js file="./Async.tsx"
5259

5360
```
5461

5562
### Modal with internationalization support
63+
5664
To customize the content displayed in the feedback modal, pass in a custom `i18n` object with values for each property of `<FeedbackModal>`. This allows you to prepare a modal for different languages and requirements.
65+
5766
```js file="./i18n.tsx"
5867

59-
```
68+
```

packages/module/patternfly-docs/generated/extensions/user-feedback/design-guidelines.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react';
22
import { AutoLinkHeader, Example, Link as PatternflyThemeLink } from '@patternfly/documentation-framework/components';
3-
import srcImport0 from '../../../content/design-guidelines/./img/advanced-user-feedback.png';
4-
import srcImport1 from '../../../content/design-guidelines/./img/dropdown-selection.png';
5-
import srcImport2 from '../../../content/design-guidelines/./img/share-feedback.png';
6-
import srcImport3 from '../../../content/design-guidelines/./img/report-bug.png';
7-
import srcImport4 from '../../../content/design-guidelines/./img/research-opportunities.png';
8-
import srcImport5 from '../../../content/design-guidelines/./img/user-feedback-external-links.png';
3+
import srcImport6 from '../../../content/design-guidelines/./img/advanced-user-feedback.png';
4+
import srcImport7 from '../../../content/design-guidelines/./img/dropdown-selection.png';
5+
import srcImport8 from '../../../content/design-guidelines/./img/share-feedback.png';
6+
import srcImport9 from '../../../content/design-guidelines/./img/report-bug.png';
7+
import srcImport10 from '../../../content/design-guidelines/./img/research-opportunities.png';
8+
import srcImport11 from '../../../content/design-guidelines/./img/user-feedback-external-links.png';
99
const pageData = {
1010
"id": "User feedback",
1111
"section": "extensions",
@@ -44,7 +44,7 @@ const Component = () => (
4444
{`Elements`}
4545
</AutoLinkHeader>
4646
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
47-
<img src={srcImport0} width={srcImport0.width} height={srcImport0.height} {...{"alt":"Image of advanced feedback modal with annotations","className":"ws-img "}}>
47+
<img src={srcImport6} width={srcImport6.width} height={srcImport6.height} {...{"alt":"Image of advanced feedback modal with annotations","className":"ws-img "}}>
4848
</img>
4949
</p>
5050
<ol {...{"className":"pf-v6-c-content--ol pf-m-editorial ws-ol "}}>
@@ -86,7 +86,7 @@ const Component = () => (
8686
{`For example, you can allow users to access the modal by selecting a masthead’s help icon and choosing “Share feedback” in the dropdown menu:`}
8787
</p>
8888
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
89-
<img src={srcImport1} width={srcImport1.width} height={srcImport1.height} {...{"alt":"Image of expanded dropdown menu with link to sharing feedback","className":"ws-img "}}>
89+
<img src={srcImport7} width={srcImport7.width} height={srcImport7.height} {...{"alt":"Image of expanded dropdown menu with link to sharing feedback","className":"ws-img "}}>
9090
</img>
9191
</p>
9292
<AutoLinkHeader {...{"id":"variations","headingLevel":"h2","className":"ws-title ws-h2"}}>
@@ -110,7 +110,7 @@ const Component = () => (
110110
{`The general feedback form allows users to enter feedback into a text box and submit.`}
111111
</p>
112112
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
113-
<img src={srcImport2} width={srcImport2.width} height={srcImport2.height} {...{"alt":"Image of a form within a modal to share feedback","className":"ws-img "}}>
113+
<img src={srcImport8} width={srcImport8.width} height={srcImport8.height} {...{"alt":"Image of a form within a modal to share feedback","className":"ws-img "}}>
114114
</img>
115115
</p>
116116
</li>
@@ -122,7 +122,7 @@ const Component = () => (
122122
{`The bug report form allows users to enter feedback into a text box and submit. Its description directs users to a URL where they can submit a support ticket for critical issues.`}
123123
</p>
124124
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
125-
<img src={srcImport3} width={srcImport3.width} height={srcImport3.height} {...{"alt":"Image of a form within a modal to report bugs","className":"ws-img "}}>
125+
<img src={srcImport9} width={srcImport9.width} height={srcImport9.height} {...{"alt":"Image of a form within a modal to report bugs","className":"ws-img "}}>
126126
</img>
127127
</p>
128128
</li>
@@ -134,7 +134,7 @@ const Component = () => (
134134
{`The user research opt-in form allows users to enter their email address to participate in future research efforts.`}
135135
</p>
136136
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
137-
<img src={srcImport4} width={srcImport4.width} height={srcImport4.height} {...{"alt":"Image of a form within a modal to sign up for research opportunities","className":"ws-img "}}>
137+
<img src={srcImport10} width={srcImport10.width} height={srcImport10.height} {...{"alt":"Image of a form within a modal to sign up for research opportunities","className":"ws-img "}}>
138138
</img>
139139
</p>
140140
</li>
@@ -146,7 +146,7 @@ const Component = () => (
146146
{`Selecting an item redirects users to an external URL (like a qualtrics form) that opens in a separate tab.`}
147147
</p>
148148
<p {...{"className":"pf-v6-c-content--p pf-m-editorial ws-p "}}>
149-
<img src={srcImport5} width={srcImport5.width} height={srcImport5.height} {...{"alt":"Image of modal with links to external forms","className":"ws-img "}}>
149+
<img src={srcImport11} width={srcImport11.width} height={srcImport11.height} {...{"alt":"Image of modal with links to external forms","className":"ws-img "}}>
150150
</img>
151151
</p>
152152
</React.Fragment>

0 commit comments

Comments
 (0)