-
Notifications
You must be signed in to change notification settings - Fork 381
Expand file tree
/
Copy pathDrawerSection.tsx
More file actions
39 lines (37 loc) · 1.31 KB
/
DrawerSection.tsx
File metadata and controls
39 lines (37 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
import { css } from '@patternfly/react-styles';
import { DrawerColorVariant } from './Drawer';
export interface DrawerSectionProps extends React.HTMLProps<HTMLDivElement> {
/** Additional classes added to the drawer section. */
className?: string;
/** Content to be rendered in the drawer section. */
children?: React.ReactNode;
/**
* Color variant of the background of the drawer section.
* The `no-background` value is deprecated; use the `isPlain` prop instead.
*/
colorVariant?: DrawerColorVariant | 'no-background' | 'default' | 'secondary';
/** @beta Flag indicating that the drawer section should use plain styles. */
isPlain?: boolean;
}
export const DrawerSection: React.FunctionComponent<DrawerSectionProps> = ({
className = '',
children,
colorVariant = DrawerColorVariant.default,
isPlain = false,
...props
}: DrawerSectionProps) => (
<div
className={css(
styles.drawerSection,
isPlain && styles.modifiers.plain,
colorVariant === DrawerColorVariant.noBackground && styles.modifiers.noBackground,
colorVariant === DrawerColorVariant.secondary && styles.modifiers.secondary,
className
)}
{...props}
>
{children}
</div>
);
DrawerSection.displayName = 'DrawerSection';