Skip to content

Commit 93020a1

Browse files
committed
docs(compass): Content review and edits.
1 parent 6e44a0f commit 93020a1

File tree

3 files changed

+39
-18
lines changed

3 files changed

+39
-18
lines changed

packages/react-core/src/components/Compass/examples/Compass.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,48 +28,42 @@ import './compass.css';
2828

2929
### Basic
3030

31-
In a basic compass layout, content can be passed to the following props to populate areas of the page:
31+
In a basic compass layout, content can be passed to the following props to populate different areas of the page:
3232

33-
- `header`: content rendered in the top of the page. This will typically be a `CompassHeader` component to break the header into 3 areas consisting of a logo or brand, middle navigation, and profile.
34-
- `sidebarStart`: content rendered in the left side or start side of the page
35-
- `main`: content rendered in the center of the page. This will typically consist of a `CompassMainHeader` or `CompassHero`, along with a `CompassContent` filled with one or more `CompassPanel` components.
36-
- `sidebarEnd`: content rendered in the right side or end side of the page
37-
- `footer`: content rendered in the bottom of the page
33+
- `header`: Content rendered at the top of the page, typically including a `<CompassHeader>` component that divides the header into 3 areas, with a logo or brand, middle navigation, and profile.
34+
- `sidebarStart`: Content rendered at the horizontal start of the page (by default, the left side).
35+
- `main`: Content rendered in the center of the page, typically including a `<CompassMainHeader>` or `<CompassHero>`, along with a `<CompassContent>` filled with 1 or more `<CompassPanel>` components.
36+
- `sidebarEnd`: Content rendered at the horizontal end of the page (by default, the right side).
37+
- `footer`: Content rendered at the bottom of the page.
3838

39-
The background image of the `Compass` and `CompassHero` may be customized by using their respective `backgroundSrcLight` and `backgroundSrcDark` props. The `CompassHero` also allows customization of a color gradient across its container by using the `gradientLight` and `gradientDark` props.
39+
To customize the background image of the `<Compass>` and `<CompassHero>` components, you can use their respective `backgroundSrcLight` and `backgroundSrcDark` props. You can also add and customize a color gradient background for the `<CompassHero>` component by using the `gradientLight` and `gradientDark` props.
4040

4141
```ts file="CompassBasic.tsx"
4242

4343
```
4444

4545
### With alternate footer
4646

47-
When `footer` is used, its content will take up the width of the screen. However, if content inside of the footer grows, then the two sidebars' heights and placement will adjust to allow for the change. If this is not the desired behavior, then using a `CompassMainFooter` inside of the of the `main` section provides an alterate way to render footer content without interfering with the sidebars, by rendering content at the bottom of the page between the two sidebars opposed to the whole bottom of the page.
47+
When `footer` is used, its content will fill the width of the screen. By default, when content inside the footer grows, the height and placement of the start and end sidebars will adjust to allow for the change. To modify this behavior and render footer content without interfering with the sidebars, instead place a `<CompassMainFooter>` inside the `main` section. This will render content at the bottom of the page between the 2 sidebars, rather than across the entire bottom of the page.
4848

4949
```ts file="CompassMainFooterDemo.tsx"
5050

5151
```
5252

53-
### Demo
54-
55-
```ts isFullscreen file="CompassDemo.tsx"
56-
57-
```
58-
5953
## Composable structure
6054

61-
When building a more custom implementation using Compass components, there are some intended or expected structures that must be present.
55+
When building a more custom implementation with compass components, there are some intended or expected structures that must remain present.
6256

6357
### CompassMainHeader structure
6458

65-
When using the `children` property in the `<CompassMainHeader>` component, you should ensure that the expected sub-components are used. The following code block shows a general structure to follow.
59+
When using the `children` property in the `<CompassMainHeader>` component, there are specific structural patterns that you should follow, as shown this general code structure.
6660

6761
```noLive
6862
<CompassMainHeader>
6963
<CompassPanel>
7064
<CompassMainHeaderContent>
71-
{Your custom content goes here, which can include the CompassMainHeaderTitle and/or CompassMainHeaderToolbar sub-components}
65+
{Your custom content goes here, which can include the <CompassMainHeaderTitle> and/or <CompassMainHeaderToolbar> sub-components}
7266
</CompassMainHeaderContent>
7367
</CompassPanel>
7468
</CompassMainHeader>
75-
```
69+
```
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
id: Compass
3+
section: AI
4+
subsection: Generative UIs
5+
---
6+
7+
import { useRef, useState } from 'react';
8+
import PlayIcon from '@patternfly/react-icons/dist/esm/icons/play-icon';
9+
import OutlinedPlusSquare from '@patternfly/react-icons/dist/esm/icons/outlined-plus-square-icon';
10+
import OutlinedCopy from '@patternfly/react-icons/dist/esm/icons/outlined-copy-icon';
11+
import OutlinedQuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/outlined-question-circle-icon';
12+
13+
## Demos
14+
15+
### Compass layout
16+
17+
This demo showcases an implementation of the following Compass features:
18+
19+
- Middle navigation in the `header`, featuring top-level primary tabs and a secondary container for sub-tabs.
20+
- Vertical sidebars utilizing `<ActionList>` groups with buttons that use the `isCircle` prop.
21+
- A custom gradient background in the `<Hero>`, visible in dark mode.
22+
- Background images that automatically adapt to both light and dark modes.
23+
- A `footer` section containing the `<CompassMessageBar>`, that could be used for AI text input.
24+
25+
```ts isFullscreen file="./examples/CompassDemo.tsx"
26+
27+
```

packages/react-core/src/components/Compass/examples/CompassDemo.tsx renamed to packages/react-core/src/demos/Compass/examples/CompassDemo.tsx

File renamed without changes.

0 commit comments

Comments
 (0)