@kubex/zinc 1.1.46 → 1.1.47

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.
@@ -52,6 +52,35 @@ layout: component
52
52
  </zn-content-block>
53
53
  ```
54
54
 
55
+ ### Subject
56
+
57
+ When a subject is available it is always shown in the header after the sender — expanded or
58
+ collapsed — in place of the truncated body preview. When `subject` is empty,
59
+ `subject-placeholder` is shown dimmed in its place. Omit both attributes to fall back to the
60
+ body preview (e.g. notes).
61
+
62
+ ```html:preview
63
+
64
+ <zn-content-block
65
+ time="16 Jun 2025, 13:00"
66
+ sender="John Smith"
67
+ avatar="JS"
68
+ subject="Re: Help with my order"
69
+ >
70
+ <div slot="text">Text formatted message goes here.</div>
71
+ </zn-content-block>
72
+
73
+ <zn-content-block
74
+ time="16 Jun 2025, 13:05"
75
+ sender="John Smith"
76
+ avatar="JS"
77
+ subject=""
78
+ subject-placeholder="This message has no subject."
79
+ >
80
+ <div slot="text">Text formatted message goes here.</div>
81
+ </zn-content-block>
82
+ ```
83
+
55
84
  ### Attachments
56
85
 
57
86
  Attachments render in a row at the bottom of the content and are only visible while the block
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubex/zinc",
3
- "version": "1.1.46",
3
+ "version": "1.1.47",
4
4
  "description": "A collection of web components for building web applications based off of @shoelace-style/Shoelace",
5
5
  "keywords": [
6
6
  "web components",
@@ -35,6 +35,16 @@ export default class ContentBlock extends ZincElement {
35
35
  @property() sender = '';
36
36
  @property() avatar = '';
37
37
 
38
+ /** The message subject, shown in the header after the sender. */
39
+ @property() subject = '';
40
+
41
+ /**
42
+ * Placeholder shown dimmed in place of the subject when `subject` is empty
43
+ * (e.g. "This message has no subject."). Omit both for content without a
44
+ * subject line (e.g. notes).
45
+ */
46
+ @property({attribute: 'subject-placeholder'}) subjectPlaceholder = '';
47
+
38
48
  @property({type: Boolean, reflect: true}) outbound = false;
39
49
 
40
50
  @property({type: Boolean, attribute: "no-collapse"}) noCollapse = false;
@@ -225,7 +235,12 @@ export default class ContentBlock extends ZincElement {
225
235
  <span class="content-block-header__caption">
226
236
  <slot name="caption">${this.sender}</slot>
227
237
  </span>
228
- <span class="content-block-header__description">${this.truncateText()}</span>
238
+ ${this.subject || this.subjectPlaceholder ? html`
239
+ <span class="${classMap({
240
+ 'content-block-header__subject': true,
241
+ 'content-block-header__subject--empty': !this.subject
242
+ })}">${this.subject || this.subjectPlaceholder}</span>` : html`
243
+ <span class="content-block-header__description">${this.truncateText()}</span>`}
229
244
  ${this.attachmentCount > 0 ? html`
230
245
  <span class="content-block-header__attachments" part="header-attachments">
231
246
  <zn-icon src="paperclip@lu" size="14"></zn-icon>${this.attachmentCount}
@@ -6,6 +6,9 @@
6
6
  -webkit-font-smoothing: antialiased;
7
7
  -moz-osx-font-smoothing: grayscale;
8
8
 
9
+ background-color: rgba(var(--zn-panel), var(--zn-panel-opacity));
10
+ border-bottom: 1px solid rgb(var(--zn-border-color));
11
+
9
12
  padding-inline: calc(var(--zn-gutter, 0) + var(--zn-base-gap, 0));
10
13
 
11
14
  *, *::before, *::after {
@@ -58,6 +61,19 @@
58
61
  text-overflow: ellipsis;
59
62
  }
60
63
 
64
+ .content-block-header__subject {
65
+ flex: 1 1 auto;
66
+ min-width: 0;
67
+ font-size: var(--zn-font-size-medium);
68
+ overflow: hidden;
69
+ white-space: nowrap;
70
+ text-overflow: ellipsis;
71
+
72
+ &--empty {
73
+ opacity: 0.5;
74
+ }
75
+ }
76
+
61
77
  .content-block-header__description {
62
78
  flex: 1 1 auto;
63
79
  min-width: 0;