@patternfly/react-core 4.228.1 → 4.229.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 (23) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/esm/components/DescriptionList/DescriptionList.d.ts +4 -0
  3. package/dist/esm/components/DescriptionList/DescriptionList.d.ts.map +1 -1
  4. package/dist/esm/components/DescriptionList/DescriptionList.js +5 -2
  5. package/dist/esm/components/DescriptionList/DescriptionList.js.map +1 -1
  6. package/dist/esm/components/DescriptionList/DescriptionListGroup.js.map +1 -1
  7. package/dist/js/components/DescriptionList/DescriptionList.d.ts +4 -0
  8. package/dist/js/components/DescriptionList/DescriptionList.d.ts.map +1 -1
  9. package/dist/js/components/DescriptionList/DescriptionList.js +5 -2
  10. package/dist/js/components/DescriptionList/DescriptionList.js.map +1 -1
  11. package/dist/js/components/DescriptionList/DescriptionListGroup.js.map +1 -1
  12. package/dist/umd/react-core.js +5 -2
  13. package/dist/umd/react-core.min.css +410 -410
  14. package/dist/umd/react-core.min.js +1 -1
  15. package/package.json +5 -5
  16. package/src/components/DescriptionList/DescriptionList.tsx +14 -0
  17. package/src/components/DescriptionList/DescriptionListGroup.tsx +1 -0
  18. package/src/components/DescriptionList/examples/DescriptionList.md +31 -1
  19. package/src/components/DescriptionList/examples/DescriptionListDisplaySizeAndCard.tsx +63 -0
  20. package/src/components/DescriptionList/examples/DescriptionListDisplaySizeAndCardHorizontalTermWidth.tsx +34 -0
  21. package/src/components/DescriptionList/examples/DescriptionListDisplaySizeAndCardThreeColumn.tsx +34 -0
  22. package/src/components/DescriptionList/examples/DescriptionListWithCard.tsx +62 -0
  23. package/src/components/DescriptionList/examples/DescriptionListWithDisplaySize.tsx +63 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.228.1",
3
+ "version": "4.229.0",
4
4
  "description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -34,9 +34,9 @@
34
34
  "generate": "node scripts/copyStyles.js"
35
35
  },
36
36
  "dependencies": {
37
- "@patternfly/react-icons": "^4.79.1",
38
- "@patternfly/react-styles": "^4.78.1",
39
- "@patternfly/react-tokens": "^4.80.1",
37
+ "@patternfly/react-icons": "^4.80.0",
38
+ "@patternfly/react-styles": "^4.79.0",
39
+ "@patternfly/react-tokens": "^4.81.0",
40
40
  "focus-trap": "6.9.2",
41
41
  "react-dropzone": "9.0.0",
42
42
  "tippy.js": "5.1.2",
@@ -60,5 +60,5 @@
60
60
  "react": "^16.8.0 || ^17.0.0",
61
61
  "react-dom": "^16.8.0 || ^17.0.0"
62
62
  },
63
- "gitHead": "f6c791bad9fa1bc817102fea17d5ba7243cd6121"
63
+ "gitHead": "6f68aa3d05370ed0e088e00b2a780f2babe64dd6"
64
64
  }
@@ -30,6 +30,8 @@ export interface DescriptionListProps extends Omit<React.HTMLProps<HTMLDListElem
30
30
  isFluid?: boolean;
31
31
  /** Sets the the default placement of description list groups to fill from top to bottom. */
32
32
  isFillColumns?: boolean;
33
+ /** Sets the display size of the descriptions in the description list.*/
34
+ displaySize?: 'lg' | '2xl';
33
35
  /** Sets the number of columns on the description list at various breakpoints */
34
36
  columnModifier?: {
35
37
  default?: '1Col' | '2Col' | '3Col';
@@ -56,6 +58,8 @@ export interface DescriptionListProps extends Omit<React.HTMLProps<HTMLDListElem
56
58
  xl?: string;
57
59
  '2xl'?: string;
58
60
  };
61
+ /** Sets the description list's term column width.*/
62
+ termWidth?: string;
59
63
  /** Sets the horizontal description list's term column width at various breakpoints. */
60
64
  horizontalTermWidthModifier?: {
61
65
  default?: string;
@@ -86,8 +90,10 @@ export const DescriptionList: React.FunctionComponent<DescriptionListProps> = ({
86
90
  isCompact,
87
91
  isFluid,
88
92
  isFillColumns,
93
+ displaySize,
89
94
  columnModifier,
90
95
  autoFitMinModifier,
96
+ termWidth,
91
97
  horizontalTermWidthModifier,
92
98
  orientation,
93
99
  style,
@@ -99,6 +105,12 @@ export const DescriptionList: React.FunctionComponent<DescriptionListProps> = ({
99
105
  ...setBreakpointModifiers('--pf-c-description-list--GridTemplateColumns--min', autoFitMinModifier)
100
106
  };
101
107
  }
108
+ if (termWidth) {
109
+ style = {
110
+ ...style,
111
+ ...{ '--pf-c-description-list__term--width': termWidth }
112
+ };
113
+ }
102
114
  if (isHorizontal && horizontalTermWidthModifier) {
103
115
  style = {
104
116
  ...style,
@@ -119,6 +131,8 @@ export const DescriptionList: React.FunctionComponent<DescriptionListProps> = ({
119
131
  isCompact && styles.modifiers.compact,
120
132
  isFluid && styles.modifiers.fluid,
121
133
  isFillColumns && styles.modifiers.fillColumns,
134
+ displaySize === 'lg' && styles.modifiers.displayLg,
135
+ displaySize === '2xl' && styles.modifiers.display_2xl,
122
136
  className
123
137
  )}
124
138
  style={style}
@@ -18,4 +18,5 @@ export const DescriptionListGroup: React.FunctionComponent<DescriptionListGroupP
18
18
  {children}
19
19
  </div>
20
20
  );
21
+
21
22
  DescriptionListGroup.displayName = 'DescriptionListGroup';
@@ -11,10 +11,11 @@ propComponents:
11
11
  'DescriptionListTermHelpText',
12
12
  'DescriptionListTermHelpTextButton',
13
13
  'Popover',
14
+ 'Card'
14
15
  ]
15
16
  ---
16
17
 
17
- import { Button, DescriptionList, DescriptionListTerm, DescriptionListDescription, DescriptionListGroup, DescriptionListTermHelpText, DescriptionListTermHelpTextButton, Popover } from '@patternfly/react-core';
18
+ import { Button, DescriptionList, DescriptionListTerm, DescriptionListDescription, DescriptionListGroup, DescriptionListTermHelpText, DescriptionListTermHelpTextButton, Popover, Checkbox, Card } from '@patternfly/react-core';
18
19
  import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
19
20
  import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
20
21
  import BookIcon from '@patternfly/react-icons/dist/esm/icons/book-icon';
@@ -84,6 +85,11 @@ import FlagIcon from '@patternfly/react-icons/dist/esm/icons/flag-icon';
84
85
  ```ts file='./DescriptionListColumnFill.tsx'
85
86
  ```
86
87
 
88
+ ### Display size
89
+
90
+ ```ts file='./DescriptionListWithDisplaySize.tsx'
91
+ ```
92
+
87
93
  ## Responsive column definitions
88
94
 
89
95
  ### Default responsive columns
@@ -120,6 +126,30 @@ import FlagIcon from '@patternfly/react-icons/dist/esm/icons/flag-icon';
120
126
  ```ts file='./DescriptionListDefaultInlineGrid.tsx'
121
127
  ```
122
128
 
129
+ ## Card variants
130
+
131
+ A [card component](/components/card) can be used in place of a description list group.
132
+
133
+ ### Description list with card
134
+
135
+ ```ts file='./DescriptionListWithCard.tsx'
136
+ ```
137
+
138
+ ### Description list with display size and card
139
+
140
+ ```ts file='./DescriptionListDisplaySizeAndCard.tsx'
141
+ ```
142
+
143
+ ### Display size with card, three column on large breakpoint
144
+
145
+ ```ts file='./DescriptionListDisplaySizeAndCardThreeColumn.tsx'
146
+ ```
147
+
148
+ ### Display size with card, horizontal, modified term width
149
+
150
+ ```ts file='./DescriptionListDisplaySizeAndCardHorizontalTermWidth.tsx'
151
+ ```
152
+
123
153
  ## Auto fit
124
154
 
125
155
  ### Auto-fit basic
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+ import {
3
+ Button,
4
+ DescriptionList,
5
+ DescriptionListTerm,
6
+ DescriptionListDescription,
7
+ Card,
8
+ Checkbox
9
+ } from '@patternfly/react-core';
10
+ import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
11
+
12
+ export const DescriptionListDisplaySizeAndCard: React.FunctionComponent = () => {
13
+ const [isChecked, setIsChecked] = React.useState<boolean>(false);
14
+ const [displaySize, setDisplaySize] = React.useState<'lg' | '2xl'>('lg');
15
+
16
+ const toggleDisplaySize = (checked: boolean) => {
17
+ setDisplaySize(checked ? '2xl' : 'lg');
18
+ setIsChecked(checked);
19
+ };
20
+
21
+ return (
22
+ <>
23
+ <div style={{ marginBottom: '12px' }}>
24
+ <Checkbox
25
+ label="displaySize 2xl"
26
+ isChecked={isChecked}
27
+ onChange={toggleDisplaySize}
28
+ aria-label="set display size 2xl"
29
+ id="toggle-display-size-with-card"
30
+ name="toggle-display-size-with-card"
31
+ />
32
+ </div>
33
+ <DescriptionList displaySize={displaySize} columnModifier={{ lg: '2Col' }}>
34
+ <Card component="div">
35
+ <DescriptionListTerm>Name</DescriptionListTerm>
36
+ <DescriptionListDescription>Example</DescriptionListDescription>
37
+ </Card>
38
+ <Card component="div">
39
+ <DescriptionListTerm>Namespace</DescriptionListTerm>
40
+ <DescriptionListDescription>
41
+ <a href="#">mary-test</a>
42
+ </DescriptionListDescription>
43
+ </Card>
44
+ <Card component="div">
45
+ <DescriptionListTerm>Labels</DescriptionListTerm>
46
+ <DescriptionListDescription>example</DescriptionListDescription>
47
+ </Card>
48
+ <Card component="div">
49
+ <DescriptionListTerm>Pod selector</DescriptionListTerm>
50
+ <DescriptionListDescription>
51
+ <Button variant="link" isInline icon={<PlusCircleIcon />}>
52
+ app=MyApp
53
+ </Button>
54
+ </DescriptionListDescription>
55
+ </Card>
56
+ <Card component="div">
57
+ <DescriptionListTerm>Annotation</DescriptionListTerm>
58
+ <DescriptionListDescription>2 Annotations</DescriptionListDescription>
59
+ </Card>
60
+ </DescriptionList>
61
+ </>
62
+ );
63
+ };
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Button, DescriptionList, DescriptionListTerm, DescriptionListDescription, Card } from '@patternfly/react-core';
3
+ import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
4
+
5
+ export const DescriptionListDisplaySizeAndCardHorizontalTermWidth: React.FunctionComponent = () => (
6
+ <DescriptionList displaySize="lg" isHorizontal columnModifier={{ lg: '2Col' }} termWidth="10ch">
7
+ <Card component="div">
8
+ <DescriptionListTerm>Name</DescriptionListTerm>
9
+ <DescriptionListDescription>Example</DescriptionListDescription>
10
+ </Card>
11
+ <Card component="div">
12
+ <DescriptionListTerm>Namespace</DescriptionListTerm>
13
+ <DescriptionListDescription>
14
+ <a href="#">mary-test</a>
15
+ </DescriptionListDescription>
16
+ </Card>
17
+ <Card component="div">
18
+ <DescriptionListTerm>Labels</DescriptionListTerm>
19
+ <DescriptionListDescription>example</DescriptionListDescription>
20
+ </Card>
21
+ <Card component="div">
22
+ <DescriptionListTerm>Pod selector</DescriptionListTerm>
23
+ <DescriptionListDescription>
24
+ <Button variant="link" isInline icon={<PlusCircleIcon />}>
25
+ app=MyApp
26
+ </Button>
27
+ </DescriptionListDescription>
28
+ </Card>
29
+ <Card component="div">
30
+ <DescriptionListTerm>Annotation</DescriptionListTerm>
31
+ <DescriptionListDescription>2 Annotations</DescriptionListDescription>
32
+ </Card>
33
+ </DescriptionList>
34
+ );
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Button, DescriptionList, DescriptionListTerm, DescriptionListDescription, Card } from '@patternfly/react-core';
3
+ import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
4
+
5
+ export const DescriptionListDisplayLgAndCardThreeColumn: React.FunctionComponent = () => (
6
+ <DescriptionList displaySize="lg" columnModifier={{ lg: '3Col' }}>
7
+ <Card component="div">
8
+ <DescriptionListTerm>Name</DescriptionListTerm>
9
+ <DescriptionListDescription>Example</DescriptionListDescription>
10
+ </Card>
11
+ <Card component="div">
12
+ <DescriptionListTerm>Namespace</DescriptionListTerm>
13
+ <DescriptionListDescription>
14
+ <a href="#">mary-test</a>
15
+ </DescriptionListDescription>
16
+ </Card>
17
+ <Card component="div">
18
+ <DescriptionListTerm>Labels</DescriptionListTerm>
19
+ <DescriptionListDescription>example</DescriptionListDescription>
20
+ </Card>
21
+ <Card component="div">
22
+ <DescriptionListTerm>Pod selector</DescriptionListTerm>
23
+ <DescriptionListDescription>
24
+ <Button variant="link" isInline icon={<PlusCircleIcon />}>
25
+ app=MyApp
26
+ </Button>
27
+ </DescriptionListDescription>
28
+ </Card>
29
+ <Card component="div">
30
+ <DescriptionListTerm>Annotation</DescriptionListTerm>
31
+ <DescriptionListDescription>2 Annotations</DescriptionListDescription>
32
+ </Card>
33
+ </DescriptionList>
34
+ );
@@ -0,0 +1,62 @@
1
+ import React from 'react';
2
+ import {
3
+ Button,
4
+ DescriptionList,
5
+ DescriptionListTerm,
6
+ DescriptionListDescription,
7
+ Card,
8
+ Checkbox
9
+ } from '@patternfly/react-core';
10
+ import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
11
+
12
+ export const DescriptionListWithCard: React.FunctionComponent = () => {
13
+ const [isChecked, setIsChecked] = React.useState<boolean>(false);
14
+ const [isSelectable, setSelectable] = React.useState<boolean>(false);
15
+
16
+ const toggleSelectable = (checked: boolean) => {
17
+ setSelectable(checked ? true : false);
18
+ setIsChecked(checked);
19
+ };
20
+ return (
21
+ <>
22
+ <div style={{ marginBottom: '12px' }}>
23
+ <Checkbox
24
+ label="isSelectable"
25
+ isChecked={isChecked}
26
+ onChange={toggleSelectable}
27
+ aria-label="set isSelectable"
28
+ id="toggle-isSelectable"
29
+ name="toggle-isSelectable"
30
+ />
31
+ </div>
32
+ <DescriptionList columnModifier={{ lg: '2Col' }}>
33
+ <Card component="div" isSelectable={isSelectable}>
34
+ <DescriptionListTerm>Name</DescriptionListTerm>
35
+ <DescriptionListDescription>Example</DescriptionListDescription>
36
+ </Card>
37
+ <Card component="div" isSelectable={isSelectable}>
38
+ <DescriptionListTerm>Namespace</DescriptionListTerm>
39
+ <DescriptionListDescription>
40
+ <a href="#">mary-test</a>
41
+ </DescriptionListDescription>
42
+ </Card>
43
+ <Card component="div" isSelectable={isSelectable}>
44
+ <DescriptionListTerm>Labels</DescriptionListTerm>
45
+ <DescriptionListDescription>example</DescriptionListDescription>
46
+ </Card>
47
+ <Card component="div" isSelectable={isSelectable}>
48
+ <DescriptionListTerm>Pod selector</DescriptionListTerm>
49
+ <DescriptionListDescription>
50
+ <Button variant="link" isInline icon={<PlusCircleIcon />}>
51
+ app=MyApp
52
+ </Button>
53
+ </DescriptionListDescription>
54
+ </Card>
55
+ <Card component="div" isSelectable={isSelectable}>
56
+ <DescriptionListTerm>Annotation</DescriptionListTerm>
57
+ <DescriptionListDescription>2 Annotations</DescriptionListDescription>
58
+ </Card>
59
+ </DescriptionList>
60
+ </>
61
+ );
62
+ };
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+ import {
3
+ Button,
4
+ DescriptionList,
5
+ DescriptionListTerm,
6
+ DescriptionListGroup,
7
+ DescriptionListDescription,
8
+ Checkbox
9
+ } from '@patternfly/react-core';
10
+ import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
11
+
12
+ export const DescriptionListWithDisplaySize: React.FunctionComponent = () => {
13
+ const [isChecked, setIsChecked] = React.useState<boolean>(false);
14
+ const [displaySize, setDisplaySize] = React.useState<'lg' | '2xl'>('lg');
15
+
16
+ const toggleDisplaySize = (checked: boolean) => {
17
+ setDisplaySize(checked ? '2xl' : 'lg');
18
+ setIsChecked(checked);
19
+ };
20
+
21
+ return (
22
+ <>
23
+ <div style={{ marginBottom: '12px' }}>
24
+ <Checkbox
25
+ label="displaySize 2xl"
26
+ isChecked={isChecked}
27
+ onChange={toggleDisplaySize}
28
+ aria-label="set display size 2xl"
29
+ id="toggle-display-size"
30
+ name="toggle-display-size"
31
+ />
32
+ </div>
33
+ <DescriptionList displaySize={displaySize} columnModifier={{ lg: '2Col' }}>
34
+ <DescriptionListGroup>
35
+ <DescriptionListTerm>Name</DescriptionListTerm>
36
+ <DescriptionListDescription>Example</DescriptionListDescription>
37
+ </DescriptionListGroup>
38
+ <DescriptionListGroup>
39
+ <DescriptionListTerm>Namespace</DescriptionListTerm>
40
+ <DescriptionListDescription>
41
+ <a href="#">mary-test</a>
42
+ </DescriptionListDescription>
43
+ </DescriptionListGroup>
44
+ <DescriptionListGroup>
45
+ <DescriptionListTerm>Labels</DescriptionListTerm>
46
+ <DescriptionListDescription>example</DescriptionListDescription>
47
+ </DescriptionListGroup>
48
+ <DescriptionListGroup>
49
+ <DescriptionListTerm>Pod selector</DescriptionListTerm>
50
+ <DescriptionListDescription>
51
+ <Button variant="link" isInline icon={<PlusCircleIcon />}>
52
+ app=MyApp
53
+ </Button>
54
+ </DescriptionListDescription>
55
+ </DescriptionListGroup>
56
+ <DescriptionListGroup>
57
+ <DescriptionListTerm>Annotation</DescriptionListTerm>
58
+ <DescriptionListDescription>2 Annotations</DescriptionListDescription>
59
+ </DescriptionListGroup>
60
+ </DescriptionList>
61
+ </>
62
+ );
63
+ };