diff --git a/packages/react-core/src/components/ActionList/examples/ActionList.md b/packages/react-core/src/components/ActionList/examples/ActionList.md
index c3efc39c11d..6d0ab7d2b85 100644
--- a/packages/react-core/src/components/ActionList/examples/ActionList.md
+++ b/packages/react-core/src/components/ActionList/examples/ActionList.md
@@ -7,25 +7,35 @@ propComponents: ['ActionList', 'ActionListGroup', 'ActionListItem']
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
+import {
+Dropdown as DropdownDeprecated,
+DropdownItem as DropdownItemDeprecated,
+DropdownSeparator,
+KebabToggle
+} from '@patternfly/react-core/deprecated';
## Examples
### Action list single group
```ts file="ActionListSingleGroup.tsx"
+
```
### Action list with icons
```ts file="./ActionListWithIcons.tsx"
+
```
### Action list multiple groups
```ts file="./ActionListMultipleGroups.tsx"
+
```
### Action list with cancel button
```ts file="./ActionListWithCancelButton.tsx"
+
```
diff --git a/packages/react-core/src/components/ActionList/examples/ActionListSingleGroup.tsx b/packages/react-core/src/components/ActionList/examples/ActionListSingleGroup.tsx
index e06a26aeb68..509332c9d2e 100644
--- a/packages/react-core/src/components/ActionList/examples/ActionListSingleGroup.tsx
+++ b/packages/react-core/src/components/ActionList/examples/ActionListSingleGroup.tsx
@@ -1,13 +1,11 @@
import React from 'react';
+import { ActionList, ActionListItem, Button } from '@patternfly/react-core';
import {
- ActionList,
- ActionListItem,
- Button,
- Dropdown,
- DropdownItem,
+ Dropdown as DropdownDeprecated,
+ DropdownItem as DropdownItemDeprecated,
DropdownSeparator,
KebabToggle
-} from '@patternfly/react-core';
+} from '@patternfly/react-core/deprecated';
export const ActionListSingleGroup: React.FunctionComponent = () => {
const [isOpen, setIsOpen] = React.useState(false);
@@ -26,21 +24,21 @@ export const ActionListSingleGroup: React.FunctionComponent = () => {
};
const dropdownItems = [
- Link,
-
+ Link,
+
Action
- ,
-
+ ,
+
Disabled Link
- ,
-
+ ,
+
Disabled Action
- ,
+ ,
,
- Separated Link,
-
+ Separated Link,
+
Separated Action
-
+
];
return (
@@ -71,7 +69,7 @@ export const ActionListSingleGroup: React.FunctionComponent = () => {
- }
isOpen={isOpen}
diff --git a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx
index 812fa2bfb85..9437f82c0e0 100644
--- a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx
@@ -2,8 +2,13 @@ import * as React from 'react';
import { css } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/AppLauncher/app-launcher';
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
-import { DropdownDirection, DropdownPosition, DropdownToggle, DropdownContext } from '../Dropdown';
-import { DropdownWithContext } from '../Dropdown/DropdownWithContext';
+import {
+ DropdownDirection,
+ DropdownPosition,
+ DropdownToggle,
+ DropdownContext
+} from '../../deprecated/components/Dropdown';
+import { DropdownWithContext } from '../../deprecated/components/Dropdown/DropdownWithContext';
import { ApplicationLauncherGroup } from './ApplicationLauncherGroup';
import { ApplicationLauncherSeparator } from './ApplicationLauncherSeparator';
import { ApplicationLauncherItem } from './ApplicationLauncherItem';
@@ -94,13 +99,7 @@ export class ApplicationLauncher extends React.Component
- }
+ customChild={}
>
);
diff --git a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherGroup.tsx b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherGroup.tsx
index 7be51bf49d4..bf0754f2b19 100644
--- a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherGroup.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherGroup.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { DropdownGroup, DropdownGroupProps } from '../Dropdown';
+import { DropdownGroup, DropdownGroupProps } from '../../deprecated/components/Dropdown';
export const ApplicationLauncherGroup: React.FunctionComponent = ({
children,
diff --git a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherItem.tsx b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherItem.tsx
index f1a53a0c72c..67a99a31626 100644
--- a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherItem.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherItem.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
import { css } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/components/AppLauncher/app-launcher';
-import { DropdownItem, DropdownItemProps } from '../Dropdown';
+import { DropdownItem, DropdownItemProps } from '../../deprecated/components/Dropdown';
import { ApplicationLauncherContent } from './ApplicationLauncherContent';
import { ApplicationLauncherContext } from './ApplicationLauncherContext';
import { ApplicationLauncherItemContext } from './ApplicationLauncherItemContext';
diff --git a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherSeparator.tsx b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherSeparator.tsx
index 59ca4ac3aba..82d63ca61db 100644
--- a/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherSeparator.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/ApplicationLauncherSeparator.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { DropdownSeparator, SeparatorProps } from '../Dropdown/DropdownSeparator';
+import { DropdownSeparator, SeparatorProps } from '../../deprecated/components/Dropdown/DropdownSeparator';
export const ApplicationLauncherSeparator: React.FunctionComponent = ({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/ApplicationLauncher.test.tsx b/packages/react-core/src/components/ApplicationLauncher/__tests__/ApplicationLauncher.test.tsx
index bbb07940e19..387fbda9579 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/ApplicationLauncher.test.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/ApplicationLauncher.test.tsx
@@ -4,7 +4,7 @@ import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
import { ApplicationLauncher } from '../ApplicationLauncher';
import { ApplicationLauncherItem } from '../ApplicationLauncherItem';
-import { DropdownPosition, DropdownDirection } from '../../Dropdown/dropdownConstants';
+import { DropdownPosition, DropdownDirection } from '../../../deprecated/components/Dropdown/dropdownConstants';
import { ApplicationLauncherSeparator } from '../ApplicationLauncherSeparator';
const dropdownItems = [
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherSeparator.test.tsx b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherSeparator.test.tsx
index fbba4de4795..1dfd81edec5 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherSeparator.test.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherSeparator.test.tsx
@@ -2,7 +2,7 @@ import React from 'react';
import { render } from '@testing-library/react';
import { ApplicationLauncherSeparator } from '../../ApplicationLauncherSeparator';
-import { DropdownArrowContext } from '../../../Dropdown/dropdownConstants';
+import { DropdownArrowContext } from '../../../../deprecated/components/Dropdown/dropdownConstants';
describe('ApplicationLauncherSeparator', () => {
it('should match snapshot', () => {
diff --git a/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncher.md b/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncher.md
index db5d30e9e52..ee9df4ff57e 100644
--- a/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncher.md
+++ b/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncher.md
@@ -6,6 +6,7 @@ propComponents: ['ApplicationLauncher', 'ApplicationLauncherItem', 'ApplicationL
ouia: true
---
+import { DropdownDirection, DropdownPosition } from '@patternfly/react-core/deprecated';
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
import { Link } from '@reach/router';
import pfLogoSm from './pf-logo-small.svg';
@@ -18,49 +19,59 @@ To add a tooltip, use the `tooltip` prop and optionally add more tooltip props b
### Basic
```ts file="./ApplicationLauncherBasic.tsx"
+
```
### Router link
```ts file="./ApplicationLauncherRouterLink.tsx"
+
```
### Disabled
```ts file="./ApplicationLauncherDisabled.tsx"
+
```
### Aligned right
```ts file="./ApplicationLauncherAlignRight.tsx"
+
```
### Aligned top
```ts file="./ApplicationLauncherAlignTop.tsx"
+
```
### With tooltip
```ts file="./ApplicationLauncherTooltip.tsx"
+
```
### With sections and icons
```ts file="./ApplicationLauncherSectionsAndIcons.tsx"
+
```
### With favorites and search
```ts file="./ApplicationLauncherFavoritesAndSearch.tsx"
+
```
### With custom icon
```ts file="./ApplicationLauncherCustomIcon.tsx"
+
```
### Basic with menu appended to document body
```ts file="./ApplicationLauncherDocumentBody.tsx"
+
```
diff --git a/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncherAlignRight.tsx b/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncherAlignRight.tsx
index ca7f9a2a220..72fd38819b9 100644
--- a/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncherAlignRight.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/examples/ApplicationLauncherAlignRight.tsx
@@ -1,5 +1,6 @@
import React from 'react';
-import { ApplicationLauncher, ApplicationLauncherItem, DropdownPosition } from '@patternfly/react-core';
+import { ApplicationLauncher, ApplicationLauncherItem } from '@patternfly/react-core';
+import { DropdownPosition } from '@patternfly/react-core/deprecated';
const appLauncherItems: React.ReactElement[] = [
@@ -17,7 +18,7 @@ export const ApplicationLauncherAlignRight: React.FunctionComponent = () => {
const [isOpen, setIsOpen] = React.useState(false);
const onToggle = (_event: any, isOpen: boolean) => setIsOpen(isOpen);
- const onSelect = (_event: any) => setIsOpen(prevIsOpen => !prevIsOpen);
+ const onSelect = (_event: any) => setIsOpen((prevIsOpen) => !prevIsOpen);
return (
@@ -17,7 +18,7 @@ export const ApplicationLauncherAlignTop: React.FunctionComponent = () => {
const [isOpen, setIsOpen] = React.useState(false);
const onToggle = (_event: any, isOpen: boolean) => setIsOpen(isOpen);
- const onSelect = (_event: any) => setIsOpen(prevIsOpen => !prevIsOpen);
+ const onSelect = (_event: any) => setIsOpen((prevIsOpen) => !prevIsOpen);
return (
}>
+ }>
Edit
- ,
- }>
+ ,
+ }>
Deployment
- ,
- }>
+ ,
+ }>
Applications
-
+
];
export const BreadcrumbDropdown: React.FunctionComponent = () => {
@@ -36,7 +34,7 @@ export const BreadcrumbDropdown: React.FunctionComponent = () => {
Section home
-
diff --git a/packages/react-core/src/components/Card/examples/Card.md b/packages/react-core/src/components/Card/examples/Card.md
index 912b8734457..d65ff910609 100644
--- a/packages/react-core/src/components/Card/examples/Card.md
+++ b/packages/react-core/src/components/Card/examples/Card.md
@@ -2,21 +2,28 @@
id: Card
section: components
cssPrefix: pf-c-card
-propComponents: ['Card', 'CardHeader', 'CardHeaderActionsObject', 'CardTitle', 'CardBody', 'CardFooter', 'CardExpandableContent']
+propComponents:
+ ['Card', 'CardHeader', 'CardHeaderActionsObject', 'CardTitle', 'CardBody', 'CardFooter', 'CardExpandableContent']
ouia: true
---
+import {
+Dropdown as DropdownDeprecated,
+DropdownItem as DropdownItemDeprecated,
+DropdownSeparator,
+KebabToggle
+} from '@patternfly/react-core/deprecated';
import pfLogo from './pfLogo.svg';
import pfLogoSmall from './pf-logo-small.svg';
-
-## Examples
+## Examples
### Basic cards
Basic cards typically have a ``, `` and ``. You may omit these components as needed, but it is recommended to at least include a `` to provide details about the card item.
```ts file='./CardBasic.tsx'
+
```
### Modifiers
@@ -26,29 +33,30 @@ You can further modify the styling of the card's content by using the properties
Most modifiers can be used in combination with each other, except for `isCompact` and `isLarge`, since they are contradictory.
```ts file='./CardWithModifiers.tsx'
-```
-| Modifier | Description |
-| --- | --- |
-| isCompact | Modifies the card to include compact styling. Should not be used with isLarge. |
-| isFlat | Modifies the card to include flat styling. |
-| isRounded | Modifies the card to include rounded border styling. |
-| isLarge | Modifies the card to be large. Should not be used with isCompact. |
-| isFullHeight | Modifies the card so that it fills the total available height of its container. |
-| isPlain | Modifies the card to include plain styling, which removes the border and background. |
+```
+| Modifier | Description |
+| ------------ | ------------------------------------------------------------------------------------ |
+| isCompact | Modifies the card to include compact styling. Should not be used with isLarge. |
+| isFlat | Modifies the card to include flat styling. |
+| isRounded | Modifies the card to include rounded border styling. |
+| isLarge | Modifies the card to be large. Should not be used with isCompact. |
+| isFullHeight | Modifies the card so that it fills the total available height of its container. |
+| isPlain | Modifies the card to include plain styling, which removes the border and background. |
### Header images and actions
You can include header actions with the `actions` property of `` . The following example includes an image using the [Brand](/components/brand) component, and also includes a kebab dropdown and a checkbox in `` actions.
-The `actions` property for `` includes the `hasNoOffset` property, which is `false` by default. When `hasNoOffset` is `false`, a negative margin is applied to help align default-sized card titles with card actions.
+The `actions` property for `` includes the `hasNoOffset` property, which is `false` by default. When `hasNoOffset` is `false`, a negative margin is applied to help align default-sized card titles with card actions.
-You may use `hasNoOffset` to remove this negative margin, which better aligns card actions in implementations that use large card titles or tall header images, for example.
+You may use `hasNoOffset` to remove this negative margin, which better aligns card actions in implementations that use large card titles or tall header images, for example.
Select the "actions hasNoOffset" checkbox in the example below to illustrate this behavior.
```ts file='./CardWithImageAndActions.tsx'
+
```
### Title inline with images and actions
@@ -56,6 +64,7 @@ Select the "actions hasNoOffset" checkbox in the example below to illustrate thi
Moving `` within the `` will style it inline with any images or actions.
```ts file='./CardHeaderInCardHead.tsx'
+
```
### Card header without title
@@ -65,6 +74,7 @@ Card actions can be placed in the card header even without a ``.
Images can also be placed in the card header without a ``.
```ts file='./CardOnlyActionsInCardHead.tsx'
+
```
### With HTML heading element
@@ -72,6 +82,7 @@ Images can also be placed in the card header without a ``.
You may use the `component` property to place the card's title within an HTML heading element.
```ts file='./CardWithHeadingElement.tsx'
+
```
### With multiple body sections
@@ -79,15 +90,17 @@ You may use the `component` property to place the card's title within an HTML he
You may use multiple body sections to visually separate blocks of content.
```ts file='./CardWithMultipleBodySections.tsx'
+
```
### With a primary body section that fills
`` sections will fill the available height of the card when `isFilled` equals `{true}`, which is the default value. Set `isFilled` to `{false}` to disable this behavior for one or more body sections. The remaining available height of the card will be split between any `` section that does not set `isFilled` to `{false}`.
-A common use case of this is to set all but one body section to `isFilled={false}` so that a primary body section fills the available space of the card as seen in the example below. This example has 3 `` sections, two of which set `isFilled` to `{false}`. The third `` fills the remaining height of the card.
+A common use case of this is to set all but one body section to `isFilled={false}` so that a primary body section fills the available space of the card as seen in the example below. This example has 3 `` sections, two of which set `isFilled` to `{false}`. The third `` fills the remaining height of the card.
```ts file='./CardWithBodySectionFills.tsx'
+
```
### Selectable cards
@@ -95,6 +108,7 @@ A common use case of this is to set all but one body section to `isFilled={false
Selectable cards can only be selected one at a time, and are intended for use with [primary-detail layout](/demos/primary-detail).
```ts file='./CardSelectable.tsx'
+
```
### Legacy selectable cards
@@ -102,6 +116,7 @@ Selectable cards can only be selected one at a time, and are intended for use wi
The following example shows a legacy implementation of selectable cards. This example uses the `isSelectable` property instead of `isSelectableRaised`, which is the current recommendation for implementation. `isSelectable` applies selectable styling, but does not apply raised styling on hover and selection as `isSelectableRaised` does.
```ts file='./CardLegacySelectable.tsx'
+
```
### Selectable card accessibility features
@@ -114,20 +129,22 @@ By default, this input will have an aria-label that corresponds to the `` component.
```ts file='./CardExpandable.tsx'
+
```
### Expandable with icon
@@ -135,4 +152,5 @@ Place any content that you want to be hidden within the `
An image can be placed in the card header to show users an icon beside the expansion caret.
```ts file='./CardExpandableWithIcon.tsx'
+
```
diff --git a/packages/react-core/src/components/Card/examples/CardExpandable.tsx b/packages/react-core/src/components/Card/examples/CardExpandable.tsx
index 63d34b84ffa..6871cba5068 100644
--- a/packages/react-core/src/components/Card/examples/CardExpandable.tsx
+++ b/packages/react-core/src/components/Card/examples/CardExpandable.tsx
@@ -6,12 +6,14 @@ import {
CardBody,
CardFooter,
CardExpandableContent,
- Checkbox,
- Dropdown,
- DropdownItem,
+ Checkbox
+} from '@patternfly/react-core';
+import {
+ Dropdown as DropdownDeprecated,
+ DropdownItem as DropdownItemDeprecated,
DropdownSeparator,
KebabToggle
-} from '@patternfly/react-core';
+} from '@patternfly/react-core/deprecated';
export const CardExpandable: React.FunctionComponent = () => {
const [isOpen, setIsOpen] = React.useState(false);
@@ -38,26 +40,26 @@ export const CardExpandable: React.FunctionComponent = () => {
};
const dropdownItems = [
- Link,
-
+ Link,
+
Action
- ,
-
+ ,
+
Disabled Link
- ,
-
+ ,
+
Disabled Action
- ,
+ ,
,
- Separated Link,
-
+ Separated Link,
+
Separated Action
-
+
];
const headerActions = (
<>
- setIsOpen(isOpen)} />}
isOpen={isOpen}
@@ -88,7 +90,7 @@ export const CardExpandable: React.FunctionComponent = () => {
{
@@ -33,26 +28,26 @@ export const CardExpandableWithIcon: React.FunctionComponent = () => {
};
const dropdownItems = [
- Link,
-
+ Link,
+
Action
- ,
-
+ ,
+
Disabled Link
- ,
-
+ ,
+
Disabled Action
- ,
+ ,
,
- Separated Link,
-
+ Separated Link,
+
Separated Action
-
+
];
const headerActions = (
<>
- setIsOpen(isOpen)} />}
isOpen={isOpen}
@@ -73,7 +68,7 @@ export const CardExpandableWithIcon: React.FunctionComponent = () => {
return (
{
const [isOpen, setIsOpen] = React.useState(false);
@@ -24,26 +19,26 @@ export const CardTitleInHeader: React.FunctionComponent = () => {
};
const dropdownItems = [
- Link,
-
+ Link,
+
Action
- ,
-
+ ,
+
Disabled Link
- ,
-
+ ,
+
Disabled Action
- ,
+ ,
,
- Separated Link,
-
+ Separated Link,
+
Separated Action
-
+
];
const headerActions = (
<>
- setIsOpen(isOpen)} />}
isOpen={isOpen}
@@ -63,7 +58,7 @@ export const CardTitleInHeader: React.FunctionComponent = () => {
return (
-
+
This is a really really really really really really really really really really long header
diff --git a/packages/react-core/src/components/Card/examples/CardLegacySelectable.tsx b/packages/react-core/src/components/Card/examples/CardLegacySelectable.tsx
index 6b32f9ee43e..cb1f647638e 100644
--- a/packages/react-core/src/components/Card/examples/CardLegacySelectable.tsx
+++ b/packages/react-core/src/components/Card/examples/CardLegacySelectable.tsx
@@ -1,14 +1,11 @@
import React from 'react';
+import { Card, CardHeader, CardTitle, CardBody } from '@patternfly/react-core';
import {
- Card,
- CardHeader,
- CardTitle,
- CardBody,
- Dropdown,
- DropdownItem,
+ Dropdown as DropdownDeprecated,
+ DropdownItem as DropdownItemDeprecated,
DropdownSeparator,
KebabToggle
-} from '@patternfly/react-core';
+} from '@patternfly/react-core/deprecated';
export const CardLegacySelectable: React.FunctionComponent = () => {
const [selected, setSelected] = React.useState('');
@@ -46,26 +43,26 @@ export const CardLegacySelectable: React.FunctionComponent = () => {
};
const dropdownItems = [
- Link,
-
+ Link,
+
Action
- ,
-
+ ,
+
Disabled Link
- ,
-
+ ,
+
Disabled Action
- ,
+ ,
,
- Separated Link,
-
+ Separated Link,
+
Separated Action
-
+
];
const headerActions = (
<>
- }
isOpen={isKebabOpen}
@@ -87,7 +84,7 @@ export const CardLegacySelectable: React.FunctionComponent = () => {
isSelected={selected === 'legacy-first-card'}
hasSelectableInput
>
-
+ First legacy selectable cardThis is a selectable card. Click me to select me. Click again to deselect me.
diff --git a/packages/react-core/src/components/Card/examples/CardOnlyActionsInCardHead.tsx b/packages/react-core/src/components/Card/examples/CardOnlyActionsInCardHead.tsx
index 75be753f345..ef14942d7be 100644
--- a/packages/react-core/src/components/Card/examples/CardOnlyActionsInCardHead.tsx
+++ b/packages/react-core/src/components/Card/examples/CardOnlyActionsInCardHead.tsx
@@ -1,14 +1,11 @@
import React from 'react';
+import { Checkbox, Card, CardHeader, CardBody } from '@patternfly/react-core';
import {
- Checkbox,
- Dropdown,
- DropdownItem,
+ Dropdown as DropdownDeprecated,
+ DropdownItem as DropdownItemDeprecated,
DropdownSeparator,
- KebabToggle,
- Card,
- CardHeader,
- CardBody
-} from '@patternfly/react-core';
+ KebabToggle
+} from '@patternfly/react-core/deprecated';
export const CardOnlyActionsInCardHead: React.FunctionComponent = () => {
const [isOpen, setIsOpen] = React.useState(false);
@@ -22,26 +19,26 @@ export const CardOnlyActionsInCardHead: React.FunctionComponent = () => {
};
const dropdownItems = [
- Link,
-
+ Link,
+
Action
- ,
-
+ ,
+
Disabled Link
- ,
-
+ ,
+
Disabled Action
- ,
+ ,
,
- Separated Link,
-
+ Separated Link,
+
Separated Action
-
+
];
const headerActions = (
<>
- setIsOpen(isOpen)} />}
isOpen={isOpen}
@@ -61,7 +58,7 @@ export const CardOnlyActionsInCardHead: React.FunctionComponent = () => {
return (
-
+ This is the card body. There are only actions in the card head.
);
diff --git a/packages/react-core/src/components/Card/examples/CardSelectable.tsx b/packages/react-core/src/components/Card/examples/CardSelectable.tsx
index b3679eac3e4..9849709b62e 100644
--- a/packages/react-core/src/components/Card/examples/CardSelectable.tsx
+++ b/packages/react-core/src/components/Card/examples/CardSelectable.tsx
@@ -1,14 +1,11 @@
import React from 'react';
+import { Card, CardHeader, CardTitle, CardBody } from '@patternfly/react-core';
import {
- Card,
- CardHeader,
- CardTitle,
- CardBody,
- Dropdown,
- DropdownItem,
+ Dropdown as DropdownDeprecated,
+ DropdownItem as DropdownItemDeprecated,
DropdownSeparator,
KebabToggle
-} from '@patternfly/react-core';
+} from '@patternfly/react-core/deprecated';
export const CardSelectable: React.FunctionComponent = () => {
const [selected, setSelected] = React.useState('');
@@ -49,26 +46,26 @@ export const CardSelectable: React.FunctionComponent = () => {
};
const dropdownItems = [
- Link,
-
+ Link,
+
Action
- ,
-
+ ,
+
Disabled Link
- ,
-
+ ,
+
Disabled Action
- ,
+ ,
,
- Separated Link,
-
+ Separated Link,
+
Separated Action
-
+
];
const headerActions = (
<>
- }
isOpen={isKebabOpen}
@@ -90,7 +87,7 @@ export const CardSelectable: React.FunctionComponent = () => {
isSelectableRaised
isSelected={selected === 'selectable-first-card'}
>
-
+ First cardThis is a selectable card. Click me to select me. Click again to deselect me.
diff --git a/packages/react-core/src/components/Card/examples/CardWithImageAndActions.tsx b/packages/react-core/src/components/Card/examples/CardWithImageAndActions.tsx
index 5ed4b18c1e1..4062d29ed03 100644
--- a/packages/react-core/src/components/Card/examples/CardWithImageAndActions.tsx
+++ b/packages/react-core/src/components/Card/examples/CardWithImageAndActions.tsx
@@ -1,17 +1,11 @@
import React from 'react';
+import { Brand, Card, CardHeader, CardTitle, CardBody, CardFooter, Checkbox } from '@patternfly/react-core';
import {
- Brand,
- Card,
- CardHeader,
- CardTitle,
- CardBody,
- CardFooter,
- Checkbox,
- Dropdown,
- DropdownItem,
+ Dropdown as DropdownDeprecated,
+ DropdownItem as DropdownItemDeprecated,
DropdownSeparator,
KebabToggle
-} from '@patternfly/react-core';
+} from '@patternfly/react-core/deprecated';
import pfLogo from './pfLogo.svg';
export const CardWithImageAndActions: React.FunctionComponent = () => {
@@ -30,26 +24,26 @@ export const CardWithImageAndActions: React.FunctionComponent = () => {
};
const dropdownItems = [
- Link,
-
+ Link,
+
Action
- ,
-
+ ,
+
Disabled Link
- ,
-
+ ,
+
Disabled Action
- ,
+ ,
,
- Separated Link,
-
+ Separated Link,
+
Separated Action
-
+
];
const headerActions = (
<>
- setIsOpen(isOpen)} />}
isOpen={isOpen}
@@ -70,7 +64,7 @@ export const CardWithImageAndActions: React.FunctionComponent = () => {
return (
<>
-
+ Title
diff --git a/packages/react-core/src/components/DataList/__tests__/DataList.test.tsx b/packages/react-core/src/components/DataList/__tests__/DataList.test.tsx
index 41838b00639..52782d2e133 100644
--- a/packages/react-core/src/components/DataList/__tests__/DataList.test.tsx
+++ b/packages/react-core/src/components/DataList/__tests__/DataList.test.tsx
@@ -12,7 +12,7 @@ import { DataListItemCells } from '../DataListItemCells';
import { DataListItemRow } from '../DataListItemRow';
import { DataListContent } from '../DataListContent';
import { Button } from '../../Button';
-import { DropdownItem, Dropdown, KebabToggle, DropdownPosition } from '../../Dropdown';
+import { DropdownItem, Dropdown, KebabToggle, DropdownPosition } from '../../../deprecated/components/Dropdown';
describe('DataList', () => {
test('List default', () => {
@@ -26,7 +26,7 @@ describe('DataList', () => {
});
describe('DataList variants', () => {
- ['none', 'always', 'sm', 'md', 'lg', 'xl', '2xl'].forEach(oneBreakpoint => {
+ ['none', 'always', 'sm', 'md', 'lg', 'xl', '2xl'].forEach((oneBreakpoint) => {
test(`Breakpoint - ${oneBreakpoint}`, () => {
const { asFragment } = render(
@@ -50,7 +50,7 @@ describe('DataList', () => {
test('List renders with a hidden input to improve a11y when selectableRow is passed', () => {
render(
-
@@ -137,12 +139,12 @@ export const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => {
drillOut(event, 'breadcrumbs-rootMenu', 'group:start_rollout', null)}
+ onClick={(event) => drillOut(event, 'breadcrumbs-rootMenu', 'group:start_rollout', null)}
>
Root
- onToggle(open, 'label')}>
1
@@ -150,16 +152,16 @@ export const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => {
}
isOpen={isOpen}
dropdownItems={[
- }
- onClick={event =>
+ onClick={(event) =>
drillOut(event, 'breadcrumbs-drilldownMenuStart', 'group:labels_start', startRolloutBreadcrumb)
}
>
Start rollout
-
+
]}
/>
@@ -171,7 +173,7 @@ export const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => {
drillOut(event, 'breadcrumbs-rootMenu', 'group:pause_rollout', null)}
+ onClick={(event) => drillOut(event, 'breadcrumbs-rootMenu', 'group:pause_rollout', null)}
>
Root
@@ -183,12 +185,12 @@ export const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => {
drillOut(event, 'breadcrumbs-rootMenu', 'group:pause_rollout', null)}
+ onClick={(event) => drillOut(event, 'breadcrumbs-rootMenu', 'group:pause_rollout', null)}
>
Root
- onToggle(open, 'pause-app')}>
1
@@ -196,16 +198,16 @@ export const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => {
}
isOpen={isOpen}
dropdownItems={[
- }
- onClick={event =>
+ onClick={(event) =>
drillOut(event, 'breadcrumbs-drilldownMenuPause', 'group:app_grouping', pauseRolloutsBreadcrumb)
}
>
Pause rollouts
-
+
]}
/>
@@ -217,12 +219,12 @@ export const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => {
drillOut(event, 'breadcrumbs-rootMenu', 'group:pause_rollout', null)}
+ onClick={(event) => drillOut(event, 'breadcrumbs-rootMenu', 'group:pause_rollout', null)}
>
Root
- onToggle(open, 'pause-label')}>
1
@@ -230,16 +232,16 @@ export const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => {
}
isOpen={isOpen}
dropdownItems={[
- }
- onClick={event =>
+ onClick={(event) =>
drillOut(event, 'breadcrumbs-drilldownMenuPause', 'group:labels', pauseRolloutsBreadcrumb)
}
>
Pause rollouts
-
+
]}
/>
@@ -251,7 +253,7 @@ export const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => {
drillOut(event, 'breadcrumbs-rootMenu', 'group:storage', null)}
+ onClick={(event) => drillOut(event, 'breadcrumbs-rootMenu', 'group:storage', null)}
>
Root
diff --git a/packages/react-core/src/components/Modal/examples/Modal.md b/packages/react-core/src/components/Modal/examples/Modal.md
index 4ea44c88235..a9c1d5a550d 100644
--- a/packages/react-core/src/components/Modal/examples/Modal.md
+++ b/packages/react-core/src/components/Modal/examples/Modal.md
@@ -6,6 +6,11 @@ propComponents: ['Modal']
ouia: true
---
+import {
+Dropdown as DropdownDeprecated,
+DropdownToggle,
+DropdownItem as DropdownItemDeprecated
+} from '@patternfly/react-core/deprecated';
import WarningTriangleIcon from '@patternfly/react-icons/dist/esm/icons/warning-triangle-icon';
import CaretDownIcon from '@patternfly/react-icons/dist/esm/icons/caret-down-icon';
import BullhornIcon from '@patternfly/react-icons/dist/esm/icons/bullhorn-icon';
@@ -18,6 +23,7 @@ import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
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.
```ts file="./ModalBasic.tsx"
+
```
### Scrollable modals
@@ -25,6 +31,7 @@ Basic modals give users the option to either confirm or cancel an action. To fla
To enable keyboard-accessible scrolling of a modal’s content, pass `tabIndex={0}` to the ``.
```ts file="ModalWithOverflowingContent.tsx"
+
```
### With a static description
@@ -32,6 +39,7 @@ To enable keyboard-accessible scrolling of a modal’s content, pass `tabIndex={
To provide additional information about a modal, use the `description` property. Descriptions are static and do not scroll with other modal content.
```ts file="./ModalWithDescription.tsx"
+
```
### Top aligned
@@ -39,15 +47,17 @@ To provide additional information about a modal, use the `description` property.
To override a modal's default center alignment, use the `position` property. In this example, `position` is set to "top", which moves the modal to the top of the screen.
```ts file="./ModalTopAligned.tsx"
+
```
### Small modal
-To adjust the size of a modal, use the `variant` property. Modal variants include "small", "medium", "large", and "default".
+To adjust the size of a modal, use the `variant` property. Modal variants include "small", "medium", "large", and "default".
The following example displays a "small" modal by passing in `variant={ModalVariant.small}`.
```ts file="./ModalSmall.tsx"
+
```
### Medium modal
@@ -55,6 +65,7 @@ The following example displays a "small" modal by passing in `variant={ModalVari
The following example displays a "medium" modal by passing in `variant={ModalVariant.medium}`.
```ts file="./ModalMedium.tsx"
+
```
### Large modal
@@ -62,6 +73,7 @@ The following example displays a "medium" modal by passing in `variant={ModalVar
The following example displays a "large" modal by passing in `variant={ModalVariant.large}`.
```ts file="./ModalLarge.tsx"
+
```
### Custom width
@@ -69,6 +81,7 @@ The following example displays a "large" modal by passing in `variant={ModalVari
To choose a specific width for a modal, use the `width` property. The following example has a `width` of "50%".
```ts file="./ModalCustomWidth.tsx"
+
```
### Custom header and footer
@@ -76,6 +89,7 @@ To choose a specific width for a modal, use the `width` property. The following
To add a custom header and footer to a modal, set the `header` and `footer` properties to a custom implementation. The following example passes title components into both the header and the footer and also passes an icon to the footer.
```ts file="./ModalCustomHeaderFooter.tsx"
+
```
### No header or footer
@@ -83,6 +97,7 @@ To add a custom header and footer to a modal, set the `header` and `footer` prop
To exclusively present information in a modal, remove the `header` and/or `footer`.
```ts file="./ModalNoHeaderFooter.tsx"
+
```
### Title icon
@@ -90,6 +105,7 @@ To exclusively present information in a modal, remove the `header` and/or `foote
To add an icon before a modal’s title, use the `titleIconVariant`, which can be set to one of the predefined variants -- "success", "danger", "warning", "info", and "default" -- or to an imported custom icon. The following example uses a "warning" variant.
```ts file="./ModalTitleIcon.tsx"
+
```
### Custom title icon
@@ -97,6 +113,7 @@ To add an icon before a modal’s title, use the `titleIconVariant`, which can b
To add a custom icon before a modal’s title, set `titleIconVariant` to an imported custom icon. The following example imports and uses a bullhorn icon.
```ts file="./ModalCustomTitleIcon.tsx"
+
```
### With wizard
@@ -104,6 +121,7 @@ To add a custom icon before a modal’s title, set `titleIconVariant` to an impo
To guide users through a series of steps in a modal, you can add a [wizard](/components/wizard) to a modal. To configure the ``, pass an array that contains a “name” and “component” value for each step into the `steps` property.
```ts file="./ModalWithWizard.tsx"
+
```
### With dropdown
@@ -111,6 +129,7 @@ To guide users through a series of steps in a modal, you can add a [wizard](/com
To present a menu of actions or links to a user, you can add a [dropdown](/components/dropdown) to a modal. To allow the dropdown to visually break out of the modal container, set the `menuAppendTo` property to “parent”. Handle the modal’s closing behavior by listening to the `onEscapePress` callback on the `` component. This allows the "escape" key to collapse the dropdown without closing the entire modal.
```ts file="./ModalWithDropdown.tsx"
+
```
### With help
@@ -118,14 +137,15 @@ To present a menu of actions or links to a user, you can add a [dropdown](/compo
To help simplify and explain complex models, add a help [popover](/components/popover). Only place a help icon at the modal level if its information applies to all content in the modal. If the help popover is specific to a particular modal section, place the help icon beside that section instead.
```ts file="./ModalWithHelp.tsx"
+
```
### With form
-To collect user input within a modal, you can add a [form](/components/form).
+To collect user input within a modal, you can add a [form](/components/form).
-To submit the form from a button in the modal's footer (outside of the `