@patternfly/patternfly 6.2.0 → 6.2.1
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/README.md +1 -1
- package/components/Card/card.css +3 -0
- package/components/Card/card.scss +3 -0
- package/components/CodeEditor/code-editor.css +3 -0
- package/components/CodeEditor/code-editor.scss +3 -1
- package/components/Drawer/drawer.css +28 -14
- package/components/Drawer/drawer.scss +28 -9
- package/components/FormControl/form-control.css +1 -2
- package/components/FormControl/form-control.scss +1 -5
- package/components/Page/page.css +4 -3
- package/components/Page/page.scss +4 -2
- package/components/Tabs/tabs.css +65 -0
- package/components/Tabs/tabs.scss +77 -0
- package/components/Truncate/truncate.css +5 -0
- package/components/Truncate/truncate.scss +6 -0
- package/components/_index.css +108 -19
- package/docs/components/Divider/examples/Divider.md +1 -1
- package/docs/components/Drawer/examples/Drawer.md +4 -0
- package/docs/components/Page/examples/Page.md +1 -0
- package/docs/components/Table/examples/Table.md +4 -4
- package/docs/components/Tabs/examples/Tabs.md +6741 -12
- package/docs/components/Truncate/examples/Truncate.md +53 -10
- package/docs/demos/Card/examples/Card.md +57 -0
- package/docs/demos/DescriptionList/examples/DescriptionList.md +38 -0
- package/docs/demos/Drawer/examples/Drawer.md +38 -0
- package/docs/demos/Masthead/examples/Masthead.md +1 -1
- package/docs/demos/Nav/examples/Nav.md +2 -2
- package/docs/demos/Page/examples/Page.md +355 -0
- package/docs/demos/PrimaryDetail/examples/PrimaryDetail.md +76 -0
- package/docs/demos/Table/examples/Table.md +41 -21
- package/docs/demos/Tabs/examples/Tabs.md +570 -0
- package/package.json +6 -6
- package/patternfly-no-globals.css +108 -19
- package/patternfly.css +108 -19
- package/patternfly.min.css +1 -1
- package/patternfly.min.css.map +1 -1
|
@@ -6,18 +6,18 @@ cssPrefix: pf-v6-c-truncate
|
|
|
6
6
|
|
|
7
7
|
## Examples
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
The truncate component contains two child elements, `.pf-v6-c-truncate__start` and `.pf-v6-c-truncate__end`. If both `start` and `end` are present within `.pf-v6-c-truncate`, trucation will occur in the middle of the string. If only `.pf-v6-c-truncate__start` is present, truncation will occur at the end of the string. If only `.pf-v6-c-truncate__end` is present, truncation will occur at the beginning of the string. A `.pf-v6-c-popover` will be automatically applied to the PatternFly React implementation. `‎` must be included at the end of string to denote the ending punctuation mark. Otherwise it will occur and the beggining of truncation for a `pf-v6-c-truncate__end` element.
|
|
9
|
+
The default behavior of the truncate component is to truncate based on whether the content can fit within the width of its parent container, and to prevent text from wrapping. The following examples that use this default behavior render the truncate component inside a resizable container, allowing you to see how the parent container width affects the truncation.
|
|
12
10
|
|
|
13
11
|
### Default
|
|
14
12
|
|
|
13
|
+
When only the `.pf-v6-c-truncate__start` element is used, truncation will occur at the end of the string.
|
|
14
|
+
|
|
15
15
|
```html
|
|
16
16
|
<div class="pf-v6-c-truncate--example">
|
|
17
17
|
<span class="pf-v6-c-truncate">
|
|
18
18
|
<span
|
|
19
19
|
class="pf-v6-c-truncate__start"
|
|
20
|
-
>
|
|
20
|
+
>redhat_logo_black_and_white_reversed_simple_with_fedora_container.zip</span>
|
|
21
21
|
</span>
|
|
22
22
|
</div>
|
|
23
23
|
|
|
@@ -25,13 +25,15 @@ The truncate component contains two child elements, `.pf-v6-c-truncate__start` a
|
|
|
25
25
|
|
|
26
26
|
### Middle
|
|
27
27
|
|
|
28
|
+
When both `.pf-v6-c-truncate__start` and `.pf-v6-c-truncate__end` elements are used, truncation will occur between the strings that are in each respective element. As the parent container width changes, the point at which content within the `.pf-v6-c-truncate__start` element is truncated will also change.
|
|
29
|
+
|
|
28
30
|
```html
|
|
29
31
|
<div class="pf-v6-c-truncate--example">
|
|
30
32
|
<span class="pf-v6-c-truncate">
|
|
31
33
|
<span
|
|
32
34
|
class="pf-v6-c-truncate__start"
|
|
33
|
-
>
|
|
34
|
-
<span class="pf-v6-c-truncate__end">
|
|
35
|
+
>redhat_logo_black_and_white_reversed_simple_</span>
|
|
36
|
+
<span class="pf-v6-c-truncate__end">with_fedora_container.zip</span>
|
|
35
37
|
</span>
|
|
36
38
|
</div>
|
|
37
39
|
|
|
@@ -39,23 +41,64 @@ The truncate component contains two child elements, `.pf-v6-c-truncate__start` a
|
|
|
39
41
|
|
|
40
42
|
### Start
|
|
41
43
|
|
|
44
|
+
When only the `.pf-v6-c-truncate__end` element is used, truncation will occur at the start of the string. `‎` **must** be included at the end of a string to denote the ending punctuation mark, otherwise it will render at the start of the truncated content.
|
|
45
|
+
|
|
42
46
|
```html
|
|
43
47
|
<div class="pf-v6-c-truncate--example">
|
|
44
48
|
<span class="pf-v6-c-truncate">
|
|
45
49
|
<span
|
|
46
50
|
class="pf-v6-c-truncate__end"
|
|
47
|
-
>
|
|
51
|
+
>redhat_logo_black_and_white_reversed_simple_with_fedora_container.zip</span>
|
|
48
52
|
</span>
|
|
49
53
|
</div>
|
|
50
54
|
|
|
51
55
|
```
|
|
52
56
|
|
|
57
|
+
### Based on max characters
|
|
58
|
+
|
|
59
|
+
Apply the `.pf-m-fixed` class to the `.pf-v6-c-truncate` element to implement truncation based on a fixed amount of characters rather than a parent container width.
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<div>Truncated at end position:</div>
|
|
63
|
+
<span class="pf-v6-c-truncate pf-m-fixed">
|
|
64
|
+
<span
|
|
65
|
+
class="pf-v6-c-truncate__text"
|
|
66
|
+
>redhat_logo_black_and_white_reversed_simple_with_</span>
|
|
67
|
+
<span class="pf-v6-c-truncate__omission" aria-hidden="true">…</span>
|
|
68
|
+
<span class="pf-v6-screen-reader">fedora_container.zip</span>
|
|
69
|
+
</span>
|
|
70
|
+
<br />
|
|
71
|
+
<br />
|
|
72
|
+
<div>Truncated at middle position:</div>
|
|
73
|
+
<span class="pf-v6-c-truncate pf-m-fixed">
|
|
74
|
+
<span class="pf-v6-c-truncate__text">redhat_logo_black_and_</span>
|
|
75
|
+
<span class="pf-v6-screen-reader">white_reversed_simple_with_</span>
|
|
76
|
+
|
|
77
|
+
<span class="pf-v6-c-truncate__omission" aria-hidden="true">…</span>
|
|
78
|
+
<span class="pf-v6-c-truncate__text">fedora_container.zip</span>
|
|
79
|
+
</span>
|
|
80
|
+
<br />
|
|
81
|
+
<br />
|
|
82
|
+
<div>Truncated at start position:</div>
|
|
83
|
+
<span class="pf-v6-c-truncate pf-m-fixed">
|
|
84
|
+
<span class="pf-v6-screen-reader">redhat_logo_black_</span>
|
|
85
|
+
|
|
86
|
+
<span class="pf-v6-c-truncate__omission" aria-hidden="true">…</span>
|
|
87
|
+
<span
|
|
88
|
+
class="pf-v6-c-truncate__text"
|
|
89
|
+
>and_white_reversed_simple_with_fedora_container.zip</span>
|
|
90
|
+
</span>
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
|
|
53
94
|
## Documentation
|
|
54
95
|
|
|
55
96
|
### Usage
|
|
56
97
|
|
|
57
98
|
| Class | Applied | Outcome |
|
|
58
99
|
| -- | -- | -- |
|
|
59
|
-
| `.pf-v6-c-truncate` | `<span>` | Initiates the truncate component. |
|
|
60
|
-
| `.pf-v6-c-truncate__start` | `<span>` | Defines the truncate component starting text. |
|
|
61
|
-
| `.pf-v6-c-truncate__end` | `<span>` | Defines the truncate component ending text. |
|
|
100
|
+
| `.pf-v6-c-truncate` | `<span>` | Initiates the truncate component. **Required** |
|
|
101
|
+
| `.pf-v6-c-truncate__start` | `<span>` | Defines the truncate component starting text. **Required** when using default/end or middle truncation, **except** for when the `.pf-m-fixed` class is applied to the `.pf-v6-c-truncate` element. |
|
|
102
|
+
| `.pf-v6-c-truncate__end` | `<span>` | Defines the truncate component ending text. **Required** when using start or middle truncation, **except** for when the `.pf-m-fixed` class is applied to the `.pf-v6-c-truncate` element. |
|
|
103
|
+
| `.pf-v6-c-truncate__text` | `<span>` | Defines the visible truncate component text. **Required** and should only be used when the `.pf-m-fixed` class is applied to the `.pf-v6-c-truncate` element. |
|
|
104
|
+
| `.pf-m-fixed` | `.pf-v6-c-truncate` | Modifies the truncate component to base truncation on a fixed amount of characters rather than container width. |
|
|
@@ -723,6 +723,25 @@ wrapperTag: div
|
|
|
723
723
|
<button
|
|
724
724
|
type="button"
|
|
725
725
|
class="pf-v6-c-tabs__link"
|
|
726
|
+
onclick="
|
|
727
|
+
event.preventDefault();
|
|
728
|
+
((e) => {
|
|
729
|
+
const el = this,
|
|
730
|
+
li = this.closest('li'),
|
|
731
|
+
ul = this.closest('ul'),
|
|
732
|
+
tabs = this.closest('.pf-v6-c-tabs'),
|
|
733
|
+
left = Math.round(li.offsetLeft),
|
|
734
|
+
top = Math.round(li.offsetTop),
|
|
735
|
+
width = Math.round(li.offsetWidth),
|
|
736
|
+
height = Math.round(li.offsetHeight);
|
|
737
|
+
|
|
738
|
+
ul.querySelectorAll('li').forEach(function(el) {
|
|
739
|
+
el.classList.remove('pf-m-current')});
|
|
740
|
+
li.classList.add('pf-m-current');
|
|
741
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--start', left + 'px');
|
|
742
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--length', width + 'px');
|
|
743
|
+
}
|
|
744
|
+
)()"
|
|
726
745
|
role="tab"
|
|
727
746
|
id="status-tabs-object-1-link"
|
|
728
747
|
>
|
|
@@ -733,6 +752,25 @@ wrapperTag: div
|
|
|
733
752
|
<button
|
|
734
753
|
type="button"
|
|
735
754
|
class="pf-v6-c-tabs__link"
|
|
755
|
+
onclick="
|
|
756
|
+
event.preventDefault();
|
|
757
|
+
((e) => {
|
|
758
|
+
const el = this,
|
|
759
|
+
li = this.closest('li'),
|
|
760
|
+
ul = this.closest('ul'),
|
|
761
|
+
tabs = this.closest('.pf-v6-c-tabs'),
|
|
762
|
+
left = Math.round(li.offsetLeft),
|
|
763
|
+
top = Math.round(li.offsetTop),
|
|
764
|
+
width = Math.round(li.offsetWidth),
|
|
765
|
+
height = Math.round(li.offsetHeight);
|
|
766
|
+
|
|
767
|
+
ul.querySelectorAll('li').forEach(function(el) {
|
|
768
|
+
el.classList.remove('pf-m-current')});
|
|
769
|
+
li.classList.add('pf-m-current');
|
|
770
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--start', left + 'px');
|
|
771
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--length', width + 'px');
|
|
772
|
+
}
|
|
773
|
+
)()"
|
|
736
774
|
role="tab"
|
|
737
775
|
id="status-tabs-object-2-link"
|
|
738
776
|
>
|
|
@@ -743,6 +781,25 @@ wrapperTag: div
|
|
|
743
781
|
<button
|
|
744
782
|
type="button"
|
|
745
783
|
class="pf-v6-c-tabs__link"
|
|
784
|
+
onclick="
|
|
785
|
+
event.preventDefault();
|
|
786
|
+
((e) => {
|
|
787
|
+
const el = this,
|
|
788
|
+
li = this.closest('li'),
|
|
789
|
+
ul = this.closest('ul'),
|
|
790
|
+
tabs = this.closest('.pf-v6-c-tabs'),
|
|
791
|
+
left = Math.round(li.offsetLeft),
|
|
792
|
+
top = Math.round(li.offsetTop),
|
|
793
|
+
width = Math.round(li.offsetWidth),
|
|
794
|
+
height = Math.round(li.offsetHeight);
|
|
795
|
+
|
|
796
|
+
ul.querySelectorAll('li').forEach(function(el) {
|
|
797
|
+
el.classList.remove('pf-m-current')});
|
|
798
|
+
li.classList.add('pf-m-current');
|
|
799
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--start', left + 'px');
|
|
800
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--length', width + 'px');
|
|
801
|
+
}
|
|
802
|
+
)()"
|
|
746
803
|
role="tab"
|
|
747
804
|
id="status-tabs-object-3-link"
|
|
748
805
|
>
|
|
@@ -736,6 +736,25 @@ cssPrefix: pf-d-description-list
|
|
|
736
736
|
<button
|
|
737
737
|
type="button"
|
|
738
738
|
class="pf-v6-c-tabs__link"
|
|
739
|
+
onclick="
|
|
740
|
+
event.preventDefault();
|
|
741
|
+
((e) => {
|
|
742
|
+
const el = this,
|
|
743
|
+
li = this.closest('li'),
|
|
744
|
+
ul = this.closest('ul'),
|
|
745
|
+
tabs = this.closest('.pf-v6-c-tabs'),
|
|
746
|
+
left = Math.round(li.offsetLeft),
|
|
747
|
+
top = Math.round(li.offsetTop),
|
|
748
|
+
width = Math.round(li.offsetWidth),
|
|
749
|
+
height = Math.round(li.offsetHeight);
|
|
750
|
+
|
|
751
|
+
ul.querySelectorAll('li').forEach(function(el) {
|
|
752
|
+
el.classList.remove('pf-m-current')});
|
|
753
|
+
li.classList.add('pf-m-current');
|
|
754
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--start', left + 'px');
|
|
755
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--length', width + 'px');
|
|
756
|
+
}
|
|
757
|
+
)()"
|
|
739
758
|
role="tab"
|
|
740
759
|
id="description-list-in-drawer-example-panel-tabs-tab1-link"
|
|
741
760
|
>
|
|
@@ -746,6 +765,25 @@ cssPrefix: pf-d-description-list
|
|
|
746
765
|
<button
|
|
747
766
|
type="button"
|
|
748
767
|
class="pf-v6-c-tabs__link"
|
|
768
|
+
onclick="
|
|
769
|
+
event.preventDefault();
|
|
770
|
+
((e) => {
|
|
771
|
+
const el = this,
|
|
772
|
+
li = this.closest('li'),
|
|
773
|
+
ul = this.closest('ul'),
|
|
774
|
+
tabs = this.closest('.pf-v6-c-tabs'),
|
|
775
|
+
left = Math.round(li.offsetLeft),
|
|
776
|
+
top = Math.round(li.offsetTop),
|
|
777
|
+
width = Math.round(li.offsetWidth),
|
|
778
|
+
height = Math.round(li.offsetHeight);
|
|
779
|
+
|
|
780
|
+
ul.querySelectorAll('li').forEach(function(el) {
|
|
781
|
+
el.classList.remove('pf-m-current')});
|
|
782
|
+
li.classList.add('pf-m-current');
|
|
783
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--start', left + 'px');
|
|
784
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--length', width + 'px');
|
|
785
|
+
}
|
|
786
|
+
)()"
|
|
749
787
|
role="tab"
|
|
750
788
|
id="description-list-in-drawer-example-panel-tabs-tab2-link"
|
|
751
789
|
>
|
|
@@ -369,6 +369,25 @@ wrapperTag: div
|
|
|
369
369
|
<button
|
|
370
370
|
type="button"
|
|
371
371
|
class="pf-v6-c-tabs__link"
|
|
372
|
+
onclick="
|
|
373
|
+
event.preventDefault();
|
|
374
|
+
((e) => {
|
|
375
|
+
const el = this,
|
|
376
|
+
li = this.closest('li'),
|
|
377
|
+
ul = this.closest('ul'),
|
|
378
|
+
tabs = this.closest('.pf-v6-c-tabs'),
|
|
379
|
+
left = Math.round(li.offsetLeft),
|
|
380
|
+
top = Math.round(li.offsetTop),
|
|
381
|
+
width = Math.round(li.offsetWidth),
|
|
382
|
+
height = Math.round(li.offsetHeight);
|
|
383
|
+
|
|
384
|
+
ul.querySelectorAll('li').forEach(function(el) {
|
|
385
|
+
el.classList.remove('pf-m-current')});
|
|
386
|
+
li.classList.add('pf-m-current');
|
|
387
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--start', left + 'px');
|
|
388
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--length', width + 'px');
|
|
389
|
+
}
|
|
390
|
+
)()"
|
|
372
391
|
role="tab"
|
|
373
392
|
id="drawer-collapsed-example-panel-tabs-tab1-link"
|
|
374
393
|
>
|
|
@@ -379,6 +398,25 @@ wrapperTag: div
|
|
|
379
398
|
<button
|
|
380
399
|
type="button"
|
|
381
400
|
class="pf-v6-c-tabs__link"
|
|
401
|
+
onclick="
|
|
402
|
+
event.preventDefault();
|
|
403
|
+
((e) => {
|
|
404
|
+
const el = this,
|
|
405
|
+
li = this.closest('li'),
|
|
406
|
+
ul = this.closest('ul'),
|
|
407
|
+
tabs = this.closest('.pf-v6-c-tabs'),
|
|
408
|
+
left = Math.round(li.offsetLeft),
|
|
409
|
+
top = Math.round(li.offsetTop),
|
|
410
|
+
width = Math.round(li.offsetWidth),
|
|
411
|
+
height = Math.round(li.offsetHeight);
|
|
412
|
+
|
|
413
|
+
ul.querySelectorAll('li').forEach(function(el) {
|
|
414
|
+
el.classList.remove('pf-m-current')});
|
|
415
|
+
li.classList.add('pf-m-current');
|
|
416
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--start', left + 'px');
|
|
417
|
+
tabs.style.setProperty('--pf-v6-c-tabs--link-accent--length', width + 'px');
|
|
418
|
+
}
|
|
419
|
+
)()"
|
|
382
420
|
role="tab"
|
|
383
421
|
id="drawer-collapsed-example-panel-tabs-tab2-link"
|
|
384
422
|
>
|
|
@@ -2066,7 +2066,7 @@ wrapperTag: div
|
|
|
2066
2066
|
### Horizontal nav
|
|
2067
2067
|
|
|
2068
2068
|
```html isFullscreen
|
|
2069
|
-
<div class="pf-v6-c-page" id="masthead-horizontal-nav">
|
|
2069
|
+
<div class="pf-v6-c-page pf-m-no-sidebar" id="masthead-horizontal-nav">
|
|
2070
2070
|
<div class="pf-v6-c-skip-to-content">
|
|
2071
2071
|
<a
|
|
2072
2072
|
class="pf-v6-c-button pf-m-primary"
|
|
@@ -1036,7 +1036,7 @@ section: components
|
|
|
1036
1036
|
### Horizontal nav
|
|
1037
1037
|
|
|
1038
1038
|
```html isFullscreen
|
|
1039
|
-
<div class="pf-v6-c-page" id="nav-horizontal-example">
|
|
1039
|
+
<div class="pf-v6-c-page pf-m-no-sidebar" id="nav-horizontal-example">
|
|
1040
1040
|
<div class="pf-v6-c-skip-to-content">
|
|
1041
1041
|
<a
|
|
1042
1042
|
class="pf-v6-c-button pf-m-primary"
|
|
@@ -1678,7 +1678,7 @@ section: components
|
|
|
1678
1678
|
### Horizontal nav with horizontal subnav
|
|
1679
1679
|
|
|
1680
1680
|
```html isFullscreen
|
|
1681
|
-
<div class="pf-v6-c-page" id="nav-horizontal-example">
|
|
1681
|
+
<div class="pf-v6-c-page pf-m-no-sidebar" id="nav-horizontal-example">
|
|
1682
1682
|
<div class="pf-v6-c-skip-to-content">
|
|
1683
1683
|
<a
|
|
1684
1684
|
class="pf-v6-c-button pf-m-primary"
|