Skip to content

Commit

Permalink
refactor(Text examples): update names to Content
Browse files Browse the repository at this point in the history
  • Loading branch information
adamviktora committed Jun 20, 2024
1 parent e6d3930 commit d49a920
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: Text
id: Content
section: components
cssPrefix: pf-v5-c-content
propComponents: ['TextContent', 'Text', 'TextList', 'TextListItem']
Expand All @@ -15,50 +15,50 @@ For example, rather than nesting the `<List>` and `<Title>` 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"

```

Text components such as Text, TextList, TextListItem can be placed within a TextContent to provide styling for html elements, and additional styling options applied to the children.

### Wrapped in TextContent

```ts file="./TextContentWrapped.tsx"
```ts file="./ContentWrapper.tsx"

```

### Link and visited link

```ts file="./TextVisited.tsx"
```ts file="./ContentVisited.tsx"

```
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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}>
Expand Down
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/components/Content/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './Content';
export * from './TextContent';
export * from './Text';
export * from './TextList';
export * from './TextListItem';

0 comments on commit d49a920

Please sign in to comment.