@patternfly/react-core 4.164.1 → 4.168.4

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 (158) hide show
  1. package/CHANGELOG.md +145 -0
  2. package/README.md +1 -1
  3. package/dist/esm/components/Dropdown/DropdownToggle.d.ts +1 -1
  4. package/dist/esm/components/Dropdown/DropdownToggle.d.ts.map +1 -1
  5. package/dist/esm/components/Dropdown/KebabToggle.d.ts +1 -1
  6. package/dist/esm/components/Dropdown/KebabToggle.d.ts.map +1 -1
  7. package/dist/esm/components/DualListSelector/DualListSelector.d.ts +1 -0
  8. package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
  9. package/dist/esm/components/DualListSelector/DualListSelector.js +23 -10
  10. package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
  11. package/dist/esm/components/Label/Label.d.ts +2 -0
  12. package/dist/esm/components/Label/Label.d.ts.map +1 -1
  13. package/dist/esm/components/Label/Label.js +2 -2
  14. package/dist/esm/components/Label/Label.js.map +1 -1
  15. package/dist/esm/components/LabelGroup/LabelGroup.d.ts +2 -0
  16. package/dist/esm/components/LabelGroup/LabelGroup.d.ts.map +1 -1
  17. package/dist/esm/components/LabelGroup/LabelGroup.js +5 -3
  18. package/dist/esm/components/LabelGroup/LabelGroup.js.map +1 -1
  19. package/dist/esm/components/ProgressStepper/ProgressStep.d.ts +5 -1
  20. package/dist/esm/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
  21. package/dist/esm/components/ProgressStepper/ProgressStep.js +7 -3
  22. package/dist/esm/components/ProgressStepper/ProgressStep.js.map +1 -1
  23. package/dist/esm/components/Select/SelectOption.d.ts +1 -1
  24. package/dist/esm/components/Select/SelectOption.d.ts.map +1 -1
  25. package/dist/esm/components/Tabs/TabContentBody.d.ts +11 -0
  26. package/dist/esm/components/Tabs/TabContentBody.d.ts.map +1 -0
  27. package/dist/esm/components/Tabs/TabContentBody.js +10 -0
  28. package/dist/esm/components/Tabs/TabContentBody.js.map +1 -0
  29. package/dist/esm/components/Tabs/index.d.ts +1 -0
  30. package/dist/esm/components/Tabs/index.d.ts.map +1 -1
  31. package/dist/esm/components/Tabs/index.js +1 -0
  32. package/dist/esm/components/Tabs/index.js.map +1 -1
  33. package/dist/esm/components/TextInputGroup/TextInputGroup.d.ts +9 -0
  34. package/dist/esm/components/TextInputGroup/TextInputGroup.d.ts.map +1 -0
  35. package/dist/esm/components/TextInputGroup/TextInputGroup.js +10 -0
  36. package/dist/esm/components/TextInputGroup/TextInputGroup.js.map +1 -0
  37. package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts +15 -0
  38. package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -0
  39. package/dist/esm/components/TextInputGroup/TextInputGroupMain.js +15 -0
  40. package/dist/esm/components/TextInputGroup/TextInputGroupMain.js.map +1 -0
  41. package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.d.ts +9 -0
  42. package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.d.ts.map +1 -0
  43. package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.js +10 -0
  44. package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.js.map +1 -0
  45. package/dist/esm/components/TextInputGroup/index.d.ts +4 -0
  46. package/dist/esm/components/TextInputGroup/index.d.ts.map +1 -0
  47. package/dist/esm/components/TextInputGroup/index.js +4 -0
  48. package/dist/esm/components/TextInputGroup/index.js.map +1 -0
  49. package/dist/esm/components/Toolbar/Toolbar.d.ts +2 -0
  50. package/dist/esm/components/Toolbar/Toolbar.d.ts.map +1 -1
  51. package/dist/esm/components/Toolbar/Toolbar.js +2 -2
  52. package/dist/esm/components/Toolbar/Toolbar.js.map +1 -1
  53. package/dist/esm/components/index.d.ts +1 -0
  54. package/dist/esm/components/index.d.ts.map +1 -1
  55. package/dist/esm/components/index.js +1 -0
  56. package/dist/esm/components/index.js.map +1 -1
  57. package/dist/js/components/Dropdown/DropdownToggle.d.ts +1 -1
  58. package/dist/js/components/Dropdown/DropdownToggle.d.ts.map +1 -1
  59. package/dist/js/components/Dropdown/KebabToggle.d.ts +1 -1
  60. package/dist/js/components/Dropdown/KebabToggle.d.ts.map +1 -1
  61. package/dist/js/components/DualListSelector/DualListSelector.d.ts +1 -0
  62. package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
  63. package/dist/js/components/DualListSelector/DualListSelector.js +23 -10
  64. package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
  65. package/dist/js/components/Label/Label.d.ts +2 -0
  66. package/dist/js/components/Label/Label.d.ts.map +1 -1
  67. package/dist/js/components/Label/Label.js +2 -2
  68. package/dist/js/components/Label/Label.js.map +1 -1
  69. package/dist/js/components/LabelGroup/LabelGroup.d.ts +2 -0
  70. package/dist/js/components/LabelGroup/LabelGroup.d.ts.map +1 -1
  71. package/dist/js/components/LabelGroup/LabelGroup.js +5 -3
  72. package/dist/js/components/LabelGroup/LabelGroup.js.map +1 -1
  73. package/dist/js/components/ProgressStepper/ProgressStep.d.ts +5 -1
  74. package/dist/js/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
  75. package/dist/js/components/ProgressStepper/ProgressStep.js +7 -4
  76. package/dist/js/components/ProgressStepper/ProgressStep.js.map +1 -1
  77. package/dist/js/components/Select/SelectOption.d.ts +1 -1
  78. package/dist/js/components/Select/SelectOption.d.ts.map +1 -1
  79. package/dist/js/components/Tabs/TabContentBody.d.ts +11 -0
  80. package/dist/js/components/Tabs/TabContentBody.d.ts.map +1 -0
  81. package/dist/js/components/Tabs/TabContentBody.js +14 -0
  82. package/dist/js/components/Tabs/TabContentBody.js.map +1 -0
  83. package/dist/js/components/Tabs/index.d.ts +1 -0
  84. package/dist/js/components/Tabs/index.d.ts.map +1 -1
  85. package/dist/js/components/Tabs/index.js +1 -0
  86. package/dist/js/components/Tabs/index.js.map +1 -1
  87. package/dist/js/components/TextInputGroup/TextInputGroup.d.ts +9 -0
  88. package/dist/js/components/TextInputGroup/TextInputGroup.d.ts.map +1 -0
  89. package/dist/js/components/TextInputGroup/TextInputGroup.js +14 -0
  90. package/dist/js/components/TextInputGroup/TextInputGroup.js.map +1 -0
  91. package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts +15 -0
  92. package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -0
  93. package/dist/js/components/TextInputGroup/TextInputGroupMain.js +19 -0
  94. package/dist/js/components/TextInputGroup/TextInputGroupMain.js.map +1 -0
  95. package/dist/js/components/TextInputGroup/TextInputGroupUtilities.d.ts +9 -0
  96. package/dist/js/components/TextInputGroup/TextInputGroupUtilities.d.ts.map +1 -0
  97. package/dist/js/components/TextInputGroup/TextInputGroupUtilities.js +14 -0
  98. package/dist/js/components/TextInputGroup/TextInputGroupUtilities.js.map +1 -0
  99. package/dist/js/components/TextInputGroup/index.d.ts +4 -0
  100. package/dist/js/components/TextInputGroup/index.d.ts.map +1 -0
  101. package/dist/js/components/TextInputGroup/index.js +7 -0
  102. package/dist/js/components/TextInputGroup/index.js.map +1 -0
  103. package/dist/js/components/Toolbar/Toolbar.d.ts +2 -0
  104. package/dist/js/components/Toolbar/Toolbar.d.ts.map +1 -1
  105. package/dist/js/components/Toolbar/Toolbar.js +2 -2
  106. package/dist/js/components/Toolbar/Toolbar.js.map +1 -1
  107. package/dist/js/components/index.d.ts +1 -0
  108. package/dist/js/components/index.d.ts.map +1 -1
  109. package/dist/js/components/index.js +1 -0
  110. package/dist/js/components/index.js.map +1 -1
  111. package/dist/styles/assets/pficon/pficon.woff +0 -0
  112. package/dist/styles/assets/pficon/pficon.woff2 +0 -0
  113. package/dist/umd/react-core.css +360 -17
  114. package/dist/umd/react-core.js +970 -890
  115. package/dist/umd/react-core.min.css +360 -17
  116. package/dist/umd/react-core.min.js +3 -3
  117. package/package.json +6 -6
  118. package/src/components/Dropdown/DropdownToggle.tsx +1 -1
  119. package/src/components/Dropdown/KebabToggle.tsx +1 -1
  120. package/src/components/DualListSelector/DualListSelector.tsx +25 -23
  121. package/src/components/Label/Label.tsx +4 -0
  122. package/src/components/Label/__tests__/Generated/__snapshots__/Label.test.tsx.snap +0 -1
  123. package/src/components/Label/examples/Label.md +72 -42
  124. package/src/components/LabelGroup/LabelGroup.tsx +10 -1
  125. package/src/components/LabelGroup/__tests__/LabelGroup.test.tsx +12 -0
  126. package/src/components/LabelGroup/__tests__/__snapshots__/LabelGroup.test.tsx.snap +8 -0
  127. package/src/components/Modal/__tests__/ModalBox.test.tsx +11 -21
  128. package/src/components/Modal/__tests__/ModalBoxDescription.test.tsx +12 -0
  129. package/src/components/Modal/__tests__/ModalBoxTitle.test.tsx +59 -0
  130. package/src/components/Modal/__tests__/ModalContent.test.tsx +15 -10
  131. package/src/components/Modal/__tests__/__snapshots__/ModalBox.test.tsx.snap +12 -30
  132. package/src/components/Modal/__tests__/__snapshots__/ModalBoxDescription.test.tsx.snap +10 -0
  133. package/src/components/Modal/__tests__/__snapshots__/ModalBoxTitle.test.tsx.snap +158 -0
  134. package/src/components/Modal/__tests__/__snapshots__/ModalContent.test.tsx.snap +53 -22
  135. package/src/components/ProgressStepper/ProgressStep.tsx +18 -4
  136. package/src/components/ProgressStepper/__tests__/ProgressStepper.test.tsx +5 -0
  137. package/src/components/ProgressStepper/__tests__/__snapshots__/ProgressStepper.test.tsx.snap +680 -517
  138. package/src/components/ProgressStepper/examples/ProgressStepper.md +78 -0
  139. package/src/components/Select/SelectOption.tsx +1 -1
  140. package/src/components/Tabs/TabContentBody.tsx +24 -0
  141. package/src/components/Tabs/__tests__/Tabs.test.tsx +4 -3
  142. package/src/components/Tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +10 -2
  143. package/src/components/Tabs/examples/Tabs.md +40 -0
  144. package/src/components/Tabs/index.ts +1 -0
  145. package/src/components/TextInputGroup/TextInputGroup.tsx +22 -0
  146. package/src/components/TextInputGroup/TextInputGroupMain.tsx +43 -0
  147. package/src/components/TextInputGroup/TextInputGroupUtilities.tsx +22 -0
  148. package/src/components/TextInputGroup/__tests__/TextInputGroup.test.tsx +77 -0
  149. package/src/components/TextInputGroup/__tests__/__snapshots__/TextInputGroup.test.tsx.snap +211 -0
  150. package/src/components/TextInputGroup/examples/TextInputGroup.md +138 -0
  151. package/src/components/TextInputGroup/index.ts +3 -0
  152. package/src/components/Toolbar/Toolbar.tsx +4 -0
  153. package/src/components/Wizard/examples/Wizard.md +17 -1
  154. package/src/components/index.ts +1 -0
  155. package/src/demos/CardDemos.md +5 -5
  156. package/src/demos/ProgressDemo.md +82 -0
  157. package/src/demos/Tabs.md +439 -0
  158. package/src/demos/examples/DashboardWrapper.js +16 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.164.1",
3
+ "version": "4.168.4",
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,16 +34,16 @@
34
34
  "generate": "node scripts/copyStyles.js"
35
35
  },
36
36
  "dependencies": {
37
- "@patternfly/react-icons": "^4.15.1",
38
- "@patternfly/react-styles": "^4.14.1",
39
- "@patternfly/react-tokens": "^4.16.1",
37
+ "@patternfly/react-icons": "^4.19.4",
38
+ "@patternfly/react-styles": "^4.18.4",
39
+ "@patternfly/react-tokens": "^4.20.4",
40
40
  "focus-trap": "6.2.2",
41
41
  "react-dropzone": "9.0.0",
42
42
  "tippy.js": "5.1.2",
43
43
  "tslib": "^2.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@patternfly/patternfly": "4.147.1",
46
+ "@patternfly/patternfly": "4.151.3",
47
47
  "@rollup/plugin-commonjs": "^21.0.0",
48
48
  "@rollup/plugin-node-resolve": "^13.0.0",
49
49
  "@rollup/plugin-replace": "^3.0.0",
@@ -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": "ee038be10e2fb095affe47c5a31af65564fd2442"
63
+ "gitHead": "84c2450e8f45e7807dc1e35a09dbb399d2aa282e"
64
64
  }
@@ -16,7 +16,7 @@ export interface DropdownToggleProps extends React.HTMLProps<HTMLButtonElement>,
16
16
  /** Flag to indicate if menu is opened */
17
17
  isOpen?: boolean;
18
18
  /** Callback called when toggle is clicked */
19
- onToggle?: (isOpen: boolean) => void;
19
+ onToggle?: (value: boolean, event: any) => void;
20
20
  /** Element which wraps toggle */
21
21
  parentRef?: HTMLElement;
22
22
  /** The menu element */
@@ -15,7 +15,7 @@ export interface KebabToggleProps extends DropdownToggleProps {
15
15
  /** Label Toggle button */
16
16
  'aria-label'?: string;
17
17
  /** Callback called when toggle is clicked */
18
- onToggle?: (isOpen: boolean) => void;
18
+ onToggle?: (value: boolean, event: any) => void;
19
19
  /** Element which wraps toggle */
20
20
  parentRef?: any;
21
21
  /** The menu element */
@@ -149,8 +149,27 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
149
149
  isTree: false,
150
150
  isDisabled: false
151
151
  };
152
- private originalAvailableCopy = this.props.availableOptions;
153
- private originalChosenCopy = this.props.chosenOptions;
152
+ private originalAvailableCopy = JSON.parse(JSON.stringify(this.props.availableOptions));
153
+ private originalChosenCopy = JSON.parse(JSON.stringify(this.props.chosenOptions));
154
+
155
+ // If the DualListSelector uses trees, concat the two initial arrays and merge duplicate folder IDs
156
+ private mergedCopy = this.props.isTree
157
+ ? Object.values(
158
+ (this.originalAvailableCopy as DualListSelectorTreeItemData[])
159
+ .concat(this.originalChosenCopy as DualListSelectorTreeItemData[])
160
+ .reduce((mapObj: any, item: DualListSelectorTreeItemData) => {
161
+ const key = item.id;
162
+ if (mapObj[key]) {
163
+ // If map already has an item ID, add the dupe ID's children to the existing map
164
+ mapObj[key].children.push(...item.children);
165
+ } else {
166
+ // Else clone the item data
167
+ mapObj[key] = { ...item };
168
+ }
169
+ return mapObj;
170
+ }, {})
171
+ )
172
+ : null;
154
173
 
155
174
  constructor(props: DualListSelectorProps) {
156
175
  super(props);
@@ -250,18 +269,13 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
250
269
  const movedOptions =
251
270
  prevState.availableTreeFilteredOptions ||
252
271
  flattenTreeWithFolders(prevState.availableOptions as DualListSelectorTreeItemData[]);
253
-
254
272
  const newAvailable = prevState.availableOptions
255
273
  .map(opt => Object.assign({}, opt))
256
274
  .filter(item => filterRestTreeItems(item as DualListSelectorTreeItemData, movedOptions));
257
275
 
258
276
  const currChosen = flattenTree(prevState.chosenOptions as DualListSelectorTreeItemData[]);
259
277
  const nextChosenOptions = currChosen.concat(movedOptions);
260
-
261
- const allOptions = (this.originalAvailableCopy as DualListSelectorTreeItemData[]).concat(
262
- this.originalChosenCopy as DualListSelectorTreeItemData[]
263
- );
264
- const newChosen = allOptions
278
+ const newChosen = this.mergedCopy
265
279
  .map(opt => Object.assign({}, opt))
266
280
  .filter(item => filterTreeItemsWithoutFolders(item as DualListSelectorTreeItemData, nextChosenOptions));
267
281
 
@@ -316,10 +330,7 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
316
330
  // Get next chosen options from current + new nodes and remap from base
317
331
  const currChosen = flattenTree(prevState.chosenOptions as DualListSelectorTreeItemData[]);
318
332
  const nextChosenOptions = currChosen.concat(prevState.availableTreeOptionsChecked);
319
- const allOptions = (this.originalAvailableCopy as DualListSelectorTreeItemData[]).concat(
320
- this.originalChosenCopy as DualListSelectorTreeItemData[]
321
- );
322
- const newChosen = allOptions
333
+ const newChosen = this.mergedCopy
323
334
  .map(opt => Object.assign({}, opt))
324
335
  .filter(item => filterTreeItemsWithoutFolders(item as DualListSelectorTreeItemData, nextChosenOptions));
325
336
 
@@ -372,11 +383,7 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
372
383
  .filter(item => filterRestTreeItems(item as DualListSelectorTreeItemData, movedOptions));
373
384
  const currAvailable = flattenTree(prevState.availableOptions as DualListSelectorTreeItemData[]);
374
385
  const nextAvailableOptions = currAvailable.concat(movedOptions);
375
-
376
- const allOptions = (this.originalAvailableCopy as DualListSelectorTreeItemData[]).concat(
377
- this.originalChosenCopy as DualListSelectorTreeItemData[]
378
- );
379
- const newAvailable = allOptions
386
+ const newAvailable = this.mergedCopy
380
387
  .map(opt => Object.assign({}, opt))
381
388
  .filter(item => filterTreeItemsWithoutFolders(item as DualListSelectorTreeItemData, nextAvailableOptions));
382
389
 
@@ -427,11 +434,7 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
427
434
  // Get next chosen options from current and remap from base
428
435
  const currAvailable = flattenTree(prevState.availableOptions as DualListSelectorTreeItemData[]);
429
436
  const nextAvailableOptions = currAvailable.concat(prevState.chosenTreeOptionsChecked);
430
-
431
- const allOptions = (this.originalAvailableCopy as DualListSelectorTreeItemData[]).concat(
432
- this.originalChosenCopy as DualListSelectorTreeItemData[]
433
- );
434
- const newAvailable = allOptions
437
+ const newAvailable = this.mergedCopy
435
438
  .map(opt => Object.assign({}, opt))
436
439
  .filter(item => filterTreeItemsWithoutFolders(item as DualListSelectorTreeItemData, nextAvailableOptions));
437
440
 
@@ -616,7 +619,6 @@ export class DualListSelector extends React.Component<DualListSelectorProps, Dua
616
619
  chosenTreeOptionsChecked,
617
620
  availableTreeOptionsChecked
618
621
  } = this.state;
619
-
620
622
  const availableOptionsStatusToDisplay =
621
623
  availableOptionsStatus ||
622
624
  (isTree
@@ -18,6 +18,8 @@ export interface LabelProps extends React.HTMLProps<HTMLSpanElement> {
18
18
  color?: 'blue' | 'cyan' | 'green' | 'orange' | 'purple' | 'red' | 'grey';
19
19
  /** Variant of the label. */
20
20
  variant?: 'outline' | 'filled';
21
+ /** Flag indicating the label is compact. */
22
+ isCompact?: boolean;
21
23
  /** Flag indicating the label is editable. */
22
24
  isEditable?: boolean;
23
25
  /** Additional props passed to the editable label text div. Optionally passing onInput and onBlur callbacks will allow finer custom text input control. */
@@ -71,6 +73,7 @@ export const Label: React.FunctionComponent<LabelProps> = ({
71
73
  className = '',
72
74
  color = 'grey',
73
75
  variant = 'filled',
76
+ isCompact = false,
74
77
  isEditable = false,
75
78
  editableProps,
76
79
  isTruncated = false,
@@ -237,6 +240,7 @@ export const Label: React.FunctionComponent<LabelProps> = ({
237
240
  colorStyles[color],
238
241
  variant === 'outline' && styles.modifiers.outline,
239
242
  isOverflowLabel && styles.modifiers.overflow,
243
+ isCompact && styles.modifiers.compact,
240
244
  isEditable && labelGrpStyles.modifiers.editable,
241
245
  isEditableActive && styles.modifiers.editableActive,
242
246
  className
@@ -3,7 +3,6 @@
3
3
  exports[`Label should match snapshot (auto-generated) 1`] = `
4
4
  <span
5
5
  className="pf-c-label ''"
6
- isCompact={false}
7
6
  >
8
7
  <span
9
8
  className="pf-c-label__content"
@@ -19,13 +19,13 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
19
19
 
20
20
  <React.Fragment>
21
21
  <Label>Grey</Label> <Label icon={<InfoCircleIcon />}>Grey icon</Label>{' '}
22
- <Label onClose={Function.prototype}>Grey removeable</Label>{' '}
22
+ <Label onClose={Function.prototype}>Grey removable</Label>{' '}
23
23
  <Label icon={<InfoCircleIcon />} onClose={Function.prototype}>
24
- Grey icon removeable
24
+ Grey icon removable
25
25
  </Label>{' '}
26
26
  <Label href="#filled">Grey link</Label>{' '}
27
27
  <Label href="#filled" onClose={Function.prototype}>
28
- Grey link removeable
28
+ Grey link removable
29
29
  </Label>
30
30
  <Label icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
31
31
  Grey label with icon that overflows
@@ -37,16 +37,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
37
37
  Blue icon
38
38
  </Label>{' '}
39
39
  <Label color="blue" onClose={Function.prototype}>
40
- Blue removeable
40
+ Blue removable
41
41
  </Label>{' '}
42
42
  <Label color="blue" icon={<InfoCircleIcon />} onClose={Function.prototype}>
43
- Blue icon removeable
43
+ Blue icon removable
44
44
  </Label>{' '}
45
45
  <Label color="blue" href="#filled">
46
46
  Blue link
47
47
  </Label>{' '}
48
48
  <Label color="blue" href="#filled" onClose={Function.prototype}>
49
- Blue link removeable
49
+ Blue link removable
50
50
  </Label>
51
51
  <Label color="blue" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
52
52
  Blue label with icon that overflows
@@ -58,16 +58,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
58
58
  Green icon
59
59
  </Label>{' '}
60
60
  <Label color="green" onClose={Function.prototype}>
61
- Green removeable
61
+ Green removable
62
62
  </Label>{' '}
63
63
  <Label color="green" icon={<InfoCircleIcon />} onClose={Function.prototype}>
64
- Green icon removeable
64
+ Green icon removable
65
65
  </Label>{' '}
66
66
  <Label color="green" href="#filled">
67
67
  Green link
68
68
  </Label>{' '}
69
69
  <Label color="green" href="#filled" onClose={Function.prototype}>
70
- Green link removeable
70
+ Green link removable
71
71
  </Label>
72
72
  <Label color="green" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
73
73
  Green label with icon that overflows
@@ -79,16 +79,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
79
79
  Orange icon
80
80
  </Label>{' '}
81
81
  <Label color="orange" onClose={Function.prototype}>
82
- Orange removeable
82
+ Orange removable
83
83
  </Label>{' '}
84
84
  <Label color="orange" icon={<InfoCircleIcon />} onClose={Function.prototype}>
85
- Orange icon removeable
85
+ Orange icon removable
86
86
  </Label>{' '}
87
87
  <Label color="orange" href="#filled">
88
88
  Orange link
89
89
  </Label>{' '}
90
90
  <Label color="orange" href="#filled" onClose={Function.prototype}>
91
- Orange link removeable
91
+ Orange link removable
92
92
  </Label>
93
93
  <Label color="orange" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
94
94
  Orange label with icon that overflows
@@ -100,16 +100,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
100
100
  Red icon
101
101
  </Label>{' '}
102
102
  <Label color="red" onClose={Function.prototype}>
103
- Red removeable
103
+ Red removable
104
104
  </Label>{' '}
105
105
  <Label color="red" icon={<InfoCircleIcon />} onClose={Function.prototype}>
106
- Red icon removeable
106
+ Red icon removable
107
107
  </Label>{' '}
108
108
  <Label color="red" href="#filled">
109
109
  Red link
110
110
  </Label>{' '}
111
111
  <Label color="red" href="#filled" onClose={Function.prototype}>
112
- Red link removeable
112
+ Red link removable
113
113
  </Label>
114
114
  <Label color="red" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
115
115
  Red label with icon that overflows
@@ -121,16 +121,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
121
121
  Purple icon
122
122
  </Label>{' '}
123
123
  <Label color="purple" onClose={Function.prototype}>
124
- Purple removeable
124
+ Purple removable
125
125
  </Label>{' '}
126
126
  <Label color="purple" icon={<InfoCircleIcon />} onClose={Function.prototype}>
127
- Purple icon removeable
127
+ Purple icon removable
128
128
  </Label>{' '}
129
129
  <Label color="purple" href="#filled">
130
130
  Purple link
131
131
  </Label>{' '}
132
132
  <Label color="purple" href="#filled" onClose={Function.prototype}>
133
- Purple link removeable
133
+ Purple link removable
134
134
  </Label>
135
135
  <Label color="purple" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
136
136
  Purple label with icon that overflows
@@ -142,16 +142,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
142
142
  Cyan icon
143
143
  </Label>{' '}
144
144
  <Label color="cyan" onClose={Function.prototype}>
145
- Cyan removeable
145
+ Cyan removable
146
146
  </Label>{' '}
147
147
  <Label color="cyan" icon={<InfoCircleIcon />} onClose={Function.prototype}>
148
- Cyan icon removeable
148
+ Cyan icon removable
149
149
  </Label>{' '}
150
150
  <Label color="cyan" href="#filled">
151
151
  Cyan link
152
152
  </Label>{' '}
153
153
  <Label color="cyan" href="#filled" onClose={Function.prototype}>
154
- Cyan link removeable
154
+ Cyan link removable
155
155
  </Label>
156
156
  <Label color="cyan" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
157
157
  Cyan label with icon that overflows
@@ -172,16 +172,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
172
172
  Grey icon
173
173
  </Label>{' '}
174
174
  <Label variant="outline" onClose={Function.prototype}>
175
- Grey removeable
175
+ Grey removable
176
176
  </Label>{' '}
177
177
  <Label variant="outline" icon={<InfoCircleIcon />} onClose={Function.prototype}>
178
- Grey icon removeable
178
+ Grey icon removable
179
179
  </Label>{' '}
180
180
  <Label variant="outline" href="#outline">
181
181
  Grey link
182
182
  </Label>{' '}
183
183
  <Label variant="outline" href="#outline" onClose={Function.prototype}>
184
- Grey link removeable
184
+ Grey link removable
185
185
  </Label>
186
186
  <Label variant="outline" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
187
187
  Grey label with icon that overflows
@@ -195,16 +195,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
195
195
  Blue icon
196
196
  </Label>{' '}
197
197
  <Label variant="outline" color="blue" onClose={Function.prototype}>
198
- Blue removeable
198
+ Blue removable
199
199
  </Label>{' '}
200
200
  <Label variant="outline" color="blue" icon={<InfoCircleIcon />} onClose={Function.prototype}>
201
- Blue icon removeable
201
+ Blue icon removable
202
202
  </Label>{' '}
203
203
  <Label variant="outline" color="blue" href="#outline">
204
204
  Blue link
205
205
  </Label>{' '}
206
206
  <Label variant="outline" color="blue" href="#outline" onClose={Function.prototype}>
207
- Blue link removeable
207
+ Blue link removable
208
208
  </Label>
209
209
  <Label variant="outline" color="blue" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
210
210
  Blue label with icon that overflows
@@ -218,16 +218,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
218
218
  Green icon
219
219
  </Label>{' '}
220
220
  <Label variant="outline" color="green" onClose={Function.prototype}>
221
- Green removeable
221
+ Green removable
222
222
  </Label>{' '}
223
223
  <Label variant="outline" color="green" icon={<InfoCircleIcon />} onClose={Function.prototype}>
224
- Green icon removeable
224
+ Green icon removable
225
225
  </Label>{' '}
226
226
  <Label variant="outline" color="green" href="#outline">
227
227
  Green link
228
228
  </Label>{' '}
229
229
  <Label variant="outline" color="green" href="#outline" onClose={Function.prototype}>
230
- Green link removeable
230
+ Green link removable
231
231
  </Label>
232
232
  <Label variant="outline" color="green" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
233
233
  Green label with icon that overflows
@@ -241,16 +241,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
241
241
  Orange icon
242
242
  </Label>{' '}
243
243
  <Label variant="outline" color="orange" onClose={Function.prototype}>
244
- Orange removeable
244
+ Orange removable
245
245
  </Label>{' '}
246
246
  <Label variant="outline" color="orange" icon={<InfoCircleIcon />} onClose={Function.prototype}>
247
- Orange icon removeable
247
+ Orange icon removable
248
248
  </Label>{' '}
249
249
  <Label variant="outline" color="orange" href="#outline">
250
250
  Orange link
251
251
  </Label>{' '}
252
252
  <Label variant="outline" color="orange" href="#outline" onClose={Function.prototype}>
253
- Orange link removeable
253
+ Orange link removable
254
254
  </Label>
255
255
  <Label variant="outline" color="orange" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
256
256
  Orange label with icon that overflows
@@ -264,16 +264,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
264
264
  Red icon
265
265
  </Label>{' '}
266
266
  <Label variant="outline" color="red" onClose={Function.prototype}>
267
- Red removeable
267
+ Red removable
268
268
  </Label>{' '}
269
269
  <Label variant="outline" color="red" icon={<InfoCircleIcon />} onClose={Function.prototype}>
270
- Red icon removeable
270
+ Red icon removable
271
271
  </Label>{' '}
272
272
  <Label variant="outline" color="red" href="#outline">
273
273
  Red link
274
274
  </Label>{' '}
275
275
  <Label variant="outline" color="red" href="#outline" onClose={Function.prototype}>
276
- Red link removeable
276
+ Red link removable
277
277
  </Label>
278
278
  <Label variant="outline" color="red" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
279
279
  Red label with icon that overflows
@@ -287,16 +287,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
287
287
  Purple icon
288
288
  </Label>{' '}
289
289
  <Label variant="outline" color="purple" onClose={Function.prototype}>
290
- Purple removeable
290
+ Purple removable
291
291
  </Label>{' '}
292
292
  <Label variant="outline" color="purple" icon={<InfoCircleIcon />} onClose={Function.prototype}>
293
- Purple icon removeable
293
+ Purple icon removable
294
294
  </Label>{' '}
295
295
  <Label variant="outline" color="purple" href="#outline">
296
296
  Purple link
297
297
  </Label>{' '}
298
298
  <Label variant="outline" color="purple" href="#outline" onClose={Function.prototype}>
299
- Purple link removeable
299
+ Purple link removable
300
300
  </Label>
301
301
  <Label variant="outline" color="purple" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
302
302
  Purple label with icon that overflows
@@ -310,16 +310,16 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
310
310
  Cyan icon
311
311
  </Label>{' '}
312
312
  <Label variant="outline" color="cyan" onClose={Function.prototype}>
313
- Cyan removeable
313
+ Cyan removable
314
314
  </Label>{' '}
315
315
  <Label variant="outline" color="cyan" icon={<InfoCircleIcon />} onClose={Function.prototype}>
316
- Cyan icon removeable
316
+ Cyan icon removable
317
317
  </Label>{' '}
318
318
  <Label variant="outline" color="cyan" href="#outline">
319
319
  Cyan link
320
320
  </Label>{' '}
321
321
  <Label variant="outline" color="cyan" href="#outline" onClose={Function.prototype}>
322
- Cyan link removeable
322
+ Cyan link removable
323
323
  </Label>
324
324
  <Label variant="outline" color="cyan" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
325
325
  Cyan label with icon that overflows
@@ -327,6 +327,36 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
327
327
  </React.Fragment>;
328
328
  ```
329
329
 
330
+ ### Compact
331
+
332
+ ```js
333
+ import React from 'react';
334
+ import { Label } from '@patternfly/react-core';
335
+ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
336
+
337
+ <React.Fragment>
338
+ <Label isCompact>Grey</Label>{' '}
339
+ <Label isCompact icon={<InfoCircleIcon />}>
340
+ Compact icon
341
+ </Label>{' '}
342
+ <Label isCompact onClose={Function.prototype}>
343
+ Compact removable
344
+ </Label>{' '}
345
+ <Label isCompact icon={<InfoCircleIcon />} onClose={Function.prototype}>
346
+ Compact icon removable
347
+ </Label>{' '}
348
+ <Label isCompact href="#outline">
349
+ Compact link
350
+ </Label>{' '}
351
+ <Label isCompact href="#outline" onClose={Function.prototype}>
352
+ Compact link removable
353
+ </Label>
354
+ <Label isCompact icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
355
+ Compact label with icon that overflows
356
+ </Label>
357
+ </React.Fragment>;
358
+ ```
359
+
330
360
  ### Router link
331
361
 
332
362
  ```js
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import styles from '@patternfly/react-styles/css/components/LabelGroup/label-group';
3
+ import labelStyles from '@patternfly/react-styles/css/components/Label/label';
3
4
  import { css } from '@patternfly/react-styles';
4
5
  import { Button } from '../Button';
5
6
  import { Label } from '../Label';
@@ -27,6 +28,8 @@ export interface LabelGroupProps extends React.HTMLProps<HTMLUListElement> {
27
28
  numLabels?: number;
28
29
  /** Flag if label group can be closed */
29
30
  isClosable?: boolean;
31
+ /** Flag indicating the labels in the group are compact */
32
+ isCompact?: boolean;
30
33
  /** Aria label for close button */
31
34
  closeBtnAriaLabel?: string;
32
35
  /** Function that is called when clicking on the label group close button */
@@ -66,6 +69,7 @@ export class LabelGroup extends React.Component<LabelGroupProps, LabelGroupState
66
69
  defaultIsOpen: false,
67
70
  numLabels: 3,
68
71
  isClosable: false,
72
+ isCompact: false,
69
73
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
70
74
  onClick: (_e: React.MouseEvent) => undefined as any,
71
75
  closeBtnAriaLabel: 'Close label group',
@@ -121,6 +125,7 @@ export class LabelGroup extends React.Component<LabelGroupProps, LabelGroupState
121
125
  children,
122
126
  className,
123
127
  isClosable,
128
+ isCompact,
124
129
  closeBtnAriaLabel,
125
130
  'aria-label': ariaLabel,
126
131
  onClick,
@@ -165,7 +170,11 @@ export class LabelGroup extends React.Component<LabelGroupProps, LabelGroupState
165
170
  ))}
166
171
  {numChildren > numLabels && (
167
172
  <li className={css(styles.labelGroupListItem)}>
168
- <Label isOverflowLabel onClick={this.toggleCollapse}>
173
+ <Label
174
+ isOverflowLabel
175
+ onClick={this.toggleCollapse}
176
+ className={css(isCompact && labelStyles.modifiers.compact)}
177
+ >
169
178
  {isOpen ? expandedText : collapsedTextResult}
170
179
  </Label>
171
180
  </li>
@@ -60,4 +60,16 @@ describe('LabelGroup', () => {
60
60
  );
61
61
  expect(view).toMatchSnapshot();
62
62
  });
63
+
64
+ test('label group compact', () => {
65
+ const view = shallow(
66
+ <LabelGroup isCompact>
67
+ <Label isCompact>1</Label>
68
+ <Label isCompact>2</Label>
69
+ <Label isCompact>3</Label>
70
+ <Label isCompact>4</Label>
71
+ </LabelGroup>
72
+ );
73
+ expect(view).toMatchSnapshot();
74
+ });
63
75
  });
@@ -1,5 +1,13 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`LabelGroup label group compact 1`] = `
4
+ <GenerateId
5
+ prefix="pf-random-id-"
6
+ >
7
+ <Component />
8
+ </GenerateId>
9
+ `;
10
+
3
11
  exports[`LabelGroup label group default 1`] = `
4
12
  <GenerateId
5
13
  prefix="pf-random-id-"
@@ -2,65 +2,55 @@ import * as React from 'react';
2
2
  import { shallow } from 'enzyme';
3
3
 
4
4
  import { ModalBox } from '../ModalBox';
5
- import BullhornIcon from '@patternfly/react-icons/dist/esm/icons/bullhorn-icon';
6
5
 
7
6
  test('ModalBox Test', () => {
8
7
  const view = shallow(
9
- <ModalBox title="Test Modal Box" id="boxId">
8
+ <ModalBox aria-describedby="Test Modal Box" id="boxId">
10
9
  This is a ModalBox
11
10
  </ModalBox>
12
11
  );
13
12
  expect(view).toMatchSnapshot();
14
13
  });
15
14
 
16
- test('ModalBox Test isLarge', () => {
15
+ test('ModalBox Test large', () => {
17
16
  const view = shallow(
18
- <ModalBox title="Test Modal Box" id="boxId" isLarge>
17
+ <ModalBox aria-describedby="Test Modal Box" id="boxId" variant="large">
19
18
  This is a ModalBox
20
19
  </ModalBox>
21
20
  );
22
21
  expect(view).toMatchSnapshot();
23
22
  });
24
23
 
25
- test('ModalBox Test isSmall', () => {
24
+ test('ModalBox Test medium', () => {
26
25
  const view = shallow(
27
- <ModalBox title="Test Modal Box" id="boxId" isSmall>
26
+ <ModalBox aria-describedby="Test Modal Box" id="boxId" variant="medium">
28
27
  This is a ModalBox
29
28
  </ModalBox>
30
29
  );
31
30
  expect(view).toMatchSnapshot();
32
31
  });
33
32
 
34
- test('ModalBox Test top aligned', () => {
33
+ test('ModalBox Test small', () => {
35
34
  const view = shallow(
36
- <ModalBox title="Test Modal Box" id="boxId" position="top">
35
+ <ModalBox aria-describedby="Test Modal Box" id="boxId" variant="small">
37
36
  This is a ModalBox
38
37
  </ModalBox>
39
38
  );
40
39
  expect(view).toMatchSnapshot();
41
40
  });
42
41
 
43
- test('ModalBox Test top aligned distance', () => {
44
- const view = shallow(
45
- <ModalBox title="Test Modal Box" id="boxId" position="top" positionOffset="50px">
46
- This is a ModalBox
47
- </ModalBox>
48
- );
49
- expect(view).toMatchSnapshot();
50
- });
51
-
52
- test('ModalBox Test alert variant', () => {
42
+ test('ModalBox Test top aligned', () => {
53
43
  const view = shallow(
54
- <ModalBox title="Test Modal Box" id="boxId" titleIconVariant="warning">
44
+ <ModalBox aria-describedby="Test Modal Box" id="boxId" position="top">
55
45
  This is a ModalBox
56
46
  </ModalBox>
57
47
  );
58
48
  expect(view).toMatchSnapshot();
59
49
  });
60
50
 
61
- test('ModalBox Test custom icon variant', () => {
51
+ test('ModalBox Test top aligned distance', () => {
62
52
  const view = shallow(
63
- <ModalBox title="Test Modal Box" id="boxId" titleIconVariant={BullhornIcon}>
53
+ <ModalBox aria-describedby="Test Modal Box" id="boxId" position="top" positionOffset="50px">
64
54
  This is a ModalBox
65
55
  </ModalBox>
66
56
  );
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { shallow } from 'enzyme';
3
+ import { ModalBoxDescription } from '../ModalBoxDescription';
4
+
5
+ test('ModalBoxDescription Test', () => {
6
+ const view = shallow(
7
+ <ModalBoxDescription>
8
+ This is a ModalBox Description
9
+ </ModalBoxDescription>
10
+ );
11
+ expect(view).toMatchSnapshot();
12
+ });