@patternfly/react-core 4.267.13 → 4.267.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/src/components/Page/examples/Page.md +63 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.267.14](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@4.267.13...@patternfly/react-core@4.267.14) (2023-01-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## 4.267.13 (2023-01-06)
|
|
7
15
|
|
|
8
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.267.
|
|
3
|
+
"version": "4.267.14",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"react": "^16.8 || ^17 || ^18",
|
|
72
72
|
"react-dom": "^16.8 || ^17 || ^18"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "2ebc9fdc95102eaf3acb7a25e58571c3cf1d499b"
|
|
75
75
|
}
|
|
@@ -23,49 +23,99 @@ import './page.css';
|
|
|
23
23
|
|
|
24
24
|
## Examples
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### Basic page components
|
|
27
|
+
|
|
28
|
+
A page will typically contain the following components:
|
|
29
|
+
|
|
30
|
+
- A `<Page>` with a `header` that often contains a [masthead](/components/masthead)
|
|
31
|
+
- Mastheads contain the `<PageToggleButton>`, a `<MastheadMain>` that contains a `<MastheadBrand>`, and the page's header toolbar within `<MastheadContent>`.
|
|
32
|
+
- A `<PageSidebar>` for vertical navigation
|
|
33
|
+
- 1 or more `<PageSection>` components
|
|
34
|
+
|
|
35
|
+
### Vertical navigation
|
|
36
|
+
|
|
37
|
+
To add a vertical sidebar to a `<Page>`, pass a `<PageSidebar>` component into the `sidebar` property. To render navigation in the sidebar, use the `nav` property of the `<PageSidebar>`.
|
|
38
|
+
|
|
39
|
+
The `isNavOpen` property helps facilitate the opening and closing of the sidebar and should be 'true' when the navigation sidebar is visible.
|
|
27
40
|
|
|
28
41
|
```ts file="./PageVerticalNav.tsx"
|
|
29
42
|
```
|
|
30
43
|
|
|
31
|
-
###
|
|
44
|
+
### Legacy page header
|
|
45
|
+
|
|
46
|
+
This example shows the legacy implementation of a page's vertical navigation. Our updated recommendation advises you to use a masthead and toolbar to make headers, rather than `<PageHeader>` and `<PageHeaderTools>` as shown in the following example.
|
|
47
|
+
|
|
48
|
+
```ts file="./PageVerticalNavUsingPageHeaderComponent.tsx"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Horizontal navigation
|
|
52
|
+
|
|
53
|
+
To add horizontal navigation to the top of a `<Page>`, add the navigation inside of a `<ToolbarItem>` in the `<Toolbar>` that is passed to the `<MastheadContent>` of the `<Masthead>`.
|
|
32
54
|
|
|
33
55
|
```ts file="./PageHorizontalNav.tsx"
|
|
34
56
|
```
|
|
35
57
|
|
|
36
|
-
###
|
|
58
|
+
### Legacy tertiary navigation
|
|
59
|
+
|
|
60
|
+
[Horizontal sub-navigation](/components/navigation#horizontal-subnav) is now recommended instead of tertiary-level navigation.
|
|
61
|
+
|
|
62
|
+
Tertiary navigation allows you to add an additional navigation menu alongside vertical or horizontal navigation. To create tertiary navigation, use the `tertiaryNav` property. The following example passes `tertiaryNav="Navigation"` into a `<Page>` component.
|
|
37
63
|
|
|
38
64
|
```ts file="./PageTertiaryNav.tsx"
|
|
39
65
|
```
|
|
40
66
|
|
|
41
|
-
###
|
|
67
|
+
### Uncontrolled navigation
|
|
68
|
+
|
|
69
|
+
When the `isManagedSidebar` property is true, it manages the sidebar open/close state, removing the need to pass both `isNavOpen` into the `<PageSidebar>` and `onNavToggle` into the `<PageHeader>`.
|
|
70
|
+
|
|
71
|
+
```ts file="./PageUncontrolledNav.tsx"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Filled page sections
|
|
75
|
+
|
|
76
|
+
By default, the last page section is "filled", meaning it fills the available vertical space of a page.
|
|
77
|
+
|
|
78
|
+
To change the default behavior, use the `isFilled` property. To make other page sections "filled", set `isFilled` equal to "true". To disable the last page section from being "filled", set `isFilled` equal to "false".
|
|
42
79
|
|
|
43
80
|
```ts file="./PageWithOrWithoutFill.tsx"
|
|
44
81
|
```
|
|
45
82
|
|
|
46
83
|
### Main section padding
|
|
47
84
|
|
|
48
|
-
|
|
49
|
-
```
|
|
85
|
+
To adjust the padding of a `<PageSection>`, you can pass in different values to the `padding` property. These values should be aligned to a specific breakpoint: 'default', 'sm', 'md', 'lg', 'xl', and '2xl'. Each breakpoint passed into the property should be given a value of either ‘padding’ or ‘noPadding’.
|
|
50
86
|
|
|
51
|
-
|
|
87
|
+
As the page's viewport width increases, breakpoints inherit the padding behavior of the previous breakpoint. For example, padding that is set on 'lg' also applies to 'xl' and '2xl'.
|
|
52
88
|
|
|
53
|
-
|
|
89
|
+
To remove padding entirely, pass 'noPadding' to the `default` breakpoint. For example, the second section in this example passes in `padding={{ default: 'noPadding' }}`. Since no specific breakpoints are mentioned, every breakpoint will have 'noPadding'.
|
|
90
|
+
|
|
91
|
+
To add padding at specific breakpoints, pass in "padding" at those breakpoints. For example, the third section in this example passes in `padding={{ default: 'noPadding', md: 'padding' }}`. At 'md', 'lg', 'xl', and '2xl' breakpoints, the default value will be overwritten, and padding will be added.
|
|
92
|
+
|
|
93
|
+
To remove padding at specific breakpoints, pass in 'noPadding' at those breakpoints. For example, the fourth section in this example passes in `padding={{ md: 'noPadding' }}`, which means that 'md', 'lg' 'xl', and '2xl' breakpoints will have `noPadding`.
|
|
94
|
+
|
|
95
|
+
```ts file="./PageMainSectionPadding.tsx"
|
|
54
96
|
```
|
|
55
97
|
|
|
56
98
|
### Group section
|
|
57
99
|
|
|
58
|
-
|
|
59
|
-
```
|
|
100
|
+
To group page content sections, add 1 or more `<PageGroup>` components to a `<Page>`.
|
|
60
101
|
|
|
61
|
-
|
|
102
|
+
The following example adds a group containing `<PageNavigation>`, `<PageBreadcrumb>`, and `<PageSection>` components.
|
|
62
103
|
|
|
63
|
-
|
|
104
|
+
To add additional components and information to a group, you may use the following properties:
|
|
64
105
|
|
|
65
|
-
|
|
106
|
+
- To indicate that a breadcrumb should be in a group, use `isBreadcrumbGrouped`.
|
|
107
|
+
- To indicate that tertiary navigation should be in a group, use `isTertiaryNavGrouped`.
|
|
108
|
+
- To specify additional group content, use `additionalGroupedContent`.
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
```ts file="./PageGroupSection.tsx"
|
|
66
112
|
```
|
|
67
113
|
|
|
68
114
|
### Centered section
|
|
69
115
|
|
|
116
|
+
By default, a page section spans the width of the page. To reduce the width of a section, use the `isWidthLimited` property. To center align width-limited page sections, use the `isCenterAligned` property. When the main content area of a page is wider than the value of a centered, width-limited page section's `--pf-c-page--section--m-limit-width--MaxWidth` custom property, the section will automatically be centered.
|
|
117
|
+
|
|
118
|
+
The content in this example is placed in a card to better illustrate how the section behaves when it is centered, but a card is not required to center a page section.
|
|
119
|
+
|
|
70
120
|
```ts file="./PageCenteredSection.tsx"
|
|
71
121
|
```
|