@patternfly/react-core 4.208.13 → 4.211.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/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
- package/dist/esm/components/Select/SelectMenu.d.ts +3 -1
- package/dist/esm/components/Select/SelectMenu.d.ts.map +1 -1
- package/dist/esm/components/Select/SelectMenu.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.js +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
- package/dist/js/components/Select/SelectMenu.d.ts +3 -1
- package/dist/js/components/Select/SelectMenu.d.ts.map +1 -1
- package/dist/js/components/Select/SelectMenu.js.map +1 -1
- package/dist/umd/react-core.js +1 -1
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/ClipboardCopy/ClipboardCopyButton.tsx +2 -0
- package/src/components/Drawer/examples/Drawer.md +19 -1354
- package/src/components/Drawer/examples/DrawerAdditionalSectionAboveContent.tsx +59 -0
- package/src/components/Drawer/examples/DrawerBasic.tsx +57 -0
- package/src/components/Drawer/examples/DrawerBasicInline.tsx +57 -0
- package/src/components/Drawer/examples/DrawerBreakpoint.tsx +57 -0
- package/src/components/Drawer/examples/DrawerInlinePanelLeft.tsx +57 -0
- package/src/components/Drawer/examples/DrawerInlinePanelRight.tsx +57 -0
- package/src/components/Drawer/examples/DrawerLightGray.tsx +107 -0
- package/src/components/Drawer/examples/DrawerModifiedContentPadding.tsx +59 -0
- package/src/components/Drawer/examples/DrawerModifiedPanelPadding.tsx +57 -0
- package/src/components/Drawer/examples/DrawerPanelBottom.tsx +59 -0
- package/src/components/Drawer/examples/DrawerPanelLeft.tsx +57 -0
- package/src/components/Drawer/examples/DrawerPanelRight.tsx +57 -0
- package/src/components/Drawer/examples/DrawerResizableOnBottom.tsx +58 -0
- package/src/components/Drawer/examples/DrawerResizableOnInline.tsx +56 -0
- package/src/components/Drawer/examples/DrawerResizableOnLeft.tsx +57 -0
- package/src/components/Drawer/examples/DrawerResizableOnRight.tsx +62 -0
- package/src/components/Drawer/examples/DrawerStackedContentBodyElements.tsx +60 -0
- package/src/components/Drawer/examples/DrawerStatic.tsx +57 -0
- package/src/components/Select/SelectMenu.tsx +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Drawer,
|
|
4
|
+
DrawerPanelContent,
|
|
5
|
+
DrawerContent,
|
|
6
|
+
DrawerContentBody,
|
|
7
|
+
DrawerHead,
|
|
8
|
+
DrawerActions,
|
|
9
|
+
DrawerCloseButton,
|
|
10
|
+
DrawerSection,
|
|
11
|
+
Button
|
|
12
|
+
} from '@patternfly/react-core';
|
|
13
|
+
|
|
14
|
+
export const DrawerAdditionalSectionAboveContent: React.FunctionComponent = () => {
|
|
15
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
16
|
+
const drawerRef = React.useRef<HTMLDivElement>();
|
|
17
|
+
|
|
18
|
+
const onExpand = () => {
|
|
19
|
+
drawerRef.current && drawerRef.current.focus();
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const onClick = () => {
|
|
23
|
+
setIsExpanded(!isExpanded);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const onCloseClick = () => {
|
|
27
|
+
setIsExpanded(false);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const panelContent = (
|
|
31
|
+
<DrawerPanelContent>
|
|
32
|
+
<DrawerHead>
|
|
33
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
34
|
+
drawer-panel
|
|
35
|
+
</span>
|
|
36
|
+
<DrawerActions>
|
|
37
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
38
|
+
</DrawerActions>
|
|
39
|
+
</DrawerHead>
|
|
40
|
+
</DrawerPanelContent>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const drawerContent =
|
|
44
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<React.Fragment>
|
|
48
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
49
|
+
Toggle drawer
|
|
50
|
+
</Button>
|
|
51
|
+
<Drawer isExpanded={isExpanded} onExpand={onExpand}>
|
|
52
|
+
<DrawerSection>drawer-section</DrawerSection>
|
|
53
|
+
<DrawerContent panelContent={panelContent}>
|
|
54
|
+
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
55
|
+
</DrawerContent>
|
|
56
|
+
</Drawer>
|
|
57
|
+
</React.Fragment>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Drawer,
|
|
4
|
+
DrawerPanelContent,
|
|
5
|
+
DrawerContent,
|
|
6
|
+
DrawerContentBody,
|
|
7
|
+
DrawerHead,
|
|
8
|
+
DrawerActions,
|
|
9
|
+
DrawerCloseButton,
|
|
10
|
+
Button
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
|
|
13
|
+
export const DrawerBasic: React.FunctionComponent = () => {
|
|
14
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
|
+
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
|
+
|
|
17
|
+
const onExpand = () => {
|
|
18
|
+
drawerRef.current && drawerRef.current.focus();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onClick = () => {
|
|
22
|
+
setIsExpanded(!isExpanded);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onCloseClick = () => {
|
|
26
|
+
setIsExpanded(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const panelContent = (
|
|
30
|
+
<DrawerPanelContent>
|
|
31
|
+
<DrawerHead>
|
|
32
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
33
|
+
drawer-panel
|
|
34
|
+
</span>
|
|
35
|
+
<DrawerActions>
|
|
36
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
37
|
+
</DrawerActions>
|
|
38
|
+
</DrawerHead>
|
|
39
|
+
</DrawerPanelContent>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const drawerContent =
|
|
43
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<React.Fragment>
|
|
47
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
|
+
Toggle drawer
|
|
49
|
+
</Button>
|
|
50
|
+
<Drawer isExpanded={isExpanded} onExpand={onExpand}>
|
|
51
|
+
<DrawerContent panelContent={panelContent}>
|
|
52
|
+
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
|
+
</DrawerContent>
|
|
54
|
+
</Drawer>
|
|
55
|
+
</React.Fragment>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Drawer,
|
|
4
|
+
DrawerPanelContent,
|
|
5
|
+
DrawerContent,
|
|
6
|
+
DrawerContentBody,
|
|
7
|
+
DrawerHead,
|
|
8
|
+
DrawerActions,
|
|
9
|
+
DrawerCloseButton,
|
|
10
|
+
Button
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
|
|
13
|
+
export const DrawerBasicInline: React.FunctionComponent = () => {
|
|
14
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
|
+
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
|
+
|
|
17
|
+
const onExpand = () => {
|
|
18
|
+
drawerRef.current && drawerRef.current.focus();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onClick = () => {
|
|
22
|
+
setIsExpanded(!isExpanded);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onCloseClick = () => {
|
|
26
|
+
setIsExpanded(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const panelContent = (
|
|
30
|
+
<DrawerPanelContent>
|
|
31
|
+
<DrawerHead>
|
|
32
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
33
|
+
drawer-panel
|
|
34
|
+
</span>
|
|
35
|
+
<DrawerActions>
|
|
36
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
37
|
+
</DrawerActions>
|
|
38
|
+
</DrawerHead>
|
|
39
|
+
</DrawerPanelContent>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const drawerContent =
|
|
43
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<React.Fragment>
|
|
47
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
|
+
Toggle drawer
|
|
49
|
+
</Button>
|
|
50
|
+
<Drawer isExpanded={isExpanded} isInline onExpand={onExpand}>
|
|
51
|
+
<DrawerContent panelContent={panelContent}>
|
|
52
|
+
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
|
+
</DrawerContent>
|
|
54
|
+
</Drawer>
|
|
55
|
+
</React.Fragment>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Drawer,
|
|
4
|
+
DrawerPanelContent,
|
|
5
|
+
DrawerContent,
|
|
6
|
+
DrawerContentBody,
|
|
7
|
+
DrawerHead,
|
|
8
|
+
DrawerActions,
|
|
9
|
+
DrawerCloseButton,
|
|
10
|
+
Button
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
|
|
13
|
+
export const DrawerBreakpoint: React.FunctionComponent = () => {
|
|
14
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
|
+
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
|
+
|
|
17
|
+
const onExpand = () => {
|
|
18
|
+
drawerRef.current && drawerRef.current.focus();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onClick = () => {
|
|
22
|
+
setIsExpanded(!isExpanded);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onCloseClick = () => {
|
|
26
|
+
setIsExpanded(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const panelContent = (
|
|
30
|
+
<DrawerPanelContent widths={{ default: 'width_33' }}>
|
|
31
|
+
<DrawerHead>
|
|
32
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
33
|
+
drawer-panel
|
|
34
|
+
</span>
|
|
35
|
+
<DrawerActions>
|
|
36
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
37
|
+
</DrawerActions>
|
|
38
|
+
</DrawerHead>
|
|
39
|
+
</DrawerPanelContent>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const drawerContent =
|
|
43
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<React.Fragment>
|
|
47
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
|
+
Toggle drawer
|
|
49
|
+
</Button>
|
|
50
|
+
<Drawer isExpanded={isExpanded} onExpand={onExpand}>
|
|
51
|
+
<DrawerContent panelContent={panelContent}>
|
|
52
|
+
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
|
+
</DrawerContent>
|
|
54
|
+
</Drawer>
|
|
55
|
+
</React.Fragment>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Drawer,
|
|
4
|
+
DrawerPanelContent,
|
|
5
|
+
DrawerContent,
|
|
6
|
+
DrawerContentBody,
|
|
7
|
+
DrawerHead,
|
|
8
|
+
DrawerActions,
|
|
9
|
+
DrawerCloseButton,
|
|
10
|
+
Button
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
|
|
13
|
+
export const DrawerInlinePanelLeft: React.FunctionComponent = () => {
|
|
14
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
|
+
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
|
+
|
|
17
|
+
const onExpand = () => {
|
|
18
|
+
drawerRef.current && drawerRef.current.focus();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onClick = () => {
|
|
22
|
+
setIsExpanded(!isExpanded);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onCloseClick = () => {
|
|
26
|
+
setIsExpanded(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const panelContent = (
|
|
30
|
+
<DrawerPanelContent>
|
|
31
|
+
<DrawerHead>
|
|
32
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
33
|
+
drawer-panel
|
|
34
|
+
</span>
|
|
35
|
+
<DrawerActions>
|
|
36
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
37
|
+
</DrawerActions>
|
|
38
|
+
</DrawerHead>
|
|
39
|
+
</DrawerPanelContent>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const drawerContent =
|
|
43
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<React.Fragment>
|
|
47
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
|
+
Toggle drawer
|
|
49
|
+
</Button>
|
|
50
|
+
<Drawer isExpanded={isExpanded} isInline position="left" onExpand={onExpand}>
|
|
51
|
+
<DrawerContent panelContent={panelContent}>
|
|
52
|
+
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
|
+
</DrawerContent>
|
|
54
|
+
</Drawer>
|
|
55
|
+
</React.Fragment>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Drawer,
|
|
4
|
+
DrawerPanelContent,
|
|
5
|
+
DrawerContent,
|
|
6
|
+
DrawerContentBody,
|
|
7
|
+
DrawerHead,
|
|
8
|
+
DrawerActions,
|
|
9
|
+
DrawerCloseButton,
|
|
10
|
+
Button
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
|
|
13
|
+
export const DrawerInlinePanelRight: React.FunctionComponent = () => {
|
|
14
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
|
+
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
|
+
|
|
17
|
+
const onExpand = () => {
|
|
18
|
+
drawerRef.current && drawerRef.current.focus();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onClick = () => {
|
|
22
|
+
setIsExpanded(!isExpanded);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onCloseClick = () => {
|
|
26
|
+
setIsExpanded(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const panelContent = (
|
|
30
|
+
<DrawerPanelContent>
|
|
31
|
+
<DrawerHead>
|
|
32
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
33
|
+
drawer-panel
|
|
34
|
+
</span>
|
|
35
|
+
<DrawerActions>
|
|
36
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
37
|
+
</DrawerActions>
|
|
38
|
+
</DrawerHead>
|
|
39
|
+
</DrawerPanelContent>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const drawerContent =
|
|
43
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<React.Fragment>
|
|
47
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
|
+
Toggle drawer
|
|
49
|
+
</Button>
|
|
50
|
+
<Drawer isExpanded={isExpanded} isInline onExpand={onExpand}>
|
|
51
|
+
<DrawerContent panelContent={panelContent}>
|
|
52
|
+
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
|
+
</DrawerContent>
|
|
54
|
+
</Drawer>
|
|
55
|
+
</React.Fragment>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Checkbox,
|
|
4
|
+
Drawer,
|
|
5
|
+
DrawerPanelContent,
|
|
6
|
+
DrawerContent,
|
|
7
|
+
DrawerContentBody,
|
|
8
|
+
DrawerHead,
|
|
9
|
+
DrawerActions,
|
|
10
|
+
DrawerCloseButton,
|
|
11
|
+
DrawerSection,
|
|
12
|
+
Button,
|
|
13
|
+
DrawerColorVariant
|
|
14
|
+
} from '@patternfly/react-core';
|
|
15
|
+
|
|
16
|
+
export const DrawerLightGray: React.FunctionComponent = () => {
|
|
17
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
18
|
+
const [panelGray, setPanelGray] = React.useState(true);
|
|
19
|
+
const [contentGray, setContentGray] = React.useState(false);
|
|
20
|
+
const [sectionGray, setSectionGray] = React.useState(false);
|
|
21
|
+
|
|
22
|
+
const drawerRef = React.useRef<HTMLDivElement>();
|
|
23
|
+
|
|
24
|
+
const onExpand = () => {
|
|
25
|
+
drawerRef.current && drawerRef.current.focus();
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const onClick = () => {
|
|
29
|
+
setIsExpanded(!isExpanded);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const onCloseClick = () => {
|
|
33
|
+
setIsExpanded(false);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const togglePanelGray = (checked: boolean) => {
|
|
37
|
+
setPanelGray(checked);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const toggleSectionGray = (checked: boolean) => {
|
|
41
|
+
setSectionGray(checked);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const toggleContentGray = (checked: boolean) => {
|
|
45
|
+
setContentGray(checked);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const panelContent = (
|
|
49
|
+
<DrawerPanelContent colorVariant={panelGray ? DrawerColorVariant.light200 : DrawerColorVariant.default}>
|
|
50
|
+
<DrawerHead>
|
|
51
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
52
|
+
drawer-panel
|
|
53
|
+
</span>
|
|
54
|
+
<DrawerActions>
|
|
55
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
56
|
+
</DrawerActions>
|
|
57
|
+
</DrawerHead>
|
|
58
|
+
</DrawerPanelContent>
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const drawerContent =
|
|
62
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<React.Fragment>
|
|
66
|
+
<Checkbox
|
|
67
|
+
label="Gray panel"
|
|
68
|
+
isChecked={panelGray}
|
|
69
|
+
onChange={togglePanelGray}
|
|
70
|
+
aria-label="Gray panel checkbox"
|
|
71
|
+
id="toggle-gray-panel"
|
|
72
|
+
name="toggle-gray-panel"
|
|
73
|
+
/>
|
|
74
|
+
<Checkbox
|
|
75
|
+
label="Gray content"
|
|
76
|
+
isChecked={contentGray}
|
|
77
|
+
onChange={toggleContentGray}
|
|
78
|
+
aria-label="Gray content checkbox"
|
|
79
|
+
id="toggle-gray-content"
|
|
80
|
+
name="toggle-gray-content"
|
|
81
|
+
/>
|
|
82
|
+
<Checkbox
|
|
83
|
+
label="Gray section"
|
|
84
|
+
isChecked={sectionGray}
|
|
85
|
+
onChange={toggleSectionGray}
|
|
86
|
+
aria-label="Gray section checkbox"
|
|
87
|
+
id="toggle-gray-section"
|
|
88
|
+
name="toggle-gray-section"
|
|
89
|
+
/>
|
|
90
|
+
<br />
|
|
91
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
92
|
+
Toggle drawer
|
|
93
|
+
</Button>
|
|
94
|
+
<Drawer isExpanded={isExpanded} onExpand={onExpand}>
|
|
95
|
+
<DrawerSection colorVariant={sectionGray ? DrawerColorVariant.light200 : DrawerColorVariant.default}>
|
|
96
|
+
drawer-section
|
|
97
|
+
</DrawerSection>
|
|
98
|
+
<DrawerContent
|
|
99
|
+
colorVariant={contentGray ? DrawerColorVariant.light200 : DrawerColorVariant.default}
|
|
100
|
+
panelContent={panelContent}
|
|
101
|
+
>
|
|
102
|
+
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
103
|
+
</DrawerContent>
|
|
104
|
+
</Drawer>
|
|
105
|
+
</React.Fragment>
|
|
106
|
+
);
|
|
107
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Drawer,
|
|
4
|
+
DrawerPanelContent,
|
|
5
|
+
DrawerContent,
|
|
6
|
+
DrawerContentBody,
|
|
7
|
+
DrawerHead,
|
|
8
|
+
DrawerActions,
|
|
9
|
+
DrawerCloseButton,
|
|
10
|
+
Button
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
|
|
13
|
+
export const DrawerModifiedContentPadding: React.FunctionComponent = () => {
|
|
14
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
|
+
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
|
+
|
|
17
|
+
const onExpand = () => {
|
|
18
|
+
drawerRef.current && drawerRef.current.focus();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onClick = () => {
|
|
22
|
+
setIsExpanded(!isExpanded);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onCloseClick = () => {
|
|
26
|
+
setIsExpanded(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const panelContent = (
|
|
30
|
+
<DrawerPanelContent>
|
|
31
|
+
<DrawerHead>
|
|
32
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
33
|
+
drawer-panel
|
|
34
|
+
</span>
|
|
35
|
+
<DrawerActions>
|
|
36
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
37
|
+
</DrawerActions>
|
|
38
|
+
</DrawerHead>
|
|
39
|
+
</DrawerPanelContent>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const drawerContent =
|
|
43
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<React.Fragment>
|
|
47
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
|
+
Toggle drawer
|
|
49
|
+
</Button>
|
|
50
|
+
<Drawer isExpanded={isExpanded} onExpand={onExpand}>
|
|
51
|
+
<DrawerContent panelContent={panelContent}>
|
|
52
|
+
<DrawerContentBody hasPadding>
|
|
53
|
+
<b>Drawer content padding.</b> {drawerContent}
|
|
54
|
+
</DrawerContentBody>
|
|
55
|
+
</DrawerContent>
|
|
56
|
+
</Drawer>
|
|
57
|
+
</React.Fragment>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Drawer,
|
|
4
|
+
DrawerPanelContent,
|
|
5
|
+
DrawerContent,
|
|
6
|
+
DrawerContentBody,
|
|
7
|
+
DrawerHead,
|
|
8
|
+
DrawerActions,
|
|
9
|
+
DrawerCloseButton,
|
|
10
|
+
Button
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
|
|
13
|
+
export const DrawerModifiedPanelPadding: React.FunctionComponent = () => {
|
|
14
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
|
+
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
|
+
|
|
17
|
+
const onExpand = () => {
|
|
18
|
+
drawerRef.current && drawerRef.current.focus();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onClick = () => {
|
|
22
|
+
setIsExpanded(!isExpanded);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onCloseClick = () => {
|
|
26
|
+
setIsExpanded(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const panelContent = (
|
|
30
|
+
<DrawerPanelContent>
|
|
31
|
+
<DrawerHead hasNoPadding>
|
|
32
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
33
|
+
drawer-panel
|
|
34
|
+
</span>
|
|
35
|
+
<DrawerActions>
|
|
36
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
37
|
+
</DrawerActions>
|
|
38
|
+
</DrawerHead>
|
|
39
|
+
</DrawerPanelContent>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const drawerContent =
|
|
43
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<React.Fragment>
|
|
47
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
|
+
Toggle drawer
|
|
49
|
+
</Button>
|
|
50
|
+
<Drawer isExpanded={isExpanded} onExpand={onExpand}>
|
|
51
|
+
<DrawerContent panelContent={panelContent}>
|
|
52
|
+
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
53
|
+
</DrawerContent>
|
|
54
|
+
</Drawer>
|
|
55
|
+
</React.Fragment>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Drawer,
|
|
4
|
+
DrawerPanelContent,
|
|
5
|
+
DrawerContent,
|
|
6
|
+
DrawerContentBody,
|
|
7
|
+
DrawerHead,
|
|
8
|
+
DrawerActions,
|
|
9
|
+
DrawerCloseButton,
|
|
10
|
+
Button
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
|
|
13
|
+
export const DrawerPanelBottom: React.FunctionComponent = () => {
|
|
14
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
15
|
+
const drawerRef = React.useRef<HTMLDivElement>();
|
|
16
|
+
|
|
17
|
+
const onExpand = () => {
|
|
18
|
+
drawerRef.current && drawerRef.current.focus();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onClick = () => {
|
|
22
|
+
setIsExpanded(!isExpanded);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const onCloseClick = () => {
|
|
26
|
+
setIsExpanded(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const panelContent = (
|
|
30
|
+
<DrawerPanelContent>
|
|
31
|
+
<DrawerHead>
|
|
32
|
+
<span tabIndex={isExpanded ? 0 : -1} ref={drawerRef}>
|
|
33
|
+
drawer-panel
|
|
34
|
+
</span>
|
|
35
|
+
<DrawerActions>
|
|
36
|
+
<DrawerCloseButton onClick={onCloseClick} />
|
|
37
|
+
</DrawerActions>
|
|
38
|
+
</DrawerHead>
|
|
39
|
+
</DrawerPanelContent>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const drawerContent =
|
|
43
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat,nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.';
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<React.Fragment>
|
|
47
|
+
<Button aria-expanded={isExpanded} onClick={onClick}>
|
|
48
|
+
Toggle drawer
|
|
49
|
+
</Button>
|
|
50
|
+
<div style={{ height: '400px' }}>
|
|
51
|
+
<Drawer isExpanded={isExpanded} position="bottom" onExpand={onExpand}>
|
|
52
|
+
<DrawerContent panelContent={panelContent}>
|
|
53
|
+
<DrawerContentBody>{drawerContent}</DrawerContentBody>
|
|
54
|
+
</DrawerContent>
|
|
55
|
+
</Drawer>
|
|
56
|
+
</div>
|
|
57
|
+
</React.Fragment>
|
|
58
|
+
);
|
|
59
|
+
};
|