@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.
Files changed (102) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/esm/components/DescriptionList/DescriptionList.d.ts +4 -0
  3. package/dist/esm/components/DescriptionList/DescriptionList.d.ts.map +1 -1
  4. package/dist/esm/components/DescriptionList/DescriptionList.js +5 -2
  5. package/dist/esm/components/DescriptionList/DescriptionList.js.map +1 -1
  6. package/dist/esm/components/DescriptionList/DescriptionListGroup.js.map +1 -1
  7. package/dist/esm/components/Menu/MenuItem.d.ts.map +1 -1
  8. package/dist/esm/components/Menu/MenuItem.js +5 -3
  9. package/dist/esm/components/Menu/MenuItem.js.map +1 -1
  10. package/dist/esm/components/Nav/NavItem.d.ts.map +1 -1
  11. package/dist/esm/components/Nav/NavItem.js +5 -1
  12. package/dist/esm/components/Nav/NavItem.js.map +1 -1
  13. package/dist/esm/components/Page/Page.d.ts +13 -0
  14. package/dist/esm/components/Page/Page.d.ts.map +1 -1
  15. package/dist/esm/components/Page/Page.js +18 -19
  16. package/dist/esm/components/Page/Page.js.map +1 -1
  17. package/dist/esm/components/Page/PageBreadcrumb.d.ts +11 -2
  18. package/dist/esm/components/Page/PageBreadcrumb.d.ts.map +1 -1
  19. package/dist/esm/components/Page/PageBreadcrumb.js +5 -2
  20. package/dist/esm/components/Page/PageBreadcrumb.js.map +1 -1
  21. package/dist/esm/components/Page/PageGroup.d.ts +11 -2
  22. package/dist/esm/components/Page/PageGroup.d.ts.map +1 -1
  23. package/dist/esm/components/Page/PageGroup.js +5 -2
  24. package/dist/esm/components/Page/PageGroup.js.map +1 -1
  25. package/dist/esm/components/Page/PageNavigation.d.ts +11 -2
  26. package/dist/esm/components/Page/PageNavigation.d.ts.map +1 -1
  27. package/dist/esm/components/Page/PageNavigation.js +5 -2
  28. package/dist/esm/components/Page/PageNavigation.js.map +1 -1
  29. package/dist/esm/components/Page/PageSection.d.ts +10 -1
  30. package/dist/esm/components/Page/PageSection.d.ts.map +1 -1
  31. package/dist/esm/components/Page/PageSection.js +4 -2
  32. package/dist/esm/components/Page/PageSection.js.map +1 -1
  33. package/dist/esm/helpers/constants.d.ts +14 -0
  34. package/dist/esm/helpers/constants.d.ts.map +1 -1
  35. package/dist/esm/helpers/constants.js +24 -0
  36. package/dist/esm/helpers/constants.js.map +1 -1
  37. package/dist/esm/helpers/util.d.ts +8 -1
  38. package/dist/esm/helpers/util.d.ts.map +1 -1
  39. package/dist/esm/helpers/util.js +36 -9
  40. package/dist/esm/helpers/util.js.map +1 -1
  41. package/dist/js/components/DescriptionList/DescriptionList.d.ts +4 -0
  42. package/dist/js/components/DescriptionList/DescriptionList.d.ts.map +1 -1
  43. package/dist/js/components/DescriptionList/DescriptionList.js +5 -2
  44. package/dist/js/components/DescriptionList/DescriptionList.js.map +1 -1
  45. package/dist/js/components/DescriptionList/DescriptionListGroup.js.map +1 -1
  46. package/dist/js/components/Menu/MenuItem.d.ts.map +1 -1
  47. package/dist/js/components/Menu/MenuItem.js +5 -3
  48. package/dist/js/components/Menu/MenuItem.js.map +1 -1
  49. package/dist/js/components/Nav/NavItem.d.ts.map +1 -1
  50. package/dist/js/components/Nav/NavItem.js +5 -1
  51. package/dist/js/components/Nav/NavItem.js.map +1 -1
  52. package/dist/js/components/Page/Page.d.ts +13 -0
  53. package/dist/js/components/Page/Page.d.ts.map +1 -1
  54. package/dist/js/components/Page/Page.js +17 -18
  55. package/dist/js/components/Page/Page.js.map +1 -1
  56. package/dist/js/components/Page/PageBreadcrumb.d.ts +11 -2
  57. package/dist/js/components/Page/PageBreadcrumb.d.ts.map +1 -1
  58. package/dist/js/components/Page/PageBreadcrumb.js +5 -2
  59. package/dist/js/components/Page/PageBreadcrumb.js.map +1 -1
  60. package/dist/js/components/Page/PageGroup.d.ts +11 -2
  61. package/dist/js/components/Page/PageGroup.d.ts.map +1 -1
  62. package/dist/js/components/Page/PageGroup.js +5 -2
  63. package/dist/js/components/Page/PageGroup.js.map +1 -1
  64. package/dist/js/components/Page/PageNavigation.d.ts +11 -2
  65. package/dist/js/components/Page/PageNavigation.d.ts.map +1 -1
  66. package/dist/js/components/Page/PageNavigation.js +5 -2
  67. package/dist/js/components/Page/PageNavigation.js.map +1 -1
  68. package/dist/js/components/Page/PageSection.d.ts +10 -1
  69. package/dist/js/components/Page/PageSection.d.ts.map +1 -1
  70. package/dist/js/components/Page/PageSection.js +4 -2
  71. package/dist/js/components/Page/PageSection.js.map +1 -1
  72. package/dist/js/helpers/constants.d.ts +14 -0
  73. package/dist/js/helpers/constants.d.ts.map +1 -1
  74. package/dist/js/helpers/constants.js +26 -1
  75. package/dist/js/helpers/constants.js.map +1 -1
  76. package/dist/js/helpers/util.d.ts +8 -1
  77. package/dist/js/helpers/util.d.ts.map +1 -1
  78. package/dist/js/helpers/util.js +37 -9
  79. package/dist/js/helpers/util.js.map +1 -1
  80. package/dist/umd/react-core.js +170 -71
  81. package/dist/umd/react-core.min.js +6 -5
  82. package/package.json +5 -5
  83. package/src/components/DescriptionList/DescriptionList.tsx +14 -0
  84. package/src/components/DescriptionList/DescriptionListGroup.tsx +1 -0
  85. package/src/components/DescriptionList/examples/DescriptionList.md +31 -1
  86. package/src/components/DescriptionList/examples/DescriptionListDisplaySizeAndCard.tsx +63 -0
  87. package/src/components/DescriptionList/examples/DescriptionListDisplaySizeAndCardHorizontalTermWidth.tsx +34 -0
  88. package/src/components/DescriptionList/examples/DescriptionListDisplaySizeAndCardThreeColumn.tsx +34 -0
  89. package/src/components/DescriptionList/examples/DescriptionListWithCard.tsx +62 -0
  90. package/src/components/DescriptionList/examples/DescriptionListWithDisplaySize.tsx +63 -0
  91. package/src/components/Menu/MenuItem.tsx +7 -5
  92. package/src/components/Nav/NavItem.tsx +6 -0
  93. package/src/components/Page/Page.tsx +58 -21
  94. package/src/components/Page/PageBreadcrumb.tsx +37 -20
  95. package/src/components/Page/PageGroup.tsx +35 -19
  96. package/src/components/Page/PageNavigation.tsx +37 -20
  97. package/src/components/Page/PageSection.tsx +41 -25
  98. package/src/components/Page/__tests__/Page.test.tsx +126 -2
  99. package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +683 -14
  100. package/src/demos/Page/Page.md +356 -3
  101. package/src/helpers/constants.ts +28 -0
  102. 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
- <section
33
- className={css(
34
- styles.pageMainBreadcrumb,
35
- isWidthLimited && styles.modifiers.limitWidth,
36
- sticky === 'top' && styles.modifiers.stickyTop,
37
- sticky === 'bottom' && styles.modifiers.stickyBottom,
38
- hasShadowTop && styles.modifiers.shadowTop,
39
- hasShadowBottom && styles.modifiers.shadowBottom,
40
- hasOverflowScroll && styles.modifiers.overflowScroll,
41
- className
42
- )}
43
- {...(hasOverflowScroll && { tabIndex: 0 })}
44
- {...props}
45
- >
46
- {isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
47
- {!isWidthLimited && children}
48
- </section>
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 PageGroup is sticky to the top or bottom */
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
- <div
30
- {...props}
31
- className={css(
32
- styles.pageMainGroup,
33
- sticky === 'top' && styles.modifiers.stickyTop,
34
- sticky === 'bottom' && styles.modifiers.stickyBottom,
35
- hasShadowTop && styles.modifiers.shadowTop,
36
- hasShadowBottom && styles.modifiers.shadowBottom,
37
- hasOverflowScroll && styles.modifiers.overflowScroll,
38
- className
39
- )}
40
- {...(hasOverflowScroll && { tabIndex: 0 })}
41
- >
42
- {children}
43
- </div>
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 PageNavigation 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 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
- <div
33
- className={css(
34
- styles.pageMainNav,
35
- isWidthLimited && styles.modifiers.limitWidth,
36
- sticky === 'top' && styles.modifiers.stickyTop,
37
- sticky === 'bottom' && styles.modifiers.stickyBottom,
38
- hasShadowTop && styles.modifiers.shadowTop,
39
- hasShadowBottom && styles.modifiers.shadowBottom,
40
- hasOverflowScroll && styles.modifiers.overflowScroll,
41
- className
42
- )}
43
- {...(hasOverflowScroll && { tabIndex: 0 })}
44
- {...props}
45
- >
46
- {isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
47
- {!isWidthLimited && children}
48
- </div>
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 PageSection is sticky to the top or bottom */
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
- <section
88
- {...props}
89
- className={css(
90
- variantType[type],
91
- formatBreakpointMods(padding, styles),
92
- variantStyle[variant],
93
- isFilled === false && styles.modifiers.noFill,
94
- isFilled === true && styles.modifiers.fill,
95
- isWidthLimited && styles.modifiers.limitWidth,
96
- isWidthLimited && isCenterAligned && type !== PageSectionTypes.subNav && styles.modifiers.alignCenter,
97
- sticky === 'top' && styles.modifiers.stickyTop,
98
- sticky === 'bottom' && styles.modifiers.stickyBottom,
99
- hasShadowTop && styles.modifiers.shadowTop,
100
- hasShadowBottom && styles.modifiers.shadowBottom,
101
- hasOverflowScroll && styles.modifiers.overflowScroll,
102
- className
103
- )}
104
- {...(hasOverflowScroll && { tabIndex: 0 })}
105
- >
106
- {isWidthLimited && <div className={css(styles.pageMainBody)}>{children}</div>}
107
- {!isWidthLimited && children}
108
- </section>
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 sticky="bottom">
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={{ sticky: 'bottom', hasShadowTop: true }}
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>