@patternfly/react-core 4.228.0 → 4.230.0
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 +33 -0
- package/dist/esm/components/DescriptionList/DescriptionList.d.ts +4 -0
- package/dist/esm/components/DescriptionList/DescriptionList.d.ts.map +1 -1
- package/dist/esm/components/DescriptionList/DescriptionList.js +5 -2
- package/dist/esm/components/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/esm/components/DescriptionList/DescriptionListGroup.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js +5 -3
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/esm/components/Nav/NavItem.js +5 -1
- package/dist/esm/components/Nav/NavItem.js.map +1 -1
- package/dist/esm/components/Page/Page.d.ts +13 -0
- package/dist/esm/components/Page/Page.d.ts.map +1 -1
- package/dist/esm/components/Page/Page.js +18 -19
- package/dist/esm/components/Page/Page.js.map +1 -1
- package/dist/esm/components/Page/PageBreadcrumb.d.ts +11 -2
- package/dist/esm/components/Page/PageBreadcrumb.d.ts.map +1 -1
- package/dist/esm/components/Page/PageBreadcrumb.js +5 -2
- package/dist/esm/components/Page/PageBreadcrumb.js.map +1 -1
- package/dist/esm/components/Page/PageGroup.d.ts +11 -2
- package/dist/esm/components/Page/PageGroup.d.ts.map +1 -1
- package/dist/esm/components/Page/PageGroup.js +5 -2
- package/dist/esm/components/Page/PageGroup.js.map +1 -1
- package/dist/esm/components/Page/PageNavigation.d.ts +11 -2
- package/dist/esm/components/Page/PageNavigation.d.ts.map +1 -1
- package/dist/esm/components/Page/PageNavigation.js +5 -2
- package/dist/esm/components/Page/PageNavigation.js.map +1 -1
- package/dist/esm/components/Page/PageSection.d.ts +10 -1
- package/dist/esm/components/Page/PageSection.d.ts.map +1 -1
- package/dist/esm/components/Page/PageSection.js +4 -2
- package/dist/esm/components/Page/PageSection.js.map +1 -1
- package/dist/esm/helpers/constants.d.ts +14 -0
- package/dist/esm/helpers/constants.d.ts.map +1 -1
- package/dist/esm/helpers/constants.js +24 -0
- package/dist/esm/helpers/constants.js.map +1 -1
- package/dist/esm/helpers/util.d.ts +8 -1
- package/dist/esm/helpers/util.d.ts.map +1 -1
- package/dist/esm/helpers/util.js +36 -9
- package/dist/esm/helpers/util.js.map +1 -1
- package/dist/js/components/DescriptionList/DescriptionList.d.ts +4 -0
- package/dist/js/components/DescriptionList/DescriptionList.d.ts.map +1 -1
- package/dist/js/components/DescriptionList/DescriptionList.js +5 -2
- package/dist/js/components/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/js/components/DescriptionList/DescriptionListGroup.js.map +1 -1
- package/dist/js/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuItem.js +5 -3
- package/dist/js/components/Menu/MenuItem.js.map +1 -1
- package/dist/js/components/Nav/NavItem.d.ts.map +1 -1
- package/dist/js/components/Nav/NavItem.js +5 -1
- package/dist/js/components/Nav/NavItem.js.map +1 -1
- package/dist/js/components/Page/Page.d.ts +13 -0
- package/dist/js/components/Page/Page.d.ts.map +1 -1
- package/dist/js/components/Page/Page.js +17 -18
- package/dist/js/components/Page/Page.js.map +1 -1
- package/dist/js/components/Page/PageBreadcrumb.d.ts +11 -2
- package/dist/js/components/Page/PageBreadcrumb.d.ts.map +1 -1
- package/dist/js/components/Page/PageBreadcrumb.js +5 -2
- package/dist/js/components/Page/PageBreadcrumb.js.map +1 -1
- package/dist/js/components/Page/PageGroup.d.ts +11 -2
- package/dist/js/components/Page/PageGroup.d.ts.map +1 -1
- package/dist/js/components/Page/PageGroup.js +5 -2
- package/dist/js/components/Page/PageGroup.js.map +1 -1
- package/dist/js/components/Page/PageNavigation.d.ts +11 -2
- package/dist/js/components/Page/PageNavigation.d.ts.map +1 -1
- package/dist/js/components/Page/PageNavigation.js +5 -2
- package/dist/js/components/Page/PageNavigation.js.map +1 -1
- package/dist/js/components/Page/PageSection.d.ts +10 -1
- package/dist/js/components/Page/PageSection.d.ts.map +1 -1
- package/dist/js/components/Page/PageSection.js +4 -2
- package/dist/js/components/Page/PageSection.js.map +1 -1
- package/dist/js/helpers/constants.d.ts +14 -0
- package/dist/js/helpers/constants.d.ts.map +1 -1
- package/dist/js/helpers/constants.js +26 -1
- package/dist/js/helpers/constants.js.map +1 -1
- package/dist/js/helpers/util.d.ts +8 -1
- package/dist/js/helpers/util.d.ts.map +1 -1
- package/dist/js/helpers/util.js +37 -9
- package/dist/js/helpers/util.js.map +1 -1
- package/dist/umd/react-core.js +170 -71
- package/dist/umd/react-core.min.js +6 -5
- package/package.json +5 -5
- package/src/components/DescriptionList/DescriptionList.tsx +14 -0
- package/src/components/DescriptionList/DescriptionListGroup.tsx +1 -0
- package/src/components/DescriptionList/examples/DescriptionList.md +31 -1
- package/src/components/DescriptionList/examples/DescriptionListDisplaySizeAndCard.tsx +63 -0
- package/src/components/DescriptionList/examples/DescriptionListDisplaySizeAndCardHorizontalTermWidth.tsx +34 -0
- package/src/components/DescriptionList/examples/DescriptionListDisplaySizeAndCardThreeColumn.tsx +34 -0
- package/src/components/DescriptionList/examples/DescriptionListWithCard.tsx +62 -0
- package/src/components/DescriptionList/examples/DescriptionListWithDisplaySize.tsx +63 -0
- package/src/components/Menu/MenuItem.tsx +7 -5
- package/src/components/Nav/NavItem.tsx +6 -0
- package/src/components/Page/Page.tsx +58 -21
- package/src/components/Page/PageBreadcrumb.tsx +37 -20
- package/src/components/Page/PageGroup.tsx +35 -19
- package/src/components/Page/PageNavigation.tsx +37 -20
- package/src/components/Page/PageSection.tsx +41 -25
- package/src/components/Page/__tests__/Page.test.tsx +126 -2
- package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +683 -14
- package/src/demos/Page/Page.md +356 -3
- package/src/helpers/constants.ts +28 -0
- package/src/helpers/util.ts +44 -9
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
3
|
import styles from '@patternfly/react-styles/css/components/Page/page';
|
|
4
|
+
import { formatBreakpointMods } from '../../helpers/util';
|
|
5
|
+
import { PageContext } from '../Page/Page';
|
|
4
6
|
|
|
5
7
|
export interface PageBreadcrumbProps extends React.HTMLProps<HTMLElement> {
|
|
6
8
|
/** Additional classes to apply to the PageBreadcrumb */
|
|
@@ -9,8 +11,17 @@ export interface PageBreadcrumbProps extends React.HTMLProps<HTMLElement> {
|
|
|
9
11
|
children?: React.ReactNode;
|
|
10
12
|
/** Limits the width of the breadcrumb */
|
|
11
13
|
isWidthLimited?: boolean;
|
|
12
|
-
/** Modifier indicating if the PageBreadcrumb is sticky to the top or bottom */
|
|
14
|
+
/** @deprecated Use the stickyOnBreakpoint prop instead - Modifier indicating if the PageBreadcrumb is sticky to the top or bottom */
|
|
13
15
|
sticky?: 'top' | 'bottom';
|
|
16
|
+
/** Modifier indicating if the PageBreadcrumb is sticky to the top or bottom at various breakpoints */
|
|
17
|
+
stickyOnBreakpoint?: {
|
|
18
|
+
default?: 'top' | 'bottom';
|
|
19
|
+
sm?: 'top' | 'bottom';
|
|
20
|
+
md?: 'top' | 'bottom';
|
|
21
|
+
lg?: 'top' | 'bottom';
|
|
22
|
+
xl?: 'top' | 'bottom';
|
|
23
|
+
'2xl'?: 'top' | 'bottom';
|
|
24
|
+
};
|
|
14
25
|
/** Flag indicating if PageBreadcrumb should have a shadow at the top */
|
|
15
26
|
hasShadowTop?: boolean;
|
|
16
27
|
/** Flag indicating if PageBreadcrumb should have a shadow at the bottom */
|
|
@@ -24,27 +35,33 @@ export const PageBreadcrumb = ({
|
|
|
24
35
|
children,
|
|
25
36
|
isWidthLimited,
|
|
26
37
|
sticky,
|
|
38
|
+
stickyOnBreakpoint,
|
|
27
39
|
hasShadowTop = false,
|
|
28
40
|
hasShadowBottom = false,
|
|
29
41
|
hasOverflowScroll = false,
|
|
30
42
|
...props
|
|
31
|
-
}: PageBreadcrumbProps) =>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
}: PageBreadcrumbProps) => {
|
|
44
|
+
const { height, getVerticalBreakpoint } = React.useContext(PageContext);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<section
|
|
48
|
+
className={css(
|
|
49
|
+
styles.pageMainBreadcrumb,
|
|
50
|
+
formatBreakpointMods(stickyOnBreakpoint, styles, 'sticky-', getVerticalBreakpoint(height), true),
|
|
51
|
+
isWidthLimited && styles.modifiers.limitWidth,
|
|
52
|
+
sticky === 'top' && styles.modifiers.stickyTop,
|
|
53
|
+
sticky === 'bottom' && styles.modifiers.stickyBottom,
|
|
54
|
+
hasShadowTop && styles.modifiers.shadowTop,
|
|
55
|
+
hasShadowBottom && styles.modifiers.shadowBottom,
|
|
56
|
+
hasOverflowScroll && styles.modifiers.overflowScroll,
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
{...(hasOverflowScroll && { tabIndex: 0 })}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
{isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
|
|
63
|
+
{!isWidthLimited && children}
|
|
64
|
+
</section>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
50
67
|
PageBreadcrumb.displayName = 'PageBreadcrumb';
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
3
|
import styles from '@patternfly/react-styles/css/components/Page/page';
|
|
4
|
-
|
|
4
|
+
import { formatBreakpointMods } from '../../helpers/util';
|
|
5
|
+
import { PageContext } from '../Page/Page';
|
|
5
6
|
export interface PageGroupProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
7
|
/** Additional classes to apply to the PageGroup */
|
|
7
8
|
className?: string;
|
|
8
9
|
/** Content rendered inside of the PageGroup */
|
|
9
10
|
children?: React.ReactNode;
|
|
10
|
-
/** Modifier indicating if
|
|
11
|
+
/** @deprecated Use the stickyOnBreakpoint prop instead - Modifier indicating if the PageBreadcrumb is sticky to the top or bottom */
|
|
11
12
|
sticky?: 'top' | 'bottom';
|
|
13
|
+
/** Modifier indicating if the PageBreadcrumb is sticky to the top or bottom at various breakpoints */
|
|
14
|
+
stickyOnBreakpoint?: {
|
|
15
|
+
default?: 'top' | 'bottom';
|
|
16
|
+
sm?: 'top' | 'bottom';
|
|
17
|
+
md?: 'top' | 'bottom';
|
|
18
|
+
lg?: 'top' | 'bottom';
|
|
19
|
+
xl?: 'top' | 'bottom';
|
|
20
|
+
'2xl'?: 'top' | 'bottom';
|
|
21
|
+
};
|
|
12
22
|
/** Modifier indicating if PageGroup should have a shadow at the top */
|
|
13
23
|
hasShadowTop?: boolean;
|
|
14
24
|
/** Modifier indicating if PageGroup should have a shadow at the bottom */
|
|
@@ -21,25 +31,31 @@ export const PageGroup = ({
|
|
|
21
31
|
className = '',
|
|
22
32
|
children,
|
|
23
33
|
sticky,
|
|
34
|
+
stickyOnBreakpoint,
|
|
24
35
|
hasShadowTop = false,
|
|
25
36
|
hasShadowBottom = false,
|
|
26
37
|
hasOverflowScroll = false,
|
|
27
38
|
...props
|
|
28
|
-
}: PageGroupProps) =>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
39
|
+
}: PageGroupProps) => {
|
|
40
|
+
const { height, getVerticalBreakpoint } = React.useContext(PageContext);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
{...props}
|
|
45
|
+
className={css(
|
|
46
|
+
styles.pageMainGroup,
|
|
47
|
+
formatBreakpointMods(stickyOnBreakpoint, styles, 'sticky-', getVerticalBreakpoint(height), true),
|
|
48
|
+
sticky === 'top' && styles.modifiers.stickyTop,
|
|
49
|
+
sticky === 'bottom' && styles.modifiers.stickyBottom,
|
|
50
|
+
hasShadowTop && styles.modifiers.shadowTop,
|
|
51
|
+
hasShadowBottom && styles.modifiers.shadowBottom,
|
|
52
|
+
hasOverflowScroll && styles.modifiers.overflowScroll,
|
|
53
|
+
className
|
|
54
|
+
)}
|
|
55
|
+
{...(hasOverflowScroll && { tabIndex: 0 })}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
45
61
|
PageGroup.displayName = 'PageGroup';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
3
|
import styles from '@patternfly/react-styles/css/components/Page/page';
|
|
4
|
+
import { formatBreakpointMods } from '../../helpers/util';
|
|
5
|
+
import { PageContext } from '../Page/Page';
|
|
4
6
|
|
|
5
7
|
export interface PageNavigationProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
8
|
/** Additional classes to apply to the PageNavigation */
|
|
@@ -9,8 +11,17 @@ export interface PageNavigationProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
9
11
|
children?: React.ReactNode;
|
|
10
12
|
/** Limits the width of the PageNavigation */
|
|
11
13
|
isWidthLimited?: boolean;
|
|
12
|
-
/** Modifier indicating if the
|
|
14
|
+
/** @deprecated Use the stickyOnBreakpoint prop instead - Modifier indicating if the PageBreadcrumb is sticky to the top or bottom */
|
|
13
15
|
sticky?: 'top' | 'bottom';
|
|
16
|
+
/** Modifier indicating if the PageBreadcrumb is sticky to the top or bottom at various breakpoints */
|
|
17
|
+
stickyOnBreakpoint?: {
|
|
18
|
+
default?: 'top' | 'bottom';
|
|
19
|
+
sm?: 'top' | 'bottom';
|
|
20
|
+
md?: 'top' | 'bottom';
|
|
21
|
+
lg?: 'top' | 'bottom';
|
|
22
|
+
xl?: 'top' | 'bottom';
|
|
23
|
+
'2xl'?: 'top' | 'bottom';
|
|
24
|
+
};
|
|
14
25
|
/** Flag indicating if PageNavigation should have a shadow at the top */
|
|
15
26
|
hasShadowTop?: boolean;
|
|
16
27
|
/** Flag indicating if PageNavigation should have a shadow at the bottom */
|
|
@@ -24,27 +35,33 @@ export const PageNavigation = ({
|
|
|
24
35
|
children,
|
|
25
36
|
isWidthLimited,
|
|
26
37
|
sticky,
|
|
38
|
+
stickyOnBreakpoint,
|
|
27
39
|
hasShadowTop = false,
|
|
28
40
|
hasShadowBottom = false,
|
|
29
41
|
hasOverflowScroll = false,
|
|
30
42
|
...props
|
|
31
|
-
}: PageNavigationProps) =>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
}: PageNavigationProps) => {
|
|
44
|
+
const { height, getVerticalBreakpoint } = React.useContext(PageContext);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
className={css(
|
|
49
|
+
styles.pageMainNav,
|
|
50
|
+
formatBreakpointMods(stickyOnBreakpoint, styles, 'sticky-', getVerticalBreakpoint(height), true),
|
|
51
|
+
isWidthLimited && styles.modifiers.limitWidth,
|
|
52
|
+
sticky === 'top' && styles.modifiers.stickyTop,
|
|
53
|
+
sticky === 'bottom' && styles.modifiers.stickyBottom,
|
|
54
|
+
hasShadowTop && styles.modifiers.shadowTop,
|
|
55
|
+
hasShadowBottom && styles.modifiers.shadowBottom,
|
|
56
|
+
hasOverflowScroll && styles.modifiers.overflowScroll,
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
{...(hasOverflowScroll && { tabIndex: 0 })}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
{isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
|
|
63
|
+
{!isWidthLimited && children}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
50
67
|
PageNavigation.displayName = 'PageNavigation';
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Page/page';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
import { formatBreakpointMods } from '../../helpers/util';
|
|
5
|
+
import { PageContext } from '../Page/Page';
|
|
5
6
|
|
|
6
7
|
export enum PageSectionVariants {
|
|
7
8
|
default = 'default',
|
|
@@ -43,8 +44,17 @@ export interface PageSectionProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
43
44
|
xl?: 'padding' | 'noPadding';
|
|
44
45
|
'2xl'?: 'padding' | 'noPadding';
|
|
45
46
|
};
|
|
46
|
-
/** Modifier indicating if
|
|
47
|
+
/** @deprecated Use the stickyOnBreakpoint prop instead - Modifier indicating if the PageBreadcrumb is sticky to the top or bottom */
|
|
47
48
|
sticky?: 'top' | 'bottom';
|
|
49
|
+
/** Modifier indicating if the PageBreadcrumb is sticky to the top or bottom at various breakpoints */
|
|
50
|
+
stickyOnBreakpoint?: {
|
|
51
|
+
default?: 'top' | 'bottom';
|
|
52
|
+
sm?: 'top' | 'bottom';
|
|
53
|
+
md?: 'top' | 'bottom';
|
|
54
|
+
lg?: 'top' | 'bottom';
|
|
55
|
+
xl?: 'top' | 'bottom';
|
|
56
|
+
'2xl'?: 'top' | 'bottom';
|
|
57
|
+
};
|
|
48
58
|
/** Modifier indicating if PageSection should have a shadow at the top */
|
|
49
59
|
hasShadowTop?: boolean;
|
|
50
60
|
/** Modifier indicating if PageSection should have a shadow at the bottom */
|
|
@@ -79,32 +89,38 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({
|
|
|
79
89
|
isWidthLimited = false,
|
|
80
90
|
isCenterAligned = false,
|
|
81
91
|
sticky,
|
|
92
|
+
stickyOnBreakpoint,
|
|
82
93
|
hasShadowTop = false,
|
|
83
94
|
hasShadowBottom = false,
|
|
84
95
|
hasOverflowScroll = false,
|
|
85
96
|
...props
|
|
86
|
-
}: PageSectionProps) =>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
97
|
+
}: PageSectionProps) => {
|
|
98
|
+
const { height, getVerticalBreakpoint } = React.useContext(PageContext);
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<section
|
|
102
|
+
{...props}
|
|
103
|
+
className={css(
|
|
104
|
+
variantType[type],
|
|
105
|
+
formatBreakpointMods(padding, styles),
|
|
106
|
+
formatBreakpointMods(stickyOnBreakpoint, styles, 'sticky-', getVerticalBreakpoint(height), true),
|
|
107
|
+
variantStyle[variant],
|
|
108
|
+
isFilled === false && styles.modifiers.noFill,
|
|
109
|
+
isFilled === true && styles.modifiers.fill,
|
|
110
|
+
isWidthLimited && styles.modifiers.limitWidth,
|
|
111
|
+
isWidthLimited && isCenterAligned && type !== PageSectionTypes.subNav && styles.modifiers.alignCenter,
|
|
112
|
+
sticky === 'top' && styles.modifiers.stickyTop,
|
|
113
|
+
sticky === 'bottom' && styles.modifiers.stickyBottom,
|
|
114
|
+
hasShadowTop && styles.modifiers.shadowTop,
|
|
115
|
+
hasShadowBottom && styles.modifiers.shadowBottom,
|
|
116
|
+
hasOverflowScroll && styles.modifiers.overflowScroll,
|
|
117
|
+
className
|
|
118
|
+
)}
|
|
119
|
+
{...(hasOverflowScroll && { tabIndex: 0 })}
|
|
120
|
+
>
|
|
121
|
+
{isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
|
|
122
|
+
{!isWidthLimited && children}
|
|
123
|
+
</section>
|
|
124
|
+
);
|
|
125
|
+
};
|
|
110
126
|
PageSection.displayName = 'PageSection';
|
|
@@ -95,6 +95,74 @@ describe('Page', () => {
|
|
|
95
95
|
expect(asFragment()).toMatchSnapshot();
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
+
test('Verify sticky top breadcrumb on all height breakpoints', () => {
|
|
99
|
+
const Header = <PageHeader logo="Logo" headerTools="PageHeaderTools | Avatar" topNav="Navigation" />;
|
|
100
|
+
const Sidebar = <PageSidebar isNavOpen />;
|
|
101
|
+
const PageBreadcrumb = () => (
|
|
102
|
+
<Breadcrumb>
|
|
103
|
+
<BreadcrumbItem>Section Home</BreadcrumbItem>
|
|
104
|
+
<BreadcrumbItem to="#">Section Title</BreadcrumbItem>
|
|
105
|
+
<BreadcrumbItem to="#">Section Title</BreadcrumbItem>
|
|
106
|
+
<BreadcrumbItem to="#" isActive>
|
|
107
|
+
Section Landing
|
|
108
|
+
</BreadcrumbItem>
|
|
109
|
+
</Breadcrumb>
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const { asFragment } = render(
|
|
113
|
+
<Page
|
|
114
|
+
{...props}
|
|
115
|
+
header={Header}
|
|
116
|
+
sidebar={Sidebar}
|
|
117
|
+
breadcrumb={<PageBreadcrumb />}
|
|
118
|
+
breadcrumbProps={{ stickyOnBreakpoint: { sm: 'top', md: 'top', lg: 'top', xl: 'top', '2xl': 'top' } }}
|
|
119
|
+
>
|
|
120
|
+
<PageSection variant="default">Section with default background</PageSection>
|
|
121
|
+
<PageSection variant="light">Section with light background</PageSection>
|
|
122
|
+
<PageSection variant="dark">Section with dark background</PageSection>
|
|
123
|
+
<PageSection variant="darker">Section with darker background</PageSection>
|
|
124
|
+
</Page>
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
expect(screen.getByRole('main')).not.toHaveAttribute('id');
|
|
128
|
+
expect(asFragment()).toMatchSnapshot();
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
test('Verify sticky bottom breadcrumb on all height breakpoints', () => {
|
|
132
|
+
const Header = <PageHeader logo="Logo" headerTools="PageHeaderTools | Avatar" topNav="Navigation" />;
|
|
133
|
+
const Sidebar = <PageSidebar isNavOpen />;
|
|
134
|
+
const PageBreadcrumb = () => (
|
|
135
|
+
<Breadcrumb>
|
|
136
|
+
<BreadcrumbItem>Section Home</BreadcrumbItem>
|
|
137
|
+
<BreadcrumbItem to="#">Section Title</BreadcrumbItem>
|
|
138
|
+
<BreadcrumbItem to="#">Section Title</BreadcrumbItem>
|
|
139
|
+
<BreadcrumbItem to="#" isActive>
|
|
140
|
+
Section Landing
|
|
141
|
+
</BreadcrumbItem>
|
|
142
|
+
</Breadcrumb>
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
const { asFragment } = render(
|
|
146
|
+
<Page
|
|
147
|
+
{...props}
|
|
148
|
+
header={Header}
|
|
149
|
+
sidebar={Sidebar}
|
|
150
|
+
breadcrumb={<PageBreadcrumb />}
|
|
151
|
+
breadcrumbProps={{
|
|
152
|
+
stickyOnBreakpoint: { sm: 'bottom', md: 'bottom', lg: 'bottom', xl: 'bottom', '2xl': 'bottom' }
|
|
153
|
+
}}
|
|
154
|
+
>
|
|
155
|
+
<PageSection variant="default">Section with default background</PageSection>
|
|
156
|
+
<PageSection variant="light">Section with light background</PageSection>
|
|
157
|
+
<PageSection variant="dark">Section with dark background</PageSection>
|
|
158
|
+
<PageSection variant="darker">Section with darker background</PageSection>
|
|
159
|
+
</Page>
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
expect(screen.getByRole('main')).not.toHaveAttribute('id');
|
|
163
|
+
expect(asFragment()).toMatchSnapshot();
|
|
164
|
+
});
|
|
165
|
+
|
|
98
166
|
test('Check page to verify breadcrumb is created - PageBreadcrumb syntax', () => {
|
|
99
167
|
const Header = <PageHeader logo="Logo" headerTools="PageHeaderTools | Avatar" topNav="Navigation" />;
|
|
100
168
|
const Sidebar = <PageSidebar isNavOpen />;
|
|
@@ -122,6 +190,62 @@ describe('Page', () => {
|
|
|
122
190
|
expect(asFragment()).toMatchSnapshot();
|
|
123
191
|
});
|
|
124
192
|
|
|
193
|
+
test('Verify sticky top breadcrumb on all height breakpoints - PageBreadcrumb syntax', () => {
|
|
194
|
+
const Header = <PageHeader logo="Logo" headerTools="PageHeaderTools | Avatar" topNav="Navigation" />;
|
|
195
|
+
const Sidebar = <PageSidebar isNavOpen />;
|
|
196
|
+
|
|
197
|
+
const { asFragment } = render(
|
|
198
|
+
<Page {...props} header={Header} sidebar={Sidebar}>
|
|
199
|
+
<PageBreadcrumb stickyOnBreakpoint={{ sm: 'top', md: 'top', lg: 'top', xl: 'top', '2xl': 'top' }}>
|
|
200
|
+
<Breadcrumb>
|
|
201
|
+
<BreadcrumbItem>Section Home</BreadcrumbItem>
|
|
202
|
+
<BreadcrumbItem to="#">Section Title</BreadcrumbItem>
|
|
203
|
+
<BreadcrumbItem to="#">Section Title</BreadcrumbItem>
|
|
204
|
+
<BreadcrumbItem to="#" isActive>
|
|
205
|
+
Section Landing
|
|
206
|
+
</BreadcrumbItem>
|
|
207
|
+
</Breadcrumb>
|
|
208
|
+
</PageBreadcrumb>
|
|
209
|
+
<PageSection variant="default">Section with default background</PageSection>
|
|
210
|
+
<PageSection variant="light">Section with light background</PageSection>
|
|
211
|
+
<PageSection variant="dark">Section with dark background</PageSection>
|
|
212
|
+
<PageSection variant="darker">Section with darker background</PageSection>
|
|
213
|
+
</Page>
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
expect(screen.getByRole('main')).not.toHaveAttribute('id');
|
|
217
|
+
expect(asFragment()).toMatchSnapshot();
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
test('Sticky bottom breadcrumb on all height breakpoints - PageBreadcrumb syntax', () => {
|
|
221
|
+
const Header = <PageHeader logo="Logo" headerTools="PageHeaderTools | Avatar" topNav="Navigation" />;
|
|
222
|
+
const Sidebar = <PageSidebar isNavOpen />;
|
|
223
|
+
|
|
224
|
+
const { asFragment } = render(
|
|
225
|
+
<Page {...props} header={Header} sidebar={Sidebar}>
|
|
226
|
+
<PageBreadcrumb
|
|
227
|
+
stickyOnBreakpoint={{ sm: 'bottom', md: 'bottom', lg: 'bottom', xl: 'bottom', '2xl': 'bottom' }}
|
|
228
|
+
>
|
|
229
|
+
<Breadcrumb>
|
|
230
|
+
<BreadcrumbItem>Section Home</BreadcrumbItem>
|
|
231
|
+
<BreadcrumbItem to="#">Section Title</BreadcrumbItem>
|
|
232
|
+
<BreadcrumbItem to="#">Section Title</BreadcrumbItem>
|
|
233
|
+
<BreadcrumbItem to="#" isActive>
|
|
234
|
+
Section Landing
|
|
235
|
+
</BreadcrumbItem>
|
|
236
|
+
</Breadcrumb>
|
|
237
|
+
</PageBreadcrumb>
|
|
238
|
+
<PageSection variant="default">Section with default background</PageSection>
|
|
239
|
+
<PageSection variant="light">Section with light background</PageSection>
|
|
240
|
+
<PageSection variant="dark">Section with dark background</PageSection>
|
|
241
|
+
<PageSection variant="darker">Section with darker background</PageSection>
|
|
242
|
+
</Page>
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
expect(screen.getByRole('main')).not.toHaveAttribute('id');
|
|
246
|
+
expect(asFragment()).toMatchSnapshot();
|
|
247
|
+
});
|
|
248
|
+
|
|
125
249
|
test('Check page to verify nav is created - PageNavigation syntax', () => {
|
|
126
250
|
const Header = <PageHeader logo="Logo" headerTools="PageHeaderTools | Avatar" topNav="Navigation" />;
|
|
127
251
|
const Sidebar = <PageSidebar isNavOpen />;
|
|
@@ -158,7 +282,7 @@ describe('Page', () => {
|
|
|
158
282
|
|
|
159
283
|
const { asFragment } = render(
|
|
160
284
|
<Page {...props} header={Header} sidebar={Sidebar}>
|
|
161
|
-
<PageGroup
|
|
285
|
+
<PageGroup stickyOnBreakpoint={{ default: 'bottom' }}>
|
|
162
286
|
<PageBreadcrumb>
|
|
163
287
|
<Breadcrumb>
|
|
164
288
|
<BreadcrumbItem>Section Home</BreadcrumbItem>
|
|
@@ -232,7 +356,7 @@ describe('Page', () => {
|
|
|
232
356
|
tertiaryNav={nav}
|
|
233
357
|
isBreadcrumbGrouped
|
|
234
358
|
isTertiaryNavGrouped
|
|
235
|
-
groupProps={{
|
|
359
|
+
groupProps={{ stickyOnBreakpoint: { default: 'bottom' }, hasShadowTop: true }}
|
|
236
360
|
>
|
|
237
361
|
<PageSection variant="default">Section with default background</PageSection>
|
|
238
362
|
<PageSection variant="light">Section with light background</PageSection>
|