From 2de9feaaf661307f23991b5c51d786e1106db114 Mon Sep 17 00:00:00 2001 From: Mark Franceschelli <39063664+mfrances17@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:51:16 -0500 Subject: [PATCH] feat(Wizard): replace deprecations in examples (#11298) * feat(Wizard): replace deprecations in examples * rm modalbody from example and revise modal doc --- .../src/components/Modal/examples/Modal.md | 2 +- .../src/components/Wizard/examples/Wizard.md | 3 ++- .../Wizard/examples/WizardWithinModal.tsx | 13 +++++-------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/react-core/src/components/Modal/examples/Modal.md b/packages/react-core/src/components/Modal/examples/Modal.md index a01abf79698..e3e77986fa9 100644 --- a/packages/react-core/src/components/Modal/examples/Modal.md +++ b/packages/react-core/src/components/Modal/examples/Modal.md @@ -20,7 +20,7 @@ Basic modals give users the option to either confirm or cancel an action. To flag an open modal, use the `isOpen` property. To execute a callback when a modal is closed, use the `onClose` property. -A modal must have a ``, containing the main content of the modal. The `` and `` components are not required, but are typically used to display the modal title and any button actions, respectively. +The ``, ``, and `` components are not required, but are typically used to display the main content of the modal, modal title, and any button actions, respectively. ```ts file="./ModalBasic.tsx" diff --git a/packages/react-core/src/components/Wizard/examples/Wizard.md b/packages/react-core/src/components/Wizard/examples/Wizard.md index 3597f20bfd9..28ba35d252f 100644 --- a/packages/react-core/src/components/Wizard/examples/Wizard.md +++ b/packages/react-core/src/components/Wizard/examples/Wizard.md @@ -34,6 +34,8 @@ DrawerColorVariant, DrawerHead, DrawerActions, DrawerCloseButton, +Modal, +ModalVariant, Wizard, WizardFooter, WizardFooterWrapper, @@ -46,7 +48,6 @@ WizardNavItem, WizardNav, WizardHeader } from '@patternfly/react-core'; -import { Modal as ModalDeprecated, ModalVariant as ModalVariantDeprecated } from '@patternfly/react-core/deprecated'; import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon'; import SlackHashIcon from '@patternfly/react-icons/dist/esm/icons/slack-hash-icon'; import CogsIcon from '@patternfly/react-icons/dist/esm/icons/cogs-icon'; diff --git a/packages/react-core/src/components/Wizard/examples/WizardWithinModal.tsx b/packages/react-core/src/components/Wizard/examples/WizardWithinModal.tsx index 41289391e65..fcccc015852 100644 --- a/packages/react-core/src/components/Wizard/examples/WizardWithinModal.tsx +++ b/packages/react-core/src/components/Wizard/examples/WizardWithinModal.tsx @@ -1,21 +1,18 @@ import React from 'react'; -import { Button, Wizard, WizardStep, WizardHeader } from '@patternfly/react-core'; -import { Modal as ModalDeprecated, ModalVariant as ModalVariantDeprecated } from '@patternfly/react-core/deprecated'; +import { Button, Modal, ModalVariant, Wizard, WizardHeader, WizardStep } from '@patternfly/react-core'; -export const WizardWithinModal = () => { +export const WizardWithinModal: React.FunctionComponent = () => { const [isModelOpen, setIsModalOpen] = React.useState(false); return ( <> - setIsModalOpen(false)} - variant={ModalVariantDeprecated.medium} + variant={ModalVariant.medium} > { Review step content - + ); };