Skip to content

Commit 546aaa1

Browse files
authored
fix(deps): Apply JSX tranform changes to missed demos and examples (#11679)
* fix(deps): Apply JSX tranform changes to missed demos and examples * fixed all missed and edge cases * fix remaining issues
1 parent 54e11ce commit 546aaa1

File tree

473 files changed

+1723
-1388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

473 files changed

+1723
-1388
lines changed

packages/react-core/src/components/Accordion/examples/Accordion.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ cssPrefix: pf-v6-c-accordion
55
propComponents: ['Accordion', 'AccordionItem', 'AccordionContent', 'AccordionToggle', AccordionExpandableContentBody]
66
---
77

8+
import { useState } from 'react';
89
import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-icon';
910

1011
## Examples

packages/react-core/src/components/Accordion/examples/AccordionBordered.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useState } from 'react';
12
import {
23
Accordion,
34
AccordionItem,
@@ -10,8 +11,8 @@ import {
1011
import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-icon';
1112

1213
export const AccordionBordered: React.FunctionComponent = () => {
13-
const [expanded, setExpanded] = React.useState('bordered-toggle4');
14-
const [isDisplayLarge, setIsDisplayLarge] = React.useState(false);
14+
const [expanded, setExpanded] = useState('bordered-toggle4');
15+
const [isDisplayLarge, setIsDisplayLarge] = useState(false);
1516

1617
const displaySize = isDisplayLarge ? 'lg' : 'default';
1718
const onToggle = (id: string) => {

packages/react-core/src/components/Accordion/examples/AccordionDefinitionList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { useState } from 'react';
12
import { Accordion, AccordionItem, AccordionContent, AccordionToggle } from '@patternfly/react-core';
23

34
export const AccordionDefinitionList: React.FunctionComponent = () => {
4-
const [expanded, setExpanded] = React.useState('def-list-toggle2');
5+
const [expanded, setExpanded] = useState('def-list-toggle2');
56

67
const onToggle = (id: string) => {
78
if (id === expanded) {

packages/react-core/src/components/Accordion/examples/AccordionFixedWithMultipleExpandBehavior.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { useState } from 'react';
12
import { Accordion, AccordionItem, AccordionContent, AccordionToggle } from '@patternfly/react-core';
23

34
export const AccordionFixedWithMultipleExpandBehavior: React.FunctionComponent = () => {
4-
const [expanded, setExpanded] = React.useState(['ex2-toggle4']);
5+
const [expanded, setExpanded] = useState(['ex2-toggle4']);
56

67
const toggle = (id) => {
78
const index = expanded.indexOf(id);

packages/react-core/src/components/Accordion/examples/AccordionSingleExpandBehavior.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { useState } from 'react';
12
import { Accordion, AccordionItem, AccordionContent, AccordionToggle } from '@patternfly/react-core';
23

34
export const AccordionSingleExpandBehavior: React.FunctionComponent = () => {
4-
const [expanded, setExpanded] = React.useState('ex-toggle2');
5+
const [expanded, setExpanded] = useState('ex-toggle2');
56

67
const onToggle = (id: string) => {
78
if (id === expanded) {

packages/react-core/src/components/Accordion/examples/AccordionToggleIconAtStart.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { useState } from 'react';
12
import { Accordion, AccordionItem, AccordionContent, AccordionToggle } from '@patternfly/react-core';
23

34
export const AccordionToggleIconAtStart: React.FunctionComponent = () => {
4-
const [expanded, setExpanded] = React.useState('start-toggle-toggle2');
5+
const [expanded, setExpanded] = useState('start-toggle-toggle2');
56

67
const onToggle = (id: string) => {
78
if (id === expanded) {

packages/react-core/src/components/ActionList/examples/ActionList.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cssPrefix: pf-v6-c-action-list
55
propComponents: ['ActionList', 'ActionListGroup', 'ActionListItem']
66
---
77

8-
import { Fragment } from 'react';
8+
import { Fragment, useState } from 'react';
99
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
1010
import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
1111
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';

packages/react-core/src/components/ActionList/examples/ActionListSingleGroup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Fragment } from 'react';
1+
import { Fragment, useState } from 'react';
22
import {
33
ActionList,
44
ActionListGroup,
@@ -14,7 +14,7 @@ import {
1414
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
1515

1616
export const ActionListSingleGroup: React.FunctionComponent = () => {
17-
const [isOpen, setIsOpen] = React.useState(false);
17+
const [isOpen, setIsOpen] = useState(false);
1818

1919
const onToggle = () => {
2020
setIsOpen(!isOpen);

packages/react-core/src/components/Alert/Alert.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Fragment, useEffect, useRef, useState, type JSX } from 'react';
1+
import { Fragment, useEffect, useRef, useState } from 'react';
22
import { css } from '@patternfly/react-styles';
33
import styles from '@patternfly/react-styles/css/components/Alert/alert';
44
import { AlertIcon } from './AlertIcon';
@@ -22,7 +22,7 @@ export interface AlertProps extends Omit<React.HTMLProps<HTMLDivElement>, 'actio
2222
/** Close button; use the alert action close button component. */
2323
actionClose?: React.ReactNode;
2424
/** Action links; use a single alert action link component or multiple wrapped in an array
25-
* or React.Fragment.
25+
* or React fragment.
2626
*/
2727
actionLinks?: React.ReactNode;
2828
/** Content rendered inside the alert. */
@@ -54,7 +54,7 @@ export interface AlertProps extends Omit<React.HTMLProps<HTMLDivElement>, 'actio
5454
/** Title of the alert. */
5555
title: React.ReactNode;
5656
/** Sets the element to use as the alert title. Default is h4. */
57-
component?: keyof JSX.IntrinsicElements;
57+
component?: keyof React.JSX.IntrinsicElements;
5858
/** Adds accessible text to the alert toggle. */
5959
toggleAriaLabel?: string;
6060
/** Position of the tooltip which is displayed if text is truncated. */

0 commit comments

Comments
 (0)