From d49a9209704817e640d8ea27109a5755868c254b Mon Sep 17 00:00:00 2001 From: adamviktora Date: Thu, 13 Jun 2024 16:45:47 +0200 Subject: [PATCH] refactor(Text examples): update names to Content --- .../Content/{Text.tsx => Content.tsx} | 0 .../{Text.test.tsx => Content.test.tsx} | 2 +- ...ext.test.tsx.snap => Content.test.tsx.snap} | 0 .../Content/examples/{Text.md => Content.md} | 18 +++++++++--------- .../examples/{TextBody.tsx => ContentBody.tsx} | 2 +- ...tionList.tsx => ContentDescriptionList.tsx} | 2 +- .../{TextHeadings.tsx => ContentHeadings.tsx} | 2 +- ...tOrderedList.tsx => ContentOrderedList.tsx} | 2 +- ...{TextPlainList.tsx => ContentPlainList.tsx} | 2 +- ...rderedList.tsx => ContentUnorderedList.tsx} | 2 +- .../{TextVisited.tsx => ContentVisited.tsx} | 2 +- ...xtContentWrapped.tsx => ContentWrapper.tsx} | 2 +- .../react-core/src/components/Content/index.ts | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) rename packages/react-core/src/components/Content/{Text.tsx => Content.tsx} (100%) rename packages/react-core/src/components/Content/__tests__/{Text.test.tsx => Content.test.tsx} (98%) rename packages/react-core/src/components/Content/__tests__/__snapshots__/{Text.test.tsx.snap => Content.test.tsx.snap} (100%) rename packages/react-core/src/components/Content/examples/{Text.md => Content.md} (83%) rename packages/react-core/src/components/Content/examples/{TextBody.tsx => ContentBody.tsx} (94%) rename packages/react-core/src/components/Content/examples/{TextDescriptionList.tsx => ContentDescriptionList.tsx} (91%) rename packages/react-core/src/components/Content/examples/{TextHeadings.tsx => ContentHeadings.tsx} (87%) rename packages/react-core/src/components/Content/examples/{TextOrderedList.tsx => ContentOrderedList.tsx} (90%) rename packages/react-core/src/components/Content/examples/{TextPlainList.tsx => ContentPlainList.tsx} (94%) rename packages/react-core/src/components/Content/examples/{TextUnorderedList.tsx => ContentUnorderedList.tsx} (91%) rename packages/react-core/src/components/Content/examples/{TextVisited.tsx => ContentVisited.tsx} (93%) rename packages/react-core/src/components/Content/examples/{TextContentWrapped.tsx => ContentWrapper.tsx} (84%) diff --git a/packages/react-core/src/components/Content/Text.tsx b/packages/react-core/src/components/Content/Content.tsx similarity index 100% rename from packages/react-core/src/components/Content/Text.tsx rename to packages/react-core/src/components/Content/Content.tsx diff --git a/packages/react-core/src/components/Content/__tests__/Text.test.tsx b/packages/react-core/src/components/Content/__tests__/Content.test.tsx similarity index 98% rename from packages/react-core/src/components/Content/__tests__/Text.test.tsx rename to packages/react-core/src/components/Content/__tests__/Content.test.tsx index 910d97cde9c..13711a4f56b 100644 --- a/packages/react-core/src/components/Content/__tests__/Text.test.tsx +++ b/packages/react-core/src/components/Content/__tests__/Content.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { render, screen } from '@testing-library/react'; -import { Text } from '../Text'; +import { Text } from '../Content'; test('Renders without children', () => { render( diff --git a/packages/react-core/src/components/Content/__tests__/__snapshots__/Text.test.tsx.snap b/packages/react-core/src/components/Content/__tests__/__snapshots__/Content.test.tsx.snap similarity index 100% rename from packages/react-core/src/components/Content/__tests__/__snapshots__/Text.test.tsx.snap rename to packages/react-core/src/components/Content/__tests__/__snapshots__/Content.test.tsx.snap diff --git a/packages/react-core/src/components/Content/examples/Text.md b/packages/react-core/src/components/Content/examples/Content.md similarity index 83% rename from packages/react-core/src/components/Content/examples/Text.md rename to packages/react-core/src/components/Content/examples/Content.md index 61566a36d43..170c085f210 100644 --- a/packages/react-core/src/components/Content/examples/Text.md +++ b/packages/react-core/src/components/Content/examples/Content.md @@ -1,5 +1,5 @@ --- -id: Text +id: Content section: components cssPrefix: pf-v5-c-content propComponents: ['TextContent', 'Text', 'TextList', 'TextListItem'] @@ -15,37 +15,37 @@ For example, rather than nesting the `` and `` components within `< ### Headings -```ts file="./TextHeadings.tsx" +```ts file="./ContentHeadings.tsx" ``` ### Body -```ts file="./TextBody.tsx" +```ts file="./ContentBody.tsx" ``` ### Unordered list -```ts file="./TextUnorderedList.tsx" +```ts file="./ContentUnorderedList.tsx" ``` ### Ordered list -```ts file="./TextOrderedList.tsx" +```ts file="./ContentOrderedList.tsx" ``` ### Plain list -```ts file="./TextPlainList.tsx" +```ts file="./ContentPlainList.tsx" ``` ### Description list -```ts file="./TextDescriptionList.tsx" +```ts file="./ContentDescriptionList.tsx" ``` @@ -53,12 +53,12 @@ Text components such as Text, TextList, TextListItem can be placed within a Text ### Wrapped in TextContent -```ts file="./TextContentWrapped.tsx" +```ts file="./ContentWrapper.tsx" ``` ### Link and visited link -```ts file="./TextVisited.tsx" +```ts file="./ContentVisited.tsx" ``` diff --git a/packages/react-core/src/components/Content/examples/TextBody.tsx b/packages/react-core/src/components/Content/examples/ContentBody.tsx similarity index 94% rename from packages/react-core/src/components/Content/examples/TextBody.tsx rename to packages/react-core/src/components/Content/examples/ContentBody.tsx index 88fa3a9b4da..922e90bce7a 100644 --- a/packages/react-core/src/components/Content/examples/TextBody.tsx +++ b/packages/react-core/src/components/Content/examples/ContentBody.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Text, TextVariants } from '@patternfly/react-core'; -export const TextBody: React.FunctionComponent = () => ( +export const ContentBody: React.FunctionComponent = () => ( <> <Text component={TextVariants.p}> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla diff --git a/packages/react-core/src/components/Content/examples/TextDescriptionList.tsx b/packages/react-core/src/components/Content/examples/ContentDescriptionList.tsx similarity index 91% rename from packages/react-core/src/components/Content/examples/TextDescriptionList.tsx rename to packages/react-core/src/components/Content/examples/ContentDescriptionList.tsx index 3ad396c0169..6ffc2422ba6 100644 --- a/packages/react-core/src/components/Content/examples/TextDescriptionList.tsx +++ b/packages/react-core/src/components/Content/examples/ContentDescriptionList.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { TextList, TextListVariants, TextListItem, TextListItemVariants } from '@patternfly/react-core'; -export const TextDescriptionList: React.FunctionComponent = () => ( +export const ContentDescriptionList: React.FunctionComponent = () => ( <TextList component={TextListVariants.dl}> <TextListItem component={TextListItemVariants.dt}>Web</TextListItem> <TextListItem component={TextListItemVariants.dd}> diff --git a/packages/react-core/src/components/Content/examples/TextHeadings.tsx b/packages/react-core/src/components/Content/examples/ContentHeadings.tsx similarity index 87% rename from packages/react-core/src/components/Content/examples/TextHeadings.tsx rename to packages/react-core/src/components/Content/examples/ContentHeadings.tsx index a9842a9caf6..0f222aee7ae 100644 --- a/packages/react-core/src/components/Content/examples/TextHeadings.tsx +++ b/packages/react-core/src/components/Content/examples/ContentHeadings.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Text, TextVariants } from '@patternfly/react-core'; -export const TextHeadings: React.FunctionComponent = () => ( +export const ContentHeadings: React.FunctionComponent = () => ( <> <Text component={TextVariants.h1}>Hello World</Text> <Text component={TextVariants.h2}>Second level</Text> diff --git a/packages/react-core/src/components/Content/examples/TextOrderedList.tsx b/packages/react-core/src/components/Content/examples/ContentOrderedList.tsx similarity index 90% rename from packages/react-core/src/components/Content/examples/TextOrderedList.tsx rename to packages/react-core/src/components/Content/examples/ContentOrderedList.tsx index 59c33f7b0f1..08ddf3d79f0 100644 --- a/packages/react-core/src/components/Content/examples/TextOrderedList.tsx +++ b/packages/react-core/src/components/Content/examples/ContentOrderedList.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { TextList, TextListVariants, TextListItem } from '@patternfly/react-core'; -export const TextOrderedList: React.FunctionComponent = () => ( +export const ContentOrderedList: React.FunctionComponent = () => ( <TextList component={TextListVariants.ol}> <TextListItem>Donec blandit a lorem id convallis.</TextListItem> <TextListItem>Cras gravida arcu at diam gravida gravida.</TextListItem> diff --git a/packages/react-core/src/components/Content/examples/TextPlainList.tsx b/packages/react-core/src/components/Content/examples/ContentPlainList.tsx similarity index 94% rename from packages/react-core/src/components/Content/examples/TextPlainList.tsx rename to packages/react-core/src/components/Content/examples/ContentPlainList.tsx index 61672f3c170..aa55b8c36b7 100644 --- a/packages/react-core/src/components/Content/examples/TextPlainList.tsx +++ b/packages/react-core/src/components/Content/examples/ContentPlainList.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Text, TextVariants, TextList, TextListVariants, TextListItem } from '@patternfly/react-core'; -export const TextPlainList: React.FunctionComponent = () => ( +export const ContentPlainList: React.FunctionComponent = () => ( <> <Text component={TextVariants.h3}>Plain unordered list</Text> <TextList isPlain> diff --git a/packages/react-core/src/components/Content/examples/TextUnorderedList.tsx b/packages/react-core/src/components/Content/examples/ContentUnorderedList.tsx similarity index 91% rename from packages/react-core/src/components/Content/examples/TextUnorderedList.tsx rename to packages/react-core/src/components/Content/examples/ContentUnorderedList.tsx index 59b6296cbb2..30f5aaa486d 100644 --- a/packages/react-core/src/components/Content/examples/TextUnorderedList.tsx +++ b/packages/react-core/src/components/Content/examples/ContentUnorderedList.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { TextList, TextListItem } from '@patternfly/react-core'; -export const TextUnorderedList: React.FunctionComponent = () => ( +export const ContentUnorderedList: React.FunctionComponent = () => ( <TextList> <TextListItem>In fermentum leo eu lectus mollis, quis dictum mi aliquet.</TextListItem> <TextListItem>Morbi eu nulla lobortis, lobortis est in, fringilla felis.</TextListItem> diff --git a/packages/react-core/src/components/Content/examples/TextVisited.tsx b/packages/react-core/src/components/Content/examples/ContentVisited.tsx similarity index 93% rename from packages/react-core/src/components/Content/examples/TextVisited.tsx rename to packages/react-core/src/components/Content/examples/ContentVisited.tsx index 348841539ed..1692938f52e 100644 --- a/packages/react-core/src/components/Content/examples/TextVisited.tsx +++ b/packages/react-core/src/components/Content/examples/ContentVisited.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { TextContent, Text, TextVariants } from '@patternfly/react-core'; -export const TextVisited: React.FunctionComponent = () => ( +export const ContentVisited: React.FunctionComponent = () => ( <> <TextContent> <Text component={TextVariants.h3}>Link example</Text> diff --git a/packages/react-core/src/components/Content/examples/TextContentWrapped.tsx b/packages/react-core/src/components/Content/examples/ContentWrapper.tsx similarity index 84% rename from packages/react-core/src/components/Content/examples/TextContentWrapped.tsx rename to packages/react-core/src/components/Content/examples/ContentWrapper.tsx index 6b89c1df7c0..8e2b9ed593e 100644 --- a/packages/react-core/src/components/Content/examples/TextContentWrapped.tsx +++ b/packages/react-core/src/components/Content/examples/ContentWrapper.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { TextContent, Text, TextVariants } from '@patternfly/react-core'; -export const TextContentWrapped: React.FunctionComponent = () => ( +export const ContentWrapper: React.FunctionComponent = () => ( <TextContent> <Text component={TextVariants.p}> Text with a component of type "p" still renders the same when wrapped with a TextContent. diff --git a/packages/react-core/src/components/Content/index.ts b/packages/react-core/src/components/Content/index.ts index 8f8269d7d26..ef7483f3f13 100644 --- a/packages/react-core/src/components/Content/index.ts +++ b/packages/react-core/src/components/Content/index.ts @@ -1,4 +1,4 @@ +export * from './Content'; export * from './TextContent'; -export * from './Text'; export * from './TextList'; export * from './TextListItem';