@patternfly/react-core 5.0.0-alpha.24 → 5.0.0-alpha.25
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 +6 -0
- package/components/Label/Label.d.ts +2 -2
- package/components/Label/Label.d.ts.map +1 -1
- package/components/Label/Label.js +6 -3
- package/components/Label/Label.js.map +1 -1
- package/dist/esm/components/Label/Label.d.ts +2 -2
- package/dist/esm/components/Label/Label.d.ts.map +1 -1
- package/dist/esm/components/Label/Label.js +6 -3
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/js/components/Label/Label.d.ts +2 -2
- package/dist/js/components/Label/Label.d.ts.map +1 -1
- package/dist/js/components/Label/Label.js +6 -3
- package/dist/js/components/Label/Label.js.map +1 -1
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +2 -2
- package/src/components/Label/Label.tsx +13 -9
- package/src/components/Label/__tests__/Label.test.tsx +1 -1
- package/src/components/Label/__tests__/__snapshots__/Label.test.tsx.snap +122 -25
- package/src/components/Label/examples/LabelCompact.tsx +1 -1
- package/src/components/Label/examples/LabelFilled.tsx +15 -8
- package/src/components/Label/examples/LabelOutline.tsx +8 -8
- package/src/components/Label/examples/LabelRouterLink.tsx +1 -1
- package/src/components/LabelGroup/__tests__/__snapshots__/LabelGroup.test.tsx.snap +40 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.25",
|
|
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",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"react": "^16.8 || ^17 || ^18",
|
|
71
71
|
"react-dom": "^16.8 || ^17 || ^18"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "e469295db3c4d6a1366d5a2e61c434d193703309"
|
|
74
74
|
}
|
|
@@ -27,8 +27,8 @@ export interface LabelProps extends React.HTMLProps<HTMLSpanElement> {
|
|
|
27
27
|
onEditComplete?: (event: MouseEvent | KeyboardEvent, newText: string) => void;
|
|
28
28
|
/** @beta Callback when an editable label cancels an edit. */
|
|
29
29
|
onEditCancel?: (event: KeyboardEvent, previousText: string) => void;
|
|
30
|
-
/**
|
|
31
|
-
|
|
30
|
+
/** The max width of the label before it is truncated. Can be any valid CSS unit, such as '100%', '100px', or '16ch'. */
|
|
31
|
+
textMaxWidth?: string;
|
|
32
32
|
/** Position of the tooltip which is displayed if text is truncated */
|
|
33
33
|
tooltipPosition?:
|
|
34
34
|
| TooltipPosition
|
|
@@ -90,7 +90,7 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
90
90
|
isCompact = false,
|
|
91
91
|
isEditable = false,
|
|
92
92
|
editableProps,
|
|
93
|
-
|
|
93
|
+
textMaxWidth,
|
|
94
94
|
tooltipPosition,
|
|
95
95
|
icon,
|
|
96
96
|
onClose,
|
|
@@ -212,12 +212,16 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
212
212
|
const content = (
|
|
213
213
|
<React.Fragment>
|
|
214
214
|
{icon && <span className={css(styles.labelIcon)}>{icon}</span>}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
215
|
+
<span
|
|
216
|
+
ref={textRef}
|
|
217
|
+
className={css(styles.labelText)}
|
|
218
|
+
{...(textMaxWidth && {
|
|
219
|
+
style: {
|
|
220
|
+
'--pf-c-label__text--MaxWidth': textMaxWidth,
|
|
221
|
+
} as React.CSSProperties
|
|
222
|
+
})}>
|
|
223
|
+
{children}
|
|
224
|
+
</span>
|
|
221
225
|
</React.Fragment>
|
|
222
226
|
);
|
|
223
227
|
|
|
@@ -86,7 +86,7 @@ describe('Label', () => {
|
|
|
86
86
|
|
|
87
87
|
test('label with truncation', () => {
|
|
88
88
|
const { asFragment } = render(
|
|
89
|
-
<Label
|
|
89
|
+
<Label textMaxWidth="16ch">textMaxWidth set at 16ch on this very long label that should be truncated</Label>
|
|
90
90
|
);
|
|
91
91
|
expect(asFragment()).toMatchSnapshot();
|
|
92
92
|
});
|
|
@@ -8,7 +8,11 @@ exports[`Label editable label 1`] = `
|
|
|
8
8
|
<button
|
|
9
9
|
class="pf-c-label__content"
|
|
10
10
|
>
|
|
11
|
-
|
|
11
|
+
<span
|
|
12
|
+
class="pf-c-label__text"
|
|
13
|
+
>
|
|
14
|
+
Something
|
|
15
|
+
</span>
|
|
12
16
|
</button>
|
|
13
17
|
<span
|
|
14
18
|
class="pf-c-label__actions"
|
|
@@ -64,7 +68,11 @@ exports[`Label label with additional class name 1`] = `
|
|
|
64
68
|
<span
|
|
65
69
|
class="pf-c-label__content"
|
|
66
70
|
>
|
|
67
|
-
|
|
71
|
+
<span
|
|
72
|
+
class="pf-c-label__text"
|
|
73
|
+
>
|
|
74
|
+
Something
|
|
75
|
+
</span>
|
|
68
76
|
</span>
|
|
69
77
|
</span>
|
|
70
78
|
</DocumentFragment>
|
|
@@ -80,7 +88,11 @@ exports[`Label label with additional class name and props 1`] = `
|
|
|
80
88
|
<span
|
|
81
89
|
class="pf-c-label__content"
|
|
82
90
|
>
|
|
83
|
-
|
|
91
|
+
<span
|
|
92
|
+
class="pf-c-label__text"
|
|
93
|
+
>
|
|
94
|
+
Something
|
|
95
|
+
</span>
|
|
84
96
|
</span>
|
|
85
97
|
</span>
|
|
86
98
|
</DocumentFragment>
|
|
@@ -94,7 +106,11 @@ exports[`Label label with blue color 1`] = `
|
|
|
94
106
|
<span
|
|
95
107
|
class="pf-c-label__content"
|
|
96
108
|
>
|
|
97
|
-
|
|
109
|
+
<span
|
|
110
|
+
class="pf-c-label__text"
|
|
111
|
+
>
|
|
112
|
+
Something
|
|
113
|
+
</span>
|
|
98
114
|
</span>
|
|
99
115
|
</span>
|
|
100
116
|
</DocumentFragment>
|
|
@@ -108,7 +124,11 @@ exports[`Label label with blue color with outline variant 1`] = `
|
|
|
108
124
|
<span
|
|
109
125
|
class="pf-c-label__content"
|
|
110
126
|
>
|
|
111
|
-
|
|
127
|
+
<span
|
|
128
|
+
class="pf-c-label__text"
|
|
129
|
+
>
|
|
130
|
+
Something
|
|
131
|
+
</span>
|
|
112
132
|
</span>
|
|
113
133
|
</span>
|
|
114
134
|
</DocumentFragment>
|
|
@@ -122,7 +142,11 @@ exports[`Label label with close button 1`] = `
|
|
|
122
142
|
<span
|
|
123
143
|
class="pf-c-label__content"
|
|
124
144
|
>
|
|
125
|
-
|
|
145
|
+
<span
|
|
146
|
+
class="pf-c-label__text"
|
|
147
|
+
>
|
|
148
|
+
Something
|
|
149
|
+
</span>
|
|
126
150
|
</span>
|
|
127
151
|
<span
|
|
128
152
|
class="pf-c-label__actions"
|
|
@@ -163,7 +187,11 @@ exports[`Label label with close button and outline variant 1`] = `
|
|
|
163
187
|
<span
|
|
164
188
|
class="pf-c-label__content"
|
|
165
189
|
>
|
|
166
|
-
|
|
190
|
+
<span
|
|
191
|
+
class="pf-c-label__text"
|
|
192
|
+
>
|
|
193
|
+
Something
|
|
194
|
+
</span>
|
|
167
195
|
</span>
|
|
168
196
|
<span
|
|
169
197
|
class="pf-c-label__actions"
|
|
@@ -204,7 +232,11 @@ exports[`Label label with cyan color 1`] = `
|
|
|
204
232
|
<span
|
|
205
233
|
class="pf-c-label__content"
|
|
206
234
|
>
|
|
207
|
-
|
|
235
|
+
<span
|
|
236
|
+
class="pf-c-label__text"
|
|
237
|
+
>
|
|
238
|
+
Something
|
|
239
|
+
</span>
|
|
208
240
|
</span>
|
|
209
241
|
</span>
|
|
210
242
|
</DocumentFragment>
|
|
@@ -218,7 +250,11 @@ exports[`Label label with cyan color with outline variant 1`] = `
|
|
|
218
250
|
<span
|
|
219
251
|
class="pf-c-label__content"
|
|
220
252
|
>
|
|
221
|
-
|
|
253
|
+
<span
|
|
254
|
+
class="pf-c-label__text"
|
|
255
|
+
>
|
|
256
|
+
Something
|
|
257
|
+
</span>
|
|
222
258
|
</span>
|
|
223
259
|
</span>
|
|
224
260
|
</DocumentFragment>
|
|
@@ -232,7 +268,11 @@ exports[`Label label with green color 1`] = `
|
|
|
232
268
|
<span
|
|
233
269
|
class="pf-c-label__content"
|
|
234
270
|
>
|
|
235
|
-
|
|
271
|
+
<span
|
|
272
|
+
class="pf-c-label__text"
|
|
273
|
+
>
|
|
274
|
+
Something
|
|
275
|
+
</span>
|
|
236
276
|
</span>
|
|
237
277
|
</span>
|
|
238
278
|
</DocumentFragment>
|
|
@@ -246,7 +286,11 @@ exports[`Label label with green color with outline variant 1`] = `
|
|
|
246
286
|
<span
|
|
247
287
|
class="pf-c-label__content"
|
|
248
288
|
>
|
|
249
|
-
|
|
289
|
+
<span
|
|
290
|
+
class="pf-c-label__text"
|
|
291
|
+
>
|
|
292
|
+
Something
|
|
293
|
+
</span>
|
|
250
294
|
</span>
|
|
251
295
|
</span>
|
|
252
296
|
</DocumentFragment>
|
|
@@ -260,7 +304,11 @@ exports[`Label label with grey color 1`] = `
|
|
|
260
304
|
<span
|
|
261
305
|
class="pf-c-label__content"
|
|
262
306
|
>
|
|
263
|
-
|
|
307
|
+
<span
|
|
308
|
+
class="pf-c-label__text"
|
|
309
|
+
>
|
|
310
|
+
Something
|
|
311
|
+
</span>
|
|
264
312
|
</span>
|
|
265
313
|
</span>
|
|
266
314
|
</DocumentFragment>
|
|
@@ -274,7 +322,11 @@ exports[`Label label with grey color with outline variant 1`] = `
|
|
|
274
322
|
<span
|
|
275
323
|
class="pf-c-label__content"
|
|
276
324
|
>
|
|
277
|
-
|
|
325
|
+
<span
|
|
326
|
+
class="pf-c-label__text"
|
|
327
|
+
>
|
|
328
|
+
Something
|
|
329
|
+
</span>
|
|
278
330
|
</span>
|
|
279
331
|
</span>
|
|
280
332
|
</DocumentFragment>
|
|
@@ -289,7 +341,11 @@ exports[`Label label with href 1`] = `
|
|
|
289
341
|
class="pf-c-label__content"
|
|
290
342
|
href="#"
|
|
291
343
|
>
|
|
292
|
-
|
|
344
|
+
<span
|
|
345
|
+
class="pf-c-label__text"
|
|
346
|
+
>
|
|
347
|
+
Something
|
|
348
|
+
</span>
|
|
293
349
|
</a>
|
|
294
350
|
</span>
|
|
295
351
|
</DocumentFragment>
|
|
@@ -304,7 +360,11 @@ exports[`Label label with href with outline variant 1`] = `
|
|
|
304
360
|
class="pf-c-label__content"
|
|
305
361
|
href="#"
|
|
306
362
|
>
|
|
307
|
-
|
|
363
|
+
<span
|
|
364
|
+
class="pf-c-label__text"
|
|
365
|
+
>
|
|
366
|
+
Something
|
|
367
|
+
</span>
|
|
308
368
|
</a>
|
|
309
369
|
</span>
|
|
310
370
|
</DocumentFragment>
|
|
@@ -318,7 +378,11 @@ exports[`Label label with orange color 1`] = `
|
|
|
318
378
|
<span
|
|
319
379
|
class="pf-c-label__content"
|
|
320
380
|
>
|
|
321
|
-
|
|
381
|
+
<span
|
|
382
|
+
class="pf-c-label__text"
|
|
383
|
+
>
|
|
384
|
+
Something
|
|
385
|
+
</span>
|
|
322
386
|
</span>
|
|
323
387
|
</span>
|
|
324
388
|
</DocumentFragment>
|
|
@@ -332,7 +396,11 @@ exports[`Label label with orange color with outline variant 1`] = `
|
|
|
332
396
|
<span
|
|
333
397
|
class="pf-c-label__content"
|
|
334
398
|
>
|
|
335
|
-
|
|
399
|
+
<span
|
|
400
|
+
class="pf-c-label__text"
|
|
401
|
+
>
|
|
402
|
+
Something
|
|
403
|
+
</span>
|
|
336
404
|
</span>
|
|
337
405
|
</span>
|
|
338
406
|
</DocumentFragment>
|
|
@@ -346,7 +414,11 @@ exports[`Label label with purple color 1`] = `
|
|
|
346
414
|
<span
|
|
347
415
|
class="pf-c-label__content"
|
|
348
416
|
>
|
|
349
|
-
|
|
417
|
+
<span
|
|
418
|
+
class="pf-c-label__text"
|
|
419
|
+
>
|
|
420
|
+
Something
|
|
421
|
+
</span>
|
|
350
422
|
</span>
|
|
351
423
|
</span>
|
|
352
424
|
</DocumentFragment>
|
|
@@ -360,7 +432,11 @@ exports[`Label label with purple color with outline variant 1`] = `
|
|
|
360
432
|
<span
|
|
361
433
|
class="pf-c-label__content"
|
|
362
434
|
>
|
|
363
|
-
|
|
435
|
+
<span
|
|
436
|
+
class="pf-c-label__text"
|
|
437
|
+
>
|
|
438
|
+
Something
|
|
439
|
+
</span>
|
|
364
440
|
</span>
|
|
365
441
|
</span>
|
|
366
442
|
</DocumentFragment>
|
|
@@ -374,7 +450,11 @@ exports[`Label label with red color 1`] = `
|
|
|
374
450
|
<span
|
|
375
451
|
class="pf-c-label__content"
|
|
376
452
|
>
|
|
377
|
-
|
|
453
|
+
<span
|
|
454
|
+
class="pf-c-label__text"
|
|
455
|
+
>
|
|
456
|
+
Something
|
|
457
|
+
</span>
|
|
378
458
|
</span>
|
|
379
459
|
</span>
|
|
380
460
|
</DocumentFragment>
|
|
@@ -388,7 +468,11 @@ exports[`Label label with red color with outline variant 1`] = `
|
|
|
388
468
|
<span
|
|
389
469
|
class="pf-c-label__content"
|
|
390
470
|
>
|
|
391
|
-
|
|
471
|
+
<span
|
|
472
|
+
class="pf-c-label__text"
|
|
473
|
+
>
|
|
474
|
+
Something
|
|
475
|
+
</span>
|
|
392
476
|
</span>
|
|
393
477
|
</span>
|
|
394
478
|
</DocumentFragment>
|
|
@@ -404,8 +488,9 @@ exports[`Label label with truncation 1`] = `
|
|
|
404
488
|
>
|
|
405
489
|
<span
|
|
406
490
|
class="pf-c-label__text"
|
|
491
|
+
style="--pf-c-label__text--MaxWidth: 16ch;"
|
|
407
492
|
>
|
|
408
|
-
|
|
493
|
+
textMaxWidth set at 16ch on this very long label that should be truncated
|
|
409
494
|
</span>
|
|
410
495
|
</span>
|
|
411
496
|
</span>
|
|
@@ -420,7 +505,11 @@ exports[`Label renders 1`] = `
|
|
|
420
505
|
<span
|
|
421
506
|
class="pf-c-label__content"
|
|
422
507
|
>
|
|
423
|
-
|
|
508
|
+
<span
|
|
509
|
+
class="pf-c-label__text"
|
|
510
|
+
>
|
|
511
|
+
Something
|
|
512
|
+
</span>
|
|
424
513
|
</span>
|
|
425
514
|
</span>
|
|
426
515
|
</DocumentFragment>
|
|
@@ -434,7 +523,11 @@ exports[`Label renders with isCompact 1`] = `
|
|
|
434
523
|
<span
|
|
435
524
|
class="pf-c-label__content"
|
|
436
525
|
>
|
|
437
|
-
|
|
526
|
+
<span
|
|
527
|
+
class="pf-c-label__text"
|
|
528
|
+
>
|
|
529
|
+
Something
|
|
530
|
+
</span>
|
|
438
531
|
</span>
|
|
439
532
|
</span>
|
|
440
533
|
</DocumentFragment>
|
|
@@ -448,7 +541,11 @@ exports[`Label renders with outline variant 1`] = `
|
|
|
448
541
|
<span
|
|
449
542
|
class="pf-c-label__content"
|
|
450
543
|
>
|
|
451
|
-
|
|
544
|
+
<span
|
|
545
|
+
class="pf-c-label__text"
|
|
546
|
+
>
|
|
547
|
+
Something
|
|
548
|
+
</span>
|
|
452
549
|
</span>
|
|
453
550
|
</span>
|
|
454
551
|
</DocumentFragment>
|
|
@@ -20,7 +20,7 @@ export const LabelCompact: React.FunctionComponent = () => (
|
|
|
20
20
|
<Label isCompact href="#compact" onClose={() => Function.prototype}>
|
|
21
21
|
Compact link removable
|
|
22
22
|
</Label>
|
|
23
|
-
<Label isCompact icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
23
|
+
<Label isCompact icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
24
24
|
Compact label with icon that overflows
|
|
25
25
|
</Label>
|
|
26
26
|
</React.Fragment>
|
|
@@ -13,7 +13,7 @@ export const LabelFilled: React.FunctionComponent = () => (
|
|
|
13
13
|
<Label href="#filled" onClose={() => Function.prototype}>
|
|
14
14
|
Grey link removable
|
|
15
15
|
</Label>
|
|
16
|
-
<Label icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
16
|
+
<Label icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
17
17
|
Grey label with icon that overflows
|
|
18
18
|
</Label>
|
|
19
19
|
<br />
|
|
@@ -34,7 +34,7 @@ export const LabelFilled: React.FunctionComponent = () => (
|
|
|
34
34
|
<Label color="blue" href="#filled" onClose={() => Function.prototype}>
|
|
35
35
|
Blue link removable
|
|
36
36
|
</Label>
|
|
37
|
-
<Label color="blue" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
37
|
+
<Label color="blue" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
38
38
|
Blue label with icon that overflows
|
|
39
39
|
</Label>
|
|
40
40
|
<br />
|
|
@@ -55,7 +55,7 @@ export const LabelFilled: React.FunctionComponent = () => (
|
|
|
55
55
|
<Label color="green" href="#filled" onClose={() => Function.prototype}>
|
|
56
56
|
Green link removable
|
|
57
57
|
</Label>
|
|
58
|
-
<Label color="green" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
58
|
+
<Label color="green" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
59
59
|
Green label with icon that overflows
|
|
60
60
|
</Label>
|
|
61
61
|
<br />
|
|
@@ -76,7 +76,7 @@ export const LabelFilled: React.FunctionComponent = () => (
|
|
|
76
76
|
<Label color="orange" href="#filled" onClose={() => Function.prototype}>
|
|
77
77
|
Orange link removable
|
|
78
78
|
</Label>
|
|
79
|
-
<Label color="orange" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
79
|
+
<Label color="orange" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
80
80
|
Orange label with icon that overflows
|
|
81
81
|
</Label>
|
|
82
82
|
<br />
|
|
@@ -97,7 +97,7 @@ export const LabelFilled: React.FunctionComponent = () => (
|
|
|
97
97
|
<Label color="red" href="#filled" onClose={() => Function.prototype}>
|
|
98
98
|
Red link removable
|
|
99
99
|
</Label>
|
|
100
|
-
<Label color="red" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
100
|
+
<Label color="red" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
101
101
|
Red label with icon that overflows
|
|
102
102
|
</Label>
|
|
103
103
|
<br />
|
|
@@ -118,7 +118,7 @@ export const LabelFilled: React.FunctionComponent = () => (
|
|
|
118
118
|
<Label color="purple" href="#filled" onClose={() => Function.prototype}>
|
|
119
119
|
Purple link removable
|
|
120
120
|
</Label>
|
|
121
|
-
<Label color="purple" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
121
|
+
<Label color="purple" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
122
122
|
Purple label with icon that overflows
|
|
123
123
|
</Label>
|
|
124
124
|
<br />
|
|
@@ -139,7 +139,7 @@ export const LabelFilled: React.FunctionComponent = () => (
|
|
|
139
139
|
<Label color="cyan" href="#filled" onClose={() => Function.prototype}>
|
|
140
140
|
Cyan link removable
|
|
141
141
|
</Label>
|
|
142
|
-
<Label color="cyan" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
142
|
+
<Label color="cyan" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
143
143
|
Cyan label with icon that overflows
|
|
144
144
|
</Label>
|
|
145
145
|
<br />
|
|
@@ -160,8 +160,15 @@ export const LabelFilled: React.FunctionComponent = () => (
|
|
|
160
160
|
<Label color="gold" href="#filled" onClose={() => Function.prototype}>
|
|
161
161
|
Gold link removable
|
|
162
162
|
</Label>
|
|
163
|
-
<Label color="gold" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
163
|
+
<Label color="gold" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
164
164
|
Gold label with icon that overflows
|
|
165
165
|
</Label>
|
|
166
|
+
<br />
|
|
167
|
+
<br />
|
|
168
|
+
<div style={{width: "250px"}}>
|
|
169
|
+
<Label>
|
|
170
|
+
Label that overflows its parent, but has no textMaxWidth on its own
|
|
171
|
+
</Label>
|
|
172
|
+
</div>
|
|
166
173
|
</React.Fragment>
|
|
167
174
|
);
|
|
@@ -20,7 +20,7 @@ export const LabelOutline: React.FunctionComponent = () => (
|
|
|
20
20
|
<Label variant="outline" href="#outline" onClose={() => Function.prototype}>
|
|
21
21
|
Grey link removable
|
|
22
22
|
</Label>
|
|
23
|
-
<Label variant="outline" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
23
|
+
<Label variant="outline" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
24
24
|
Grey label with icon that overflows
|
|
25
25
|
</Label>
|
|
26
26
|
<br />
|
|
@@ -43,7 +43,7 @@ export const LabelOutline: React.FunctionComponent = () => (
|
|
|
43
43
|
<Label variant="outline" color="blue" href="#outline" onClose={() => Function.prototype}>
|
|
44
44
|
Blue link removable
|
|
45
45
|
</Label>
|
|
46
|
-
<Label variant="outline" color="blue" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
46
|
+
<Label variant="outline" color="blue" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
47
47
|
Blue label with icon that overflows
|
|
48
48
|
</Label>
|
|
49
49
|
<br />
|
|
@@ -66,7 +66,7 @@ export const LabelOutline: React.FunctionComponent = () => (
|
|
|
66
66
|
<Label variant="outline" color="green" href="#outline" onClose={() => Function.prototype}>
|
|
67
67
|
Green link removable
|
|
68
68
|
</Label>
|
|
69
|
-
<Label variant="outline" color="green" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
69
|
+
<Label variant="outline" color="green" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
70
70
|
Green label with icon that overflows
|
|
71
71
|
</Label>
|
|
72
72
|
<br />
|
|
@@ -89,7 +89,7 @@ export const LabelOutline: React.FunctionComponent = () => (
|
|
|
89
89
|
<Label variant="outline" color="orange" href="#outline" onClose={() => Function.prototype}>
|
|
90
90
|
Orange link removable
|
|
91
91
|
</Label>
|
|
92
|
-
<Label variant="outline" color="orange" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
92
|
+
<Label variant="outline" color="orange" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
93
93
|
Orange label with icon that overflows
|
|
94
94
|
</Label>
|
|
95
95
|
<br />
|
|
@@ -112,7 +112,7 @@ export const LabelOutline: React.FunctionComponent = () => (
|
|
|
112
112
|
<Label variant="outline" color="red" href="#outline" onClose={() => Function.prototype}>
|
|
113
113
|
Red link removable
|
|
114
114
|
</Label>
|
|
115
|
-
<Label variant="outline" color="red" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
115
|
+
<Label variant="outline" color="red" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
116
116
|
Red label with icon that overflows
|
|
117
117
|
</Label>
|
|
118
118
|
<br />
|
|
@@ -135,7 +135,7 @@ export const LabelOutline: React.FunctionComponent = () => (
|
|
|
135
135
|
<Label variant="outline" color="purple" href="#outline" onClose={() => Function.prototype}>
|
|
136
136
|
Purple link removable
|
|
137
137
|
</Label>
|
|
138
|
-
<Label variant="outline" color="purple" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
138
|
+
<Label variant="outline" color="purple" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
139
139
|
Purple label with icon that overflows
|
|
140
140
|
</Label>
|
|
141
141
|
<br />
|
|
@@ -158,7 +158,7 @@ export const LabelOutline: React.FunctionComponent = () => (
|
|
|
158
158
|
<Label variant="outline" color="cyan" href="#outline" onClose={() => Function.prototype}>
|
|
159
159
|
Cyan link removable
|
|
160
160
|
</Label>
|
|
161
|
-
<Label variant="outline" color="cyan" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
161
|
+
<Label variant="outline" color="cyan" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
162
162
|
Cyan label with icon that overflows
|
|
163
163
|
</Label>
|
|
164
164
|
<br />
|
|
@@ -181,7 +181,7 @@ export const LabelOutline: React.FunctionComponent = () => (
|
|
|
181
181
|
<Label variant="outline" color="gold" href="#outline" onClose={() => Function.prototype}>
|
|
182
182
|
Gold link removable
|
|
183
183
|
</Label>
|
|
184
|
-
<Label variant="outline" color="gold" icon={<InfoCircleIcon />} onClose={() => Function.prototype}
|
|
184
|
+
<Label variant="outline" color="gold" icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
185
185
|
Gold label with icon that overflows
|
|
186
186
|
</Label>
|
|
187
187
|
</React.Fragment>
|
|
@@ -8,12 +8,12 @@ export const LabelRouterLink: React.FunctionComponent = () => (
|
|
|
8
8
|
color="blue"
|
|
9
9
|
icon={<InfoCircleIcon />}
|
|
10
10
|
onClose={() => Function.prototype}
|
|
11
|
-
isTruncated
|
|
12
11
|
render={({ className, content, componentRef }) => (
|
|
13
12
|
<Link to="/" className={className} innerRef={componentRef}>
|
|
14
13
|
{content}
|
|
15
14
|
</Link>
|
|
16
15
|
)}
|
|
16
|
+
textMaxWidth="16ch"
|
|
17
17
|
>
|
|
18
18
|
Blue label router link with icon that overflows
|
|
19
19
|
</Label>
|
|
@@ -22,7 +22,11 @@ exports[`LabelGroup label group compact 1`] = `
|
|
|
22
22
|
<span
|
|
23
23
|
class="pf-c-label__content"
|
|
24
24
|
>
|
|
25
|
-
|
|
25
|
+
<span
|
|
26
|
+
class="pf-c-label__text"
|
|
27
|
+
>
|
|
28
|
+
1
|
|
29
|
+
</span>
|
|
26
30
|
</span>
|
|
27
31
|
</span>
|
|
28
32
|
</li>
|
|
@@ -35,7 +39,11 @@ exports[`LabelGroup label group compact 1`] = `
|
|
|
35
39
|
<span
|
|
36
40
|
class="pf-c-label__content"
|
|
37
41
|
>
|
|
38
|
-
|
|
42
|
+
<span
|
|
43
|
+
class="pf-c-label__text"
|
|
44
|
+
>
|
|
45
|
+
2
|
|
46
|
+
</span>
|
|
39
47
|
</span>
|
|
40
48
|
</span>
|
|
41
49
|
</li>
|
|
@@ -48,7 +56,11 @@ exports[`LabelGroup label group compact 1`] = `
|
|
|
48
56
|
<span
|
|
49
57
|
class="pf-c-label__content"
|
|
50
58
|
>
|
|
51
|
-
|
|
59
|
+
<span
|
|
60
|
+
class="pf-c-label__text"
|
|
61
|
+
>
|
|
62
|
+
3
|
|
63
|
+
</span>
|
|
52
64
|
</span>
|
|
53
65
|
</span>
|
|
54
66
|
</li>
|
|
@@ -61,7 +73,11 @@ exports[`LabelGroup label group compact 1`] = `
|
|
|
61
73
|
<span
|
|
62
74
|
class="pf-c-label__content"
|
|
63
75
|
>
|
|
64
|
-
|
|
76
|
+
<span
|
|
77
|
+
class="pf-c-label__text"
|
|
78
|
+
>
|
|
79
|
+
1 more
|
|
80
|
+
</span>
|
|
65
81
|
</span>
|
|
66
82
|
</button>
|
|
67
83
|
</li>
|
|
@@ -93,7 +109,11 @@ exports[`LabelGroup label group default 1`] = `
|
|
|
93
109
|
<span
|
|
94
110
|
class="pf-c-label__content"
|
|
95
111
|
>
|
|
96
|
-
|
|
112
|
+
<span
|
|
113
|
+
class="pf-c-label__text"
|
|
114
|
+
>
|
|
115
|
+
1.1
|
|
116
|
+
</span>
|
|
97
117
|
</span>
|
|
98
118
|
</span>
|
|
99
119
|
</li>
|
|
@@ -132,7 +152,11 @@ exports[`LabelGroup label group with category 1`] = `
|
|
|
132
152
|
<span
|
|
133
153
|
class="pf-c-label__content"
|
|
134
154
|
>
|
|
135
|
-
|
|
155
|
+
<span
|
|
156
|
+
class="pf-c-label__text"
|
|
157
|
+
>
|
|
158
|
+
1.1
|
|
159
|
+
</span>
|
|
136
160
|
</span>
|
|
137
161
|
</span>
|
|
138
162
|
</li>
|
|
@@ -171,7 +195,11 @@ exports[`LabelGroup label group with category and tooltip 1`] = `
|
|
|
171
195
|
<span
|
|
172
196
|
class="pf-c-label__content"
|
|
173
197
|
>
|
|
174
|
-
|
|
198
|
+
<span
|
|
199
|
+
class="pf-c-label__text"
|
|
200
|
+
>
|
|
201
|
+
1.1
|
|
202
|
+
</span>
|
|
175
203
|
</span>
|
|
176
204
|
</span>
|
|
177
205
|
</li>
|
|
@@ -210,7 +238,11 @@ exports[`LabelGroup label group with closable category 1`] = `
|
|
|
210
238
|
<span
|
|
211
239
|
class="pf-c-label__content"
|
|
212
240
|
>
|
|
213
|
-
|
|
241
|
+
<span
|
|
242
|
+
class="pf-c-label__text"
|
|
243
|
+
>
|
|
244
|
+
1.1
|
|
245
|
+
</span>
|
|
214
246
|
</span>
|
|
215
247
|
</span>
|
|
216
248
|
</li>
|