From c676e2f25a44e1f4d8444f3b47bf8d0255af6f02 Mon Sep 17 00:00:00 2001
From: adamviktora
Date: Thu, 13 Jun 2024 15:34:08 +0200
Subject: [PATCH 01/18] feat(Text): move to Content folder
---
.../src/components/Content/examples/Text.md | 64 +++++++++++++++++++
.../src/components/Text/examples/Text.md | 2 +-
2 files changed, 65 insertions(+), 1 deletion(-)
create mode 100644 packages/react-core/src/components/Content/examples/Text.md
diff --git a/packages/react-core/src/components/Content/examples/Text.md b/packages/react-core/src/components/Content/examples/Text.md
new file mode 100644
index 00000000000..61566a36d43
--- /dev/null
+++ b/packages/react-core/src/components/Content/examples/Text.md
@@ -0,0 +1,64 @@
+---
+id: Text
+section: components
+cssPrefix: pf-v5-c-content
+propComponents: ['TextContent', 'Text', 'TextList', 'TextListItem']
+---
+
+The `` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `p`, `a`, `small`, `blockquote`, and `pre`), as well as the text component suite ``, and ``. `TextContent` may be used as a container for the text components, but nesting them inside `` is not required.
+
+You cannot nest other components within ``, and doing so can cause styling overrides or other conflicts. Instead, you can use the `` component's properties to achieve the same results.
+
+For example, rather than nesting the `` and `Codestin Search App
+
+
Custom header modal
Add custom content to the header by not passing the titles prop the modal box header component.
-
+
diff --git a/packages/react-core/src/components/Slider/examples/SliderActions.tsx b/packages/react-core/src/components/Slider/examples/SliderActions.tsx
index 23e21dfecb3..f5df5ce1e24 100644
--- a/packages/react-core/src/components/Slider/examples/SliderActions.tsx
+++ b/packages/react-core/src/components/Slider/examples/SliderActions.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { Slider, SliderOnChangeEvent, Button, Text, TextVariants } from '@patternfly/react-core';
+import { Slider, SliderOnChangeEvent, Button, Content } from '@patternfly/react-core';
import MinusIcon from '@patternfly/react-icons/dist/esm/icons/minus-icon';
import PlusIcon from '@patternfly/react-icons/dist/esm/icons/plus-icon';
import LockIcon from '@patternfly/react-icons/dist/esm/icons/lock-icon';
@@ -64,7 +64,7 @@ export const SliderActions: React.FunctionComponent = () => {
return (
<>
- Slider value is: {value1}
+ Slider value is: {value1} {
const [hasTooltipOverThumb, setHasTooltipOverThumb] = React.useState(false);
@@ -15,14 +15,14 @@ export const SliderContinuous: React.FunctionComponent = () => {
onChange={(_event: React.FormEvent, checked: boolean) => setHasTooltipOverThumb(checked)}
style={{ marginBottom: 20 }}
/>
- Slider Value is: {value}
+ Slider Value is: {value} setValue(value)}
/>
- Slider value is: {valueCustom}
+ Slider value is: {valueCustom} setValueCustom(value)}
value={valueCustom}
diff --git a/packages/react-core/src/components/Slider/examples/SliderDisabled.tsx b/packages/react-core/src/components/Slider/examples/SliderDisabled.tsx
index 31b36872194..8656b95f6b9 100644
--- a/packages/react-core/src/components/Slider/examples/SliderDisabled.tsx
+++ b/packages/react-core/src/components/Slider/examples/SliderDisabled.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { Slider, SliderOnChangeEvent, Text, TextVariants } from '@patternfly/react-core';
+import { Slider, SliderOnChangeEvent, Content } from '@patternfly/react-core';
export const SliderDisabled: React.FunctionComponent = () => {
const [value, setValue] = React.useState(50);
@@ -22,7 +22,7 @@ export const SliderDisabled: React.FunctionComponent = () => {
return (
<>
- Slider value is: {displayValue()}
+ Slider value is: {displayValue()} {
const initialValues = {
@@ -50,15 +50,15 @@ export const SliderDiscrete: React.FunctionComponent = () => {
return (
<>
- Slider value is: {numValue.value1}
+ Slider value is: {numValue.value1} handleChange(value, 'value1')}
customSteps={steps}
/>
- Slider value is: {numValue.value2}
- (min = 0, max = 200, step = 50)
+ Slider value is: {numValue.value2}
+ (min = 0, max = 200, step = 50) handleChange(value, 'value2')}
@@ -67,8 +67,8 @@ export const SliderDiscrete: React.FunctionComponent = () => {
showTicks
/>
- Slider value is: {Math.floor(numValue.value3)}
- (min = -25, max = 75, step = 10, boundaries not shown)
+ Slider value is: {Math.floor(numValue.value3)}
+ (min = -25, max = 75, step = 10, boundaries not shown) handleChange(value, 'value3')}
@@ -79,8 +79,8 @@ export const SliderDiscrete: React.FunctionComponent = () => {
showBoundaries={false}
/>
- Slider value is: {Math.floor(numValue.value4)}
- (min = -25, max = 75, step = 10, boundaries shown)
+ Slider value is: {Math.floor(numValue.value4)}
+ (min = -25, max = 75, step = 10, boundaries shown) handleChange(value, 'value4')}
@@ -90,8 +90,8 @@ export const SliderDiscrete: React.FunctionComponent = () => {
showTicks
/>
- Slider value is: {Math.floor(numValue.value5)}
- (min = -25, max = 75, step = 10, boundaries shown, ticks not shown)
+ Slider value is: {Math.floor(numValue.value5)}
+ (min = -25, max = 75, step = 10, boundaries shown, ticks not shown) handleChange(value, 'value5')}
@@ -100,8 +100,8 @@ export const SliderDiscrete: React.FunctionComponent = () => {
step={10}
/>
- Slider value is: {Math.floor(numValue.value6)}
- (max = 5, custom steps)
+ Slider value is: {Math.floor(numValue.value6)}
+ (max = 5, custom steps) {
onChange={(_event: SliderOnChangeEvent, value: number) => handleChange(value, 'value6')}
/>
- Slider value is: {Math.floor(numValue.value7)}
- (min = 12, max = 86, custom steps with non linear data)
+ Slider value is: {Math.floor(numValue.value7)}
+ (min = 12, max = 86, custom steps with non linear data) (
-
-
+
+
Heading
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit Sed hendrerit nisi in cursus maximus.
-
-
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit Sed hendrerit nisi in cursus maximus.
+
Second level
-
-
+
+
Curabitur accumsan turpis pharetra blandit. Quisque condimentum maximus mi,{' '}
sit amet commodo arcu rutrum id. Proin pretium urna vel
cursus venenatis. Suspendisse potenti.
-
+
Sometimes you need small text
-
+
);
diff --git a/packages/react-core/src/demos/Banner.md b/packages/react-core/src/demos/Banner.md
index ac1b38cea37..6d2342da70a 100644
--- a/packages/react-core/src/demos/Banner.md
+++ b/packages/react-core/src/demos/Banner.md
@@ -13,17 +13,7 @@ import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/Dashboard
```js isFullscreen
import React from 'react';
-import {
- Banner,
- Card,
- CardBody,
- Flex,
- Gallery,
- GalleryItem,
- PageSection,
- TextContent,
- Text
-} from '@patternfly/react-core';
+import { Banner, Card, CardBody, Flex, Gallery, GalleryItem, PageSection, Content } from '@patternfly/react-core';
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
import { css } from '@patternfly/react-styles';
@@ -48,13 +38,13 @@ class BannerDemo extends React.Component {
-
- Main title
-
+
+
Main title
+
Body text should be Overpass Regular at 16px. It should have leading of 24px because
of it’s relative line height of 1.5.
-
-
+
+
@@ -87,8 +77,7 @@ import {
Gallery,
GalleryItem,
PageSection,
- TextContent,
- Text
+ Content
} from '@patternfly/react-core';
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
import { css } from '@patternfly/react-styles';
@@ -122,13 +111,13 @@ class BannerDemo extends React.Component {
-
- Main title
-
+
+
Main title
+
Body text should be Overpass Regular at 16px. It should have leading of 24px because
of it’s relative line height of 1.5.
-
New alerts can be added with buttons below. Each alert has a timeout of 7 seconds, however, even after the
timeout expires, all alerts are still visible in the notification drawer. By default, only 3 alerts are
displayed. The rest can be accessed in the notification drawer after clicking on the bell icon in the header
or by clicking on the overflow message.
-
-
+
+
@@ -348,11 +347,11 @@ export const AlertGroupToastWithNotificationDrawer: React.FunctionComponent = ()
-
+
- Max displayed alerts
- The maximum number of displayed alerts can be set below.
-
+
Max displayed alerts
+
The maximum number of displayed alerts can be set below.
+
{
-
- Main title
-
+
+
Main title
+
Body text should be Overpass Regular at 16px.It should have leading of 24px because
of it’s relative line height of 1.5.
-
+
-
+
-
- Main title
- This is a full page demo.
-
+
+
Wizard description goes here. If you need more assistance,{' '}
{' '}
in the side drawer.{' '}
-
+
@@ -164,10 +163,10 @@ export const WizardFullPageWithDrawerInfoStepDemo: React.FunctionComponent = ()
mainContainerId={pageId}
>
-
- Main title
- A demo of a wizard in a page.
-
+
+
Main title
+
A demo of a wizard in a page.
+
diff --git a/packages/react-docs/patternfly-docs/pages/icons.js b/packages/react-docs/patternfly-docs/pages/icons.js
index b3844cadfc9..6c2b50c5a0b 100644
--- a/packages/react-docs/patternfly-docs/pages/icons.js
+++ b/packages/react-docs/patternfly-docs/pages/icons.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { Tooltip, Text, Grid, GridItem, PageSection } from '@patternfly/react-core';
+import { Tooltip, Grid, GridItem, PageSection, Content } from '@patternfly/react-core';
import spacerMd from '@patternfly/react-tokens/dist/esm/global_spacer_md';
import labelFontSize from '@patternfly/react-tokens/dist/esm/global_font_size_sm';
import * as IconsModule from '@patternfly/react-icons/dist/esm';
@@ -36,14 +36,14 @@ const iconsPage = () => {
return (
-
+
These are all of the icons available for use in PatternFly React. For recommended icon usage, see our{' '}
icon usage guidelines.
-
-
+
+
Learn how you can use them in the{' '}
react-icons docs.
-
+
{allIcons
// BREAKING CHANGE - remove line below when AnsibeTowerIcon is removed
diff --git a/packages/react-integration/demo-app-ts/src/components/demos/AboutModal/AboutModalDemo.tsx b/packages/react-integration/demo-app-ts/src/components/demos/AboutModal/AboutModalDemo.tsx
index 3cda19c050f..30aa5e8f5a7 100644
--- a/packages/react-integration/demo-app-ts/src/components/demos/AboutModal/AboutModalDemo.tsx
+++ b/packages/react-integration/demo-app-ts/src/components/demos/AboutModal/AboutModalDemo.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { AboutModal, Button, TextContent, TextList, TextListItem } from '@patternfly/react-core';
+import { AboutModal, Button, Content } from '@patternfly/react-core';
const brandImg = '../../../assets/images/brandImg.svg';
interface AboutModalState {
@@ -37,24 +37,24 @@ export class AboutModalDemo extends React.Component<{}, AboutModalState> {
brandImageAlt="Patternfly Logo"
productName="Product Name"
>
-
-
- CFME Version
- 5.5.3.4.20102789036450
- Cloudforms Version
- 4.1
- Server Name
- 40DemoMaster
- User Name
- Administrator
- User Role
- EvmRole-super_administrator
- Browser Version
- 601.2
- Browser OS
- Mac
-
-
+
+
Below is an example of a responsive sortable table. When the screen size shrinks the table into a compact
form, the toolbar will display a dropdown menu containing sorting options.
-
-
+
+
Date: Mon, 24 Jun 2024 16:05:03 +0200
Subject: [PATCH 06/18] test(Content): update test
---
.../Content/__tests__/Content.test.tsx | 176 +++++++++++++++++-
1 file changed, 175 insertions(+), 1 deletion(-)
diff --git a/packages/react-core/src/components/Content/__tests__/Content.test.tsx b/packages/react-core/src/components/Content/__tests__/Content.test.tsx
index a92d76446e8..63b922e9c3a 100644
--- a/packages/react-core/src/components/Content/__tests__/Content.test.tsx
+++ b/packages/react-core/src/components/Content/__tests__/Content.test.tsx
@@ -1,6 +1,7 @@
import * as React from 'react';
import { render, screen } from '@testing-library/react';
import { Content } from '../Content';
+import styles from '@patternfly/react-styles/css/components/Content/content';
test('Renders without children', () => {
render(
@@ -71,12 +72,185 @@ test('Renders as "pre" element when component="pre"', () => {
expect(screen.getByText('Test')).toHaveProperty('nodeName', 'PRE');
});
+test('Renders as "hr" element when component="hr"', () => {
+ render();
+ expect(screen.getByRole('separator')).toHaveProperty('nodeName', 'HR');
+});
+
+test('Renders as "ul" element component="ul"', () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveProperty('nodeName', 'UL');
+});
+
+test('Renders as "ol" element when component="ol"', () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveProperty('nodeName', 'OL');
+});
+
+test('Renders as "dl" element when component="dl"', () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveProperty('nodeName', 'DL');
+});
+
+test('Renders as "li" element when component="li"', () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveProperty('nodeName', 'LI');
+});
+
+test('Renders as "dt" element when component="dt"', () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveProperty('nodeName', 'DT');
+});
+
+test('Renders as "dd" element when component="dd"', () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveProperty('nodeName', 'DD');
+});
+
+test(`Renders with class name ${styles.contentH1} when component="h1"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentH1);
+});
+
+test(`Renders with class name ${styles.contentH2} when component="h2"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentH2);
+});
+
+test(`Renders with class name ${styles.contentH3} when component="h3"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentH3);
+});
+
+test(`Renders with class name ${styles.contentH4} when component="h4"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentH4);
+});
+
+test(`Renders with class name ${styles.contentH5} when component="h5"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentH5);
+});
+
+test(`Renders with class name ${styles.contentH6} when component="h6"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentH6);
+});
+
+test(`Renders with class name ${styles.contentP} when component="p"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentP);
+});
+
+test(`Renders with class name ${styles.contentA} when component="a"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentA);
+});
+
+test(`Renders with class name ${styles.contentSmall} when component="small"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentSmall);
+});
+
+test(`Renders with class name ${styles.contentBlockquote} when component="blockquote"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentBlockquote);
+});
+
+test(`Renders with class name ${styles.contentPre} when component="pre"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentPre);
+});
+
+test(`Renders with class name ${styles.contentHr} when component="hr"`, () => {
+ render();
+ expect(screen.getByRole('separator')).toHaveClass(styles.contentHr);
+});
+
+test(`Renders with class name ${styles.contentUl} when component="ul"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentUl);
+});
+
+test(`Renders with class name ${styles.contentOl} when component="ol"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentOl);
+});
+
+test(`Renders with class name ${styles.contentDl} when component="dl"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentDl);
+});
+
+test(`Renders with class name ${styles.contentLi} when component="li"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentLi);
+});
+
+test(`Renders with class name ${styles.contentDt} when component="dt"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentDt);
+});
+
+test(`Renders with class name ${styles.contentDd} when component="dd"`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.contentDd);
+});
+
+test(`Renders with class name ${styles.content} when no component prop is provided`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass(styles.content);
+});
+
+test(`Renders without class name ${styles.content} when component is provided`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).not.toHaveClass(styles.content);
+});
+
+test(`Renders with class name pf-m-plain when isPlainList=true and component is 'ul', 'ol' or 'dl'`, () => {
+ render(
+ <>
+
+ Test1
+
+
+ Test2
+
+
+ Test3
+
+ >
+ );
+ expect(screen.getByText('Test1')).toHaveClass('pf-m-plain');
+ expect(screen.getByText('Test2')).toHaveClass('pf-m-plain');
+ expect(screen.getByText('Test3')).toHaveClass('pf-m-plain');
+});
+
+test(`Renders without class name pf-m-plain by default`, () => {
+ render(Test);
+ expect(screen.getByText('Test')).not.toHaveClass('pf-m-plain');
+});
+
+test(`Renders without class name pf-m-plain when isPlainList=true, but component is not 'ul', 'ol' or 'dl'`, () => {
+ render(
+
+ Test
+
+ );
+ expect(screen.getByText('Test')).not.toHaveClass('pf-m-plain');
+});
+
test('Renders without class name pf-m-visited by default', () => {
render(Test);
expect(screen.getByText('Test')).not.toHaveClass('pf-m-visited');
});
-test('Renders with class name pf-m-visited when isVisited=true and component="a"', () => {
+test('Renders with class name pf-m-visited when isVisitedLink=true', () => {
+ render(Test);
+ expect(screen.getByText('Test')).toHaveClass('pf-m-visited');
+});
+
+test('Renders with class name pf-m-visited when isVisitedLink=true and component="a"', () => {
render(
Test
From 110b40e62692e5690d963ac3b2f66a1f6c047022 Mon Sep 17 00:00:00 2001
From: adamviktora
Date: Mon, 24 Jun 2024 16:05:28 +0200
Subject: [PATCH 07/18] feat(misc): delete TextContent, TextList, TextListItem
---
.../src/components/Content/TextContent.tsx | 25 ---------
.../src/components/Content/TextList.tsx | 43 ---------------
.../src/components/Content/TextListItem.tsx | 40 --------------
.../__tests__/Generated/TextContent.test.tsx | 13 -----
.../__tests__/Generated/TextList.test.tsx | 13 -----
.../__tests__/Generated/TextListItem.test.tsx | 13 -----
.../__snapshots__/TextContent.test.tsx.snap | 11 ----
.../__snapshots__/TextList.test.tsx.snap | 11 ----
.../__snapshots__/TextListItem.test.tsx.snap | 11 ----
.../Content/__tests__/TextContent.test.tsx | 48 -----------------
.../Content/__tests__/TextList.test.tsx | 52 -------------------
.../Content/__tests__/TextListItem.test.tsx | 47 -----------------
.../__snapshots__/TextContent.test.tsx.snap | 11 ----
.../__snapshots__/TextList.test.tsx.snap | 11 ----
.../__snapshots__/TextListItem.test.tsx.snap | 11 ----
.../src/components/Content/index.ts | 3 --
16 files changed, 363 deletions(-)
delete mode 100644 packages/react-core/src/components/Content/TextContent.tsx
delete mode 100644 packages/react-core/src/components/Content/TextList.tsx
delete mode 100644 packages/react-core/src/components/Content/TextListItem.tsx
delete mode 100644 packages/react-core/src/components/Content/__tests__/Generated/TextContent.test.tsx
delete mode 100644 packages/react-core/src/components/Content/__tests__/Generated/TextList.test.tsx
delete mode 100644 packages/react-core/src/components/Content/__tests__/Generated/TextListItem.test.tsx
delete mode 100644 packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextContent.test.tsx.snap
delete mode 100644 packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextList.test.tsx.snap
delete mode 100644 packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextListItem.test.tsx.snap
delete mode 100644 packages/react-core/src/components/Content/__tests__/TextContent.test.tsx
delete mode 100644 packages/react-core/src/components/Content/__tests__/TextList.test.tsx
delete mode 100644 packages/react-core/src/components/Content/__tests__/TextListItem.test.tsx
delete mode 100644 packages/react-core/src/components/Content/__tests__/__snapshots__/TextContent.test.tsx.snap
delete mode 100644 packages/react-core/src/components/Content/__tests__/__snapshots__/TextList.test.tsx.snap
delete mode 100644 packages/react-core/src/components/Content/__tests__/__snapshots__/TextListItem.test.tsx.snap
diff --git a/packages/react-core/src/components/Content/TextContent.tsx b/packages/react-core/src/components/Content/TextContent.tsx
deleted file mode 100644
index b7df9cfa2f6..00000000000
--- a/packages/react-core/src/components/Content/TextContent.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import * as React from 'react';
-import styles from '@patternfly/react-styles/css/components/Content/content';
-import { css } from '@patternfly/react-styles';
-
-export interface TextContentProps extends React.HTMLProps {
- /** Content rendered within the TextContent */
- children?: React.ReactNode;
- /** Additional classes added to the TextContent */
- className?: string;
- /** Flag to indicate the all links in a the content block have visited styles applied if the browser determines the link has been visited */
- isVisited?: boolean;
-}
-
-export const TextContent: React.FunctionComponent = ({
- children,
- className = '',
- isVisited = false,
- ...props
-}: TextContentProps) => (
-
- {children}
-
-);
-
-TextContent.displayName = 'TextContent';
diff --git a/packages/react-core/src/components/Content/TextList.tsx b/packages/react-core/src/components/Content/TextList.tsx
deleted file mode 100644
index ebceb43dee7..00000000000
--- a/packages/react-core/src/components/Content/TextList.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import * as React from 'react';
-import styles from '@patternfly/react-styles/css/components/Content/content';
-import { css } from '@patternfly/react-styles';
-
-export enum TextListVariants {
- ul = 'ul',
- ol = 'ol',
- dl = 'dl'
-}
-
-const componentStyles = {
- ul: styles.contentUl,
- ol: styles.contentOl,
- dl: styles.contentDl
-};
-
-export interface TextListProps extends React.HTMLProps {
- /** Content rendered within the TextList */
- children?: React.ReactNode;
- /** Additional classes added to the TextList */
- className?: string;
- /** The text list component */
- component?: 'ul' | 'ol' | 'dl';
- /** Modifies the list to include plain styling */
- isPlain?: boolean;
-}
-
-export const TextList: React.FunctionComponent = ({
- children = null,
- className = '',
- component = TextListVariants.ul,
- isPlain = false,
- ...props
-}: TextListProps) => {
- const Component: any = component;
-
- return (
-
- {children}
-
- );
-};
-TextList.displayName = 'TextList';
diff --git a/packages/react-core/src/components/Content/TextListItem.tsx b/packages/react-core/src/components/Content/TextListItem.tsx
deleted file mode 100644
index 8aedef965fb..00000000000
--- a/packages/react-core/src/components/Content/TextListItem.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import * as React from 'react';
-import styles from '@patternfly/react-styles/css/components/Content/content';
-import { css } from '@patternfly/react-styles';
-
-export enum TextListItemVariants {
- li = 'li',
- dt = 'dt',
- dd = 'dd'
-}
-
-const componentStyles = {
- li: styles.contentLi,
- dt: styles.contentDt,
- dd: styles.contentDd
-};
-
-export interface TextListItemProps extends React.HTMLProps {
- /** Content rendered within the TextListItem */
- children?: React.ReactNode;
- /** Additional classes added to the TextListItem */
- className?: string;
- /** The text list item component */
- component?: 'li' | 'dt' | 'dd';
-}
-
-export const TextListItem: React.FunctionComponent = ({
- children = null,
- className = '',
- component = TextListItemVariants.li,
- ...props
-}: TextListItemProps) => {
- const Component: any = component;
-
- return (
-
- {children}
-
- );
-};
-TextListItem.displayName = 'TextListItem';
diff --git a/packages/react-core/src/components/Content/__tests__/Generated/TextContent.test.tsx b/packages/react-core/src/components/Content/__tests__/Generated/TextContent.test.tsx
deleted file mode 100644
index c605ea9c28d..00000000000
--- a/packages/react-core/src/components/Content/__tests__/Generated/TextContent.test.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * This test was generated
- */
-import * as React from 'react';
-import { render } from '@testing-library/react';
-import { TextContent } from '../../TextContent';
-// any missing imports can usually be resolved by adding them here
-import {} from '../..';
-
-it('TextContent should match snapshot (auto-generated)', () => {
- const { asFragment } = render(ReactNode>} className={"''"} />);
- expect(asFragment()).toMatchSnapshot();
-});
diff --git a/packages/react-core/src/components/Content/__tests__/Generated/TextList.test.tsx b/packages/react-core/src/components/Content/__tests__/Generated/TextList.test.tsx
deleted file mode 100644
index 8ca49dccde7..00000000000
--- a/packages/react-core/src/components/Content/__tests__/Generated/TextList.test.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * This test was generated
- */
-import * as React from 'react';
-import { render } from '@testing-library/react';
-import { TextList } from '../../TextList';
-// any missing imports can usually be resolved by adding them here
-import {} from '../..';
-
-it('TextList should match snapshot (auto-generated)', () => {
- const { asFragment } = render(ReactNode>} className={"''"} component={'ul'} />);
- expect(asFragment()).toMatchSnapshot();
-});
diff --git a/packages/react-core/src/components/Content/__tests__/Generated/TextListItem.test.tsx b/packages/react-core/src/components/Content/__tests__/Generated/TextListItem.test.tsx
deleted file mode 100644
index 04d86d2bc6c..00000000000
--- a/packages/react-core/src/components/Content/__tests__/Generated/TextListItem.test.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * This test was generated
- */
-import * as React from 'react';
-import { render } from '@testing-library/react';
-import { TextListItem } from '../../TextListItem';
-// any missing imports can usually be resolved by adding them here
-import {} from '../..';
-
-it('TextListItem should match snapshot (auto-generated)', () => {
- const { asFragment } = render(ReactNode>} className={"''"} component={'li'} />);
- expect(asFragment()).toMatchSnapshot();
-});
diff --git a/packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextContent.test.tsx.snap b/packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextContent.test.tsx.snap
deleted file mode 100644
index 2f445b62f7b..00000000000
--- a/packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextContent.test.tsx.snap
+++ /dev/null
@@ -1,11 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`TextContent should match snapshot (auto-generated) 1`] = `
-
-
- ReactNode
-
-
-`;
diff --git a/packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextList.test.tsx.snap b/packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextList.test.tsx.snap
deleted file mode 100644
index e55fc4c9f8b..00000000000
--- a/packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextList.test.tsx.snap
+++ /dev/null
@@ -1,11 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`TextList should match snapshot (auto-generated) 1`] = `
-
-
- ReactNode
-
-
-`;
diff --git a/packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextListItem.test.tsx.snap b/packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextListItem.test.tsx.snap
deleted file mode 100644
index 6fcd0810bad..00000000000
--- a/packages/react-core/src/components/Content/__tests__/Generated/__snapshots__/TextListItem.test.tsx.snap
+++ /dev/null
@@ -1,11 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`TextListItem should match snapshot (auto-generated) 1`] = `
-
-
- ReactNode
-
-
-`;
diff --git a/packages/react-core/src/components/Content/__tests__/TextContent.test.tsx b/packages/react-core/src/components/Content/__tests__/TextContent.test.tsx
deleted file mode 100644
index 254b2d7bcd0..00000000000
--- a/packages/react-core/src/components/Content/__tests__/TextContent.test.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import * as React from 'react';
-import { render, screen } from '@testing-library/react';
-import { TextContent } from '../TextContent';
-import styles from '@patternfly/react-styles/css/components/Content/content';
-
-test('Renders without children', () => {
- render(
-
-
-
- );
- expect(screen.getByTestId('test-content').firstChild).toBeVisible();
-});
-
-test('Renders children', () => {
- render(Test);
- expect(screen.getByText('Test')).toBeVisible();
-});
-
-test(`Renders with class name ${styles.content}`, () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveClass(styles.content, { exact: true });
-});
-
-test('Renders with custom class name when className prop is provided', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveClass('custom-class');
-});
-
-test('Renders without class name pf-m-visited by default', () => {
- render(Test);
- expect(screen.getByText('Test')).not.toHaveClass('pf-m-visited');
-});
-
-test('Renders with class name pf-m-visited when isVisited=true', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveClass('pf-m-visited');
-});
-
-test('Renders with inherited element props spread to the component', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
-});
-
-test('Matches the snapshot', () => {
- const { asFragment } = render(Test);
- expect(asFragment()).toMatchSnapshot();
-});
diff --git a/packages/react-core/src/components/Content/__tests__/TextList.test.tsx b/packages/react-core/src/components/Content/__tests__/TextList.test.tsx
deleted file mode 100644
index 76745221c5c..00000000000
--- a/packages/react-core/src/components/Content/__tests__/TextList.test.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import * as React from 'react';
-import { render, screen } from '@testing-library/react';
-import { TextList } from '../TextList';
-
-test('Renders without children', () => {
- render(
-
-
-
- );
- expect(screen.getByTestId('test-list').firstChild).toBeVisible();
-});
-
-test('Renders children', () => {
- render(Test);
- expect(screen.getByText('Test')).toBeVisible();
-});
-
-test('Renders with custom class name when className prop is provided', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveClass('custom-class');
-});
-
-test('Renders as "ul" element by default', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveProperty('nodeName', 'UL');
-});
-
-test('Renders as "ol" element when component="ol"', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveProperty('nodeName', 'OL');
-});
-
-test('Renders as "dl" element when component="dl"', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveProperty('nodeName', 'DL');
-});
-
-test('Renders with plain modifier class when isPlain is set to true', () => {
- render(Test);
- expect(screen.getByRole('list')).toHaveClass('pf-m-plain');
-});
-
-test('Renders with inherited element props spread to the component', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
-});
-
-test('Matches the snapshot', () => {
- const { asFragment } = render(Test);
- expect(asFragment()).toMatchSnapshot();
-});
diff --git a/packages/react-core/src/components/Content/__tests__/TextListItem.test.tsx b/packages/react-core/src/components/Content/__tests__/TextListItem.test.tsx
deleted file mode 100644
index d966b8fda3f..00000000000
--- a/packages/react-core/src/components/Content/__tests__/TextListItem.test.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import * as React from 'react';
-import { render, screen } from '@testing-library/react';
-import { TextListItem } from '../TextListItem';
-
-test('Renders without children', () => {
- render(
-
-
-
- );
- expect(screen.getByTestId('test-list-item').firstChild).toBeVisible();
-});
-
-test('Renders children', () => {
- render(Test);
- expect(screen.getByText('Test')).toBeVisible();
-});
-
-test('Renders with custom class name when className prop is provided', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveClass('custom-class');
-});
-
-test('Renders as "li" element by default', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveProperty('nodeName', 'LI');
-});
-
-test('Renders as "dt" element when component="dt"', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveProperty('nodeName', 'DT');
-});
-
-test('Renders as "dd" element when component="dd"', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveProperty('nodeName', 'DD');
-});
-
-test('Renders with inherited element props spread to the component', () => {
- render(Test);
- expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
-});
-
-test('Matches the snapshot', () => {
- const { asFragment } = render(Test);
- expect(asFragment()).toMatchSnapshot();
-});
diff --git a/packages/react-core/src/components/Content/__tests__/__snapshots__/TextContent.test.tsx.snap b/packages/react-core/src/components/Content/__tests__/__snapshots__/TextContent.test.tsx.snap
deleted file mode 100644
index 6e89543c768..00000000000
--- a/packages/react-core/src/components/Content/__tests__/__snapshots__/TextContent.test.tsx.snap
+++ /dev/null
@@ -1,11 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Matches the snapshot 1`] = `
-
-
-
-`;
diff --git a/packages/react-core/src/components/Content/index.ts b/packages/react-core/src/components/Content/index.ts
index ef7483f3f13..b39182a1a2f 100644
--- a/packages/react-core/src/components/Content/index.ts
+++ b/packages/react-core/src/components/Content/index.ts
@@ -1,4 +1 @@
export * from './Content';
-export * from './TextContent';
-export * from './TextList';
-export * from './TextListItem';
From d2ea05b0891fcd4d9341c6d61b062e95e48067b4 Mon Sep 17 00:00:00 2001
From: adamviktora
Date: Mon, 24 Jun 2024 16:16:06 +0200
Subject: [PATCH 08/18] test(Content): update snapshot
---
.../Content/__tests__/__snapshots__/Content.test.tsx.snap | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/react-core/src/components/Content/__tests__/__snapshots__/Content.test.tsx.snap b/packages/react-core/src/components/Content/__tests__/__snapshots__/Content.test.tsx.snap
index ca4f2b1203a..7abe54a6a73 100644
--- a/packages/react-core/src/components/Content/__tests__/__snapshots__/Content.test.tsx.snap
+++ b/packages/react-core/src/components/Content/__tests__/__snapshots__/Content.test.tsx.snap
@@ -5,7 +5,7 @@ exports[`Matches the snapshot 1`] = `
From 55d6063803eebd9061bc5b92b7975c104a256048 Mon Sep 17 00:00:00 2001
From: adamviktora
Date: Wed, 26 Jun 2024 18:12:26 +0200
Subject: [PATCH 09/18] docs(Text): prop components update
---
packages/react-core/src/components/Text/examples/Text.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/packages/react-core/src/components/Text/examples/Text.md b/packages/react-core/src/components/Text/examples/Text.md
index 7cd1f5d7bd4..395545ad148 100644
--- a/packages/react-core/src/components/Text/examples/Text.md
+++ b/packages/react-core/src/components/Text/examples/Text.md
@@ -2,7 +2,6 @@
id: Text
section: components
cssPrefix: pf-v5-c-content
-propComponents: ['TextContent', 'Text', 'TextList', 'TextListItem']
---
The `` component has been renamed to [Content](/components/content).
From ffe178abc681c516216b2d173807364e738b3ed5 Mon Sep 17 00:00:00 2001
From: Titani
Date: Wed, 17 Jul 2024 15:46:53 -0400
Subject: [PATCH 10/18] fix rebase issue
---
packages/react-core/src/components/Text/examples/Text.md | 7 -------
1 file changed, 7 deletions(-)
delete mode 100644 packages/react-core/src/components/Text/examples/Text.md
diff --git a/packages/react-core/src/components/Text/examples/Text.md b/packages/react-core/src/components/Text/examples/Text.md
deleted file mode 100644
index 395545ad148..00000000000
--- a/packages/react-core/src/components/Text/examples/Text.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-id: Text
-section: components
-cssPrefix: pf-v5-c-content
----
-
-The `` component has been renamed to [Content](/components/content).
From be118b61b2f927de52e0ea63c236e08f43bf14ef Mon Sep 17 00:00:00 2001
From: Titani
Date: Wed, 17 Jul 2024 17:25:01 -0400
Subject: [PATCH 11/18] additional updates to replace text with content
---
.../components/Content/examples/Content.md | 12 ++---
.../Content/examples/ContentBody.tsx | 22 +++++----
.../examples/ContentDescriptionList.tsx | 20 ++++----
.../Content/examples/ContentHeadings.tsx | 14 +++---
.../Content/examples/ContentOrderedList.tsx | 20 ++++----
.../Content/examples/ContentPlainList.tsx | 36 +++++++--------
.../Content/examples/ContentUnorderedList.tsx | 24 +++++-----
.../Content/examples/ContentVisited.tsx | 46 +++++++++----------
.../Content/examples/ContentWrapper.tsx | 12 ++---
.../examples/DescriptionListBasic.tsx | 15 +++---
.../Masthead/MastheadWithHorizontalNav.tsx | 22 ++++-----
.../examples/Page/PageContextSelector.tsx | 11 ++---
12 files changed, 124 insertions(+), 130 deletions(-)
diff --git a/packages/react-core/src/components/Content/examples/Content.md b/packages/react-core/src/components/Content/examples/Content.md
index 170c085f210..2c2587bbfac 100644
--- a/packages/react-core/src/components/Content/examples/Content.md
+++ b/packages/react-core/src/components/Content/examples/Content.md
@@ -1,15 +1,15 @@
---
id: Content
section: components
-cssPrefix: pf-v5-c-content
-propComponents: ['TextContent', 'Text', 'TextList', 'TextListItem']
+cssPrefix: pf-v6-c-content
+propComponents: ['Content',]
---
-The `` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `p`, `a`, `small`, `blockquote`, and `pre`), as well as the text component suite ``, and ``. `TextContent` may be used as a container for the text components, but nesting them inside `` is not required.
+The `` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `hr`, `p`, `a`, `small`, `blockquote`, and `pre`).
-You cannot nest other components within ``, and doing so can cause styling overrides or other conflicts. Instead, you can use the `` component's properties to achieve the same results.
+You cannot nest other components within ``, and doing so can cause styling overrides or other conflicts. Instead, you can use the `` component's properties to achieve the same results.
-For example, rather than nesting the `` and `Codestin Search App
- This is a full page demo
-
+ h1
+
+
+ Projects
+ This is a full page demo
+
diff --git a/packages/react-core/src/demos/examples/Masthead/MastheadWithHorizontalNav.tsx b/packages/react-core/src/demos/examples/Masthead/MastheadWithHorizontalNav.tsx
index 89e2cc91318..2095aee5257 100644
--- a/packages/react-core/src/demos/examples/Masthead/MastheadWithHorizontalNav.tsx
+++ b/packages/react-core/src/demos/examples/Masthead/MastheadWithHorizontalNav.tsx
@@ -26,10 +26,8 @@ import {
NavList,
Page,
PageSection,
- PageSectionVariants,
SkipToContent,
- Text,
- TextContent,
+ Content,
Toolbar,
ToolbarContent,
ToolbarGroup,
@@ -185,8 +183,8 @@ export const MastheadWithHorizontalNav: React.FunctionComponent = () => {
} />
@@ -288,21 +286,19 @@ export const MastheadWithHorizontalNav: React.FunctionComponent = () => {
return (
-
- Main title
- This is a full page demo.
-
+
+
+ Main title
+ This is a full page demo.
+
}
>
diff --git a/packages/react-core/src/demos/examples/Page/PageContextSelector.tsx b/packages/react-core/src/demos/examples/Page/PageContextSelector.tsx
index 8bdf970036e..8d9a8b62dea 100644
--- a/packages/react-core/src/demos/examples/Page/PageContextSelector.tsx
+++ b/packages/react-core/src/demos/examples/Page/PageContextSelector.tsx
@@ -31,8 +31,7 @@ import {
PageSidebarBody,
PageToggleButton,
SkipToContent,
- Text,
- TextContent,
+ Content,
Toolbar,
ToolbarContent,
ToolbarGroup,
@@ -298,10 +297,10 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
isBreadcrumbWidthLimited
>
-
- Main title
- This is a full page demo.
-
+
+ Main title
+ This is a full page demo.
+
From b10392295fcb5137ad89b9fda86de00139c46bb1 Mon Sep 17 00:00:00 2001
From: Titani
Date: Thu, 18 Jul 2024 14:54:12 -0400
Subject: [PATCH 12/18] fixes from pr reviews
---
.../components/Content/examples/Content.md | 6 ++---
.../Content/examples/ContentPlainList.tsx | 23 +++++++++----------
.../Content/examples/ContentWrapper.tsx | 2 +-
packages/react-core/src/demos/Banner.md | 4 ++--
.../demos/DataList/examples/DataListBasic.tsx | 5 ++--
.../DataListExpandableControlInToolbar.tsx | 7 +++---
.../examples/DescriptionListBasic.tsx | 1 -
.../examples/NotificationDrawerBasic.tsx | 2 +-
.../examples/NotificationDrawerGrouped.tsx | 2 +-
.../AlertGroupToastWithNotificationDrawer.tsx | 12 +++++-----
.../examples/BackToTop/BackToTopNameDemo.tsx | 2 +-
.../src/demos/examples/Nav/NavDefault.tsx | 2 +-
.../src/demos/examples/Nav/NavExpandable.tsx | 2 +-
.../src/demos/examples/Nav/NavGrouped.tsx | 2 +-
.../src/demos/examples/Nav/NavHorizontal.tsx | 2 +-
.../examples/Nav/NavHorizontalWithSubnav.tsx | 2 +-
.../src/demos/examples/Nav/NavManual.tsx | 2 +-
.../src/demos/examples/Nav/NavWithSubnav.tsx | 2 +-
.../PrimaryDetail/PrimaryDetailCardView.tsx | 7 +++---
.../PrimaryDetailContentPadding.tsx | 2 +-
.../PrimaryDetailDataListInCard.tsx | 5 ++--
.../PrimaryDetail/PrimaryDetailFullPage.tsx | 2 +-
.../PrimaryDetailInlineModifier.tsx | 2 +-
.../PrimaryDetailSimpleListInCard.tsx | 5 ++--
.../src/demos/examples/Tabs/ModalTabs.tsx | 2 +-
.../demos/BackToTopDemo/BackToTopDemo.tsx | 2 +-
26 files changed, 50 insertions(+), 57 deletions(-)
diff --git a/packages/react-core/src/components/Content/examples/Content.md b/packages/react-core/src/components/Content/examples/Content.md
index 2c2587bbfac..26922ca315c 100644
--- a/packages/react-core/src/components/Content/examples/Content.md
+++ b/packages/react-core/src/components/Content/examples/Content.md
@@ -5,11 +5,11 @@ cssPrefix: pf-v6-c-content
propComponents: ['Content',]
---
-The `` component provides simple, built-in styling for putting common blocks of HTML elements together. It establishes the block of content and styling within it for the elements listed in the `component` property(`h1` through `h6`, `hr`, `p`, `a`, `small`, `blockquote`, and `pre`).
+The `` component allows you to establish a block of HTML content and apply simple, built-in styling. `` can be used for any element supported by the `component` property (including `h1` through `h6`, `hr`, `p`, `a`, `small`, `blockquote`, and `pre`).
You cannot nest other components within ``, and doing so can cause styling overrides or other conflicts. Instead, you can use the `` component's properties to achieve the same results.
-For example, rather than nesting the `` and `` components within ``, you should pass `component="h1"` into the `` component. Similarly, when you need to add a divider , rather than passing in a separate `` component, you should utilize the `hr` property that `` supports, which will be styled as a divider.
+For example, to create a level 1 heading, you should pass `component="h1"` to ``, instead of nesting a `` component within ``. Similarly, when you need to add a divider to a page, you should utilize the `hr` property of `` (which is styled as a divider), rather than using a separate `` component.
## Examples
@@ -49,7 +49,7 @@ For example, rather than nesting the `` and `` components within `<
```
- Html elements wrapped by `` are styled by the Content component.
+HTML elements wrapped by `` are styled by the content component.
### Wrapped in TextContent
diff --git a/packages/react-core/src/components/Content/examples/ContentPlainList.tsx b/packages/react-core/src/components/Content/examples/ContentPlainList.tsx
index dd7fe7fd790..20b0efe7738 100644
--- a/packages/react-core/src/components/Content/examples/ContentPlainList.tsx
+++ b/packages/react-core/src/components/Content/examples/ContentPlainList.tsx
@@ -4,21 +4,20 @@ import { Content, ContentVariants } from '@patternfly/react-core';
export const ContentPlainList: React.FunctionComponent = () => (
<>
Plain unordered list
-
- In fermentum leo eu lectus mollis, quis dictum mi aliquet.
- Morbi eu nulla lobortis, lobortis est in, fringilla felis.
- Aliquam nec felis in sapien venenatis viverra fermentum nec lectus.
- Ut non enim metus.
+
+ In fermentum leo eu lectus mollis, quis dictum mi aliquet.
+ Morbi eu nulla lobortis, lobortis est in, fringilla felis.
+ Aliquam nec felis in sapien venenatis viverra fermentum nec lectus.
+ Ut non enim metus.Plain ordered list
- Donec blandit a lorem id convallis.
- Cras gravida arcu at diam gravida gravida.
- Integer in volutpat libero.
- Donec a diam tellus.
- Aenean nec tortor orci.
- Quisque aliquam cursus urna, non bibendum massa viverra eget.
- Vivamus maximus ultricies pulvinar.
+ Donec blandit a lorem id convallis.
+ component={ContentVariants.li}Cras gravida arcu at diam gravida gravida.
+ Integer in volutpat libero.
+ Aenean nec tortor orci.
+ Quisque aliquam cursus urna, non bibendum massa viverra eget.
+ Vivamus maximus ultricies pulvinar.
>
);
diff --git a/packages/react-core/src/components/Content/examples/ContentWrapper.tsx b/packages/react-core/src/components/Content/examples/ContentWrapper.tsx
index 70aa435a260..18155101d44 100644
--- a/packages/react-core/src/components/Content/examples/ContentWrapper.tsx
+++ b/packages/react-core/src/components/Content/examples/ContentWrapper.tsx
@@ -4,7 +4,7 @@ import { Content, ContentVariants } from '@patternfly/react-core';
export const ContentWrapper: React.FunctionComponent = () => (
- Content with a component of type "p" still renders the same when wrapped with a TextContent.
+ Content with a component of type "p" still renders the same when wrapped with a Content.
If located within a wrapping TextContent, html elements are styled as well!
diff --git a/packages/react-core/src/demos/Banner.md b/packages/react-core/src/demos/Banner.md
index 6d2342da70a..7e01d57ab4c 100644
--- a/packages/react-core/src/demos/Banner.md
+++ b/packages/react-core/src/demos/Banner.md
@@ -41,7 +41,7 @@ class BannerDemo extends React.Component {
Main title
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of it’s relative line height of 1.5.
@@ -114,7 +114,7 @@ class BannerDemo extends React.Component {
Main title
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of it’s relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of its relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of its relative line height of 1.5.
- New alerts can be added with buttons below. Each alert has a timeout of 7 seconds, however, even after the
- timeout expires, all alerts are still visible in the notification drawer. By default, only 3 alerts are
- displayed. The rest can be accessed in the notification drawer after clicking on the bell icon in the header
- or by clicking on the overflow message.
+ New alerts can be added with the following buttons. Each alert has a timeout of 7 seconds, however, even
+ after the timeout expires, all alerts are still visible in the notification drawer. By default, only 3
+ alerts are displayed. The rest can be accessed in the notification drawer after clicking on the bell icon in
+ the header or by clicking on the overflow message.
The maximum number of displayed alerts can be set below.
+
Adjust the maximum number of displayed alerts.
{
Main title
- Body text should be Overpass Regular at 16px.It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of it’s relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of its relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of its relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of its relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of its relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of it’s relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of its relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of it’s relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of it's relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of it’s relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of it's relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of it's relative line height of 1.5.
- Body text should be Overpass Regular at 16px. It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of it’s relative line height of 1.5.
- Body text should be Overpass Regular at 16px.It should have leading of 24px because
+ Body text should be Red Hat Text at 1rem(16px). It should have leading of 1.5rem(24px) because
of it’s relative line height of 1.5.
From 1b5c02f5fdfeda71890327057efb94b14fda2b8f Mon Sep 17 00:00:00 2001
From: Titani
Date: Thu, 18 Jul 2024 15:29:29 -0400
Subject: [PATCH 13/18] fix lint errors
---
.../src/components/Content/examples/ContentPlainList.tsx | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/packages/react-core/src/components/Content/examples/ContentPlainList.tsx b/packages/react-core/src/components/Content/examples/ContentPlainList.tsx
index 20b0efe7738..e49e4512868 100644
--- a/packages/react-core/src/components/Content/examples/ContentPlainList.tsx
+++ b/packages/react-core/src/components/Content/examples/ContentPlainList.tsx
@@ -7,13 +7,18 @@ export const ContentPlainList: React.FunctionComponent = () => (
In fermentum leo eu lectus mollis, quis dictum mi aliquet.Morbi eu nulla lobortis, lobortis est in, fringilla felis.
- Aliquam nec felis in sapien venenatis viverra fermentum nec lectus.
+
+ Aliquam nec felis in sapien venenatis viverra fermentum nec lectus.
+ Ut non enim metus.Plain ordered listDonec blandit a lorem id convallis.
- component={ContentVariants.li}Cras gravida arcu at diam gravida gravida.
+
+ {' '}
+ component={ContentVariants.li}Cras gravida arcu at diam gravida gravida.
+ Integer in volutpat libero.Aenean nec tortor orci.Quisque aliquam cursus urna, non bibendum massa viverra eget.
From d51645c7328ed916e7c4e836acf0576453cef154 Mon Sep 17 00:00:00 2001
From: Titani
Date: Fri, 19 Jul 2024 10:56:52 -0400
Subject: [PATCH 14/18] update example
---
.../Content/examples/ContentOrderedList.tsx | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/packages/react-core/src/components/Content/examples/ContentOrderedList.tsx b/packages/react-core/src/components/Content/examples/ContentOrderedList.tsx
index e10ce31cc84..24dd49c2c5d 100644
--- a/packages/react-core/src/components/Content/examples/ContentOrderedList.tsx
+++ b/packages/react-core/src/components/Content/examples/ContentOrderedList.tsx
@@ -3,12 +3,12 @@ import { Content, ContentVariants } from '@patternfly/react-core';
export const ContentOrderedList: React.FunctionComponent = () => (
- Donec blandit a lorem id convallis.
- Cras gravida arcu at diam gravida gravida.
- Integer in volutpat libero.
- Donec a diam tellus.
- Aenean nec tortor orci.
- Quisque aliquam cursus urna, non bibendum massa viverra eget.
- Vivamus maximus ultricies pulvinar.
+ Donec blandit a lorem id convallis.
+ Cras gravida arcu at diam gravida gravida.
+ Integer in volutpat libero.
+ Donec a diam tellus.
+ Aenean nec tortor orci.
+ Quisque aliquam cursus urna, non bibendum massa viverra eget.
+ Vivamus maximus ultricies pulvinar.
);
From 6dfe68486d484cef0579b77463f61e3e3096798e Mon Sep 17 00:00:00 2001
From: adamviktora
Date: Mon, 22 Jul 2024 11:22:18 +0200
Subject: [PATCH 15/18] docs(Content): get rid of TextContent occurences
---
.../src/components/Content/examples/Content.md | 18 +++++++++---------
.../Content/examples/ContentWrapper.tsx | 2 +-
packages/react-table/src/demos/Table.md | 1 -
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/packages/react-core/src/components/Content/examples/Content.md b/packages/react-core/src/components/Content/examples/Content.md
index 26922ca315c..3f6de645462 100644
--- a/packages/react-core/src/components/Content/examples/Content.md
+++ b/packages/react-core/src/components/Content/examples/Content.md
@@ -2,7 +2,7 @@
id: Content
section: components
cssPrefix: pf-v6-c-content
-propComponents: ['Content',]
+propComponents: ['Content']
---
The `` component allows you to establish a block of HTML content and apply simple, built-in styling. `` can be used for any element supported by the `component` property (including `h1` through `h6`, `hr`, `p`, `a`, `small`, `blockquote`, and `pre`).
@@ -13,6 +13,14 @@ For example, to create a level 1 heading, you should pass `component="h1"` to `<
## Examples
+HTML elements wrapped by `` are styled by the content component.
+
+### Content as a wrapper
+
+```ts file="./ContentWrapper.tsx"
+
+```
+
### Headings
```ts file="./ContentHeadings.tsx"
@@ -49,14 +57,6 @@ For example, to create a level 1 heading, you should pass `component="h1"` to `<
```
-HTML elements wrapped by `` are styled by the content component.
-
-### Wrapped in TextContent
-
-```ts file="./ContentWrapper.tsx"
-
-```
-
### Link and visited link
```ts file="./ContentVisited.tsx"
diff --git a/packages/react-core/src/components/Content/examples/ContentWrapper.tsx b/packages/react-core/src/components/Content/examples/ContentWrapper.tsx
index 18155101d44..e8ed09652c2 100644
--- a/packages/react-core/src/components/Content/examples/ContentWrapper.tsx
+++ b/packages/react-core/src/components/Content/examples/ContentWrapper.tsx
@@ -6,6 +6,6 @@ export const ContentWrapper: React.FunctionComponent = () => (
Content with a component of type "p" still renders the same when wrapped with a Content.
-
If located within a wrapping TextContent, html elements are styled as well!
+
If located within a wrapping Content, html elements are styled as well!