@patternfly/react-core 4.208.12 → 4.210.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 (67) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
  3. package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js +1 -1
  4. package/dist/esm/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
  5. package/dist/esm/components/Select/SelectMenu.d.ts +3 -1
  6. package/dist/esm/components/Select/SelectMenu.d.ts.map +1 -1
  7. package/dist/esm/components/Select/SelectMenu.js.map +1 -1
  8. package/dist/esm/components/Tabs/Tabs.d.ts +3 -1
  9. package/dist/esm/components/Tabs/Tabs.d.ts.map +1 -1
  10. package/dist/esm/components/Tabs/Tabs.js +2 -2
  11. package/dist/esm/components/Tabs/Tabs.js.map +1 -1
  12. package/dist/esm/components/Wizard/Wizard.d.ts.map +1 -1
  13. package/dist/esm/components/Wizard/Wizard.js +3 -3
  14. package/dist/esm/components/Wizard/Wizard.js.map +1 -1
  15. package/dist/esm/components/Wizard/WizardNavItem.d.ts +2 -0
  16. package/dist/esm/components/Wizard/WizardNavItem.d.ts.map +1 -1
  17. package/dist/esm/components/Wizard/WizardNavItem.js +2 -2
  18. package/dist/esm/components/Wizard/WizardNavItem.js.map +1 -1
  19. package/dist/js/components/ClipboardCopy/ClipboardCopyButton.d.ts.map +1 -1
  20. package/dist/js/components/ClipboardCopy/ClipboardCopyButton.js +1 -1
  21. package/dist/js/components/ClipboardCopy/ClipboardCopyButton.js.map +1 -1
  22. package/dist/js/components/Select/SelectMenu.d.ts +3 -1
  23. package/dist/js/components/Select/SelectMenu.d.ts.map +1 -1
  24. package/dist/js/components/Select/SelectMenu.js.map +1 -1
  25. package/dist/js/components/Tabs/Tabs.d.ts +3 -1
  26. package/dist/js/components/Tabs/Tabs.d.ts.map +1 -1
  27. package/dist/js/components/Tabs/Tabs.js +2 -2
  28. package/dist/js/components/Tabs/Tabs.js.map +1 -1
  29. package/dist/js/components/Wizard/Wizard.d.ts.map +1 -1
  30. package/dist/js/components/Wizard/Wizard.js +3 -3
  31. package/dist/js/components/Wizard/Wizard.js.map +1 -1
  32. package/dist/js/components/Wizard/WizardNavItem.d.ts +2 -0
  33. package/dist/js/components/Wizard/WizardNavItem.d.ts.map +1 -1
  34. package/dist/js/components/Wizard/WizardNavItem.js +2 -2
  35. package/dist/js/components/Wizard/WizardNavItem.js.map +1 -1
  36. package/dist/umd/react-core.js +8 -8
  37. package/dist/umd/react-core.min.css +75 -75
  38. package/dist/umd/react-core.min.js +2 -2
  39. package/package.json +5 -5
  40. package/src/components/ClipboardCopy/ClipboardCopyButton.tsx +2 -0
  41. package/src/components/Drawer/examples/Drawer.md +19 -1354
  42. package/src/components/Drawer/examples/DrawerAdditionalSectionAboveContent.tsx +59 -0
  43. package/src/components/Drawer/examples/DrawerBasic.tsx +57 -0
  44. package/src/components/Drawer/examples/DrawerBasicInline.tsx +57 -0
  45. package/src/components/Drawer/examples/DrawerBreakpoint.tsx +57 -0
  46. package/src/components/Drawer/examples/DrawerInlinePanelLeft.tsx +57 -0
  47. package/src/components/Drawer/examples/DrawerInlinePanelRight.tsx +57 -0
  48. package/src/components/Drawer/examples/DrawerLightGray.tsx +107 -0
  49. package/src/components/Drawer/examples/DrawerModifiedContentPadding.tsx +59 -0
  50. package/src/components/Drawer/examples/DrawerModifiedPanelPadding.tsx +57 -0
  51. package/src/components/Drawer/examples/DrawerPanelBottom.tsx +59 -0
  52. package/src/components/Drawer/examples/DrawerPanelLeft.tsx +57 -0
  53. package/src/components/Drawer/examples/DrawerPanelRight.tsx +57 -0
  54. package/src/components/Drawer/examples/DrawerResizableOnBottom.tsx +58 -0
  55. package/src/components/Drawer/examples/DrawerResizableOnInline.tsx +56 -0
  56. package/src/components/Drawer/examples/DrawerResizableOnLeft.tsx +57 -0
  57. package/src/components/Drawer/examples/DrawerResizableOnRight.tsx +62 -0
  58. package/src/components/Drawer/examples/DrawerStackedContentBodyElements.tsx +60 -0
  59. package/src/components/Drawer/examples/DrawerStatic.tsx +57 -0
  60. package/src/components/Select/SelectMenu.tsx +1 -1
  61. package/src/components/Tabs/Tabs.tsx +5 -1
  62. package/src/components/Tabs/__tests__/Tabs.test.tsx +40 -1
  63. package/src/components/Wizard/Wizard.tsx +3 -0
  64. package/src/components/Wizard/WizardNavItem.tsx +4 -0
  65. package/src/components/Wizard/__tests__/Wizard.test.tsx +6 -3
  66. package/src/components/Wizard/__tests__/__snapshots__/Wizard.test.tsx.snap +6 -0
  67. package/src/demos/Tabs.md +53 -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
+ 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
+ };