@patternfly/react-core 4.266.0 → 4.266.2

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 (42) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/esm/components/Pagination/Pagination.d.ts +12 -2
  3. package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
  4. package/dist/esm/components/Pagination/Pagination.js +3 -2
  5. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  6. package/dist/esm/components/Sidebar/SidebarPanel.d.ts +9 -0
  7. package/dist/esm/components/Sidebar/SidebarPanel.d.ts.map +1 -1
  8. package/dist/esm/components/Sidebar/SidebarPanel.js +10 -0
  9. package/dist/esm/components/Sidebar/SidebarPanel.js.map +1 -1
  10. package/dist/js/components/Pagination/Pagination.d.ts +12 -2
  11. package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
  12. package/dist/js/components/Pagination/Pagination.js +3 -2
  13. package/dist/js/components/Pagination/Pagination.js.map +1 -1
  14. package/dist/js/components/Sidebar/SidebarPanel.d.ts +9 -0
  15. package/dist/js/components/Sidebar/SidebarPanel.d.ts.map +1 -1
  16. package/dist/js/components/Sidebar/SidebarPanel.js +11 -1
  17. package/dist/js/components/Sidebar/SidebarPanel.js.map +1 -1
  18. package/dist/umd/react-core.min.js +1 -1
  19. package/package.json +2 -2
  20. package/src/components/Pagination/Pagination.tsx +17 -2
  21. package/src/components/Pagination/__tests__/Pagination.test.tsx +21 -0
  22. package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +1266 -0
  23. package/src/components/Pagination/examples/Pagination.md +5 -0
  24. package/src/components/Pagination/examples/PaginationInset.tsx +37 -0
  25. package/src/components/Pagination/examples/PaginationSticky.tsx +47 -55
  26. package/src/components/Panel/__tests__/Panel.test.tsx +96 -58
  27. package/src/components/Panel/__tests__/PanelFooter.test.tsx +42 -0
  28. package/src/components/Panel/__tests__/PanelHeader.test.tsx +42 -0
  29. package/src/components/Panel/__tests__/PanelMain.test.tsx +48 -0
  30. package/src/components/Panel/__tests__/PanelMainBody.test.tsx +42 -0
  31. package/src/components/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +2 -82
  32. package/src/components/Panel/__tests__/__snapshots__/PanelFooter.test.tsx.snap +11 -0
  33. package/src/components/Panel/__tests__/__snapshots__/PanelHeader.test.tsx.snap +11 -0
  34. package/src/components/Panel/__tests__/__snapshots__/PanelMain.test.tsx.snap +11 -0
  35. package/src/components/Panel/__tests__/__snapshots__/PanelMainBody.test.tsx.snap +11 -0
  36. package/src/components/Sidebar/SidebarPanel.tsx +10 -0
  37. package/src/components/Sidebar/__tests__/Sidebar.test.tsx +72 -0
  38. package/src/components/Sidebar/__tests__/SidebarContent.test.tsx +38 -0
  39. package/src/components/Sidebar/__tests__/SidebarPanel.test.tsx +75 -0
  40. package/src/components/Sidebar/__tests__/__snapshots__/Sidebar.test.tsx.snap +15 -0
  41. package/src/components/Sidebar/__tests__/__snapshots__/SidebarContent.test.tsx.snap +11 -0
  42. package/src/components/Sidebar/__tests__/__snapshots__/SidebarPanel.test.tsx.snap +11 -0
@@ -49,3 +49,8 @@ By not passing `itemCount` and passing `toggleTemplate` you can customize the to
49
49
 
50
50
  ```ts isFullscreen file="./PaginationSticky.tsx"
51
51
  ```
52
+
53
+ ### Inset
54
+
55
+ ```ts file="./PaginationInset.tsx" isBeta
56
+ ```
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { Pagination } from '@patternfly/react-core';
3
+
4
+ export const PaginationInset: React.FunctionComponent = () => {
5
+ const [page, setPage] = React.useState(1);
6
+ const [perPage, setPerPage] = React.useState(20);
7
+
8
+ const onSetPage = (_event: React.MouseEvent | React.KeyboardEvent | MouseEvent, newPage: number) => {
9
+ setPage(newPage);
10
+ };
11
+
12
+ const onPerPageSelect = (
13
+ _event: React.MouseEvent | React.KeyboardEvent | MouseEvent,
14
+ newPerPage: number,
15
+ newPage: number
16
+ ) => {
17
+ setPerPage(newPerPage);
18
+ setPage(newPage);
19
+ };
20
+
21
+ return (
22
+ <Pagination
23
+ perPageComponent="button"
24
+ itemCount={523}
25
+ perPage={perPage}
26
+ page={page}
27
+ onSetPage={onSetPage}
28
+ widgetId="inset-example"
29
+ onPerPageSelect={onPerPageSelect}
30
+ inset={{
31
+ default: 'insetNone',
32
+ md: 'insetMd',
33
+ lg: 'inset2xl'
34
+ }}
35
+ />
36
+ );
37
+ };
@@ -3,8 +3,9 @@ import { Pagination, PaginationVariant, Gallery, GalleryItem, Card, CardBody } f
3
3
 
4
4
  export const PaginationSticky: React.FunctionComponent = () => {
5
5
  const [page, setPage] = React.useState(1);
6
- const [perPage, setPerPage] = React.useState(20);
6
+ const [perPage, setPerPage] = React.useState(100);
7
7
  const [isTopSticky, setIsTopSticky] = React.useState(true);
8
+ const itemCount = 523;
8
9
 
9
10
  const onToggleSticky = () => {
10
11
  setIsTopSticky(prev => !prev);
@@ -23,59 +24,50 @@ export const PaginationSticky: React.FunctionComponent = () => {
23
24
  setPage(newPage);
24
25
  };
25
26
 
26
- return (
27
- <div>
28
- {isTopSticky && (
29
- <React.Fragment>
30
- <Pagination
31
- perPageComponent="button"
32
- itemCount={523}
33
- perPage={perPage}
34
- page={page}
35
- onSetPage={onSetPage}
36
- widgetId="sticky-example"
37
- onPerPageSelect={onPerPageSelect}
38
- isSticky
39
- >
40
- <button onClick={onToggleSticky}>Toggle to bottom position</button>
41
- </Pagination>
42
- <Gallery hasGutter>
43
- {Array.apply(0, Array(40)).map((x, i) => (
44
- <GalleryItem key={i}>
45
- <Card>
46
- <CardBody>This is a card</CardBody>
47
- </Card>
48
- </GalleryItem>
49
- ))}
50
- </Gallery>
51
- </React.Fragment>
52
- )}
53
- {!isTopSticky && (
54
- <React.Fragment>
55
- <Gallery hasGutter>
56
- {Array.apply(0, Array(40)).map((x, i) => (
57
- <GalleryItem key={i}>
58
- <Card>
59
- <CardBody>This is a card</CardBody>
60
- </Card>
61
- </GalleryItem>
62
- ))}
63
- </Gallery>
64
- <Pagination
65
- perPageComponent="button"
66
- itemCount={523}
67
- perPage={perPage}
68
- page={page}
69
- onSetPage={onSetPage}
70
- widgetId="pagination-options-menu-top"
71
- onPerPageSelect={onPerPageSelect}
72
- isSticky
73
- variant={PaginationVariant.bottom}
74
- >
75
- <button onClick={onToggleSticky}>Toggle to top position</button>
76
- </Pagination>
77
- </React.Fragment>
78
- )}
79
- </div>
27
+ const buildCards = () => {
28
+ const numberOfCards = (page - 1) * perPage + perPage - 1 >= itemCount ? itemCount - (page - 1) * perPage : perPage;
29
+
30
+ return Array.apply(0, Array(numberOfCards)).map((x, i) => (
31
+ <GalleryItem key={i}>
32
+ <Card>
33
+ <CardBody>This is a card</CardBody>
34
+ </Card>
35
+ </GalleryItem>
36
+ ));
37
+ };
38
+
39
+ return isTopSticky ? (
40
+ <React.Fragment>
41
+ <Pagination
42
+ perPageComponent="button"
43
+ itemCount={itemCount}
44
+ perPage={perPage}
45
+ page={page}
46
+ onSetPage={onSetPage}
47
+ widgetId="pagination-options-menu-top"
48
+ onPerPageSelect={onPerPageSelect}
49
+ isSticky
50
+ >
51
+ <button onClick={onToggleSticky}>Toggle to bottom position</button>
52
+ </Pagination>
53
+ <Gallery hasGutter>{buildCards()}</Gallery>
54
+ </React.Fragment>
55
+ ) : (
56
+ <React.Fragment>
57
+ <Gallery hasGutter>{buildCards()}</Gallery>
58
+ <Pagination
59
+ perPageComponent="button"
60
+ itemCount={itemCount}
61
+ perPage={perPage}
62
+ page={page}
63
+ onSetPage={onSetPage}
64
+ widgetId="pagination-options-menu-top"
65
+ onPerPageSelect={onPerPageSelect}
66
+ isSticky
67
+ variant={PaginationVariant.bottom}
68
+ >
69
+ <button onClick={onToggleSticky}>Toggle to top position</button>
70
+ </Pagination>
71
+ </React.Fragment>
80
72
  );
81
73
  };
@@ -1,62 +1,100 @@
1
- import React from 'react';
2
- import { render } from '@testing-library/react';
1
+ import * as React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import { Panel } from '../Panel';
4
4
  import { PanelMain } from '../PanelMain';
5
5
  import { PanelMainBody } from '../PanelMainBody';
6
- import { PanelHeader } from '../PanelHeader';
7
- import { PanelFooter } from '../PanelFooter';
8
-
9
- describe('Panel', () => {
10
- test('renders content', () => {
11
- const { asFragment } = render(<Panel>Foo</Panel>);
12
- expect(asFragment()).toMatchSnapshot();
13
- });
14
-
15
- test('renders content with raised styling', () => {
16
- const { asFragment } = render(<Panel variant="raised">Foo</Panel>);
17
- expect(asFragment()).toMatchSnapshot();
18
- });
19
-
20
- test('renders content with bordered styling', () => {
21
- const { asFragment } = render(<Panel variant="bordered">Foo</Panel>);
22
- expect(asFragment()).toMatchSnapshot();
23
- });
24
-
25
- test('renders content with scrollable styling', () => {
26
- const { asFragment } = render(<Panel isScrollable>Foo</Panel>);
27
- expect(asFragment()).toMatchSnapshot();
28
- });
29
- });
30
-
31
- describe('PanelMain', () => {
32
- test('renders content', () => {
33
- const { asFragment } = render(<PanelMain>Foo</PanelMain>);
34
- expect(asFragment()).toMatchSnapshot();
35
- });
36
-
37
- test('renders content with the set maximum height', () => {
38
- const { asFragment } = render(<PanelMain maxHeight={'80px'}>Foo</PanelMain>);
39
- expect(asFragment()).toMatchSnapshot();
40
- });
41
- });
42
-
43
- describe('PanelMainBody', () => {
44
- test('renders content', () => {
45
- const { asFragment } = render(<PanelMainBody>Foo</PanelMainBody>);
46
- expect(asFragment()).toMatchSnapshot();
47
- });
48
- });
49
-
50
- describe('PanelHeader', () => {
51
- test('renders content', () => {
52
- const { asFragment } = render(<PanelHeader>Foo</PanelHeader>);
53
- expect(asFragment()).toMatchSnapshot();
54
- });
55
- });
56
-
57
- describe('PanelFooter', () => {
58
- test('renders content', () => {
59
- const { asFragment } = render(<PanelFooter>Foo</PanelFooter>);
60
- expect(asFragment()).toMatchSnapshot();
61
- });
6
+ import userEvent from '@testing-library/user-event';
7
+ import { useEffect } from 'react';
8
+
9
+ test('Renders without children', () => {
10
+ render(
11
+ <div data-testid="panel">
12
+ <Panel />
13
+ </div>
14
+ );
15
+ expect(screen.getByTestId('panel').firstChild).toBeVisible();
16
+ });
17
+
18
+ test('Renders children', () => {
19
+ render(<Panel>Test</Panel>);
20
+ expect(screen.getByText('Test')).toBeVisible();
21
+ });
22
+
23
+ test('Renders with the class pf-c-panel', () => {
24
+ render(<Panel>Test</Panel>);
25
+ expect(screen.getByText('Test')).toHaveClass('pf-c-panel');
26
+ });
27
+
28
+ test('Renders with only the class pf-c-panel by default', () => {
29
+ render(<Panel>Test</Panel>);
30
+ expect(screen.getByText('Test')).toHaveClass('pf-c-panel', { exact: true });
31
+ });
32
+
33
+ test('Renders with custom class name when className prop is passed', () => {
34
+ render(<Panel className="test-class">Test</Panel>);
35
+ expect(screen.getByText('Test')).toHaveClass('test-class');
36
+ });
37
+
38
+ test('Renders with class name pf-m-raised when variant is raised', () => {
39
+ render(<Panel variant="raised">Test</Panel>);
40
+ expect(screen.getByText('Test')).toHaveClass('pf-m-raised');
41
+ });
42
+
43
+ test('Renders with class name pf-m-bordered when variant is bordered', () => {
44
+ render(<Panel variant="bordered">Test</Panel>);
45
+ expect(screen.getByText('Test')).toHaveClass('pf-m-bordered');
46
+ });
47
+
48
+ test('Renders with class name pf-m-scrollable when isScrollable is true', () => {
49
+ render(<Panel isScrollable>Test</Panel>);
50
+ expect(screen.getByText('Test')).toHaveClass('pf-m-scrollable');
51
+ });
52
+
53
+ test('Renders with ref', async () => {
54
+ const user = userEvent.setup();
55
+ const panelRef: React.RefObject<HTMLDivElement> = React.createRef();
56
+
57
+ const BasicPanel = () => {
58
+ const [lastClickWasInPanel, setLastClickWasInPanel] = React.useState(false);
59
+
60
+ const handleClick = event => {
61
+ if (panelRef.current && panelRef.current.contains(event.target)) {
62
+ setLastClickWasInPanel(true);
63
+ } else {
64
+ setLastClickWasInPanel(false);
65
+ }
66
+ };
67
+
68
+ useEffect(() => {
69
+ document.addEventListener('click', handleClick);
70
+ }, []);
71
+
72
+ return (
73
+ <div>
74
+ <Panel ref={panelRef}>
75
+ <PanelMain>
76
+ <PanelMainBody>Main content</PanelMainBody>
77
+ </PanelMain>
78
+ </Panel>
79
+ <p>Last click was in panel: {lastClickWasInPanel ? 'true' : 'false'}</p>
80
+ </div>
81
+ );
82
+ };
83
+
84
+ render(<BasicPanel />);
85
+
86
+ await user.click(document.body);
87
+ expect(screen.getByText('Last click was in panel: false')).toBeVisible;
88
+ await user.click(screen.getByText('Main content'));
89
+ expect(screen.getByText('Last click was in panel: true')).toBeVisible;
90
+ });
91
+
92
+ test('Renders with the inherited element props spread to the component', () => {
93
+ render(<Panel aria-label="this is a simple panel">Test</Panel>);
94
+ expect(screen.getByText('Test')).toHaveAccessibleName('this is a simple panel');
95
+ });
96
+
97
+ test('Matches the snapshot', () => {
98
+ const { asFragment } = render(<Panel>Test</Panel>);
99
+ expect(asFragment()).toMatchSnapshot();
62
100
  });
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { PanelFooter } from '../PanelFooter';
4
+
5
+ test('Renders without children', () => {
6
+ render(
7
+ <div data-testid="panelFooter">
8
+ <PanelFooter />
9
+ </div>
10
+ );
11
+ expect(screen.getByTestId('panelFooter').firstChild).toBeVisible();
12
+ });
13
+
14
+ test('Renders children', () => {
15
+ render(<PanelFooter>Test</PanelFooter>);
16
+ expect(screen.getByText('Test')).toBeVisible();
17
+ });
18
+
19
+ test('Renders with the class pf-c-panel__footer', () => {
20
+ render(<PanelFooter>Test</PanelFooter>);
21
+ expect(screen.getByText('Test')).toHaveClass('pf-c-panel__footer');
22
+ });
23
+
24
+ test('Renders with only the class pf-c-panel__footer by default', () => {
25
+ render(<PanelFooter>Test</PanelFooter>);
26
+ expect(screen.getByText('Test')).toHaveClass('pf-c-panel__footer', { exact: true });
27
+ });
28
+
29
+ test('Renders with custom class name when className prop is passed', () => {
30
+ render(<PanelFooter className="test-class">Test</PanelFooter>);
31
+ expect(screen.getByText('Test')).toHaveClass('test-class');
32
+ });
33
+
34
+ test('Renders with the inherited element props spread to the component', () => {
35
+ render(<PanelFooter aria-label="this is a simple panel footer">Test</PanelFooter>);
36
+ expect(screen.getByText('Test')).toHaveAccessibleName('this is a simple panel footer');
37
+ });
38
+
39
+ test('Matches the snapshot', () => {
40
+ const { asFragment } = render(<PanelFooter>Test</PanelFooter>);
41
+ expect(asFragment()).toMatchSnapshot();
42
+ });
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { PanelHeader } from '../PanelHeader';
4
+
5
+ test('Renders without children', () => {
6
+ render(
7
+ <div data-testid="panelHeader">
8
+ <PanelHeader />
9
+ </div>
10
+ );
11
+ expect(screen.getByTestId('panelHeader').firstChild).toBeVisible();
12
+ });
13
+
14
+ test('Renders children', () => {
15
+ render(<PanelHeader>Test</PanelHeader>);
16
+ expect(screen.getByText('Test')).toBeVisible();
17
+ });
18
+
19
+ test('Renders with the class pf-c-panel__header', () => {
20
+ render(<PanelHeader>Test</PanelHeader>);
21
+ expect(screen.getByText('Test')).toHaveClass('pf-c-panel__header');
22
+ });
23
+
24
+ test('Renders with only the class pf-c-panel__header by default', () => {
25
+ render(<PanelHeader>Test</PanelHeader>);
26
+ expect(screen.getByText('Test')).toHaveClass('pf-c-panel__header', { exact: true });
27
+ });
28
+
29
+ test('Renders with custom class name when className prop is passed', () => {
30
+ render(<PanelHeader className="test-class">Test</PanelHeader>);
31
+ expect(screen.getByText('Test')).toHaveClass('test-class');
32
+ });
33
+
34
+ test('Renders with the inherited element props spread to the component', () => {
35
+ render(<PanelHeader aria-label="this is a simple panel header">Test</PanelHeader>);
36
+ expect(screen.getByText('Test')).toHaveAccessibleName('this is a simple panel header');
37
+ });
38
+
39
+ test('Matches the snapshot', () => {
40
+ const { asFragment } = render(<PanelHeader>Test</PanelHeader>);
41
+ expect(asFragment()).toMatchSnapshot();
42
+ });
@@ -0,0 +1,48 @@
1
+ import * as React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { PanelMain } from '../PanelMain';
4
+
5
+ test('Renders without children', () => {
6
+ render(
7
+ <div data-testid="panelMain">
8
+ <PanelMain />
9
+ </div>
10
+ );
11
+ expect(screen.getByTestId('panelMain').firstChild).toBeVisible();
12
+ });
13
+
14
+ test('Renders children', () => {
15
+ render(<PanelMain>Test</PanelMain>);
16
+ expect(screen.getByText('Test')).toBeVisible();
17
+ });
18
+
19
+ test('Renders with the class pf-c-panel__main', () => {
20
+ render(<PanelMain>Test</PanelMain>);
21
+ expect(screen.getByText('Test')).toHaveClass('pf-c-panel__main');
22
+ });
23
+
24
+ test('Renders with only the class pf-c-panel__main by default', () => {
25
+ render(<PanelMain>Test</PanelMain>);
26
+ expect(screen.getByText('Test')).toHaveClass('pf-c-panel__main', { exact: true });
27
+ });
28
+
29
+ test('Renders with custom class name when className prop is passed', () => {
30
+ render(<PanelMain className="test-class">Test</PanelMain>);
31
+ expect(screen.getByText('Test')).toHaveClass('test-class');
32
+ });
33
+
34
+ test('Renders with custom max height name when maxHeight prop is passed', () => {
35
+ render(<PanelMain maxHeight="100px">Test</PanelMain>);
36
+ const styles = getComputedStyle(screen.getByText('Test'));
37
+ expect(styles.getPropertyValue('--pf-c-panel__main--MaxHeight')).toBe('100px');
38
+ });
39
+
40
+ test('Renders with the inherited element props spread to the component', () => {
41
+ render(<PanelMain aria-label="this is a simple panel main">Test</PanelMain>);
42
+ expect(screen.getByText('Test')).toHaveAccessibleName('this is a simple panel main');
43
+ });
44
+
45
+ test('Matches the snapshot', () => {
46
+ const { asFragment } = render(<PanelMain>Test</PanelMain>);
47
+ expect(asFragment()).toMatchSnapshot();
48
+ });
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { PanelMainBody } from '../PanelMainBody';
4
+
5
+ test('Renders without children', () => {
6
+ render(
7
+ <div data-testid="panelMainBody">
8
+ <PanelMainBody />
9
+ </div>
10
+ );
11
+ expect(screen.getByTestId('panelMainBody').firstChild).toBeVisible();
12
+ });
13
+
14
+ test('Renders children', () => {
15
+ render(<PanelMainBody>Test</PanelMainBody>);
16
+ expect(screen.getByText('Test')).toBeVisible();
17
+ });
18
+
19
+ test('Renders with the class pf-c-panel__main-body', () => {
20
+ render(<PanelMainBody>Test</PanelMainBody>);
21
+ expect(screen.getByText('Test')).toHaveClass('pf-c-panel__main-body');
22
+ });
23
+
24
+ test('Renders with only the class pf-c-panel__main-body by default', () => {
25
+ render(<PanelMainBody>Test</PanelMainBody>);
26
+ expect(screen.getByText('Test')).toHaveClass('pf-c-panel__main-body', { exact: true });
27
+ });
28
+
29
+ test('Renders with custom class name when className prop is passed', () => {
30
+ render(<PanelMainBody className="test-class">Test</PanelMainBody>);
31
+ expect(screen.getByText('Test')).toHaveClass('test-class');
32
+ });
33
+
34
+ test('Renders with the inherited element props spread to the component', () => {
35
+ render(<PanelMainBody aria-label="this is a simple panel main body">Test</PanelMainBody>);
36
+ expect(screen.getByText('Test')).toHaveAccessibleName('this is a simple panel main body');
37
+ });
38
+
39
+ test('Matches the snapshot', () => {
40
+ const { asFragment } = render(<PanelMainBody>Test</PanelMainBody>);
41
+ expect(asFragment()).toMatchSnapshot();
42
+ });
@@ -1,92 +1,12 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Panel renders content 1`] = `
3
+ exports[`Matches the snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
6
  class="pf-c-panel"
7
7
  >
8
- Foo
8
+ Test
9
9
  </div>
10
10
  </DocumentFragment>
11
11
  `;
12
12
 
13
- exports[`Panel renders content with bordered styling 1`] = `
14
- <DocumentFragment>
15
- <div
16
- class="pf-c-panel pf-m-bordered"
17
- >
18
- Foo
19
- </div>
20
- </DocumentFragment>
21
- `;
22
-
23
- exports[`Panel renders content with raised styling 1`] = `
24
- <DocumentFragment>
25
- <div
26
- class="pf-c-panel pf-m-raised"
27
- >
28
- Foo
29
- </div>
30
- </DocumentFragment>
31
- `;
32
-
33
- exports[`Panel renders content with scrollable styling 1`] = `
34
- <DocumentFragment>
35
- <div
36
- class="pf-c-panel pf-m-scrollable"
37
- >
38
- Foo
39
- </div>
40
- </DocumentFragment>
41
- `;
42
-
43
- exports[`PanelFooter renders content 1`] = `
44
- <DocumentFragment>
45
- <div
46
- class="pf-c-panel__footer"
47
- >
48
- Foo
49
- </div>
50
- </DocumentFragment>
51
- `;
52
-
53
- exports[`PanelHeader renders content 1`] = `
54
- <DocumentFragment>
55
- <div
56
- class="pf-c-panel__header"
57
- >
58
- Foo
59
- </div>
60
- </DocumentFragment>
61
- `;
62
-
63
- exports[`PanelMain renders content 1`] = `
64
- <DocumentFragment>
65
- <div
66
- class="pf-c-panel__main"
67
- >
68
- Foo
69
- </div>
70
- </DocumentFragment>
71
- `;
72
-
73
- exports[`PanelMain renders content with the set maximum height 1`] = `
74
- <DocumentFragment>
75
- <div
76
- class="pf-c-panel__main"
77
- style="--pf-c-panel__main--MaxHeight: 80px;"
78
- >
79
- Foo
80
- </div>
81
- </DocumentFragment>
82
- `;
83
-
84
- exports[`PanelMainBody renders content 1`] = `
85
- <DocumentFragment>
86
- <div
87
- class="pf-c-panel__main-body"
88
- >
89
- Foo
90
- </div>
91
- </DocumentFragment>
92
- `;
@@ -0,0 +1,11 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Matches the snapshot 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="pf-c-panel__footer"
7
+ >
8
+ Test
9
+ </div>
10
+ </DocumentFragment>
11
+ `;
@@ -0,0 +1,11 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Matches the snapshot 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="pf-c-panel__header"
7
+ >
8
+ Test
9
+ </div>
10
+ </DocumentFragment>
11
+ `;
@@ -0,0 +1,11 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Matches the snapshot 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="pf-c-panel__main"
7
+ >
8
+ Test
9
+ </div>
10
+ </DocumentFragment>
11
+ `;
@@ -0,0 +1,11 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Matches the snapshot 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="pf-c-panel__main-body"
7
+ >
8
+ Test
9
+ </div>
10
+ </DocumentFragment>
11
+ `;
@@ -3,6 +3,16 @@ import { css } from '@patternfly/react-styles';
3
3
  import styles from '@patternfly/react-styles/css/components/Sidebar/sidebar';
4
4
  import { formatBreakpointMods } from '../../helpers/util';
5
5
 
6
+ export enum SidebarPanelWidthType {
7
+ default = 'default',
8
+ width25 = 'width_25',
9
+ width33 = 'width_33',
10
+ width50 = 'width_50',
11
+ width66 = 'width_66',
12
+ width75 = 'width_75',
13
+ width100 = 'width_100'
14
+ }
15
+
6
16
  export interface SidebarPanelProps extends Omit<React.HTMLProps<HTMLDivElement>, 'width'> {
7
17
  children: React.ReactNode;
8
18
  /** Indicates whether the panel is positioned statically or sticky to the top. Default is sticky on small screens when the orientation is stack, and static on medium and above screens when the orientation is split. */