@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.
- package/CHANGELOG.md +24 -0
- package/dist/esm/components/AboutModal/AboutModal.d.ts +1 -1
- package/dist/esm/components/AboutModal/AboutModal.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelector.js +6 -5
- package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
- package/dist/esm/components/DualListSelector/DualListSelectorPane.js.map +1 -1
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/esm/components/Modal/Modal.d.ts +1 -1
- package/dist/esm/components/Modal/Modal.js.map +1 -1
- package/dist/esm/components/Select/Select.d.ts.map +1 -1
- package/dist/esm/components/Select/Select.js +2 -1
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
- package/dist/js/components/AboutModal/AboutModal.d.ts +1 -1
- package/dist/js/components/AboutModal/AboutModal.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelector.js +6 -5
- package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
- package/dist/js/components/DualListSelector/DualListSelectorPane.js.map +1 -1
- package/dist/js/components/Menu/MenuItem.js.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/js/components/Modal/Modal.d.ts +1 -1
- package/dist/js/components/Modal/Modal.js.map +1 -1
- package/dist/js/components/Select/Select.d.ts.map +1 -1
- package/dist/js/components/Select/Select.js +2 -1
- package/dist/js/components/Select/Select.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
- package/dist/umd/react-core.css +1 -5
- package/dist/umd/react-core.js +8 -6
- package/dist/umd/react-core.min.css +1 -5
- package/package.json +6 -6
- package/src/components/AboutModal/AboutModal.tsx +1 -1
- package/src/components/DualListSelector/DualListSelector.tsx +57 -37
- package/src/components/DualListSelector/DualListSelectorPane.tsx +10 -8
- package/src/components/InputGroup/examples/InputGroup.md +5 -237
- package/src/components/InputGroup/examples/InputGroupBasic.tsx +31 -0
- package/src/components/InputGroup/examples/InputGroupWithDropdown.tsx +43 -0
- package/src/components/InputGroup/examples/InputGroupWithPopover.tsx +33 -0
- package/src/components/InputGroup/examples/InputGroupWithSiblings.tsx +32 -0
- package/src/components/InputGroup/examples/InputGroupWithTextarea.tsx +13 -0
- package/src/components/Label/examples/Label.md +5 -399
- package/src/components/Label/examples/LabelCompact.tsx +27 -0
- package/src/components/Label/examples/LabelFilled.tsx +167 -0
- package/src/components/Label/examples/LabelOutline.tsx +188 -0
- package/src/components/Label/examples/LabelRouterLink.tsx +20 -0
- package/src/components/Menu/MenuItem.tsx +1 -1
- package/src/components/MenuToggle/MenuToggle.tsx +1 -1
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/Select/Select.tsx +6 -3
- package/src/components/Toolbar/ToolbarToggleGroup.tsx +4 -1
- package/src/demos/Wizard/WizardDemo.md +66 -121
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import AtIcon from '@patternfly/react-icons/dist/esm/icons/at-icon';
|
|
3
|
+
import { InputGroup, InputGroupText, InputGroupTextVariant, TextInput, ValidatedOptions } from '@patternfly/react-core';
|
|
4
|
+
|
|
5
|
+
export const InputGroupBasic: React.FunctionComponent = () => (
|
|
6
|
+
<React.Fragment>
|
|
7
|
+
<InputGroup>
|
|
8
|
+
<TextInput id="textInput6" type="email" aria-label="email input field" />
|
|
9
|
+
<InputGroupText id="email-example">@example.com</InputGroupText>
|
|
10
|
+
</InputGroup>
|
|
11
|
+
<br />
|
|
12
|
+
<InputGroup>
|
|
13
|
+
<InputGroupText id="username">
|
|
14
|
+
<AtIcon />
|
|
15
|
+
</InputGroupText>
|
|
16
|
+
<TextInput
|
|
17
|
+
validated={ValidatedOptions.error}
|
|
18
|
+
id="textInput7"
|
|
19
|
+
type="email"
|
|
20
|
+
aria-label="Error state username example"
|
|
21
|
+
/>
|
|
22
|
+
</InputGroup>
|
|
23
|
+
<br />
|
|
24
|
+
<InputGroup>
|
|
25
|
+
<TextInput name="textIndex12" id="textInput12" type="text" aria-label="percentage" />
|
|
26
|
+
<InputGroupText id="plain-example" variant={InputGroupTextVariant.plain}>
|
|
27
|
+
%
|
|
28
|
+
</InputGroupText>
|
|
29
|
+
</InputGroup>
|
|
30
|
+
</React.Fragment>
|
|
31
|
+
);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, InputGroup, TextInput, Dropdown, DropdownToggle, DropdownItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const InputGroupWithDropdown: React.FunctionComponent = () => {
|
|
5
|
+
const [isOpen, setIsOpen] = React.useState<boolean>(false);
|
|
6
|
+
|
|
7
|
+
const onToggle = (isOpen: boolean) => {
|
|
8
|
+
setIsOpen(isOpen);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const onSelect = () => {
|
|
12
|
+
setIsOpen(false);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const dropdownItems = [
|
|
16
|
+
<DropdownItem key="opt-1" value="Option 1" component="button">
|
|
17
|
+
Option 1
|
|
18
|
+
</DropdownItem>,
|
|
19
|
+
<DropdownItem key="opt-2" value="Option 2" component="button">
|
|
20
|
+
Option 2
|
|
21
|
+
</DropdownItem>,
|
|
22
|
+
<DropdownItem key="opt-3" value="Option 3" component="button">
|
|
23
|
+
Option 3
|
|
24
|
+
</DropdownItem>
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<React.Fragment>
|
|
29
|
+
<InputGroup>
|
|
30
|
+
<Dropdown
|
|
31
|
+
onSelect={onSelect}
|
|
32
|
+
toggle={<DropdownToggle onToggle={onToggle}>Dropdown</DropdownToggle>}
|
|
33
|
+
isOpen={isOpen}
|
|
34
|
+
dropdownItems={dropdownItems}
|
|
35
|
+
/>
|
|
36
|
+
<TextInput id="textInput3" aria-label="input with dropdown and button" />
|
|
37
|
+
<Button id="inputDropdownButton1" variant="control">
|
|
38
|
+
Button
|
|
39
|
+
</Button>
|
|
40
|
+
</InputGroup>
|
|
41
|
+
</React.Fragment>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
3
|
+
import { Button, InputGroup, TextInput, Popover, PopoverPosition } from '@patternfly/react-core';
|
|
4
|
+
|
|
5
|
+
export const InputGroupWithPopover: React.FunctionComponent = () => (
|
|
6
|
+
<React.Fragment>
|
|
7
|
+
<InputGroup>
|
|
8
|
+
<TextInput name="textInput10" id="textInput10" type="text" aria-label="input example with popover" />
|
|
9
|
+
<Popover
|
|
10
|
+
aria-label="popover example"
|
|
11
|
+
position={PopoverPosition.top}
|
|
12
|
+
bodyContent="This field is an example of an input group with a popover."
|
|
13
|
+
>
|
|
14
|
+
<Button variant="control" aria-label="popover for input">
|
|
15
|
+
<QuestionCircleIcon />
|
|
16
|
+
</Button>
|
|
17
|
+
</Popover>
|
|
18
|
+
</InputGroup>
|
|
19
|
+
<br />
|
|
20
|
+
<InputGroup>
|
|
21
|
+
<TextInput name="textInput12" id="textInput12" type="text" aria-label="input example with popover" />
|
|
22
|
+
<Popover
|
|
23
|
+
aria-label="popover example"
|
|
24
|
+
position={PopoverPosition.top}
|
|
25
|
+
bodyContent="This field is an example of an input group with a popover."
|
|
26
|
+
>
|
|
27
|
+
<Button variant="plain" aria-label="Popover for input">
|
|
28
|
+
<QuestionCircleIcon />
|
|
29
|
+
</Button>
|
|
30
|
+
</Popover>
|
|
31
|
+
</InputGroup>
|
|
32
|
+
</React.Fragment>
|
|
33
|
+
);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import DollarSignIcon from '@patternfly/react-icons/dist/esm/icons/dollar-sign-icon';
|
|
3
|
+
import { Button, TextArea, InputGroup, InputGroupText, TextInput } from '@patternfly/react-core';
|
|
4
|
+
|
|
5
|
+
export const InputGroupWithSiblings: React.FunctionComponent = () => (
|
|
6
|
+
<React.Fragment>
|
|
7
|
+
<InputGroup>
|
|
8
|
+
<Button id="textAreaButton1" variant="control">
|
|
9
|
+
Button
|
|
10
|
+
</Button>
|
|
11
|
+
<TextArea name="textarea1" id="textarea1" aria-label="textarea with buttons" />
|
|
12
|
+
<Button variant="control">Button</Button>
|
|
13
|
+
</InputGroup>
|
|
14
|
+
<br />
|
|
15
|
+
<InputGroup>
|
|
16
|
+
<Button id="textAreaButton3" variant="control">
|
|
17
|
+
Button
|
|
18
|
+
</Button>
|
|
19
|
+
<Button variant="control">Button</Button>
|
|
20
|
+
<TextArea name="textarea3" id="textarea3" aria-label="textarea with 3 buttons" />
|
|
21
|
+
<Button variant="control">Button</Button>
|
|
22
|
+
</InputGroup>
|
|
23
|
+
<br />
|
|
24
|
+
<InputGroup>
|
|
25
|
+
<InputGroupText>
|
|
26
|
+
<DollarSignIcon />
|
|
27
|
+
</InputGroupText>
|
|
28
|
+
<TextInput id="textInput5" type="number" aria-label="Dollar amount input example" />
|
|
29
|
+
<InputGroupText>.00</InputGroupText>
|
|
30
|
+
</InputGroup>
|
|
31
|
+
</React.Fragment>
|
|
32
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, TextArea, InputGroup } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const InputGroupWithTextarea: React.FunctionComponent = () => (
|
|
5
|
+
<React.Fragment>
|
|
6
|
+
<InputGroup>
|
|
7
|
+
<TextArea name="textarea2" id="textarea2" aria-label="textarea with button" />
|
|
8
|
+
<Button id="textAreaButton2" variant="control">
|
|
9
|
+
Button
|
|
10
|
+
</Button>
|
|
11
|
+
</InputGroup>
|
|
12
|
+
</React.Fragment>
|
|
13
|
+
);
|
|
@@ -12,416 +12,22 @@ import { Link } from '@reach/router';
|
|
|
12
12
|
|
|
13
13
|
### Filled
|
|
14
14
|
|
|
15
|
-
```
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import { Label } from '@patternfly/react-core';
|
|
18
|
-
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
19
|
-
|
|
20
|
-
<React.Fragment>
|
|
21
|
-
<Label>Grey</Label> <Label icon={<InfoCircleIcon />}>Grey icon</Label>{' '}
|
|
22
|
-
<Label onClose={Function.prototype}>Grey removable</Label>{' '}
|
|
23
|
-
<Label icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
24
|
-
Grey icon removable
|
|
25
|
-
</Label>{' '}
|
|
26
|
-
<Label href="#filled">Grey link</Label>{' '}
|
|
27
|
-
<Label href="#filled" onClose={Function.prototype}>
|
|
28
|
-
Grey link removable
|
|
29
|
-
</Label>
|
|
30
|
-
<Label icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
31
|
-
Grey label with icon that overflows
|
|
32
|
-
</Label>
|
|
33
|
-
<br />
|
|
34
|
-
<br />
|
|
35
|
-
<Label color="blue">Blue</Label>{' '}
|
|
36
|
-
<Label color="blue" icon={<InfoCircleIcon />}>
|
|
37
|
-
Blue icon
|
|
38
|
-
</Label>{' '}
|
|
39
|
-
<Label color="blue" onClose={Function.prototype}>
|
|
40
|
-
Blue removable
|
|
41
|
-
</Label>{' '}
|
|
42
|
-
<Label color="blue" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
43
|
-
Blue icon removable
|
|
44
|
-
</Label>{' '}
|
|
45
|
-
<Label color="blue" href="#filled">
|
|
46
|
-
Blue link
|
|
47
|
-
</Label>{' '}
|
|
48
|
-
<Label color="blue" href="#filled" onClose={Function.prototype}>
|
|
49
|
-
Blue link removable
|
|
50
|
-
</Label>
|
|
51
|
-
<Label color="blue" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
52
|
-
Blue label with icon that overflows
|
|
53
|
-
</Label>
|
|
54
|
-
<br />
|
|
55
|
-
<br />
|
|
56
|
-
<Label color="green">Green</Label>{' '}
|
|
57
|
-
<Label color="green" icon={<InfoCircleIcon />}>
|
|
58
|
-
Green icon
|
|
59
|
-
</Label>{' '}
|
|
60
|
-
<Label color="green" onClose={Function.prototype}>
|
|
61
|
-
Green removable
|
|
62
|
-
</Label>{' '}
|
|
63
|
-
<Label color="green" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
64
|
-
Green icon removable
|
|
65
|
-
</Label>{' '}
|
|
66
|
-
<Label color="green" href="#filled">
|
|
67
|
-
Green link
|
|
68
|
-
</Label>{' '}
|
|
69
|
-
<Label color="green" href="#filled" onClose={Function.prototype}>
|
|
70
|
-
Green link removable
|
|
71
|
-
</Label>
|
|
72
|
-
<Label color="green" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
73
|
-
Green label with icon that overflows
|
|
74
|
-
</Label>
|
|
75
|
-
<br />
|
|
76
|
-
<br />
|
|
77
|
-
<Label color="orange">Orange</Label>{' '}
|
|
78
|
-
<Label color="orange" icon={<InfoCircleIcon />}>
|
|
79
|
-
Orange icon
|
|
80
|
-
</Label>{' '}
|
|
81
|
-
<Label color="orange" onClose={Function.prototype}>
|
|
82
|
-
Orange removable
|
|
83
|
-
</Label>{' '}
|
|
84
|
-
<Label color="orange" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
85
|
-
Orange icon removable
|
|
86
|
-
</Label>{' '}
|
|
87
|
-
<Label color="orange" href="#filled">
|
|
88
|
-
Orange link
|
|
89
|
-
</Label>{' '}
|
|
90
|
-
<Label color="orange" href="#filled" onClose={Function.prototype}>
|
|
91
|
-
Orange link removable
|
|
92
|
-
</Label>
|
|
93
|
-
<Label color="orange" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
94
|
-
Orange label with icon that overflows
|
|
95
|
-
</Label>
|
|
96
|
-
<br />
|
|
97
|
-
<br />
|
|
98
|
-
<Label color="red">Red</Label>{' '}
|
|
99
|
-
<Label color="red" icon={<InfoCircleIcon />}>
|
|
100
|
-
Red icon
|
|
101
|
-
</Label>{' '}
|
|
102
|
-
<Label color="red" onClose={Function.prototype}>
|
|
103
|
-
Red removable
|
|
104
|
-
</Label>{' '}
|
|
105
|
-
<Label color="red" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
106
|
-
Red icon removable
|
|
107
|
-
</Label>{' '}
|
|
108
|
-
<Label color="red" href="#filled">
|
|
109
|
-
Red link
|
|
110
|
-
</Label>{' '}
|
|
111
|
-
<Label color="red" href="#filled" onClose={Function.prototype}>
|
|
112
|
-
Red link removable
|
|
113
|
-
</Label>
|
|
114
|
-
<Label color="red" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
115
|
-
Red label with icon that overflows
|
|
116
|
-
</Label>
|
|
117
|
-
<br />
|
|
118
|
-
<br />
|
|
119
|
-
<Label color="purple">Purple</Label>{' '}
|
|
120
|
-
<Label color="purple" icon={<InfoCircleIcon />}>
|
|
121
|
-
Purple icon
|
|
122
|
-
</Label>{' '}
|
|
123
|
-
<Label color="purple" onClose={Function.prototype}>
|
|
124
|
-
Purple removable
|
|
125
|
-
</Label>{' '}
|
|
126
|
-
<Label color="purple" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
127
|
-
Purple icon removable
|
|
128
|
-
</Label>{' '}
|
|
129
|
-
<Label color="purple" href="#filled">
|
|
130
|
-
Purple link
|
|
131
|
-
</Label>{' '}
|
|
132
|
-
<Label color="purple" href="#filled" onClose={Function.prototype}>
|
|
133
|
-
Purple link removable
|
|
134
|
-
</Label>
|
|
135
|
-
<Label color="purple" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
136
|
-
Purple label with icon that overflows
|
|
137
|
-
</Label>
|
|
138
|
-
<br />
|
|
139
|
-
<br />
|
|
140
|
-
<Label color="cyan">Cyan</Label>{' '}
|
|
141
|
-
<Label color="cyan" icon={<InfoCircleIcon />}>
|
|
142
|
-
Cyan icon
|
|
143
|
-
</Label>{' '}
|
|
144
|
-
<Label color="cyan" onClose={Function.prototype}>
|
|
145
|
-
Cyan removable
|
|
146
|
-
</Label>{' '}
|
|
147
|
-
<Label color="cyan" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
148
|
-
Cyan icon removable
|
|
149
|
-
</Label>{' '}
|
|
150
|
-
<Label color="cyan" href="#filled">
|
|
151
|
-
Cyan link
|
|
152
|
-
</Label>{' '}
|
|
153
|
-
<Label color="cyan" href="#filled" onClose={Function.prototype}>
|
|
154
|
-
Cyan link removable
|
|
155
|
-
</Label>
|
|
156
|
-
<Label color="cyan" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
157
|
-
Cyan label with icon that overflows
|
|
158
|
-
</Label>
|
|
159
|
-
<br />
|
|
160
|
-
<br />
|
|
161
|
-
<Label color="gold">Gold</Label>{' '}
|
|
162
|
-
<Label color="gold" icon={<InfoCircleIcon />}>
|
|
163
|
-
Gold icon
|
|
164
|
-
</Label>{' '}
|
|
165
|
-
<Label color="gold" onClose={Function.prototype}>
|
|
166
|
-
Gold removable
|
|
167
|
-
</Label>{' '}
|
|
168
|
-
<Label color="gold" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
169
|
-
Gold icon removable
|
|
170
|
-
</Label>{' '}
|
|
171
|
-
<Label color="gold" href="#filled">
|
|
172
|
-
Gold link
|
|
173
|
-
</Label>{' '}
|
|
174
|
-
<Label color="gold" href="#filled" onClose={Function.prototype}>
|
|
175
|
-
Gold link removable
|
|
176
|
-
</Label>
|
|
177
|
-
<Label color="gold" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
178
|
-
Gold label with icon that overflows
|
|
179
|
-
</Label>
|
|
180
|
-
</React.Fragment>;
|
|
15
|
+
```ts file="LabelFilled.tsx"
|
|
181
16
|
```
|
|
182
17
|
|
|
183
18
|
### Outline
|
|
184
19
|
|
|
185
|
-
```
|
|
186
|
-
import React from 'react';
|
|
187
|
-
import { Label } from '@patternfly/react-core';
|
|
188
|
-
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
189
|
-
|
|
190
|
-
<React.Fragment>
|
|
191
|
-
<Label variant="outline">Grey</Label>{' '}
|
|
192
|
-
<Label variant="outline" icon={<InfoCircleIcon />}>
|
|
193
|
-
Grey icon
|
|
194
|
-
</Label>{' '}
|
|
195
|
-
<Label variant="outline" onClose={Function.prototype}>
|
|
196
|
-
Grey removable
|
|
197
|
-
</Label>{' '}
|
|
198
|
-
<Label variant="outline" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
199
|
-
Grey icon removable
|
|
200
|
-
</Label>{' '}
|
|
201
|
-
<Label variant="outline" href="#outline">
|
|
202
|
-
Grey link
|
|
203
|
-
</Label>{' '}
|
|
204
|
-
<Label variant="outline" href="#outline" onClose={Function.prototype}>
|
|
205
|
-
Grey link removable
|
|
206
|
-
</Label>
|
|
207
|
-
<Label variant="outline" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
208
|
-
Grey label with icon that overflows
|
|
209
|
-
</Label>
|
|
210
|
-
<br />
|
|
211
|
-
<br />
|
|
212
|
-
<Label variant="outline" color="blue">
|
|
213
|
-
Blue
|
|
214
|
-
</Label>{' '}
|
|
215
|
-
<Label variant="outline" color="blue" icon={<InfoCircleIcon />}>
|
|
216
|
-
Blue icon
|
|
217
|
-
</Label>{' '}
|
|
218
|
-
<Label variant="outline" color="blue" onClose={Function.prototype}>
|
|
219
|
-
Blue removable
|
|
220
|
-
</Label>{' '}
|
|
221
|
-
<Label variant="outline" color="blue" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
222
|
-
Blue icon removable
|
|
223
|
-
</Label>{' '}
|
|
224
|
-
<Label variant="outline" color="blue" href="#outline">
|
|
225
|
-
Blue link
|
|
226
|
-
</Label>{' '}
|
|
227
|
-
<Label variant="outline" color="blue" href="#outline" onClose={Function.prototype}>
|
|
228
|
-
Blue link removable
|
|
229
|
-
</Label>
|
|
230
|
-
<Label variant="outline" color="blue" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
231
|
-
Blue label with icon that overflows
|
|
232
|
-
</Label>
|
|
233
|
-
<br />
|
|
234
|
-
<br />
|
|
235
|
-
<Label variant="outline" color="green">
|
|
236
|
-
Green
|
|
237
|
-
</Label>{' '}
|
|
238
|
-
<Label variant="outline" color="green" icon={<InfoCircleIcon />}>
|
|
239
|
-
Green icon
|
|
240
|
-
</Label>{' '}
|
|
241
|
-
<Label variant="outline" color="green" onClose={Function.prototype}>
|
|
242
|
-
Green removable
|
|
243
|
-
</Label>{' '}
|
|
244
|
-
<Label variant="outline" color="green" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
245
|
-
Green icon removable
|
|
246
|
-
</Label>{' '}
|
|
247
|
-
<Label variant="outline" color="green" href="#outline">
|
|
248
|
-
Green link
|
|
249
|
-
</Label>{' '}
|
|
250
|
-
<Label variant="outline" color="green" href="#outline" onClose={Function.prototype}>
|
|
251
|
-
Green link removable
|
|
252
|
-
</Label>
|
|
253
|
-
<Label variant="outline" color="green" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
254
|
-
Green label with icon that overflows
|
|
255
|
-
</Label>
|
|
256
|
-
<br />
|
|
257
|
-
<br />
|
|
258
|
-
<Label variant="outline" color="orange">
|
|
259
|
-
Orange
|
|
260
|
-
</Label>{' '}
|
|
261
|
-
<Label variant="outline" color="orange" icon={<InfoCircleIcon />}>
|
|
262
|
-
Orange icon
|
|
263
|
-
</Label>{' '}
|
|
264
|
-
<Label variant="outline" color="orange" onClose={Function.prototype}>
|
|
265
|
-
Orange removable
|
|
266
|
-
</Label>{' '}
|
|
267
|
-
<Label variant="outline" color="orange" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
268
|
-
Orange icon removable
|
|
269
|
-
</Label>{' '}
|
|
270
|
-
<Label variant="outline" color="orange" href="#outline">
|
|
271
|
-
Orange link
|
|
272
|
-
</Label>{' '}
|
|
273
|
-
<Label variant="outline" color="orange" href="#outline" onClose={Function.prototype}>
|
|
274
|
-
Orange link removable
|
|
275
|
-
</Label>
|
|
276
|
-
<Label variant="outline" color="orange" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
277
|
-
Orange label with icon that overflows
|
|
278
|
-
</Label>
|
|
279
|
-
<br />
|
|
280
|
-
<br />
|
|
281
|
-
<Label variant="outline" color="red">
|
|
282
|
-
Red
|
|
283
|
-
</Label>{' '}
|
|
284
|
-
<Label variant="outline" color="red" icon={<InfoCircleIcon />}>
|
|
285
|
-
Red icon
|
|
286
|
-
</Label>{' '}
|
|
287
|
-
<Label variant="outline" color="red" onClose={Function.prototype}>
|
|
288
|
-
Red removable
|
|
289
|
-
</Label>{' '}
|
|
290
|
-
<Label variant="outline" color="red" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
291
|
-
Red icon removable
|
|
292
|
-
</Label>{' '}
|
|
293
|
-
<Label variant="outline" color="red" href="#outline">
|
|
294
|
-
Red link
|
|
295
|
-
</Label>{' '}
|
|
296
|
-
<Label variant="outline" color="red" href="#outline" onClose={Function.prototype}>
|
|
297
|
-
Red link removable
|
|
298
|
-
</Label>
|
|
299
|
-
<Label variant="outline" color="red" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
300
|
-
Red label with icon that overflows
|
|
301
|
-
</Label>
|
|
302
|
-
<br />
|
|
303
|
-
<br />
|
|
304
|
-
<Label variant="outline" color="purple">
|
|
305
|
-
Purple
|
|
306
|
-
</Label>{' '}
|
|
307
|
-
<Label variant="outline" color="purple" icon={<InfoCircleIcon />}>
|
|
308
|
-
Purple icon
|
|
309
|
-
</Label>{' '}
|
|
310
|
-
<Label variant="outline" color="purple" onClose={Function.prototype}>
|
|
311
|
-
Purple removable
|
|
312
|
-
</Label>{' '}
|
|
313
|
-
<Label variant="outline" color="purple" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
314
|
-
Purple icon removable
|
|
315
|
-
</Label>{' '}
|
|
316
|
-
<Label variant="outline" color="purple" href="#outline">
|
|
317
|
-
Purple link
|
|
318
|
-
</Label>{' '}
|
|
319
|
-
<Label variant="outline" color="purple" href="#outline" onClose={Function.prototype}>
|
|
320
|
-
Purple link removable
|
|
321
|
-
</Label>
|
|
322
|
-
<Label variant="outline" color="purple" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
323
|
-
Purple label with icon that overflows
|
|
324
|
-
</Label>
|
|
325
|
-
<br />
|
|
326
|
-
<br />
|
|
327
|
-
<Label variant="outline" color="cyan">
|
|
328
|
-
Cyan
|
|
329
|
-
</Label>{' '}
|
|
330
|
-
<Label variant="outline" color="cyan" icon={<InfoCircleIcon />}>
|
|
331
|
-
Cyan icon
|
|
332
|
-
</Label>{' '}
|
|
333
|
-
<Label variant="outline" color="cyan" onClose={Function.prototype}>
|
|
334
|
-
Cyan removable
|
|
335
|
-
</Label>{' '}
|
|
336
|
-
<Label variant="outline" color="cyan" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
337
|
-
Cyan icon removable
|
|
338
|
-
</Label>{' '}
|
|
339
|
-
<Label variant="outline" color="cyan" href="#outline">
|
|
340
|
-
Cyan link
|
|
341
|
-
</Label>{' '}
|
|
342
|
-
<Label variant="outline" color="cyan" href="#outline" onClose={Function.prototype}>
|
|
343
|
-
Cyan link removable
|
|
344
|
-
</Label>
|
|
345
|
-
<Label variant="outline" color="cyan" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
346
|
-
Cyan label with icon that overflows
|
|
347
|
-
</Label>
|
|
348
|
-
<br />
|
|
349
|
-
<br />
|
|
350
|
-
<Label variant="outline" color="gold">
|
|
351
|
-
Gold
|
|
352
|
-
</Label>{' '}
|
|
353
|
-
<Label variant="outline" color="gold" icon={<InfoCircleIcon />}>
|
|
354
|
-
Gold icon
|
|
355
|
-
</Label>{' '}
|
|
356
|
-
<Label variant="outline" color="gold" onClose={Function.prototype}>
|
|
357
|
-
Gold removable
|
|
358
|
-
</Label>{' '}
|
|
359
|
-
<Label variant="outline" color="gold" icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
360
|
-
Gold icon removable
|
|
361
|
-
</Label>{' '}
|
|
362
|
-
<Label variant="outline" color="gold" href="#outline">
|
|
363
|
-
Gold link
|
|
364
|
-
</Label>{' '}
|
|
365
|
-
<Label variant="outline" color="gold" href="#outline" onClose={Function.prototype}>
|
|
366
|
-
Gold link removable
|
|
367
|
-
</Label>
|
|
368
|
-
<Label variant="outline" color="gold" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
369
|
-
Gold label with icon that overflows
|
|
370
|
-
</Label>
|
|
371
|
-
</React.Fragment>;
|
|
20
|
+
```ts file="LabelOutline.tsx"
|
|
372
21
|
```
|
|
373
22
|
|
|
374
23
|
### Compact
|
|
375
24
|
|
|
376
|
-
```
|
|
377
|
-
import React from 'react';
|
|
378
|
-
import { Label } from '@patternfly/react-core';
|
|
379
|
-
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
380
|
-
|
|
381
|
-
<React.Fragment>
|
|
382
|
-
<Label isCompact>Grey</Label>{' '}
|
|
383
|
-
<Label isCompact icon={<InfoCircleIcon />}>
|
|
384
|
-
Compact icon
|
|
385
|
-
</Label>{' '}
|
|
386
|
-
<Label isCompact onClose={Function.prototype}>
|
|
387
|
-
Compact removable
|
|
388
|
-
</Label>{' '}
|
|
389
|
-
<Label isCompact icon={<InfoCircleIcon />} onClose={Function.prototype}>
|
|
390
|
-
Compact icon removable
|
|
391
|
-
</Label>{' '}
|
|
392
|
-
<Label isCompact href="#outline">
|
|
393
|
-
Compact link
|
|
394
|
-
</Label>{' '}
|
|
395
|
-
<Label isCompact href="#outline" onClose={Function.prototype}>
|
|
396
|
-
Compact link removable
|
|
397
|
-
</Label>
|
|
398
|
-
<Label isCompact icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
|
|
399
|
-
Compact label with icon that overflows
|
|
400
|
-
</Label>
|
|
401
|
-
</React.Fragment>;
|
|
25
|
+
```ts file="LabelCompact.tsx"
|
|
402
26
|
```
|
|
403
27
|
|
|
404
28
|
### Router link
|
|
405
29
|
|
|
406
|
-
```
|
|
407
|
-
import React from 'react';
|
|
408
|
-
import { Label } from '@patternfly/react-core';
|
|
409
|
-
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
410
|
-
import { Link } from '@reach/router';
|
|
411
|
-
|
|
412
|
-
<Label
|
|
413
|
-
color="blue"
|
|
414
|
-
icon={<InfoCircleIcon />}
|
|
415
|
-
onClose={Function.prototype}
|
|
416
|
-
isTruncated
|
|
417
|
-
render={({ className, content, componentRef }) => (
|
|
418
|
-
<Link to="/" className={className} innerRef={componentRef}>
|
|
419
|
-
{content}
|
|
420
|
-
</Link>
|
|
421
|
-
)}
|
|
422
|
-
>
|
|
423
|
-
Blue label router link with icon that overflows
|
|
424
|
-
</Label>;
|
|
30
|
+
```ts file="LabelRouterLink.tsx"
|
|
425
31
|
```
|
|
426
32
|
|
|
427
33
|
### Editable
|
|
@@ -430,5 +36,5 @@ Click or press either enter or space to begin editing a label. After editing, cl
|
|
|
430
36
|
|
|
431
37
|
You can also customize any Label's close button aria-label as this example shows with `closeBtnAriaLabel`.
|
|
432
38
|
|
|
433
|
-
```
|
|
39
|
+
```ts file="LabelEditable.tsx" isBeta
|
|
434
40
|
```
|
|
@@ -0,0 +1,27 @@
|
|
|
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 LabelCompact: React.FunctionComponent = () => (
|
|
6
|
+
<React.Fragment>
|
|
7
|
+
<Label isCompact>Grey</Label>{' '}
|
|
8
|
+
<Label isCompact icon={<InfoCircleIcon />}>
|
|
9
|
+
Compact icon
|
|
10
|
+
</Label>{' '}
|
|
11
|
+
<Label isCompact onClose={() => Function.prototype}>
|
|
12
|
+
Compact removable
|
|
13
|
+
</Label>{' '}
|
|
14
|
+
<Label isCompact icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
|
|
15
|
+
Compact icon removable
|
|
16
|
+
</Label>{' '}
|
|
17
|
+
<Label isCompact href="#outline">
|
|
18
|
+
Compact link
|
|
19
|
+
</Label>{' '}
|
|
20
|
+
<Label isCompact href="#outline" onClose={() => Function.prototype}>
|
|
21
|
+
Compact link removable
|
|
22
|
+
</Label>
|
|
23
|
+
<Label isCompact icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
|
|
24
|
+
Compact label with icon that overflows
|
|
25
|
+
</Label>
|
|
26
|
+
</React.Fragment>
|
|
27
|
+
);
|