@patternfly/react-core 4.222.1 → 4.222.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 (57) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/components/AboutModal/AboutModal.d.ts +1 -1
  3. package/dist/esm/components/AboutModal/AboutModal.js.map +1 -1
  4. package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
  5. package/dist/esm/components/DualListSelector/DualListSelector.js +6 -5
  6. package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
  7. package/dist/esm/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
  8. package/dist/esm/components/DualListSelector/DualListSelectorPane.js.map +1 -1
  9. package/dist/esm/components/Menu/MenuItem.js.map +1 -1
  10. package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
  11. package/dist/esm/components/Modal/Modal.d.ts +1 -1
  12. package/dist/esm/components/Modal/Modal.js.map +1 -1
  13. package/dist/esm/components/Select/Select.d.ts.map +1 -1
  14. package/dist/esm/components/Select/Select.js +2 -1
  15. package/dist/esm/components/Select/Select.js.map +1 -1
  16. package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
  17. package/dist/esm/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
  18. package/dist/js/components/AboutModal/AboutModal.d.ts +1 -1
  19. package/dist/js/components/AboutModal/AboutModal.js.map +1 -1
  20. package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
  21. package/dist/js/components/DualListSelector/DualListSelector.js +6 -5
  22. package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
  23. package/dist/js/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
  24. package/dist/js/components/DualListSelector/DualListSelectorPane.js.map +1 -1
  25. package/dist/js/components/Menu/MenuItem.js.map +1 -1
  26. package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
  27. package/dist/js/components/Modal/Modal.d.ts +1 -1
  28. package/dist/js/components/Modal/Modal.js.map +1 -1
  29. package/dist/js/components/Select/Select.d.ts.map +1 -1
  30. package/dist/js/components/Select/Select.js +2 -1
  31. package/dist/js/components/Select/Select.js.map +1 -1
  32. package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
  33. package/dist/js/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
  34. package/dist/umd/react-core.css +1 -5
  35. package/dist/umd/react-core.js +8 -6
  36. package/dist/umd/react-core.min.css +1 -5
  37. package/package.json +6 -6
  38. package/src/components/AboutModal/AboutModal.tsx +1 -1
  39. package/src/components/DualListSelector/DualListSelector.tsx +57 -37
  40. package/src/components/DualListSelector/DualListSelectorPane.tsx +10 -8
  41. package/src/components/InputGroup/examples/InputGroup.md +5 -237
  42. package/src/components/InputGroup/examples/InputGroupBasic.tsx +31 -0
  43. package/src/components/InputGroup/examples/InputGroupWithDropdown.tsx +43 -0
  44. package/src/components/InputGroup/examples/InputGroupWithPopover.tsx +33 -0
  45. package/src/components/InputGroup/examples/InputGroupWithSiblings.tsx +32 -0
  46. package/src/components/InputGroup/examples/InputGroupWithTextarea.tsx +13 -0
  47. package/src/components/Label/examples/Label.md +5 -399
  48. package/src/components/Label/examples/LabelCompact.tsx +27 -0
  49. package/src/components/Label/examples/LabelFilled.tsx +167 -0
  50. package/src/components/Label/examples/LabelOutline.tsx +188 -0
  51. package/src/components/Label/examples/LabelRouterLink.tsx +20 -0
  52. package/src/components/Menu/MenuItem.tsx +1 -1
  53. package/src/components/MenuToggle/MenuToggle.tsx +1 -1
  54. package/src/components/Modal/Modal.tsx +1 -1
  55. package/src/components/Select/Select.tsx +6 -3
  56. package/src/components/Toolbar/ToolbarToggleGroup.tsx +4 -1
  57. package/src/demos/Wizard/WizardDemo.md +66 -121
@@ -0,0 +1,167 @@
1
+ import React from 'react';
2
+ import { Label } from '@patternfly/react-core';
3
+ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
4
+
5
+ export const LabelFilled: React.FunctionComponent = () => (
6
+ <React.Fragment>
7
+ <Label>Grey</Label> <Label icon={<InfoCircleIcon />}>Grey icon</Label>{' '}
8
+ <Label onClose={() => Function.prototype}>Grey removable</Label>{' '}
9
+ <Label icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
10
+ Grey icon removable
11
+ </Label>{' '}
12
+ <Label href="#filled">Grey link</Label>{' '}
13
+ <Label href="#filled" onClose={() => Function.prototype}>
14
+ Grey link removable
15
+ </Label>
16
+ <Label icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
17
+ Grey label with icon that overflows
18
+ </Label>
19
+ <br />
20
+ <br />
21
+ <Label color="blue">Blue</Label>{' '}
22
+ <Label color="blue" icon={<InfoCircleIcon />}>
23
+ Blue icon
24
+ </Label>{' '}
25
+ <Label color="blue" onClose={() => Function.prototype}>
26
+ Blue removable
27
+ </Label>{' '}
28
+ <Label color="blue" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
29
+ Blue icon removable
30
+ </Label>{' '}
31
+ <Label color="blue" href="#filled">
32
+ Blue link
33
+ </Label>{' '}
34
+ <Label color="blue" href="#filled" onClose={() => Function.prototype}>
35
+ Blue link removable
36
+ </Label>
37
+ <Label color="blue" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
38
+ Blue label with icon that overflows
39
+ </Label>
40
+ <br />
41
+ <br />
42
+ <Label color="green">Green</Label>{' '}
43
+ <Label color="green" icon={<InfoCircleIcon />}>
44
+ Green icon
45
+ </Label>{' '}
46
+ <Label color="green" onClose={() => Function.prototype}>
47
+ Green removable
48
+ </Label>{' '}
49
+ <Label color="green" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
50
+ Green icon removable
51
+ </Label>{' '}
52
+ <Label color="green" href="#filled">
53
+ Green link
54
+ </Label>{' '}
55
+ <Label color="green" href="#filled" onClose={() => Function.prototype}>
56
+ Green link removable
57
+ </Label>
58
+ <Label color="green" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
59
+ Green label with icon that overflows
60
+ </Label>
61
+ <br />
62
+ <br />
63
+ <Label color="orange">Orange</Label>{' '}
64
+ <Label color="orange" icon={<InfoCircleIcon />}>
65
+ Orange icon
66
+ </Label>{' '}
67
+ <Label color="orange" onClose={() => Function.prototype}>
68
+ Orange removable
69
+ </Label>{' '}
70
+ <Label color="orange" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
71
+ Orange icon removable
72
+ </Label>{' '}
73
+ <Label color="orange" href="#filled">
74
+ Orange link
75
+ </Label>{' '}
76
+ <Label color="orange" href="#filled" onClose={() => Function.prototype}>
77
+ Orange link removable
78
+ </Label>
79
+ <Label color="orange" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
80
+ Orange label with icon that overflows
81
+ </Label>
82
+ <br />
83
+ <br />
84
+ <Label color="red">Red</Label>{' '}
85
+ <Label color="red" icon={<InfoCircleIcon />}>
86
+ Red icon
87
+ </Label>{' '}
88
+ <Label color="red" onClose={() => Function.prototype}>
89
+ Red removable
90
+ </Label>{' '}
91
+ <Label color="red" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
92
+ Red icon removable
93
+ </Label>{' '}
94
+ <Label color="red" href="#filled">
95
+ Red link
96
+ </Label>{' '}
97
+ <Label color="red" href="#filled" onClose={() => Function.prototype}>
98
+ Red link removable
99
+ </Label>
100
+ <Label color="red" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
101
+ Red label with icon that overflows
102
+ </Label>
103
+ <br />
104
+ <br />
105
+ <Label color="purple">Purple</Label>{' '}
106
+ <Label color="purple" icon={<InfoCircleIcon />}>
107
+ Purple icon
108
+ </Label>{' '}
109
+ <Label color="purple" onClose={() => Function.prototype}>
110
+ Purple removable
111
+ </Label>{' '}
112
+ <Label color="purple" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
113
+ Purple icon removable
114
+ </Label>{' '}
115
+ <Label color="purple" href="#filled">
116
+ Purple link
117
+ </Label>{' '}
118
+ <Label color="purple" href="#filled" onClose={() => Function.prototype}>
119
+ Purple link removable
120
+ </Label>
121
+ <Label color="purple" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
122
+ Purple label with icon that overflows
123
+ </Label>
124
+ <br />
125
+ <br />
126
+ <Label color="cyan">Cyan</Label>{' '}
127
+ <Label color="cyan" icon={<InfoCircleIcon />}>
128
+ Cyan icon
129
+ </Label>{' '}
130
+ <Label color="cyan" onClose={() => Function.prototype}>
131
+ Cyan removable
132
+ </Label>{' '}
133
+ <Label color="cyan" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
134
+ Cyan icon removable
135
+ </Label>{' '}
136
+ <Label color="cyan" href="#filled">
137
+ Cyan link
138
+ </Label>{' '}
139
+ <Label color="cyan" href="#filled" onClose={() => Function.prototype}>
140
+ Cyan link removable
141
+ </Label>
142
+ <Label color="cyan" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
143
+ Cyan label with icon that overflows
144
+ </Label>
145
+ <br />
146
+ <br />
147
+ <Label color="gold">Gold</Label>{' '}
148
+ <Label color="gold" icon={<InfoCircleIcon />}>
149
+ Gold icon
150
+ </Label>{' '}
151
+ <Label color="gold" onClose={() => Function.prototype}>
152
+ Gold removable
153
+ </Label>{' '}
154
+ <Label color="gold" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
155
+ Gold icon removable
156
+ </Label>{' '}
157
+ <Label color="gold" href="#filled">
158
+ Gold link
159
+ </Label>{' '}
160
+ <Label color="gold" href="#filled" onClose={() => Function.prototype}>
161
+ Gold link removable
162
+ </Label>
163
+ <Label color="gold" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
164
+ Gold label with icon that overflows
165
+ </Label>
166
+ </React.Fragment>
167
+ );
@@ -0,0 +1,188 @@
1
+ import React from 'react';
2
+ import { Label } from '@patternfly/react-core';
3
+ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
4
+
5
+ export const LabelOutline: React.FunctionComponent = () => (
6
+ <React.Fragment>
7
+ <Label variant="outline">Grey</Label>{' '}
8
+ <Label variant="outline" icon={<InfoCircleIcon />}>
9
+ Grey icon
10
+ </Label>{' '}
11
+ <Label variant="outline" onClose={() => Function.prototype}>
12
+ Grey removable
13
+ </Label>{' '}
14
+ <Label variant="outline" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
15
+ Grey icon removable
16
+ </Label>{' '}
17
+ <Label variant="outline" href="#outline">
18
+ Grey link
19
+ </Label>{' '}
20
+ <Label variant="outline" href="#outline" onClose={() => Function.prototype}>
21
+ Grey link removable
22
+ </Label>
23
+ <Label variant="outline" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
24
+ Grey label with icon that overflows
25
+ </Label>
26
+ <br />
27
+ <br />
28
+ <Label variant="outline" color="blue">
29
+ Blue
30
+ </Label>{' '}
31
+ <Label variant="outline" color="blue" icon={<InfoCircleIcon />}>
32
+ Blue icon
33
+ </Label>{' '}
34
+ <Label variant="outline" color="blue" onClose={() => Function.prototype}>
35
+ Blue removable
36
+ </Label>{' '}
37
+ <Label variant="outline" color="blue" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
38
+ Blue icon removable
39
+ </Label>{' '}
40
+ <Label variant="outline" color="blue" href="#outline">
41
+ Blue link
42
+ </Label>{' '}
43
+ <Label variant="outline" color="blue" href="#outline" onClose={() => Function.prototype}>
44
+ Blue link removable
45
+ </Label>
46
+ <Label variant="outline" color="blue" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
47
+ Blue label with icon that overflows
48
+ </Label>
49
+ <br />
50
+ <br />
51
+ <Label variant="outline" color="green">
52
+ Green
53
+ </Label>{' '}
54
+ <Label variant="outline" color="green" icon={<InfoCircleIcon />}>
55
+ Green icon
56
+ </Label>{' '}
57
+ <Label variant="outline" color="green" onClose={() => Function.prototype}>
58
+ Green removable
59
+ </Label>{' '}
60
+ <Label variant="outline" color="green" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
61
+ Green icon removable
62
+ </Label>{' '}
63
+ <Label variant="outline" color="green" href="#outline">
64
+ Green link
65
+ </Label>{' '}
66
+ <Label variant="outline" color="green" href="#outline" onClose={() => Function.prototype}>
67
+ Green link removable
68
+ </Label>
69
+ <Label variant="outline" color="green" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
70
+ Green label with icon that overflows
71
+ </Label>
72
+ <br />
73
+ <br />
74
+ <Label variant="outline" color="orange">
75
+ Orange
76
+ </Label>{' '}
77
+ <Label variant="outline" color="orange" icon={<InfoCircleIcon />}>
78
+ Orange icon
79
+ </Label>{' '}
80
+ <Label variant="outline" color="orange" onClose={() => Function.prototype}>
81
+ Orange removable
82
+ </Label>{' '}
83
+ <Label variant="outline" color="orange" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
84
+ Orange icon removable
85
+ </Label>{' '}
86
+ <Label variant="outline" color="orange" href="#outline">
87
+ Orange link
88
+ </Label>{' '}
89
+ <Label variant="outline" color="orange" href="#outline" onClose={() => Function.prototype}>
90
+ Orange link removable
91
+ </Label>
92
+ <Label variant="outline" color="orange" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
93
+ Orange label with icon that overflows
94
+ </Label>
95
+ <br />
96
+ <br />
97
+ <Label variant="outline" color="red">
98
+ Red
99
+ </Label>{' '}
100
+ <Label variant="outline" color="red" icon={<InfoCircleIcon />}>
101
+ Red icon
102
+ </Label>{' '}
103
+ <Label variant="outline" color="red" onClose={() => Function.prototype}>
104
+ Red removable
105
+ </Label>{' '}
106
+ <Label variant="outline" color="red" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
107
+ Red icon removable
108
+ </Label>{' '}
109
+ <Label variant="outline" color="red" href="#outline">
110
+ Red link
111
+ </Label>{' '}
112
+ <Label variant="outline" color="red" href="#outline" onClose={() => Function.prototype}>
113
+ Red link removable
114
+ </Label>
115
+ <Label variant="outline" color="red" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
116
+ Red label with icon that overflows
117
+ </Label>
118
+ <br />
119
+ <br />
120
+ <Label variant="outline" color="purple">
121
+ Purple
122
+ </Label>{' '}
123
+ <Label variant="outline" color="purple" icon={<InfoCircleIcon />}>
124
+ Purple icon
125
+ </Label>{' '}
126
+ <Label variant="outline" color="purple" onClose={() => Function.prototype}>
127
+ Purple removable
128
+ </Label>{' '}
129
+ <Label variant="outline" color="purple" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
130
+ Purple icon removable
131
+ </Label>{' '}
132
+ <Label variant="outline" color="purple" href="#outline">
133
+ Purple link
134
+ </Label>{' '}
135
+ <Label variant="outline" color="purple" href="#outline" onClose={() => Function.prototype}>
136
+ Purple link removable
137
+ </Label>
138
+ <Label variant="outline" color="purple" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
139
+ Purple label with icon that overflows
140
+ </Label>
141
+ <br />
142
+ <br />
143
+ <Label variant="outline" color="cyan">
144
+ Cyan
145
+ </Label>{' '}
146
+ <Label variant="outline" color="cyan" icon={<InfoCircleIcon />}>
147
+ Cyan icon
148
+ </Label>{' '}
149
+ <Label variant="outline" color="cyan" onClose={() => Function.prototype}>
150
+ Cyan removable
151
+ </Label>{' '}
152
+ <Label variant="outline" color="cyan" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
153
+ Cyan icon removable
154
+ </Label>{' '}
155
+ <Label variant="outline" color="cyan" href="#outline">
156
+ Cyan link
157
+ </Label>{' '}
158
+ <Label variant="outline" color="cyan" href="#outline" onClose={() => Function.prototype}>
159
+ Cyan link removable
160
+ </Label>
161
+ <Label variant="outline" color="cyan" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
162
+ Cyan label with icon that overflows
163
+ </Label>
164
+ <br />
165
+ <br />
166
+ <Label variant="outline" color="gold">
167
+ Gold
168
+ </Label>{' '}
169
+ <Label variant="outline" color="gold" icon={<InfoCircleIcon />}>
170
+ Gold icon
171
+ </Label>{' '}
172
+ <Label variant="outline" color="gold" onClose={() => Function.prototype}>
173
+ Gold removable
174
+ </Label>{' '}
175
+ <Label variant="outline" color="gold" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
176
+ Gold icon removable
177
+ </Label>{' '}
178
+ <Label variant="outline" color="gold" href="#outline">
179
+ Gold link
180
+ </Label>{' '}
181
+ <Label variant="outline" color="gold" href="#outline" onClose={() => Function.prototype}>
182
+ Gold link removable
183
+ </Label>
184
+ <Label variant="outline" color="gold" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
185
+ Gold label with icon that overflows
186
+ </Label>
187
+ </React.Fragment>
188
+ );
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { Label } from '@patternfly/react-core';
3
+ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
4
+ import { Link } from '@reach/router';
5
+
6
+ export const LabelRouterLink: React.FunctionComponent = () => (
7
+ <Label
8
+ color="blue"
9
+ icon={<InfoCircleIcon />}
10
+ onClose={() => Function.prototype}
11
+ isTruncated
12
+ render={({ className, content, componentRef }) => (
13
+ <Link to="/" className={className} innerRef={componentRef}>
14
+ {content}
15
+ </Link>
16
+ )}
17
+ >
18
+ Blue label router link with icon that overflows
19
+ </Label>
20
+ );
@@ -224,7 +224,7 @@ const MenuItemBase: React.FunctionComponent<MenuItemProps> = ({
224
224
  onDrillIn(
225
225
  menuId,
226
226
  typeof drilldownMenu === 'function'
227
- ? drilldownMenu().props.id
227
+ ? (drilldownMenu() as any).props.id
228
228
  : (drilldownMenu as React.ReactElement).props.id,
229
229
  itemId
230
230
  );
@@ -61,7 +61,7 @@ export class MenuToggleBase extends React.Component<MenuToggleProps> {
61
61
  <React.Fragment>
62
62
  {icon && <span className={css(styles.menuToggleIcon)}>{icon}</span>}
63
63
  <span className="pf-c-menu-toggle__text">{children}</span>
64
- {badge && <span className={css(styles.menuToggleCount)}>{badge}</span>}
64
+ {badge && <span className={css(styles.menuToggleCount)}>{badge as React.ReactNode}</span>}
65
65
  <span className={css(styles.menuToggleControls)}>
66
66
  <span className={css(styles.menuToggleToggleIcon)}>
67
67
  <CaretDownIcon aria-hidden />
@@ -243,6 +243,6 @@ export class Modal extends React.Component<ModalProps, ModalState> {
243
243
  ouiaSafe={ouiaSafe}
244
244
  />,
245
245
  container
246
- );
246
+ ) as React.ReactElement;
247
247
  }
248
248
  }
@@ -447,7 +447,10 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
447
447
  typeaheadFilteredChildren =
448
448
  typeaheadInputValue.toString() !== ''
449
449
  ? React.Children.map(children, group => {
450
- if (React.isValidElement(group) && group.type === SelectGroup) {
450
+ if (
451
+ React.isValidElement<React.ComponentProps<typeof SelectGroup>>(group) &&
452
+ group.type === SelectGroup
453
+ ) {
451
454
  const filteredGroupChildren = (React.Children.toArray(group.props.children) as React.ReactElement<
452
455
  SelectGroupProps
453
456
  >[]).filter(childFilter);
@@ -635,8 +638,8 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
635
638
  optionContainerRef: React.ReactNode,
636
639
  index: number
637
640
  ) => {
638
- this.refCollection[index] = [optionRef as HTMLElement, favoriteRef as HTMLElement];
639
- this.optionContainerRefCollection[index] = optionContainerRef as HTMLElement;
641
+ this.refCollection[index] = [(optionRef as unknown) as HTMLElement, (favoriteRef as unknown) as HTMLElement];
642
+ this.optionContainerRefCollection[index] = (optionContainerRef as unknown) as HTMLElement;
640
643
  };
641
644
 
642
645
  handleMenuKeys = (index: number, innerIndex: number, position: string) => {
@@ -144,7 +144,10 @@ export class ToolbarToggleGroup extends React.Component<ToolbarToggleGroupProps>
144
144
  </Button>
145
145
  </div>
146
146
  {isExpanded
147
- ? ReactDOM.createPortal(children, expandableContentRef.current.firstElementChild)
147
+ ? (ReactDOM.createPortal(
148
+ children,
149
+ expandableContentRef.current.firstElementChild
150
+ ) as React.ReactElement)
148
151
  : children}
149
152
  </div>
150
153
  );