Skip to content

Commit 8210248

Browse files
authored
feat(Page,Drawer): core bump and updates (#10211)
* feat(Page,Drawer): core bump and updates * update layouts with core bump * fix integration * move tabindex * update snap * move tabindex back * reup snaps
1 parent eb6848f commit 8210248

File tree

26 files changed

+1347
-1269
lines changed

26 files changed

+1347
-1269
lines changed

packages/react-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"tslib": "^2.5.0"
5656
},
5757
"devDependencies": {
58-
"@patternfly/patternfly": "6.0.0-alpha.100",
58+
"@patternfly/patternfly": "6.0.0-alpha.107",
5959
"@rollup/plugin-commonjs": "^25.0.0",
6060
"@rollup/plugin-node-resolve": "^15.0.2",
6161
"@rollup/plugin-replace": "^5.0.2",

packages/react-core/src/components/Drawer/DrawerContent.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import * as React from 'react';
22
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
33
import { css } from '@patternfly/react-styles';
44
import { DrawerMain } from './DrawerMain';
5-
import { DrawerColorVariant, DrawerContext } from './Drawer';
5+
import { DrawerContext } from './Drawer';
6+
7+
export enum DrawerContentColorVariant {
8+
default = 'default',
9+
primary = 'primary',
10+
secondary = 'secondary'
11+
}
612

713
export interface DrawerContentProps extends React.HTMLProps<HTMLDivElement> {
814
/** Additional classes added to the Drawer. */
@@ -12,14 +18,14 @@ export interface DrawerContentProps extends React.HTMLProps<HTMLDivElement> {
1218
/** Content rendered in the drawer panel. */
1319
panelContent: React.ReactNode;
1420
/** Color variant of the background of the drawer panel */
15-
colorVariant?: DrawerColorVariant | 'no-background' | 'default' | 'secondary';
21+
colorVariant?: DrawerContentColorVariant | 'default' | 'primary' | 'secondary';
1622
}
1723

1824
export const DrawerContent: React.FunctionComponent<DrawerContentProps> = ({
1925
className,
2026
children,
2127
panelContent,
22-
colorVariant = DrawerColorVariant.default,
28+
colorVariant = DrawerContentColorVariant.default,
2329
...props
2430
}: DrawerContentProps) => {
2531
const { drawerContentRef } = React.useContext(DrawerContext);
@@ -29,8 +35,8 @@ export const DrawerContent: React.FunctionComponent<DrawerContentProps> = ({
2935
<div
3036
className={css(
3137
styles.drawerContent,
32-
colorVariant === DrawerColorVariant.noBackground && styles.modifiers.noBackground,
33-
colorVariant === DrawerColorVariant.secondary && styles.modifiers.secondary,
38+
colorVariant === DrawerContentColorVariant.primary && styles.modifiers.primary,
39+
colorVariant === DrawerContentColorVariant.secondary && styles.modifiers.secondary,
3440
className
3541
)}
3642
ref={drawerContentRef}

packages/react-core/src/components/Drawer/examples/DrawerSecondaryBackground.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {
1010
DrawerCloseButton,
1111
DrawerSection,
1212
Button,
13-
DrawerColorVariant
13+
DrawerColorVariant,
14+
DrawerContentColorVariant
1415
} from '@patternfly/react-core';
1516

1617
export const DrawerSecondaryBackground: React.FunctionComponent = () => {
@@ -96,7 +97,7 @@ export const DrawerSecondaryBackground: React.FunctionComponent = () => {
9697
drawer-section
9798
</DrawerSection>
9899
<DrawerContent
99-
colorVariant={contentSecondary ? DrawerColorVariant.secondary : DrawerColorVariant.default}
100+
colorVariant={contentSecondary ? DrawerContentColorVariant.secondary : DrawerContentColorVariant.default}
100101
panelContent={panelContent}
101102
>
102103
<DrawerContentBody>{drawerContent}</DrawerContentBody>

packages/react-core/src/components/Page/Page.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,21 @@ class Page extends React.Component<PageProps, PageState> {
295295
const Component: keyof JSX.IntrinsicElements = mainComponent;
296296

297297
const main = (
298-
<Component
299-
ref={this.mainRef}
300-
role={role}
301-
id={mainContainerId}
302-
className={css(styles.pageMain)}
303-
tabIndex={mainTabIndex}
304-
aria-label={mainAriaLabel}
305-
>
306-
{group}
307-
{!isHorizontalSubnavGrouped && nav}
308-
{!isBreadcrumbGrouped && crumb}
309-
{children}
310-
</Component>
298+
<div className={css(styles.pageMainContainer)}>
299+
<Component
300+
ref={this.mainRef}
301+
role={role}
302+
id={mainContainerId}
303+
className={css(styles.pageMain)}
304+
tabIndex={mainTabIndex}
305+
aria-label={mainAriaLabel}
306+
>
307+
{group}
308+
{!isHorizontalSubnavGrouped && nav}
309+
{!isBreadcrumbGrouped && crumb}
310+
{children}
311+
</Component>
312+
</div>
311313
);
312314

313315
const panelContent = <DrawerPanelContent>{notificationDrawer}</DrawerPanelContent>;

0 commit comments

Comments
 (0)