@patternfly/patternfly 6.3.0-prerelease.3 → 6.3.0-prerelease.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.
@@ -9,6 +9,11 @@
9
9
  align-items: baseline;
10
10
  min-width: var(--pf-v6-c-truncate--MinWidth);
11
11
  }
12
+ .pf-v6-c-truncate.pf-m-fixed {
13
+ display: inline;
14
+ align-items: revert;
15
+ min-width: revert;
16
+ }
12
17
 
13
18
  .pf-v6-c-truncate__start,
14
19
  .pf-v6-c-truncate__end {
@@ -10,6 +10,12 @@
10
10
  grid-auto-flow: column;
11
11
  align-items: baseline;
12
12
  min-width: var(--#{$truncate}--MinWidth);
13
+
14
+ &.pf-m-fixed {
15
+ display: inline;
16
+ align-items: revert;
17
+ min-width: revert;
18
+ }
13
19
  }
14
20
 
15
21
  .#{$truncate}__start,
@@ -21822,6 +21822,11 @@ thead .pf-v6-c-table__check .pf-v6-c-radio.pf-m-standalone {
21822
21822
  align-items: baseline;
21823
21823
  min-width: var(--pf-v6-c-truncate--MinWidth);
21824
21824
  }
21825
+ .pf-v6-c-truncate.pf-m-fixed {
21826
+ display: inline;
21827
+ align-items: revert;
21828
+ min-width: revert;
21829
+ }
21825
21830
 
21826
21831
  .pf-v6-c-truncate__start,
21827
21832
  .pf-v6-c-truncate__end {
@@ -6,18 +6,18 @@ cssPrefix: pf-v6-c-truncate
6
6
 
7
7
  ## Examples
8
8
 
9
- ### Notes
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
- >Vestibulum interdum risus et enim faucibus, sit amet molestie est accumsan.</span>
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
- >Vestibulum interdum risus et enim faucibus,&nbsp;</span>
34
- <span class="pf-v6-c-truncate__end">sit amet molestie est accumsan.</span>
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. `&lrm;` **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
- >Vestibulum interdum risus et enim faucibus, sit amet molestie est accumsan.&lrm;</span>
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">&hellip;</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">&hellip;</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">&hellip;</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. |
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@patternfly/patternfly",
3
3
  "description": "Assets, source, tooling, and content for PatternFly 4",
4
- "version": "6.3.0-prerelease.3",
4
+ "version": "6.3.0-prerelease.4",
5
5
  "keywords": [],
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -47,7 +47,7 @@
47
47
  "@commitlint/config-conventional": "^19.1.0",
48
48
  "@fortawesome/fontawesome": "^1.1.8",
49
49
  "@octokit/rest": "^20.1.0",
50
- "@patternfly/documentation-framework": "6.8.4",
50
+ "@patternfly/documentation-framework": "6.9.0",
51
51
  "@patternfly/patternfly-a11y": "5.0.0",
52
52
  "@patternfly/react-code-editor": "6.2.0",
53
53
  "@patternfly/react-core": "6.2.0",
@@ -29284,6 +29284,11 @@ thead .pf-v6-c-table__check .pf-v6-c-radio.pf-m-standalone {
29284
29284
  align-items: baseline;
29285
29285
  min-width: var(--pf-v6-c-truncate--MinWidth);
29286
29286
  }
29287
+ .pf-v6-c-truncate.pf-m-fixed {
29288
+ display: inline;
29289
+ align-items: revert;
29290
+ min-width: revert;
29291
+ }
29287
29292
 
29288
29293
  .pf-v6-c-truncate__start,
29289
29294
  .pf-v6-c-truncate__end {
package/patternfly.css CHANGED
@@ -29420,6 +29420,11 @@ thead .pf-v6-c-table__check .pf-v6-c-radio.pf-m-standalone {
29420
29420
  align-items: baseline;
29421
29421
  min-width: var(--pf-v6-c-truncate--MinWidth);
29422
29422
  }
29423
+ .pf-v6-c-truncate.pf-m-fixed {
29424
+ display: inline;
29425
+ align-items: revert;
29426
+ min-width: revert;
29427
+ }
29423
29428
 
29424
29429
  .pf-v6-c-truncate__start,
29425
29430
  .pf-v6-c-truncate__end {