@patternfly/react-core 4.166.0 → 4.168.7

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 (141) 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 +4 -4
  12. package/dist/esm/components/Label/Label.d.ts.map +1 -1
  13. package/dist/esm/components/LabelGroup/LabelGroup.d.ts +3 -3
  14. package/dist/esm/components/LabelGroup/LabelGroup.d.ts.map +1 -1
  15. package/dist/esm/components/Menu/Menu.d.ts +11 -11
  16. package/dist/esm/components/Menu/Menu.d.ts.map +1 -1
  17. package/dist/esm/components/Menu/MenuItem.d.ts +5 -5
  18. package/dist/esm/components/Menu/MenuItem.d.ts.map +1 -1
  19. package/dist/esm/components/Select/Select.d.ts +1 -1
  20. package/dist/esm/components/Select/Select.d.ts.map +1 -1
  21. package/dist/esm/components/Select/SelectOption.d.ts +1 -1
  22. package/dist/esm/components/Select/SelectOption.d.ts.map +1 -1
  23. package/dist/esm/components/TextInputGroup/TextInputGroup.d.ts +9 -0
  24. package/dist/esm/components/TextInputGroup/TextInputGroup.d.ts.map +1 -0
  25. package/dist/esm/components/TextInputGroup/TextInputGroup.js +10 -0
  26. package/dist/esm/components/TextInputGroup/TextInputGroup.js.map +1 -0
  27. package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts +15 -0
  28. package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -0
  29. package/dist/esm/components/TextInputGroup/TextInputGroupMain.js +15 -0
  30. package/dist/esm/components/TextInputGroup/TextInputGroupMain.js.map +1 -0
  31. package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.d.ts +9 -0
  32. package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.d.ts.map +1 -0
  33. package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.js +10 -0
  34. package/dist/esm/components/TextInputGroup/TextInputGroupUtilities.js.map +1 -0
  35. package/dist/esm/components/TextInputGroup/index.d.ts +4 -0
  36. package/dist/esm/components/TextInputGroup/index.d.ts.map +1 -0
  37. package/dist/esm/components/TextInputGroup/index.js +4 -0
  38. package/dist/esm/components/TextInputGroup/index.js.map +1 -0
  39. package/dist/esm/components/Toolbar/Toolbar.d.ts +2 -0
  40. package/dist/esm/components/Toolbar/Toolbar.d.ts.map +1 -1
  41. package/dist/esm/components/Toolbar/Toolbar.js +2 -2
  42. package/dist/esm/components/Toolbar/Toolbar.js.map +1 -1
  43. package/dist/esm/components/index.d.ts +1 -0
  44. package/dist/esm/components/index.d.ts.map +1 -1
  45. package/dist/esm/components/index.js +1 -0
  46. package/dist/esm/components/index.js.map +1 -1
  47. package/dist/js/components/Dropdown/DropdownToggle.d.ts +1 -1
  48. package/dist/js/components/Dropdown/DropdownToggle.d.ts.map +1 -1
  49. package/dist/js/components/Dropdown/KebabToggle.d.ts +1 -1
  50. package/dist/js/components/Dropdown/KebabToggle.d.ts.map +1 -1
  51. package/dist/js/components/DualListSelector/DualListSelector.d.ts +1 -0
  52. package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
  53. package/dist/js/components/DualListSelector/DualListSelector.js +23 -10
  54. package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
  55. package/dist/js/components/Label/Label.d.ts +4 -4
  56. package/dist/js/components/Label/Label.d.ts.map +1 -1
  57. package/dist/js/components/LabelGroup/LabelGroup.d.ts +3 -3
  58. package/dist/js/components/LabelGroup/LabelGroup.d.ts.map +1 -1
  59. package/dist/js/components/Menu/Menu.d.ts +11 -11
  60. package/dist/js/components/Menu/Menu.d.ts.map +1 -1
  61. package/dist/js/components/Menu/MenuItem.d.ts +5 -5
  62. package/dist/js/components/Menu/MenuItem.d.ts.map +1 -1
  63. package/dist/js/components/Select/Select.d.ts +1 -1
  64. package/dist/js/components/Select/Select.d.ts.map +1 -1
  65. package/dist/js/components/Select/SelectOption.d.ts +1 -1
  66. package/dist/js/components/Select/SelectOption.d.ts.map +1 -1
  67. package/dist/js/components/TextInputGroup/TextInputGroup.d.ts +9 -0
  68. package/dist/js/components/TextInputGroup/TextInputGroup.d.ts.map +1 -0
  69. package/dist/js/components/TextInputGroup/TextInputGroup.js +14 -0
  70. package/dist/js/components/TextInputGroup/TextInputGroup.js.map +1 -0
  71. package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts +15 -0
  72. package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -0
  73. package/dist/js/components/TextInputGroup/TextInputGroupMain.js +19 -0
  74. package/dist/js/components/TextInputGroup/TextInputGroupMain.js.map +1 -0
  75. package/dist/js/components/TextInputGroup/TextInputGroupUtilities.d.ts +9 -0
  76. package/dist/js/components/TextInputGroup/TextInputGroupUtilities.d.ts.map +1 -0
  77. package/dist/js/components/TextInputGroup/TextInputGroupUtilities.js +14 -0
  78. package/dist/js/components/TextInputGroup/TextInputGroupUtilities.js.map +1 -0
  79. package/dist/js/components/TextInputGroup/index.d.ts +4 -0
  80. package/dist/js/components/TextInputGroup/index.d.ts.map +1 -0
  81. package/dist/js/components/TextInputGroup/index.js +7 -0
  82. package/dist/js/components/TextInputGroup/index.js.map +1 -0
  83. package/dist/js/components/Toolbar/Toolbar.d.ts +2 -0
  84. package/dist/js/components/Toolbar/Toolbar.d.ts.map +1 -1
  85. package/dist/js/components/Toolbar/Toolbar.js +2 -2
  86. package/dist/js/components/Toolbar/Toolbar.js.map +1 -1
  87. package/dist/js/components/index.d.ts +1 -0
  88. package/dist/js/components/index.d.ts.map +1 -1
  89. package/dist/js/components/index.js +1 -0
  90. package/dist/js/components/index.js.map +1 -1
  91. package/dist/styles/assets/pficon/pficon.woff +0 -0
  92. package/dist/styles/assets/pficon/pficon.woff2 +0 -0
  93. package/dist/umd/react-core.css +360 -17
  94. package/dist/umd/react-core.js +953 -885
  95. package/dist/umd/react-core.min.css +360 -17
  96. package/dist/umd/react-core.min.js +3 -3
  97. package/package.json +6 -6
  98. package/src/components/CodeBlock/examples/CodeBlock.md +0 -1
  99. package/src/components/DataList/examples/DataList.md +4 -3
  100. package/src/components/DragDrop/examples/DragDrop.md +1 -0
  101. package/src/components/Dropdown/DropdownToggle.tsx +1 -1
  102. package/src/components/Dropdown/KebabToggle.tsx +1 -1
  103. package/src/components/DualListSelector/DualListSelector.tsx +25 -23
  104. package/src/components/DualListSelector/examples/DualListSelector.md +3 -0
  105. package/src/components/HelperText/examples/HelperText.md +0 -1
  106. package/src/components/Label/Label.tsx +4 -4
  107. package/src/components/Label/examples/Label.md +1 -1
  108. package/src/components/LabelGroup/LabelGroup.tsx +3 -3
  109. package/src/components/LabelGroup/examples/LabelGroup.md +1 -1
  110. package/src/components/Menu/Menu.tsx +11 -11
  111. package/src/components/Menu/MenuItem.tsx +5 -5
  112. package/src/components/Menu/examples/Menu.md +2 -9
  113. package/src/components/Modal/__tests__/ModalBox.test.tsx +11 -21
  114. package/src/components/Modal/__tests__/ModalBoxDescription.test.tsx +12 -0
  115. package/src/components/Modal/__tests__/ModalBoxTitle.test.tsx +59 -0
  116. package/src/components/Modal/__tests__/ModalContent.test.tsx +15 -10
  117. package/src/components/Modal/__tests__/__snapshots__/ModalBox.test.tsx.snap +12 -30
  118. package/src/components/Modal/__tests__/__snapshots__/ModalBoxDescription.test.tsx.snap +10 -0
  119. package/src/components/Modal/__tests__/__snapshots__/ModalBoxTitle.test.tsx.snap +158 -0
  120. package/src/components/Modal/__tests__/__snapshots__/ModalContent.test.tsx.snap +53 -22
  121. package/src/components/Select/Select.tsx +1 -1
  122. package/src/components/Select/SelectOption.tsx +1 -1
  123. package/src/components/Select/examples/Select.md +4 -11
  124. package/src/components/Sidebar/examples/Sidebar.md +0 -1
  125. package/src/components/TextInputGroup/TextInputGroup.tsx +22 -0
  126. package/src/components/TextInputGroup/TextInputGroupMain.tsx +43 -0
  127. package/src/components/TextInputGroup/TextInputGroupUtilities.tsx +22 -0
  128. package/src/components/TextInputGroup/__tests__/TextInputGroup.test.tsx +77 -0
  129. package/src/components/TextInputGroup/__tests__/__snapshots__/TextInputGroup.test.tsx.snap +211 -0
  130. package/src/components/TextInputGroup/examples/TextInputGroup.md +138 -0
  131. package/src/components/TextInputGroup/index.ts +3 -0
  132. package/src/components/Toolbar/Toolbar.tsx +4 -0
  133. package/src/components/Wizard/examples/Wizard.md +17 -1
  134. package/src/components/index.ts +1 -0
  135. package/src/demos/ComposableMenu.md +4 -13
  136. package/src/demos/DataListDemo.md +0 -2
  137. package/src/demos/DatePicker.md +1 -0
  138. package/src/demos/NotificationDrawer/NotificationDrawer.md +1 -0
  139. package/src/demos/ProgressDemo.md +82 -0
  140. package/src/demos/ProgressStepperDemo.md +1 -0
  141. package/src/demos/SearchInput/SearchInput.md +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.166.0",
3
+ "version": "4.168.7",
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.17.0",
38
- "@patternfly/react-styles": "^4.16.0",
39
- "@patternfly/react-tokens": "^4.18.0",
37
+ "@patternfly/react-icons": "^4.19.7",
38
+ "@patternfly/react-styles": "^4.18.7",
39
+ "@patternfly/react-tokens": "^4.20.7",
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": "764f2e5fc14e50e0fd2613400ecdf360ae500acd"
63
+ "gitHead": "eade4414d728bd8e6dae15d7c668894086335c30"
64
64
  }
@@ -3,7 +3,6 @@ id: Code block
3
3
  section: components
4
4
  cssPrefix: pf-c-code-block
5
5
  propComponents: ['CodeBlock', 'CodeBlockAction', 'CodeBlockCode']
6
- beta: true
7
6
  ---
8
7
 
9
8
  import CopyIcon from '@patternfly/react-icons/dist/esm/icons/copy-icon';
@@ -704,6 +704,7 @@ class ExpandableDataList extends React.Component {
704
704
  ]}
705
705
  />
706
706
  <DataListAction
707
+ aria-labelledby="ex-item3 ex-action3"
707
708
  aria-labelledby="ex-item3 ex-action3"
708
709
  id="ex-action3"
709
710
  aria-label="Actions"
@@ -1127,7 +1128,8 @@ import {
1127
1128
 
1128
1129
  Draggable data lists used to have their own HTML5-based API for drag and drop, which wasn't able to fulfill requirements such as custom styling on items being dragged. So we wrote generic `DragDrop`, `Draggable`, and `Droppable` components for this purpose. Use those new components instead of the deprecated (and buggy!) HTML5-based API.
1129
1130
 
1130
- ```js
1131
+ Note: Keyboard accessibility and screen reader accessibility for the `DragDrop` component are still in development.
1132
+ ```js isBeta
1131
1133
  import React from 'react';
1132
1134
  import {
1133
1135
  DataList,
@@ -1238,8 +1240,7 @@ import {
1238
1240
  DataListItem,
1239
1241
  DataListItemRow,
1240
1242
  DataListItemCells,
1241
- DataListCell,
1242
- DataListGridBreakpoint
1243
+ DataListCell
1243
1244
  } from '@patternfly/react-core';
1244
1245
 
1245
1246
  <DataList aria-label="Simple data list example" gridBreakpoint="sm">
@@ -30,6 +30,7 @@ import { DragDrop, Draggable, Droppable } from '@patternfly/react-core';
30
30
  </Droppable>
31
31
  </DragDrop>
32
32
  ```
33
+ Note: Keyboard accessibility and screen reader accessibility are still in development.
33
34
 
34
35
  ## Examples
35
36
  ### Basic
@@ -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
@@ -400,6 +400,7 @@ relationships are arranged as follows:
400
400
  ```js noLive
401
401
  import React from 'react';
402
402
  import { DualListSelector, DualListSelectorPane, DualListSelectorList, DualListSelectorListItem, DualListSelectorControlsWrapper, DualListSelectorControl } from '@patternfly/react-core';
403
+
403
404
  <DualListSelector>
404
405
 
405
406
  <DualListSelectorPane>
@@ -421,6 +422,8 @@ import { DualListSelector, DualListSelectorPane, DualListSelectorList, DualListS
421
422
  </DualListSelector>
422
423
  ```
423
424
 
425
+ Note: Keyboard accessibility and screen reader accessibility for the `DragDrop` component are still in development.
426
+
424
427
  ```js
425
428
  import React from 'react';
426
429
  import {
@@ -3,7 +3,6 @@ id: Helper text
3
3
  section: components
4
4
  cssPrefix: pf-c-helper-text
5
5
  propComponents: ['HelperText', 'HelperTextItem']
6
- beta: true
7
6
  ---
8
7
 
9
8
  import InfoIcon from '@patternfly/react-icons/dist/esm/icons/info-icon';
@@ -20,13 +20,13 @@ export interface LabelProps extends React.HTMLProps<HTMLSpanElement> {
20
20
  variant?: 'outline' | 'filled';
21
21
  /** Flag indicating the label is compact. */
22
22
  isCompact?: boolean;
23
- /** Flag indicating the label is editable. */
23
+ /** @beta Flag indicating the label is editable. */
24
24
  isEditable?: boolean;
25
- /** Additional props passed to the editable label text div. Optionally passing onInput and onBlur callbacks will allow finer custom text input control. */
25
+ /** @beta Additional props passed to the editable label text div. Optionally passing onInput and onBlur callbacks will allow finer custom text input control. */
26
26
  editableProps?: any;
27
- /** Callback when an editable label completes an edit. */
27
+ /** @beta Callback when an editable label completes an edit. */
28
28
  onEditComplete?: (newText: string) => void;
29
- /** Callback when an editable label cancels an edit. */
29
+ /** @beta Callback when an editable label cancels an edit. */
30
30
  onEditCancel?: (previousText: string) => void;
31
31
  /** Flag indicating the label text should be truncated. */
32
32
  isTruncated?: boolean;
@@ -386,7 +386,7 @@ Click or press either enter or space to begin editing a label. After editing, cl
386
386
 
387
387
  You can also customize any Label's close button aria-label as this example shows with `closeBtnAriaLabel`.
388
388
 
389
- ```js
389
+ ```js isBeta
390
390
  import React from 'react';
391
391
  import { Label } from '@patternfly/react-core';
392
392
 
@@ -38,11 +38,11 @@ export interface LabelGroupProps extends React.HTMLProps<HTMLUListElement> {
38
38
  tooltipPosition?: 'auto' | 'top' | 'bottom' | 'left' | 'right';
39
39
  /** Flag to implement a vertical layout */
40
40
  isVertical?: boolean;
41
- /** Flag indicating contained labels are editable. Allows spacing for a text input after the labels. */
41
+ /** @beta Flag indicating contained labels are editable. Allows spacing for a text input after the labels. */
42
42
  isEditable?: boolean;
43
- /** Flag indicating the editable label group should be appended with a textarea. */
43
+ /** @beta Flag indicating the editable label group should be appended with a textarea. */
44
44
  hasEditableTextArea?: boolean;
45
- /** Additional props passed to the editable textarea. */
45
+ /** @beta Additional props passed to the editable textarea. */
46
46
  editableTextAreaProps?: any;
47
47
  }
48
48
 
@@ -134,7 +134,7 @@ VerticalCategoryLabelGroupOverflowRemovable = () => {
134
134
 
135
135
  ### Editable labels
136
136
 
137
- ```js
137
+ ```js isBeta
138
138
  import React from 'react';
139
139
  import { LabelGroup, Label, TextArea } from '@patternfly/react-core';
140
140
 
@@ -27,27 +27,27 @@ export interface MenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'r
27
27
  ) => void;
28
28
  /** Accessibility label */
29
29
  'aria-label'?: string;
30
- /** Indicates if menu contains a flyout menu */
30
+ /** @beta Indicates if menu contains a flyout menu */
31
31
  containsFlyout?: boolean;
32
- /** Indicates if menu contains a drilldown menu */
32
+ /** @beta Indicates if menu contains a drilldown menu */
33
33
  containsDrilldown?: boolean;
34
- /** Indicates if a menu is drilled into */
34
+ /** @beta Indicates if a menu is drilled into */
35
35
  isMenuDrilledIn?: boolean;
36
- /** Indicates the path of drilled in menu itemIds */
36
+ /** @beta Indicates the path of drilled in menu itemIds */
37
37
  drilldownItemPath?: string[];
38
- /** Array of menus that are drilled in */
38
+ /** @beta Array of menus that are drilled in */
39
39
  drilledInMenus?: string[];
40
- /** Callback for drilling into a submenu */
40
+ /** @beta Callback for drilling into a submenu */
41
41
  onDrillIn?: (fromItemId: string, toItemId: string, itemId: string) => void;
42
- /** Callback for drilling out of a submenu */
42
+ /** @beta Callback for drilling out of a submenu */
43
43
  onDrillOut?: (toItemId: string, itemId: string) => void;
44
- /** Callback for collecting menu heights */
44
+ /** @beta Callback for collecting menu heights */
45
45
  onGetMenuHeight?: (menuId: string, height: number) => void;
46
- /** ID of parent menu for drilldown menus */
46
+ /** @beta ID of parent menu for drilldown menus */
47
47
  parentMenu?: string;
48
- /** ID of the currently active menu for the drilldown variant */
48
+ /** @beta ID of the currently active menu for the drilldown variant */
49
49
  activeMenu?: string;
50
- /** itemId of the currently active item. You can also specify isActive on the MenuItem. */
50
+ /** @beta itemId of the currently active item. You can also specify isActive on the MenuItem. */
51
51
  activeItemId?: string | number;
52
52
  /** @hide Forwarded ref */
53
53
  innerRef?: React.Ref<HTMLDivElement>;
@@ -46,15 +46,15 @@ export interface MenuItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'onC
46
46
  isExternalLink?: boolean;
47
47
  /** Flag indicating if the option is selected */
48
48
  isSelected?: boolean;
49
- /** Flyout menu */
49
+ /** @beta Flyout menu */
50
50
  flyoutMenu?: React.ReactElement;
51
- /** Callback function when mouse leaves trigger */
51
+ /** @beta Callback function when mouse leaves trigger */
52
52
  onShowFlyout?: (event?: any) => void;
53
- /** Drilldown menu of the item. Should be a Menu or DrilldownMenu type. */
53
+ /** @beta Drilldown menu of the item. Should be a Menu or DrilldownMenu type. */
54
54
  drilldownMenu?: React.ReactNode;
55
- /** Sub menu direction */
55
+ /** @beta Sub menu direction */
56
56
  direction?: 'down' | 'up';
57
- /** True if item is on current selection path */
57
+ /** @beta True if item is on current selection path */
58
58
  isOnPath?: boolean;
59
59
  /** Accessibility label */
60
60
  'aria-label'?: string;
@@ -4,7 +4,6 @@ section: components
4
4
  cssPrefix: pf-c-menu
5
5
  propComponents: ['Menu', 'MenuList', 'MenuItem', 'MenuItemAction', 'MenuContent', 'MenuInput']
6
6
  ouia: true
7
- beta: true
8
7
  ---
9
8
 
10
9
  import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
@@ -341,8 +340,6 @@ class MenuWithTitledGroups extends React.Component {
341
340
  import React from 'react';
342
341
  import { Menu, MenuContent, MenuList, MenuItem } from '@patternfly/react-core';
343
342
  import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
344
- import LayerGroupIcon from '@patternfly/react-icons/dist/esm/icons/layer-group-icon';
345
- import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
346
343
 
347
344
  class MenuWithDescription extends React.Component {
348
345
  constructor(props) {
@@ -392,9 +389,6 @@ import { Menu, MenuContent, MenuGroup, MenuList, MenuItem, MenuItemAction } from
392
389
  import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
393
390
  import ClipboardIcon from '@patternfly/react-icons/dist/esm/icons/clipboard-icon';
394
391
  import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
395
- import LayerGroupIcon from '@patternfly/react-icons/dist/esm/icons/layer-group-icon';
396
- import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
397
- import TableIcon from '@patternfly/react-icons/dist/esm/icons/table-icon';
398
392
  import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
399
393
 
400
394
  class MenuWithActions extends React.Component {
@@ -690,7 +684,7 @@ class MenuOptionMultiSelect extends React.Component {
690
684
 
691
685
  ### With drilldown
692
686
 
693
- ```js
687
+ ```js isBeta
694
688
  import React from 'react';
695
689
  import { Menu, MenuContent, MenuList, MenuItem, Divider, DrilldownMenu } from '@patternfly/react-core';
696
690
  import StorageDomainIcon from '@patternfly/react-icons/dist/esm/icons/storage-domain-icon';
@@ -888,7 +882,7 @@ class MenuWithDrilldown extends React.Component {
888
882
 
889
883
  ### With drilldown breadcrumbs
890
884
 
891
- ```js
885
+ ```js isBeta
892
886
  import React from 'react';
893
887
  import {
894
888
  Menu,
@@ -902,7 +896,6 @@ import {
902
896
  BreadcrumbHeading,
903
897
  MenuBreadcrumb,
904
898
  Dropdown,
905
- DropdownToggle,
906
899
  DropdownItem,
907
900
  BadgeToggle,
908
901
  Checkbox
@@ -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
+ });
@@ -0,0 +1,59 @@
1
+ import * as React from 'react';
2
+ import { shallow } from 'enzyme';
3
+
4
+ import { ModalBoxTitle } from '../ModalBoxTitle';
5
+ import BullhornIcon from '@patternfly/react-icons/dist/esm/icons/bullhorn-icon';
6
+
7
+ test('ModalBoxTitle alert variant', () => {
8
+ const view = shallow(
9
+ <ModalBoxTitle title="Test Modal Box warning" id="boxId" titleIconVariant="warning">
10
+ content
11
+ </ModalBoxTitle>
12
+ );
13
+ expect(view).toMatchSnapshot();
14
+ });
15
+
16
+ test('ModalBoxTitle info variant', () => {
17
+ const view = shallow(
18
+ <ModalBoxTitle title="Test Modal Box info" id="boxId" titleIconVariant="info">
19
+ content
20
+ </ModalBoxTitle>
21
+ );
22
+ expect(view).toMatchSnapshot();
23
+ });
24
+
25
+ test('ModalBoxTitle danger variant', () => {
26
+ const view = shallow(
27
+ <ModalBoxTitle title="Test Modal Box danger" id="boxId" titleIconVariant="danger">
28
+ content
29
+ </ModalBoxTitle>
30
+ );
31
+ expect(view).toMatchSnapshot();
32
+ });
33
+
34
+ test('ModalBoxTitle default variant', () => {
35
+ const view = shallow(
36
+ <ModalBoxTitle title="Test Modal Box warning" id="boxId" titleIconVariant="default">
37
+ content
38
+ </ModalBoxTitle>
39
+ );
40
+ expect(view).toMatchSnapshot();
41
+ });
42
+
43
+ test('ModalBoxTitle success variant', () => {
44
+ const view = shallow(
45
+ <ModalBoxTitle title="Test Modal Box success" id="boxId" titleIconVariant="success">
46
+ content
47
+ </ModalBoxTitle>
48
+ );
49
+ expect(view).toMatchSnapshot();
50
+ });
51
+
52
+ test('ModalBoxTitle custom icon variant', () => {
53
+ const view = shallow(
54
+ <ModalBoxTitle title="Test Modal Box custom" id="boxId" titleIconVariant={BullhornIcon}>
55
+ content
56
+ </ModalBoxTitle>
57
+ );
58
+ expect(view).toMatchSnapshot();
59
+ });
@@ -3,9 +3,14 @@ import { shallow } from 'enzyme';
3
3
 
4
4
  import { ModalContent } from '../ModalContent';
5
5
 
6
+ const modalContentProps = {
7
+ boxId: "boxId",
8
+ labelId: "labelId",
9
+ descriptorId: "descriptorId"
10
+ }
6
11
  test('Modal Content Test only body', () => {
7
12
  const view = shallow(
8
- <ModalContent title="Test Modal Content title" id="id" isOpen>
13
+ <ModalContent title="Test Modal Content title" isOpen {...modalContentProps}>
9
14
  This is a ModalBox header
10
15
  </ModalContent>
11
16
  );
@@ -14,7 +19,7 @@ test('Modal Content Test only body', () => {
14
19
 
15
20
  test('Modal Content Test isOpen', () => {
16
21
  const view = shallow(
17
- <ModalContent title="Test Modal Content title" id="id" isOpen>
22
+ <ModalContent title="Test Modal Content title" isOpen {...modalContentProps}>
18
23
  This is a ModalBox header
19
24
  </ModalContent>
20
25
  );
@@ -23,7 +28,7 @@ test('Modal Content Test isOpen', () => {
23
28
 
24
29
  test('Modal Content Test description', () => {
25
30
  const view = shallow(
26
- <ModalContent title="Test Modal Content title" id="id" isOpen description="This is a test description.">
31
+ <ModalContent title="Test Modal Content title" isOpen description="This is a test description." {...modalContentProps}>
27
32
  This is a ModalBox header
28
33
  </ModalContent>
29
34
  );
@@ -32,7 +37,7 @@ test('Modal Content Test description', () => {
32
37
 
33
38
  test('Modal Content Test with footer', () => {
34
39
  const view = shallow(
35
- <ModalContent title="Test Modal Content title" id="id" isOpen actions={['Testing']}>
40
+ <ModalContent title="Test Modal Content title" isOpen actions={['Testing']} {...modalContentProps}>
36
41
  This is a ModalBox header
37
42
  </ModalContent>
38
43
  );
@@ -41,7 +46,7 @@ test('Modal Content Test with footer', () => {
41
46
 
42
47
  test('Modal Content test without footer', () => {
43
48
  const view = shallow(
44
- <ModalContent title="Test Modal Content title" id="id" isOpen>
49
+ <ModalContent title="Test Modal Content title" isOpen {...modalContentProps}>
45
50
  This is a ModalBox header
46
51
  </ModalContent>
47
52
  );
@@ -53,10 +58,10 @@ test('Modal Content Test with onclose', () => {
53
58
  <ModalContent
54
59
  title="Test Modal Content title"
55
60
  actions={['Testing footer']}
56
- isLarge
61
+ variant="large"
57
62
  onClose={() => undefined}
58
- id="id"
59
63
  isOpen
64
+ {...modalContentProps}
60
65
  >
61
66
  This is a ModalBox header
62
67
  </ModalContent>
@@ -72,10 +77,10 @@ test('Modal Test with custom header', () => {
72
77
  header={header}
73
78
  title="test-custom-header-modal"
74
79
  actions={['Testing footer']}
75
- isLarge
80
+ variant="large"
76
81
  onClose={() => undefined}
77
- id="id"
78
82
  isOpen
83
+ {...modalContentProps}
79
84
  >
80
85
  This is a ModalBox header
81
86
  </ModalContent>
@@ -87,7 +92,7 @@ test('Modal Test with custom footer', () => {
87
92
  const footer = <span id="test-custom-footer">TEST</span>;
88
93
 
89
94
  const view = shallow(
90
- <ModalContent footer={footer} title="Test Modal Custom Footer" isLarge onClose={() => undefined} id="id" isOpen>
95
+ <ModalContent footer={footer} title="Test Modal Custom Footer" variant="large" onClose={() => undefined} isOpen {...modalContentProps}>
91
96
  This is a ModalBox header
92
97
  </ModalContent>
93
98
  );