Debian Codegraph @

node/@patternfly/react-core/src/components/Label/examples/LabelOutline.tsx

raw
1 import { Fragment } from 'react';
2 import { Label, LabelColor, LabelStatus } from '@patternfly/react-core';
3 import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
4
5 export const LabelOutline: React.FunctionComponent = () => {
6 const logColor = (color: string) => {
7 // eslint-disable-next-line no-console
8 console.log(color, 'label clicked');
9 };
10 return (
11 <Fragment>
12 <strong>Non-status:</strong>
13 <br />
14 <br />
15 <Label variant="outline">Grey</Label>
16 <Label variant="outline" icon={<CubeIcon />}>
17 Grey icon
18 </Label>
19 <Label variant="outline" onClose={() => Function.prototype}>
20 Grey removable
21 </Label>
22 <Label variant="outline" icon={<CubeIcon />} onClose={() => Function.prototype}>
23 Grey icon removable
24 </Label>
25 <Label variant="outline" href="#outline">
26 Grey link
27 </Label>
28 <Label variant="outline" href="#outline" onClose={() => Function.prototype}>
29 Grey link removable
30 </Label>{' '}
31 <Label variant="outline" onClick={() => logColor('grey')}>
32 Grey clickable
33 </Label>
34 <Label variant="outline" onClick={() => logColor('grey')} onClose={() => Function.prototype}>
35 Grey clickable removable
36 </Label>
37 <Label variant="outline" icon={<CubeIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
38 Grey label with icon that overflows
39 </Label>{' '}
40 <Label variant="outline" isDisabled icon={<CubeIcon />} href="#filled" onClose={() => Function.prototype}>
41 Grey link removable (disabled)
42 </Label>{' '}
43 <Label
44 variant="outline"
45 isDisabled
46 icon={<CubeIcon />}
47 onClick={() => logColor('grey')}
48 onClose={() => Function.prototype}
49 >
50 Grey clickable removable (disabled)
51 </Label>
52 <br />
53 <br />
54 <Label variant="outline" color={LabelColor.blue}>
55 Blue
56 </Label>
57 <Label variant="outline" color={LabelColor.blue} icon={<CubeIcon />}>
58 Blue icon
59 </Label>
60 <Label variant="outline" color={LabelColor.blue} onClose={() => Function.prototype}>
61 Blue removable
62 </Label>
63 <Label variant="outline" color={LabelColor.blue} icon={<CubeIcon />} onClose={() => Function.prototype}>
64 Blue icon removable
65 </Label>
66 <Label variant="outline" color={LabelColor.blue} href="#outline">
67 Blue link
68 </Label>
69 <Label variant="outline" color={LabelColor.blue} href="#outline" onClose={() => Function.prototype}>
70 Blue link removable
71 </Label>{' '}
72 <Label variant="outline" color={LabelColor.blue} onClick={() => logColor('blue')}>
73 Blue clickable
74 </Label>
75 <Label
76 variant="outline"
77 color={LabelColor.blue}
78 onClick={() => logColor('blue')}
79 onClose={() => Function.prototype}
80 >
81 Blue clickable removable
82 </Label>
83 <Label
84 variant="outline"
85 color={LabelColor.blue}
86 icon={<CubeIcon />}
87 onClose={() => Function.prototype}
88 textMaxWidth="16ch"
89 >
90 Blue label with icon that overflows
91 </Label>{' '}
92 <Label
93 variant="outline"
94 color={LabelColor.blue}
95 isDisabled
96 icon={<CubeIcon />}
97 href="#filled"
98 onClose={() => Function.prototype}
99 >
100 Blue link removable (disabled)
101 </Label>{' '}
102 <Label
103 variant="outline"
104 color={LabelColor.blue}
105 isDisabled
106 icon={<CubeIcon />}
107 onClick={() => logColor('blue')}
108 onClose={() => Function.prototype}
109 >
110 Blue clickable removable (disabled)
111 </Label>
112 <br />
113 <br />
114 <Label variant="outline" color={LabelColor.green}>
115 Green
116 </Label>
117 <Label variant="outline" color={LabelColor.green} icon={<CubeIcon />}>
118 Green icon
119 </Label>
120 <Label variant="outline" color={LabelColor.green} onClose={() => Function.prototype}>
121 Green removable
122 </Label>
123 <Label variant="outline" color={LabelColor.green} icon={<CubeIcon />} onClose={() => Function.prototype}>
124 Green icon removable
125 </Label>
126 <Label variant="outline" color={LabelColor.green} href="#outline">
127 Green link
128 </Label>
129 <Label variant="outline" color={LabelColor.green} href="#outline" onClose={() => Function.prototype}>
130 Green link removable
131 </Label>{' '}
132 <Label variant="outline" color={LabelColor.green} onClick={() => logColor('green')}>
133 Green clickable
134 </Label>
135 <Label
136 variant="outline"
137 color={LabelColor.green}
138 onClick={() => logColor('green')}
139 onClose={() => Function.prototype}
140 >
141 Green clickable removable
142 </Label>
143 <Label
144 variant="outline"
145 color={LabelColor.green}
146 icon={<CubeIcon />}
147 onClose={() => Function.prototype}
148 textMaxWidth="16ch"
149 >
150 Green label with icon that overflows
151 </Label>{' '}
152 <Label
153 variant="outline"
154 color={LabelColor.green}
155 isDisabled
156 icon={<CubeIcon />}
157 href="#filled"
158 onClose={() => Function.prototype}
159 >
160 Green link removable (disabled)
161 </Label>{' '}
162 <Label
163 variant="outline"
164 color={LabelColor.green}
165 isDisabled
166 icon={<CubeIcon />}
167 onClick={() => logColor('green')}
168 onClose={() => Function.prototype}
169 >
170 Green clickable removable (disabled)
171 </Label>
172 <br />
173 <br />
174 <Label variant="outline" color={LabelColor.orange}>
175 Orange
176 </Label>
177 <Label variant="outline" color={LabelColor.orange} icon={<CubeIcon />}>
178 Orange icon
179 </Label>
180 <Label variant="outline" color={LabelColor.orange} onClose={() => Function.prototype}>
181 Orange removable
182 </Label>
183 <Label variant="outline" color={LabelColor.orange} icon={<CubeIcon />} onClose={() => Function.prototype}>
184 Orange icon removable
185 </Label>
186 <Label variant="outline" color={LabelColor.orange} href="#outline">
187 Orange link
188 </Label>
189 <Label variant="outline" color={LabelColor.orange} href="#outline" onClose={() => Function.prototype}>
190 Orange link removable
191 </Label>{' '}
192 <Label variant="outline" color={LabelColor.orange} onClick={() => logColor('orange')}>
193 Orange clickable
194 </Label>
195 <Label
196 variant="outline"
197 color={LabelColor.orange}
198 onClick={() => logColor('orange')}
199 onClose={() => Function.prototype}
200 >
201 Orange clickable removable
202 </Label>{' '}
203 <Label
204 variant="outline"
205 color={LabelColor.orange}
206 icon={<CubeIcon />}
207 onClose={() => Function.prototype}
208 textMaxWidth="16ch"
209 >
210 Orange label with icon that overflows
211 </Label>{' '}
212 <Label
213 variant="outline"
214 color={LabelColor.orange}
215 isDisabled
216 icon={<CubeIcon />}
217 href="#filled"
218 onClose={() => Function.prototype}
219 >
220 Orange link removable (disabled)
221 </Label>{' '}
222 <Label
223 variant="outline"
224 color={LabelColor.orange}
225 isDisabled
226 icon={<CubeIcon />}
227 onClick={() => logColor('orange')}
228 onClose={() => Function.prototype}
229 >
230 Orange clickable removable (disabled)
231 </Label>
232 <br />
233 <br />
234 <Label variant="outline" color={LabelColor.red}>
235 Red
236 </Label>
237 <Label variant="outline" color={LabelColor.red} icon={<CubeIcon />}>
238 Red icon
239 </Label>
240 <Label variant="outline" color={LabelColor.red} onClose={() => Function.prototype}>
241 Red removable
242 </Label>
243 <Label variant="outline" color={LabelColor.red} icon={<CubeIcon />} onClose={() => Function.prototype}>
244 Red icon removable
245 </Label>
246 <Label variant="outline" color={LabelColor.red} href="#outline">
247 Red link
248 </Label>
249 <Label variant="outline" color={LabelColor.red} href="#outline" onClose={() => Function.prototype}>
250 Red link removable
251 </Label>{' '}
252 <Label variant="outline" color={LabelColor.red} onClick={() => logColor('red')}>
253 Red clickable
254 </Label>
255 <Label
256 variant="outline"
257 color={LabelColor.red}
258 onClick={() => logColor('red')}
259 onClose={() => Function.prototype}
260 >
261 Red clickable removable
262 </Label>
263 <Label
264 variant="outline"
265 color={LabelColor.red}
266 icon={<CubeIcon />}
267 onClose={() => Function.prototype}
268 textMaxWidth="16ch"
269 >
270 Red label with icon that overflows
271 </Label>
272 <br />
273 <br />
274 <Label variant="outline" color={LabelColor.orangered}>
275 Orange red
276 </Label>
277 <Label variant="outline" color={LabelColor.orangered} icon={<CubeIcon />}>
278 Orange red icon
279 </Label>
280 <Label variant="outline" color={LabelColor.orangered} onClose={() => Function.prototype}>
281 Orange red removable
282 </Label>
283 <Label variant="outline" color={LabelColor.orangered} icon={<CubeIcon />} onClose={() => Function.prototype}>
284 Orange red icon removable
285 </Label>
286 <Label variant="outline" color={LabelColor.orangered} href="#outline">
287 Orange red link
288 </Label>
289 <Label variant="outline" color={LabelColor.orangered} href="#outline" onClose={() => Function.prototype}>
290 Orange red link removable
291 </Label>
292 <Label variant="outline" color={LabelColor.orangered} onClick={() => logColor('orangered')}>
293 Orange red clickable
294 </Label>
295 <Label
296 variant="outline"
297 color={LabelColor.orangered}
298 onClick={() => logColor('orangered')}
299 onClose={() => Function.prototype}
300 >
301 Orange red clickable removable
302 </Label>
303 <Label
304 variant="outline"
305 color={LabelColor.orangered}
306 icon={<CubeIcon />}
307 onClose={() => Function.prototype}
308 textMaxWidth="16ch"
309 >
310 Orange red label with icon that overflows
311 </Label>
312 <br />
313 <br />
314 <Label variant="outline" color={LabelColor.purple}>
315 Purple
316 </Label>
317 <Label variant="outline" color={LabelColor.purple} icon={<CubeIcon />}>
318 Purple icon
319 </Label>
320 <Label variant="outline" color={LabelColor.purple} onClose={() => Function.prototype}>
321 Purple removable
322 </Label>
323 <Label variant="outline" color={LabelColor.purple} icon={<CubeIcon />} onClose={() => Function.prototype}>
324 Purple icon removable
325 </Label>
326 <Label variant="outline" color={LabelColor.purple} href="#outline">
327 Purple link
328 </Label>
329 <Label variant="outline" color={LabelColor.purple} href="#outline" onClose={() => Function.prototype}>
330 Purple link removable
331 </Label>{' '}
332 <Label variant="outline" color={LabelColor.purple} onClick={() => logColor('purple')}>
333 Purple clickable
334 </Label>
335 <Label
336 variant="outline"
337 color={LabelColor.purple}
338 onClick={() => logColor('purple')}
339 onClose={() => Function.prototype}
340 >
341 Purple clickable removable
342 </Label>{' '}
343 <Label
344 variant="outline"
345 color={LabelColor.purple}
346 icon={<CubeIcon />}
347 onClose={() => Function.prototype}
348 textMaxWidth="16ch"
349 >
350 Purple label with icon that overflows
351 </Label>{' '}
352 <Label
353 variant="outline"
354 color={LabelColor.purple}
355 isDisabled
356 icon={<CubeIcon />}
357 href="#filled"
358 onClose={() => Function.prototype}
359 >
360 Purple link removable (disabled)
361 </Label>{' '}
362 <Label
363 variant="outline"
364 color={LabelColor.purple}
365 isDisabled
366 icon={<CubeIcon />}
367 onClick={() => logColor('purple')}
368 onClose={() => Function.prototype}
369 >
370 Purple clickable removable (disabled)
371 </Label>
372 <br />
373 <br />
374 <Label variant="outline" color={LabelColor.teal}>
375 Teal
376 </Label>
377 <Label variant="outline" color={LabelColor.teal} icon={<CubeIcon />}>
378 Teal icon
379 </Label>
380 <Label variant="outline" color={LabelColor.teal} onClose={() => Function.prototype}>
381 Teal removable
382 </Label>
383 <Label variant="outline" color={LabelColor.teal} icon={<CubeIcon />} onClose={() => Function.prototype}>
384 Teal icon removable
385 </Label>
386 <Label variant="outline" color={LabelColor.teal} href="#outline">
387 Teal link
388 </Label>
389 <Label variant="outline" color={LabelColor.teal} href="#outline" onClose={() => Function.prototype}>
390 Teal link removable
391 </Label>{' '}
392 <Label variant="outline" color={LabelColor.teal} onClick={() => logColor('teal')}>
393 Teal clickable
394 </Label>
395 <Label
396 variant="outline"
397 color={LabelColor.teal}
398 onClick={() => logColor('teal')}
399 onClose={() => Function.prototype}
400 >
401 Teal clickable removable
402 </Label>
403 <Label
404 variant="outline"
405 color={LabelColor.teal}
406 icon={<CubeIcon />}
407 onClose={() => Function.prototype}
408 textMaxWidth="16ch"
409 >
410 Teal label with icon that overflows
411 </Label>{' '}
412 <Label
413 variant="outline"
414 color={LabelColor.teal}
415 isDisabled
416 icon={<CubeIcon />}
417 href="#filled"
418 onClose={() => Function.prototype}
419 >
420 Teal link removable (disabled)
421 </Label>{' '}
422 <Label
423 variant="outline"
424 color={LabelColor.teal}
425 isDisabled
426 icon={<CubeIcon />}
427 onClick={() => logColor('teal')}
428 onClose={() => Function.prototype}
429 >
430 Teal clickable removable (disabled)
431 </Label>
432 <br />
433 <br />
434 <Label variant="outline" color={LabelColor.yellow}>
435 Yellow
436 </Label>
437 <Label variant="outline" color={LabelColor.yellow} icon={<CubeIcon />}>
438 Yellow icon
439 </Label>
440 <Label variant="outline" color={LabelColor.yellow} onClose={() => Function.prototype}>
441 Yellow removable
442 </Label>
443 <Label variant="outline" color={LabelColor.yellow} icon={<CubeIcon />} onClose={() => Function.prototype}>
444 Yellow icon removable
445 </Label>
446 <Label variant="outline" color={LabelColor.yellow} href="#outline">
447 Yellow link
448 </Label>
449 <Label variant="outline" color={LabelColor.yellow} href="#outline" onClose={() => Function.prototype}>
450 Yellow link removable
451 </Label>{' '}
452 <Label variant="outline" color={LabelColor.yellow} onClick={() => logColor('yellow')}>
453 Yellow clickable
454 </Label>
455 <Label
456 variant="outline"
457 color={LabelColor.yellow}
458 onClick={() => logColor('yellow')}
459 onClose={() => Function.prototype}
460 >
461 Yellow clickable removable
462 </Label>
463 <Label
464 variant="outline"
465 color={LabelColor.yellow}
466 icon={<CubeIcon />}
467 onClose={() => Function.prototype}
468 textMaxWidth="16ch"
469 >
470 Yellow label with icon that overflows
471 </Label>{' '}
472 <Label
473 variant="outline"
474 color={LabelColor.yellow}
475 isDisabled
476 icon={<CubeIcon />}
477 href="#filled"
478 onClose={() => Function.prototype}
479 >
480 Yellow link removable (disabled)
481 </Label>{' '}
482 <Label
483 variant="outline"
484 color={LabelColor.yellow}
485 isDisabled
486 icon={<CubeIcon />}
487 onClick={() => logColor('yellow')}
488 onClose={() => Function.prototype}
489 >
490 Yellow clickable removable (disabled)
491 </Label>
492 <br />
493 <br />
494 <strong>Status:</strong>
495 <br />
496 <br />
497 <Label status={LabelStatus.success} variant="outline">
498 Success
499 </Label>
500 <Label status={LabelStatus.success} variant="outline" onClose={() => Function.prototype}>
501 Success removable
502 </Label>
503 <Label status={LabelStatus.success} variant="outline" href="#filled">
504 Success link
505 </Label>
506 <Label status={LabelStatus.success} variant="outline" href="#filled" onClose={() => Function.prototype}>
507 Success link removable
508 </Label>
509 <Label status={LabelStatus.success} variant="outline" onClick={() => logColor('success')}>
510 Success clickable
511 </Label>
512 <Label
513 status={LabelStatus.success}
514 variant="outline"
515 onClick={() => logColor('success')}
516 onClose={() => Function.prototype}
517 >
518 Success clickable removable
519 </Label>
520 <Label status={LabelStatus.success} variant="outline" onClose={() => Function.prototype} textMaxWidth="16ch">
521 Success label with text that overflows
522 </Label>
523 <br />
524 <br />
525 <Label status={LabelStatus.warning} variant="outline">
526 Warning
527 </Label>
528 <Label status={LabelStatus.warning} variant="outline" onClose={() => Function.prototype}>
529 Warning removable
530 </Label>
531 <Label status={LabelStatus.warning} variant="outline" href="#filled">
532 Warning link
533 </Label>
534 <Label status={LabelStatus.warning} variant="outline" href="#filled" onClose={() => Function.prototype}>
535 Warning link removable
536 </Label>
537 <Label status={LabelStatus.warning} variant="outline" onClick={() => logColor('warning')}>
538 Warning clickable
539 </Label>
540 <Label
541 status={LabelStatus.warning}
542 variant="outline"
543 onClick={() => logColor('warning')}
544 onClose={() => Function.prototype}
545 >
546 Warning clickable removable
547 </Label>
548 <Label status={LabelStatus.warning} variant="outline" onClose={() => Function.prototype} textMaxWidth="16ch">
549 Warning label with text that overflows
550 </Label>
551 <br />
552 <br />
553 <Label status={LabelStatus.danger} variant="outline">
554 Danger
555 </Label>
556 <Label status={LabelStatus.danger} variant="outline" onClose={() => Function.prototype}>
557 Danger removable
558 </Label>
559 <Label status={LabelStatus.danger} variant="outline" href="#filled">
560 Danger link
561 </Label>
562 <Label status={LabelStatus.danger} variant="outline" href="#filled" onClose={() => Function.prototype}>
563 Danger link removable
564 </Label>
565 <Label status={LabelStatus.danger} variant="outline" onClick={() => logColor('danger')}>
566 Danger clickable
567 </Label>
568 <Label
569 status={LabelStatus.danger}
570 variant="outline"
571 onClick={() => logColor('danger')}
572 onClose={() => Function.prototype}
573 >
574 Danger clickable removable
575 </Label>
576 <Label status={LabelStatus.danger} variant="outline" onClose={() => Function.prototype} textMaxWidth="16ch">
577 Danger label with text that overflows
578 </Label>
579 <br />
580 <br />
581 <Label status={LabelStatus.info} variant="outline">
582 Info
583 </Label>
584 <Label status={LabelStatus.info} variant="outline" onClose={() => Function.prototype}>
585 Info removable
586 </Label>
587 <Label status={LabelStatus.info} variant="outline" href="#filled">
588 Info link
589 </Label>
590 <Label status={LabelStatus.info} variant="outline" href="#filled" onClose={() => Function.prototype}>
591 Info link removable
592 </Label>
593 <Label status={LabelStatus.info} variant="outline" onClick={() => logColor('info')}>
594 Info clickable
595 </Label>
596 <Label
597 status={LabelStatus.info}
598 variant="outline"
599 onClick={() => logColor('info')}
600 onClose={() => Function.prototype}
601 >
602 Info clickable removable
603 </Label>
604 <Label status={LabelStatus.info} variant="outline" onClose={() => Function.prototype} textMaxWidth="16ch">
605 Info label with text that overflows
606 </Label>
607 <br />
608 <br />
609 <Label status={LabelStatus.custom} variant="outline">
610 Custom
611 </Label>
612 <Label status={LabelStatus.custom} variant="outline" onClose={() => Function.prototype}>
613 Custom removable
614 </Label>
615 <Label status={LabelStatus.custom} variant="outline" href="#filled">
616 Custom link
617 </Label>
618 <Label status={LabelStatus.custom} variant="outline" href="#filled" onClose={() => Function.prototype}>
619 Custom link removable
620 </Label>
621 <Label status={LabelStatus.custom} variant="outline" onClick={() => logColor('custom')}>
622 Custom clickable
623 </Label>
624 <Label
625 status={LabelStatus.custom}
626 variant="outline"
627 onClick={() => logColor('custom')}
628 onClose={() => Function.prototype}
629 >
630 Custom clickable removable
631 </Label>
632 <Label status={LabelStatus.custom} variant="outline" onClose={() => Function.prototype} textMaxWidth="16ch">
633 Custom label with text that overflows
634 </Label>
635 </Fragment>
636 );
637 };