@patternfly/react-core 6.0.0-alpha.82 → 6.0.0-alpha.83
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 +6 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/AboutModal/package.json +1 -1
- package/dist/dynamic/components/Accordion/package.json +1 -1
- package/dist/dynamic/components/ActionList/package.json +1 -1
- package/dist/dynamic/components/Alert/package.json +1 -1
- package/dist/dynamic/components/Avatar/package.json +1 -1
- package/dist/dynamic/components/BackToTop/package.json +1 -1
- package/dist/dynamic/components/Backdrop/package.json +1 -1
- package/dist/dynamic/components/BackgroundImage/package.json +1 -1
- package/dist/dynamic/components/Badge/package.json +1 -1
- package/dist/dynamic/components/Banner/package.json +1 -1
- package/dist/dynamic/components/Brand/package.json +1 -1
- package/dist/dynamic/components/Breadcrumb/package.json +1 -1
- package/dist/dynamic/components/Button/package.json +1 -1
- package/dist/dynamic/components/CalendarMonth/package.json +1 -1
- package/dist/dynamic/components/Card/package.json +1 -1
- package/dist/dynamic/components/Checkbox/package.json +1 -1
- package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/Content/package.json +1 -1
- package/dist/dynamic/components/DataList/package.json +1 -1
- package/dist/dynamic/components/DatePicker/package.json +1 -1
- package/dist/dynamic/components/DescriptionList/package.json +1 -1
- package/dist/dynamic/components/Divider/package.json +1 -1
- package/dist/dynamic/components/Drawer/package.json +1 -1
- package/dist/dynamic/components/Dropdown/package.json +1 -1
- package/dist/dynamic/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/components/EmptyState/package.json +1 -1
- package/dist/dynamic/components/ExpandableSection/package.json +1 -1
- package/dist/dynamic/components/FileUpload/package.json +1 -1
- package/dist/dynamic/components/Form/package.json +1 -1
- package/dist/dynamic/components/FormSelect/package.json +1 -1
- package/dist/dynamic/components/HelperText/package.json +1 -1
- package/dist/dynamic/components/Hint/package.json +1 -1
- package/dist/dynamic/components/Icon/package.json +1 -1
- package/dist/dynamic/components/InputGroup/package.json +1 -1
- package/dist/dynamic/components/JumpLinks/package.json +1 -1
- package/dist/dynamic/components/Label/package.json +1 -1
- package/dist/dynamic/components/List/package.json +1 -1
- package/dist/dynamic/components/LoginPage/package.json +1 -1
- package/dist/dynamic/components/Masthead/package.json +1 -1
- package/dist/dynamic/components/Menu/package.json +1 -1
- package/dist/dynamic/components/MenuToggle/package.json +1 -1
- package/dist/dynamic/components/Modal/package.json +1 -1
- package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
- package/dist/dynamic/components/Nav/package.json +1 -1
- package/dist/dynamic/components/NotificationBadge/package.json +1 -1
- package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
- package/dist/dynamic/components/NumberInput/package.json +1 -1
- package/dist/dynamic/components/OverflowMenu/package.json +1 -1
- package/dist/dynamic/components/Page/package.json +1 -1
- package/dist/dynamic/components/Pagination/package.json +1 -1
- package/dist/dynamic/components/Panel/package.json +1 -1
- package/dist/dynamic/components/Popover/package.json +1 -1
- package/dist/dynamic/components/Progress/package.json +1 -1
- package/dist/dynamic/components/ProgressStepper/package.json +1 -1
- package/dist/dynamic/components/Radio/package.json +1 -1
- package/dist/dynamic/components/SearchInput/package.json +1 -1
- package/dist/dynamic/components/Select/package.json +1 -1
- package/dist/dynamic/components/Sidebar/package.json +1 -1
- package/dist/dynamic/components/SimpleList/package.json +1 -1
- package/dist/dynamic/components/Skeleton/package.json +1 -1
- package/dist/dynamic/components/SkipToContent/package.json +1 -1
- package/dist/dynamic/components/Slider/package.json +1 -1
- package/dist/dynamic/components/Spinner/package.json +1 -1
- package/dist/dynamic/components/Switch/package.json +1 -1
- package/dist/dynamic/components/Tabs/package.json +1 -1
- package/dist/dynamic/components/TextArea/package.json +1 -1
- package/dist/dynamic/components/TextInput/package.json +1 -1
- package/dist/dynamic/components/TextInputGroup/package.json +1 -1
- package/dist/dynamic/components/Tile/package.json +1 -1
- package/dist/dynamic/components/TimePicker/package.json +1 -1
- package/dist/dynamic/components/Timestamp/package.json +1 -1
- package/dist/dynamic/components/Title/package.json +1 -1
- package/dist/dynamic/components/ToggleGroup/package.json +1 -1
- package/dist/dynamic/components/Toolbar/package.json +1 -1
- package/dist/dynamic/components/Tooltip/package.json +1 -1
- package/dist/dynamic/components/TreeView/package.json +1 -1
- package/dist/dynamic/components/Truncate/package.json +1 -1
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
- package/dist/dynamic/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/Chip/package.json +1 -1
- package/dist/dynamic/deprecated/components/DragDrop/package.json +1 -1
- package/dist/dynamic/deprecated/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Modal/package.json +1 -1
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
- package/dist/dynamic/helpers/constants/package.json +1 -1
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
- package/dist/dynamic/helpers/fileUtils/package.json +1 -1
- package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
- package/dist/dynamic/helpers/package.json +1 -1
- package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
- package/dist/dynamic/helpers/typeUtils/package.json +1 -1
- package/dist/dynamic/helpers/useInterval/package.json +1 -1
- package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
- package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
- package/dist/dynamic/helpers/util/package.json +1 -1
- package/dist/dynamic/layouts/Bullseye/package.json +1 -1
- package/dist/dynamic/layouts/Flex/package.json +1 -1
- package/dist/dynamic/layouts/Gallery/package.json +1 -1
- package/dist/dynamic/layouts/Grid/package.json +1 -1
- package/dist/dynamic/layouts/Level/package.json +1 -1
- package/dist/dynamic/layouts/Split/package.json +1 -1
- package/dist/dynamic/layouts/Stack/package.json +1 -1
- package/dist/dynamic/styles/package.json +1 -1
- package/dist/dynamic-modules.json +2 -2
- package/dist/esm/components/Page/Page.d.ts.map +1 -1
- package/dist/esm/components/Page/Page.js +8 -8
- package/dist/esm/components/Page/Page.js.map +1 -1
- package/dist/esm/components/Page/PageBody.d.ts +9 -0
- package/dist/esm/components/Page/PageBody.d.ts.map +1 -0
- package/dist/esm/components/Page/PageBody.js +10 -0
- package/dist/esm/components/Page/PageBody.js.map +1 -0
- package/dist/esm/components/Page/PageBreadcrumb.d.ts +5 -1
- package/dist/esm/components/Page/PageBreadcrumb.d.ts.map +1 -1
- package/dist/esm/components/Page/PageBreadcrumb.js +3 -4
- package/dist/esm/components/Page/PageBreadcrumb.js.map +1 -1
- package/dist/esm/components/Page/PageSection.d.ts +5 -2
- package/dist/esm/components/Page/PageSection.d.ts.map +1 -1
- package/dist/esm/components/Page/PageSection.js +3 -6
- package/dist/esm/components/Page/PageSection.js.map +1 -1
- package/dist/esm/components/Page/index.d.ts +1 -1
- package/dist/esm/components/Page/index.d.ts.map +1 -1
- package/dist/esm/components/Page/index.js +1 -1
- package/dist/esm/components/Page/index.js.map +1 -1
- package/dist/js/components/Page/Page.d.ts.map +1 -1
- package/dist/js/components/Page/Page.js +7 -7
- package/dist/js/components/Page/Page.js.map +1 -1
- package/dist/js/components/Page/PageBody.d.ts +9 -0
- package/dist/js/components/Page/PageBody.d.ts.map +1 -0
- package/dist/js/components/Page/PageBody.js +14 -0
- package/dist/js/components/Page/PageBody.js.map +1 -0
- package/dist/js/components/Page/PageBreadcrumb.d.ts +5 -1
- package/dist/js/components/Page/PageBreadcrumb.d.ts.map +1 -1
- package/dist/js/components/Page/PageBreadcrumb.js +3 -4
- package/dist/js/components/Page/PageBreadcrumb.js.map +1 -1
- package/dist/js/components/Page/PageSection.d.ts +5 -2
- package/dist/js/components/Page/PageSection.d.ts.map +1 -1
- package/dist/js/components/Page/PageSection.js +3 -6
- package/dist/js/components/Page/PageSection.js.map +1 -1
- package/dist/js/components/Page/index.d.ts +1 -1
- package/dist/js/components/Page/index.d.ts.map +1 -1
- package/dist/js/components/Page/index.js +1 -1
- package/dist/js/components/Page/index.js.map +1 -1
- package/dist/umd/assets/{output-CJBOn_jY.css → output-ZK-DtcVp.css} +1672 -1672
- package/dist/umd/react-core.min.js +1 -1
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +2 -2
- package/src/components/Page/Page.tsx +11 -21
- package/src/components/Page/PageBody.tsx +18 -0
- package/src/components/Page/PageBreadcrumb.tsx +7 -2
- package/src/components/Page/PageSection.tsx +8 -5
- package/src/components/Page/__tests__/Page.test.tsx +11 -41
- package/src/components/Page/__tests__/PageBody.test.tsx +34 -0
- package/src/components/Page/__tests__/PageBreadcrumb.test.tsx +14 -1
- package/src/components/Page/__tests__/PageSection.test.tsx +15 -2
- package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +950 -973
- package/src/components/Page/__tests__/__snapshots__/PageBody.test.tsx.snap +11 -0
- package/src/components/Page/__tests__/__snapshots__/PageBreadcrumb.test.tsx.snap +30 -6
- package/src/components/Page/__tests__/__snapshots__/PageSection.test.tsx.snap +66 -14
- package/src/components/Page/examples/Page.md +2 -11
- package/src/components/Page/examples/PageGroupSection.tsx +19 -22
- package/src/components/Page/index.ts +1 -1
- package/dist/esm/components/Page/PageNavigation.d.ts +0 -31
- package/dist/esm/components/Page/PageNavigation.d.ts.map +0 -1
- package/dist/esm/components/Page/PageNavigation.js +0 -21
- package/dist/esm/components/Page/PageNavigation.js.map +0 -1
- package/dist/js/components/Page/PageNavigation.d.ts +0 -31
- package/dist/js/components/Page/PageNavigation.d.ts.map +0 -1
- package/dist/js/components/Page/PageNavigation.js +0 -25
- package/dist/js/components/Page/PageNavigation.js.map +0 -1
- package/src/components/Page/PageNavigation.tsx +0 -72
- package/src/components/Page/__tests__/PageNavigation.test.tsx +0 -78
- package/src/components/Page/__tests__/__snapshots__/PageNavigation.test.tsx.snap +0 -77
|
@@ -5,7 +5,11 @@ exports[`page breadcrumb Verify basic render 1`] = `
|
|
|
5
5
|
<section
|
|
6
6
|
class="pf-v6-c-page__main-breadcrumb"
|
|
7
7
|
>
|
|
8
|
-
|
|
8
|
+
<div
|
|
9
|
+
class="pf-v6-c-page__main-body"
|
|
10
|
+
>
|
|
11
|
+
test
|
|
12
|
+
</div>
|
|
9
13
|
</section>
|
|
10
14
|
</DocumentFragment>
|
|
11
15
|
`;
|
|
@@ -15,7 +19,11 @@ exports[`page breadcrumb Verify bottom shadow 1`] = `
|
|
|
15
19
|
<section
|
|
16
20
|
class="pf-v6-c-page__main-breadcrumb pf-m-shadow-bottom"
|
|
17
21
|
>
|
|
18
|
-
|
|
22
|
+
<div
|
|
23
|
+
class="pf-v6-c-page__main-body"
|
|
24
|
+
>
|
|
25
|
+
test
|
|
26
|
+
</div>
|
|
19
27
|
</section>
|
|
20
28
|
</DocumentFragment>
|
|
21
29
|
`;
|
|
@@ -25,7 +33,11 @@ exports[`page breadcrumb Verify bottom sticky 1`] = `
|
|
|
25
33
|
<section
|
|
26
34
|
class="pf-v6-c-page__main-breadcrumb pf-m-sticky-bottom"
|
|
27
35
|
>
|
|
28
|
-
|
|
36
|
+
<div
|
|
37
|
+
class="pf-v6-c-page__main-body"
|
|
38
|
+
>
|
|
39
|
+
test
|
|
40
|
+
</div>
|
|
29
41
|
</section>
|
|
30
42
|
</DocumentFragment>
|
|
31
43
|
`;
|
|
@@ -50,7 +62,11 @@ exports[`page breadcrumb Verify overflow scroll 1`] = `
|
|
|
50
62
|
class="pf-v6-c-page__main-breadcrumb pf-m-overflow-scroll"
|
|
51
63
|
tabindex="0"
|
|
52
64
|
>
|
|
53
|
-
|
|
65
|
+
<div
|
|
66
|
+
class="pf-v6-c-page__main-body"
|
|
67
|
+
>
|
|
68
|
+
test
|
|
69
|
+
</div>
|
|
54
70
|
</section>
|
|
55
71
|
</DocumentFragment>
|
|
56
72
|
`;
|
|
@@ -60,7 +76,11 @@ exports[`page breadcrumb Verify top shadow 1`] = `
|
|
|
60
76
|
<section
|
|
61
77
|
class="pf-v6-c-page__main-breadcrumb pf-m-shadow-top"
|
|
62
78
|
>
|
|
63
|
-
|
|
79
|
+
<div
|
|
80
|
+
class="pf-v6-c-page__main-body"
|
|
81
|
+
>
|
|
82
|
+
test
|
|
83
|
+
</div>
|
|
64
84
|
</section>
|
|
65
85
|
</DocumentFragment>
|
|
66
86
|
`;
|
|
@@ -70,7 +90,11 @@ exports[`page breadcrumb Verify top sticky 1`] = `
|
|
|
70
90
|
<section
|
|
71
91
|
class="pf-v6-c-page__main-breadcrumb pf-m-sticky-top"
|
|
72
92
|
>
|
|
73
|
-
|
|
93
|
+
<div
|
|
94
|
+
class="pf-v6-c-page__main-body"
|
|
95
|
+
>
|
|
96
|
+
test
|
|
97
|
+
</div>
|
|
74
98
|
</section>
|
|
75
99
|
</DocumentFragment>
|
|
76
100
|
`;
|
|
@@ -4,15 +4,23 @@ exports[`Check page main breadcrumb section against snapshot 1`] = `
|
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<section
|
|
6
6
|
class="pf-v6-c-page__main-breadcrumb"
|
|
7
|
-
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="pf-v6-c-page__main-body"
|
|
10
|
+
/>
|
|
11
|
+
</section>
|
|
8
12
|
</DocumentFragment>
|
|
9
13
|
`;
|
|
10
14
|
|
|
11
15
|
exports[`Check page main nav section against snapshot 1`] = `
|
|
12
16
|
<DocumentFragment>
|
|
13
17
|
<section
|
|
14
|
-
class="pf-v6-c-page__main-
|
|
15
|
-
|
|
18
|
+
class="pf-v6-c-page__main-section"
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
class="pf-v6-c-page__main-body"
|
|
22
|
+
/>
|
|
23
|
+
</section>
|
|
16
24
|
</DocumentFragment>
|
|
17
25
|
`;
|
|
18
26
|
|
|
@@ -20,7 +28,11 @@ exports[`Check page main subnav section against snapshot 1`] = `
|
|
|
20
28
|
<DocumentFragment>
|
|
21
29
|
<section
|
|
22
30
|
class="pf-v6-c-page__main-subnav"
|
|
23
|
-
|
|
31
|
+
>
|
|
32
|
+
<div
|
|
33
|
+
class="pf-v6-c-page__main-body"
|
|
34
|
+
/>
|
|
35
|
+
</section>
|
|
24
36
|
</DocumentFragment>
|
|
25
37
|
`;
|
|
26
38
|
|
|
@@ -28,7 +40,11 @@ exports[`Check page main tabs section against snapshot 1`] = `
|
|
|
28
40
|
<DocumentFragment>
|
|
29
41
|
<section
|
|
30
42
|
class="pf-v6-c-page__main-tabs"
|
|
31
|
-
|
|
43
|
+
>
|
|
44
|
+
<div
|
|
45
|
+
class="pf-v6-c-page__main-body"
|
|
46
|
+
/>
|
|
47
|
+
</section>
|
|
32
48
|
</DocumentFragment>
|
|
33
49
|
`;
|
|
34
50
|
|
|
@@ -48,7 +64,11 @@ exports[`Check page section with fill and no padding example against snapshot 1`
|
|
|
48
64
|
<DocumentFragment>
|
|
49
65
|
<section
|
|
50
66
|
class="pf-v6-c-page__main-section pf-m-no-padding pf-m-fill"
|
|
51
|
-
|
|
67
|
+
>
|
|
68
|
+
<div
|
|
69
|
+
class="pf-v6-c-page__main-body"
|
|
70
|
+
/>
|
|
71
|
+
</section>
|
|
52
72
|
</DocumentFragment>
|
|
53
73
|
`;
|
|
54
74
|
|
|
@@ -56,7 +76,11 @@ exports[`Check page section with fill example against snapshot 1`] = `
|
|
|
56
76
|
<DocumentFragment>
|
|
57
77
|
<section
|
|
58
78
|
class="pf-v6-c-page__main-section pf-m-fill"
|
|
59
|
-
|
|
79
|
+
>
|
|
80
|
+
<div
|
|
81
|
+
class="pf-v6-c-page__main-body"
|
|
82
|
+
/>
|
|
83
|
+
</section>
|
|
60
84
|
</DocumentFragment>
|
|
61
85
|
`;
|
|
62
86
|
|
|
@@ -76,7 +100,11 @@ exports[`Check page section with no fill example against snapshot 1`] = `
|
|
|
76
100
|
<DocumentFragment>
|
|
77
101
|
<section
|
|
78
102
|
class="pf-v6-c-page__main-section pf-m-no-fill"
|
|
79
|
-
|
|
103
|
+
>
|
|
104
|
+
<div
|
|
105
|
+
class="pf-v6-c-page__main-body"
|
|
106
|
+
/>
|
|
107
|
+
</section>
|
|
80
108
|
</DocumentFragment>
|
|
81
109
|
`;
|
|
82
110
|
|
|
@@ -84,7 +112,11 @@ exports[`Check page section with no padding example against snapshot 1`] = `
|
|
|
84
112
|
<DocumentFragment>
|
|
85
113
|
<section
|
|
86
114
|
class="pf-v6-c-page__main-section pf-m-no-padding"
|
|
87
|
-
|
|
115
|
+
>
|
|
116
|
+
<div
|
|
117
|
+
class="pf-v6-c-page__main-body"
|
|
118
|
+
/>
|
|
119
|
+
</section>
|
|
88
120
|
</DocumentFragment>
|
|
89
121
|
`;
|
|
90
122
|
|
|
@@ -93,7 +125,11 @@ exports[`Verify page section bottom shadow 1`] = `
|
|
|
93
125
|
<section
|
|
94
126
|
class="pf-v6-c-page__main-section pf-m-shadow-bottom"
|
|
95
127
|
>
|
|
96
|
-
|
|
128
|
+
<div
|
|
129
|
+
class="pf-v6-c-page__main-body"
|
|
130
|
+
>
|
|
131
|
+
test
|
|
132
|
+
</div>
|
|
97
133
|
</section>
|
|
98
134
|
</DocumentFragment>
|
|
99
135
|
`;
|
|
@@ -103,7 +139,11 @@ exports[`Verify page section bottom sticky 1`] = `
|
|
|
103
139
|
<section
|
|
104
140
|
class="pf-v6-c-page__main-section pf-m-sticky-bottom"
|
|
105
141
|
>
|
|
106
|
-
|
|
142
|
+
<div
|
|
143
|
+
class="pf-v6-c-page__main-body"
|
|
144
|
+
>
|
|
145
|
+
test
|
|
146
|
+
</div>
|
|
107
147
|
</section>
|
|
108
148
|
</DocumentFragment>
|
|
109
149
|
`;
|
|
@@ -114,7 +154,11 @@ exports[`Verify page section overflow scroll 1`] = `
|
|
|
114
154
|
class="pf-v6-c-page__main-section pf-m-overflow-scroll"
|
|
115
155
|
tabindex="0"
|
|
116
156
|
>
|
|
117
|
-
|
|
157
|
+
<div
|
|
158
|
+
class="pf-v6-c-page__main-body"
|
|
159
|
+
>
|
|
160
|
+
test
|
|
161
|
+
</div>
|
|
118
162
|
</section>
|
|
119
163
|
</DocumentFragment>
|
|
120
164
|
`;
|
|
@@ -124,7 +168,11 @@ exports[`Verify page section top shadow 1`] = `
|
|
|
124
168
|
<section
|
|
125
169
|
class="pf-v6-c-page__main-section pf-m-shadow-top"
|
|
126
170
|
>
|
|
127
|
-
|
|
171
|
+
<div
|
|
172
|
+
class="pf-v6-c-page__main-body"
|
|
173
|
+
>
|
|
174
|
+
test
|
|
175
|
+
</div>
|
|
128
176
|
</section>
|
|
129
177
|
</DocumentFragment>
|
|
130
178
|
`;
|
|
@@ -134,7 +182,11 @@ exports[`Verify page section top sticky 1`] = `
|
|
|
134
182
|
<section
|
|
135
183
|
class="pf-v6-c-page__main-section pf-m-sticky-top"
|
|
136
184
|
>
|
|
137
|
-
|
|
185
|
+
<div
|
|
186
|
+
class="pf-v6-c-page__main-body"
|
|
187
|
+
>
|
|
188
|
+
test
|
|
189
|
+
</div>
|
|
138
190
|
</section>
|
|
139
191
|
</DocumentFragment>
|
|
140
192
|
`;
|
|
@@ -3,16 +3,7 @@ id: Page
|
|
|
3
3
|
section: components
|
|
4
4
|
cssPrefix: pf-v5-c-page
|
|
5
5
|
propComponents:
|
|
6
|
-
[
|
|
7
|
-
'Page',
|
|
8
|
-
'PageSidebar',
|
|
9
|
-
'PageSidebarBody',
|
|
10
|
-
'PageSection',
|
|
11
|
-
'PageGroup',
|
|
12
|
-
'PageBreadcrumb',
|
|
13
|
-
'PageNavigation',
|
|
14
|
-
'PageToggleButton'
|
|
15
|
-
]
|
|
6
|
+
['Page', 'PageSidebar', 'PageSidebarBody', 'PageSection', 'PageGroup', 'PageBreadcrumb', 'PageToggleButton']
|
|
16
7
|
---
|
|
17
8
|
|
|
18
9
|
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
@@ -107,7 +98,7 @@ This example shows all types of page sections.
|
|
|
107
98
|
|
|
108
99
|
To group page content sections, add 1 or more `<PageGroup>` components to a `<Page>`.
|
|
109
100
|
|
|
110
|
-
The following example adds a group containing `<
|
|
101
|
+
The following example adds a group containing `<PageBreadcrumb>` and `<PageSection>` components.
|
|
111
102
|
|
|
112
103
|
To add additional components and information to a group, you may use the following properties:
|
|
113
104
|
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
PageSection,
|
|
12
12
|
PageGroup,
|
|
13
13
|
PageBreadcrumb,
|
|
14
|
-
PageNavigation,
|
|
15
14
|
PageToggleButton,
|
|
16
15
|
Breadcrumb,
|
|
17
16
|
BreadcrumbItem,
|
|
@@ -70,27 +69,25 @@ export const PageGroupSection: React.FunctionComponent = () => {
|
|
|
70
69
|
return (
|
|
71
70
|
<Page masthead={masthead} sidebar={sidebar}>
|
|
72
71
|
<PageGroup>
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
</Nav>
|
|
93
|
-
</PageNavigation>
|
|
72
|
+
<Nav aria-label="Group section navigation" variant="horizontal-subnav">
|
|
73
|
+
<NavList>
|
|
74
|
+
<NavItem href="#" itemId={0} isActive>
|
|
75
|
+
System panel
|
|
76
|
+
</NavItem>
|
|
77
|
+
<NavItem href="#" itemId={1}>
|
|
78
|
+
Policy
|
|
79
|
+
</NavItem>
|
|
80
|
+
<NavItem href="#" itemId={2}>
|
|
81
|
+
Authentication
|
|
82
|
+
</NavItem>
|
|
83
|
+
<NavItem href="#" itemId={3}>
|
|
84
|
+
Network services
|
|
85
|
+
</NavItem>
|
|
86
|
+
<NavItem href="#" itemId={4}>
|
|
87
|
+
Server
|
|
88
|
+
</NavItem>
|
|
89
|
+
</NavList>
|
|
90
|
+
</Nav>
|
|
94
91
|
<PageBreadcrumb>
|
|
95
92
|
<Breadcrumb>
|
|
96
93
|
<BreadcrumbItem>Section home</BreadcrumbItem>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * from './Page';
|
|
2
|
+
export * from './PageBody';
|
|
2
3
|
export * from './PageBreadcrumb';
|
|
3
4
|
export * from './PageGroup';
|
|
4
5
|
export * from './PageSidebar';
|
|
5
6
|
export * from './PageSidebarBody';
|
|
6
7
|
export * from './PageSection';
|
|
7
|
-
export * from './PageNavigation';
|
|
8
8
|
export * from './PageToggleButton';
|
|
9
9
|
export * from './PageContext';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface PageNavigationProps extends React.HTMLProps<HTMLDivElement> {
|
|
3
|
-
/** Additional classes to apply to the PageNavigation */
|
|
4
|
-
className?: string;
|
|
5
|
-
/** Content rendered inside of the PageNavigation */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/** Limits the width of the PageNavigation */
|
|
8
|
-
isWidthLimited?: boolean;
|
|
9
|
-
/** Modifier indicating if the PageBreadcrumb is sticky to the top or bottom at various breakpoints */
|
|
10
|
-
stickyOnBreakpoint?: {
|
|
11
|
-
default?: 'top' | 'bottom';
|
|
12
|
-
sm?: 'top' | 'bottom';
|
|
13
|
-
md?: 'top' | 'bottom';
|
|
14
|
-
lg?: 'top' | 'bottom';
|
|
15
|
-
xl?: 'top' | 'bottom';
|
|
16
|
-
'2xl'?: 'top' | 'bottom';
|
|
17
|
-
};
|
|
18
|
-
/** Flag indicating if PageNavigation should have a shadow at the top */
|
|
19
|
-
hasShadowTop?: boolean;
|
|
20
|
-
/** Flag indicating if PageNavigation should have a shadow at the bottom */
|
|
21
|
-
hasShadowBottom?: boolean;
|
|
22
|
-
/** Flag indicating if the PageNavigation has a scrolling overflow */
|
|
23
|
-
hasOverflowScroll?: boolean;
|
|
24
|
-
/** Adds an accessible name to the page navigation when the hasOverflowScroll prop is set to true. */
|
|
25
|
-
'aria-label'?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare const PageNavigation: {
|
|
28
|
-
({ className, children, isWidthLimited, stickyOnBreakpoint, hasShadowTop, hasShadowBottom, hasOverflowScroll, "aria-label": ariaLabel, ...props }: PageNavigationProps): React.JSX.Element;
|
|
29
|
-
displayName: string;
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=PageNavigation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/Page/PageNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAC1E,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sGAAsG;IACtG,kBAAkB,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QAC3B,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;KAC1B,CAAC;IACF,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,qGAAqG;IACrG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,cAAc;uJAUxB,mBAAmB;;CA4BrB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { css } from '@patternfly/react-styles';
|
|
4
|
-
import styles from '@patternfly/react-styles/css/components/Page/page.mjs';
|
|
5
|
-
import { formatBreakpointMods } from '../../helpers/util';
|
|
6
|
-
import { PageContext } from './PageContext';
|
|
7
|
-
export const PageNavigation = (_a) => {
|
|
8
|
-
var { className = '', children, isWidthLimited, stickyOnBreakpoint, hasShadowTop = false, hasShadowBottom = false, hasOverflowScroll = false, 'aria-label': ariaLabel } = _a, props = __rest(_a, ["className", "children", "isWidthLimited", "stickyOnBreakpoint", "hasShadowTop", "hasShadowBottom", "hasOverflowScroll", 'aria-label']);
|
|
9
|
-
const { height, getVerticalBreakpoint } = React.useContext(PageContext);
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
if (hasOverflowScroll && !ariaLabel) {
|
|
12
|
-
/* eslint-disable no-console */
|
|
13
|
-
console.warn('PageNavigation: An accessible aria-label is required when hasOverflowScroll is set to true.');
|
|
14
|
-
}
|
|
15
|
-
}, [hasOverflowScroll, ariaLabel]);
|
|
16
|
-
return (React.createElement("div", Object.assign({ className: css(styles.pageMainNav, formatBreakpointMods(stickyOnBreakpoint, styles, 'sticky-', getVerticalBreakpoint(height), true), isWidthLimited && styles.modifiers.limitWidth, hasShadowTop && styles.modifiers.shadowTop, hasShadowBottom && styles.modifiers.shadowBottom, hasOverflowScroll && styles.modifiers.overflowScroll, className) }, (hasOverflowScroll && { tabIndex: 0, role: 'region', 'aria-label': ariaLabel }), props),
|
|
17
|
-
isWidthLimited && React.createElement("div", { className: css(styles.pageMainBody) }, children),
|
|
18
|
-
!isWidthLimited && children));
|
|
19
|
-
};
|
|
20
|
-
PageNavigation.displayName = 'PageNavigation';
|
|
21
|
-
//# sourceMappingURL=PageNavigation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageNavigation.js","sourceRoot":"","sources":["../../../../src/components/Page/PageNavigation.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,MAAM,8DAA0D;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA4B5C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAUT,EAAE,EAAE;QAVK,EAC7B,SAAS,GAAG,EAAE,EACd,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,YAAY,GAAG,KAAK,EACpB,eAAe,GAAG,KAAK,EACvB,iBAAiB,GAAG,KAAK,EACzB,YAAY,EAAE,SAAS,OAEH,EADjB,KAAK,cATqB,uIAU9B,CADS;IAER,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAExE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,iBAAiB,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,+BAA+B;YAC/B,OAAO,CAAC,IAAI,CAAC,6FAA6F,CAAC,CAAC;QAC9G,CAAC;IACH,CAAC,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC;IAEnC,OAAO,CACL,2CACE,SAAS,EAAE,GAAG,CACZ,MAAM,CAAC,WAAW,EAClB,oBAAoB,CAAC,kBAAkB,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAChG,cAAc,IAAI,MAAM,CAAC,SAAS,CAAC,UAAU,EAC7C,YAAY,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS,EAC1C,eAAe,IAAI,MAAM,CAAC,SAAS,CAAC,YAAY,EAChD,iBAAiB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,EACpD,SAAS,CACV,IACG,CAAC,iBAAiB,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,EAC/E,KAAK;QAER,cAAc,IAAI,6BAAK,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,IAAG,QAAQ,CAAO;QAC5E,CAAC,cAAc,IAAI,QAAQ,CACxB,CACP,CAAC;AACJ,CAAC,CAAC;AACF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface PageNavigationProps extends React.HTMLProps<HTMLDivElement> {
|
|
3
|
-
/** Additional classes to apply to the PageNavigation */
|
|
4
|
-
className?: string;
|
|
5
|
-
/** Content rendered inside of the PageNavigation */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/** Limits the width of the PageNavigation */
|
|
8
|
-
isWidthLimited?: boolean;
|
|
9
|
-
/** Modifier indicating if the PageBreadcrumb is sticky to the top or bottom at various breakpoints */
|
|
10
|
-
stickyOnBreakpoint?: {
|
|
11
|
-
default?: 'top' | 'bottom';
|
|
12
|
-
sm?: 'top' | 'bottom';
|
|
13
|
-
md?: 'top' | 'bottom';
|
|
14
|
-
lg?: 'top' | 'bottom';
|
|
15
|
-
xl?: 'top' | 'bottom';
|
|
16
|
-
'2xl'?: 'top' | 'bottom';
|
|
17
|
-
};
|
|
18
|
-
/** Flag indicating if PageNavigation should have a shadow at the top */
|
|
19
|
-
hasShadowTop?: boolean;
|
|
20
|
-
/** Flag indicating if PageNavigation should have a shadow at the bottom */
|
|
21
|
-
hasShadowBottom?: boolean;
|
|
22
|
-
/** Flag indicating if the PageNavigation has a scrolling overflow */
|
|
23
|
-
hasOverflowScroll?: boolean;
|
|
24
|
-
/** Adds an accessible name to the page navigation when the hasOverflowScroll prop is set to true. */
|
|
25
|
-
'aria-label'?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare const PageNavigation: {
|
|
28
|
-
({ className, children, isWidthLimited, stickyOnBreakpoint, hasShadowTop, hasShadowBottom, hasOverflowScroll, "aria-label": ariaLabel, ...props }: PageNavigationProps): React.JSX.Element;
|
|
29
|
-
displayName: string;
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=PageNavigation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/Page/PageNavigation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IAC1E,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sGAAsG;IACtG,kBAAkB,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QAC3B,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,EAAE,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;QACtB,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;KAC1B,CAAC;IACF,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,qGAAqG;IACrG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,cAAc;uJAUxB,mBAAmB;;CA4BrB,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PageNavigation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const react_styles_1 = require("@patternfly/react-styles");
|
|
7
|
-
const page_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Page/page"));
|
|
8
|
-
const util_1 = require("../../helpers/util");
|
|
9
|
-
const PageContext_1 = require("./PageContext");
|
|
10
|
-
const PageNavigation = (_a) => {
|
|
11
|
-
var { className = '', children, isWidthLimited, stickyOnBreakpoint, hasShadowTop = false, hasShadowBottom = false, hasOverflowScroll = false, 'aria-label': ariaLabel } = _a, props = tslib_1.__rest(_a, ["className", "children", "isWidthLimited", "stickyOnBreakpoint", "hasShadowTop", "hasShadowBottom", "hasOverflowScroll", 'aria-label']);
|
|
12
|
-
const { height, getVerticalBreakpoint } = React.useContext(PageContext_1.PageContext);
|
|
13
|
-
React.useEffect(() => {
|
|
14
|
-
if (hasOverflowScroll && !ariaLabel) {
|
|
15
|
-
/* eslint-disable no-console */
|
|
16
|
-
console.warn('PageNavigation: An accessible aria-label is required when hasOverflowScroll is set to true.');
|
|
17
|
-
}
|
|
18
|
-
}, [hasOverflowScroll, ariaLabel]);
|
|
19
|
-
return (React.createElement("div", Object.assign({ className: (0, react_styles_1.css)(page_1.default.pageMainNav, (0, util_1.formatBreakpointMods)(stickyOnBreakpoint, page_1.default, 'sticky-', getVerticalBreakpoint(height), true), isWidthLimited && page_1.default.modifiers.limitWidth, hasShadowTop && page_1.default.modifiers.shadowTop, hasShadowBottom && page_1.default.modifiers.shadowBottom, hasOverflowScroll && page_1.default.modifiers.overflowScroll, className) }, (hasOverflowScroll && { tabIndex: 0, role: 'region', 'aria-label': ariaLabel }), props),
|
|
20
|
-
isWidthLimited && React.createElement("div", { className: (0, react_styles_1.css)(page_1.default.pageMainBody) }, children),
|
|
21
|
-
!isWidthLimited && children));
|
|
22
|
-
};
|
|
23
|
-
exports.PageNavigation = PageNavigation;
|
|
24
|
-
exports.PageNavigation.displayName = 'PageNavigation';
|
|
25
|
-
//# sourceMappingURL=PageNavigation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageNavigation.js","sourceRoot":"","sources":["../../../../src/components/Page/PageNavigation.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAC/B,2DAA+C;AAC/C,qGAAuE;AACvE,6CAA0D;AAC1D,+CAA4C;AA4BrC,MAAM,cAAc,GAAG,CAAC,EAUT,EAAE,EAAE;QAVK,EAC7B,SAAS,GAAG,EAAE,EACd,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,YAAY,GAAG,KAAK,EACpB,eAAe,GAAG,KAAK,EACvB,iBAAiB,GAAG,KAAK,EACzB,YAAY,EAAE,SAAS,OAEH,EADjB,KAAK,sBATqB,uIAU9B,CADS;IAER,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,yBAAW,CAAC,CAAC;IAExE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,iBAAiB,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,+BAA+B;YAC/B,OAAO,CAAC,IAAI,CAAC,6FAA6F,CAAC,CAAC;QAC9G,CAAC;IACH,CAAC,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC;IAEnC,OAAO,CACL,2CACE,SAAS,EAAE,IAAA,kBAAG,EACZ,cAAM,CAAC,WAAW,EAClB,IAAA,2BAAoB,EAAC,kBAAkB,EAAE,cAAM,EAAE,SAAS,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAChG,cAAc,IAAI,cAAM,CAAC,SAAS,CAAC,UAAU,EAC7C,YAAY,IAAI,cAAM,CAAC,SAAS,CAAC,SAAS,EAC1C,eAAe,IAAI,cAAM,CAAC,SAAS,CAAC,YAAY,EAChD,iBAAiB,IAAI,cAAM,CAAC,SAAS,CAAC,cAAc,EACpD,SAAS,CACV,IACG,CAAC,iBAAiB,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,EAC/E,KAAK;QAER,cAAc,IAAI,6BAAK,SAAS,EAAE,IAAA,kBAAG,EAAC,cAAM,CAAC,YAAY,CAAC,IAAG,QAAQ,CAAO;QAC5E,CAAC,cAAc,IAAI,QAAQ,CACxB,CACP,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,cAAc,kBAsCzB;AACF,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { css } from '@patternfly/react-styles';
|
|
3
|
-
import styles from '@patternfly/react-styles/css/components/Page/page';
|
|
4
|
-
import { formatBreakpointMods } from '../../helpers/util';
|
|
5
|
-
import { PageContext } from './PageContext';
|
|
6
|
-
|
|
7
|
-
export interface PageNavigationProps extends React.HTMLProps<HTMLDivElement> {
|
|
8
|
-
/** Additional classes to apply to the PageNavigation */
|
|
9
|
-
className?: string;
|
|
10
|
-
/** Content rendered inside of the PageNavigation */
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
/** Limits the width of the PageNavigation */
|
|
13
|
-
isWidthLimited?: boolean;
|
|
14
|
-
/** Modifier indicating if the PageBreadcrumb is sticky to the top or bottom at various breakpoints */
|
|
15
|
-
stickyOnBreakpoint?: {
|
|
16
|
-
default?: 'top' | 'bottom';
|
|
17
|
-
sm?: 'top' | 'bottom';
|
|
18
|
-
md?: 'top' | 'bottom';
|
|
19
|
-
lg?: 'top' | 'bottom';
|
|
20
|
-
xl?: 'top' | 'bottom';
|
|
21
|
-
'2xl'?: 'top' | 'bottom';
|
|
22
|
-
};
|
|
23
|
-
/** Flag indicating if PageNavigation should have a shadow at the top */
|
|
24
|
-
hasShadowTop?: boolean;
|
|
25
|
-
/** Flag indicating if PageNavigation should have a shadow at the bottom */
|
|
26
|
-
hasShadowBottom?: boolean;
|
|
27
|
-
/** Flag indicating if the PageNavigation has a scrolling overflow */
|
|
28
|
-
hasOverflowScroll?: boolean;
|
|
29
|
-
/** Adds an accessible name to the page navigation when the hasOverflowScroll prop is set to true. */
|
|
30
|
-
'aria-label'?: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const PageNavigation = ({
|
|
34
|
-
className = '',
|
|
35
|
-
children,
|
|
36
|
-
isWidthLimited,
|
|
37
|
-
stickyOnBreakpoint,
|
|
38
|
-
hasShadowTop = false,
|
|
39
|
-
hasShadowBottom = false,
|
|
40
|
-
hasOverflowScroll = false,
|
|
41
|
-
'aria-label': ariaLabel,
|
|
42
|
-
...props
|
|
43
|
-
}: PageNavigationProps) => {
|
|
44
|
-
const { height, getVerticalBreakpoint } = React.useContext(PageContext);
|
|
45
|
-
|
|
46
|
-
React.useEffect(() => {
|
|
47
|
-
if (hasOverflowScroll && !ariaLabel) {
|
|
48
|
-
/* eslint-disable no-console */
|
|
49
|
-
console.warn('PageNavigation: An accessible aria-label is required when hasOverflowScroll is set to true.');
|
|
50
|
-
}
|
|
51
|
-
}, [hasOverflowScroll, ariaLabel]);
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div
|
|
55
|
-
className={css(
|
|
56
|
-
styles.pageMainNav,
|
|
57
|
-
formatBreakpointMods(stickyOnBreakpoint, styles, 'sticky-', getVerticalBreakpoint(height), true),
|
|
58
|
-
isWidthLimited && styles.modifiers.limitWidth,
|
|
59
|
-
hasShadowTop && styles.modifiers.shadowTop,
|
|
60
|
-
hasShadowBottom && styles.modifiers.shadowBottom,
|
|
61
|
-
hasOverflowScroll && styles.modifiers.overflowScroll,
|
|
62
|
-
className
|
|
63
|
-
)}
|
|
64
|
-
{...(hasOverflowScroll && { tabIndex: 0, role: 'region', 'aria-label': ariaLabel })}
|
|
65
|
-
{...props}
|
|
66
|
-
>
|
|
67
|
-
{isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
|
|
68
|
-
{!isWidthLimited && children}
|
|
69
|
-
</div>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
PageNavigation.displayName = 'PageNavigation';
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { PageNavigation } from '../PageNavigation';
|
|
4
|
-
|
|
5
|
-
describe('page navigation', () => {
|
|
6
|
-
test('Verify basic render', () => {
|
|
7
|
-
const { asFragment } = render(<PageNavigation>test</PageNavigation>);
|
|
8
|
-
expect(asFragment()).toMatchSnapshot();
|
|
9
|
-
});
|
|
10
|
-
test('Verify limited width', () => {
|
|
11
|
-
const { asFragment } = render(<PageNavigation isWidthLimited>test</PageNavigation>);
|
|
12
|
-
expect(asFragment()).toMatchSnapshot();
|
|
13
|
-
});
|
|
14
|
-
test('Verify top sticky', () => {
|
|
15
|
-
const { asFragment } = render(<PageNavigation stickyOnBreakpoint={{ default: 'top' }}>test</PageNavigation>);
|
|
16
|
-
expect(asFragment()).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
test('Verify bottom sticky', () => {
|
|
19
|
-
const { asFragment } = render(<PageNavigation stickyOnBreakpoint={{ default: 'bottom' }}>test</PageNavigation>);
|
|
20
|
-
expect(asFragment()).toMatchSnapshot();
|
|
21
|
-
});
|
|
22
|
-
test('Verify top shadow', () => {
|
|
23
|
-
const { asFragment } = render(<PageNavigation hasShadowTop>test</PageNavigation>);
|
|
24
|
-
expect(asFragment()).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
test('Verify bottom shadow', () => {
|
|
27
|
-
const { asFragment } = render(<PageNavigation hasShadowBottom>test</PageNavigation>);
|
|
28
|
-
expect(asFragment()).toMatchSnapshot();
|
|
29
|
-
});
|
|
30
|
-
test('Verify overflow scroll', () => {
|
|
31
|
-
const { asFragment } = render(<PageNavigation hasOverflowScroll>test</PageNavigation>);
|
|
32
|
-
expect(asFragment()).toMatchSnapshot();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
test('Renders without an aria-label by default', () => {
|
|
36
|
-
render(<PageNavigation>test</PageNavigation>);
|
|
37
|
-
|
|
38
|
-
expect(screen.getByText('test')).not.toHaveAccessibleName('Test label');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
test('Renders with the passed aria-label applied', () => {
|
|
42
|
-
render(
|
|
43
|
-
<PageNavigation aria-label="Test label" hasOverflowScroll>
|
|
44
|
-
test
|
|
45
|
-
</PageNavigation>
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
expect(screen.getByText('test')).toHaveAccessibleName('Test label');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test('Does not log a warning in the console by default', () => {
|
|
52
|
-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
|
|
53
|
-
|
|
54
|
-
render(<PageNavigation>test</PageNavigation>);
|
|
55
|
-
|
|
56
|
-
expect(consoleWarning).not.toHaveBeenCalled();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test('Does not log a warning in the console when an aria-label is included with hasOverflowScroll', () => {
|
|
60
|
-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
|
|
61
|
-
|
|
62
|
-
render(
|
|
63
|
-
<PageNavigation hasOverflowScroll aria-label="Test label">
|
|
64
|
-
test
|
|
65
|
-
</PageNavigation>
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
expect(consoleWarning).not.toHaveBeenCalled();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
test('Logs a warning in the console when an aria-label is not included with hasOverflowScroll', () => {
|
|
72
|
-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
|
|
73
|
-
|
|
74
|
-
render(<PageNavigation hasOverflowScroll>test</PageNavigation>);
|
|
75
|
-
|
|
76
|
-
expect(consoleWarning).toHaveBeenCalled();
|
|
77
|
-
});
|
|
78
|
-
});
|