Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/react-core/src/components/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { css } from '@patternfly/react-styles';

export enum DrawerColorVariant {
default = 'default',
light200 = 'light-200'
light200 = 'light-200',
noBackground = 'no-background'
}

export interface DrawerProps extends React.HTMLProps<HTMLDivElement> {
Expand Down
3 changes: 2 additions & 1 deletion packages/react-core/src/components/Drawer/DrawerContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface DrawerContentProps extends React.HTMLProps<HTMLDivElement> {
/** Content rendered in the drawer panel. */
panelContent: React.ReactNode;
/** Color variant of the background of the drawer panel */
colorVariant?: DrawerColorVariant | 'light-200' | 'default';
colorVariant?: DrawerColorVariant | 'light-200' | 'no-background' | 'default';
}

export const DrawerContent: React.FunctionComponent<DrawerContentProps> = ({
Expand All @@ -31,6 +31,7 @@ export const DrawerContent: React.FunctionComponent<DrawerContentProps> = ({
className={css(
styles.drawerContent,
colorVariant === DrawerColorVariant.light200 && styles.modifiers.light_200,
colorVariant === DrawerColorVariant.noBackground && styles.modifiers.noBackground,
className
)}
ref={drawerContentRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface DrawerPanelContentProps extends React.HTMLProps<HTMLDivElement>
'2xl'?: 'width_25' | 'width_33' | 'width_50' | 'width_66' | 'width_75' | 'width_100';
};
/** Color variant of the background of the drawer panel */
colorVariant?: DrawerColorVariant | 'light-200' | 'default';
colorVariant?: DrawerColorVariant | 'light-200' | 'no-background' | 'default';
}
let isResizing: boolean = null;
let newSize: number = 0;
Expand Down Expand Up @@ -257,6 +257,7 @@ export const DrawerPanelContent: React.FunctionComponent<DrawerPanelContentProps
hasNoBorder && styles.modifiers.noBorder,
formatBreakpointMods(widths, styles),
colorVariant === DrawerColorVariant.light200 && styles.modifiers.light_200,
colorVariant === DrawerColorVariant.noBackground && styles.modifiers.noBackground,
className
)}
ref={panel}
Expand Down
3 changes: 2 additions & 1 deletion packages/react-core/src/components/Drawer/DrawerSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface DrawerSectionProps extends React.HTMLProps<HTMLDivElement> {
/** Content to be rendered in the drawer section. */
children?: React.ReactNode;
/** Color variant of the background of the drawer Section */
colorVariant?: DrawerColorVariant | 'light-200' | 'default';
colorVariant?: DrawerColorVariant | 'light-200' | 'no-background' | 'default';
}

export const DrawerSection: React.FunctionComponent<DrawerSectionProps> = ({
Expand All @@ -23,6 +23,7 @@ export const DrawerSection: React.FunctionComponent<DrawerSectionProps> = ({
className={css(
styles.drawerSection,
colorVariant === DrawerColorVariant.light200 && styles.modifiers.light_200,
colorVariant === DrawerColorVariant.noBackground && styles.modifiers.noBackground,
className
)}
{...props}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/demos/PrimaryDetail.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ class PrimaryDetailCardView extends React.Component {
</PageSection>
<PageSection isFilled padding={{ default: 'noPadding' }}>
<Drawer isExpanded={isDrawerExpanded} className={'pf-m-inline-on-2xl'}>
<DrawerContent panelContent={panelContent} className={'pf-m-no-background'}>
<DrawerContent panelContent={panelContent} colorVariant="no-background">
<DrawerContentBody hasPadding>{drawerContent}</DrawerContentBody>
</DrawerContent>
</Drawer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export const PrimaryDetailContentPadding: React.FunctionComponent = () => {
<Divider component="div" />
<PageSection padding={{ default: 'noPadding' }}>
<Drawer isExpanded={isDrawerExpanded}>
<DrawerContent panelContent={panelContent} className={'pf-m-no-background'}>
<DrawerContent panelContent={panelContent} colorVariant="no-background">
<DrawerContentBody hasPadding>{drawerContent}</DrawerContentBody>
</DrawerContent>
</Drawer>
Expand Down