Skip to content

Commit 08257e9

Browse files
committed
Add descriptions to panels
1 parent 2ee8a9e commit 08257e9

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

docs/pages/components/panel.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ layout: component
77

88
```html:preview
99
10-
<zn-panel caption="Example Panel" flush tabbed>
10+
<zn-panel caption="Example Panel" description="Full Example of a panel" flush tabbed>
1111
1212
<!-- All the panel actions -->
1313
<zn-chip slot="actions" icon="home">Awesome</zn-chip>
@@ -50,7 +50,7 @@ Basic panels are just that, basic. However, they are a key component in the zn f
5050
around been displayed in a panel.
5151

5252
```html:preview
53-
<zn-panel caption="Example Panel">
53+
<zn-panel caption="Example Panel" description="Simple Panels are the best">
5454
<div>Panel Content</div>
5555
</zn-panel>
5656
```

src/components/panel/panel.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export default class ZnPanel extends ZincElement {
2929

3030
@property() caption: string;
3131

32+
@property() description: string;
33+
3234
@property({type: Boolean}) tabbed: boolean;
3335

3436
@property({type: Boolean}) flush: boolean;
@@ -71,7 +73,10 @@ export default class ZnPanel extends ZincElement {
7173
7274
${hasHeader ? html`
7375
<div class="panel__header">
74-
<span class="panel__caption">${this.caption}</span>
76+
<div class="panel__header__left">
77+
<span class="panel__caption">${this.caption}</span>
78+
<span class="panel__description">${this.description}</span>
79+
</div>
7580
${hasActionSlot ? html`
7681
<slot name="actions" class="panel__header__actions"></slot>
7782
` : null}

src/components/panel/panel.scss

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@
2727
background-color: rgba(var(--zn-panel), var(--zn-panel-opacity));
2828

2929
&__header {
30-
display: flex;;
30+
display: flex;
3131
justify-items: center;
3232
padding: var(--zn-spacing-medium) var(--zn-spacing-medium) 0;
3333

34+
&__left {
35+
display: flex;
36+
flex-direction: column;
37+
gap: var(--zn-spacing-2x-small);
38+
flex-grow: 1;
39+
}
40+
3441
&__actions {
3542
display: flex;
3643
gap: var(--zn-spacing-2x-small);
@@ -39,11 +46,15 @@
3946

4047
.panel__caption {
4148
font-weight: var(--zn-font-weight-bold);
42-
flex-grow: 1;
4349
font-size: var(--zn-font-size-medium);
44-
color: rgba(var(--zn-text-panel-title), 100%);
45-
display: flex;
46-
align-items: center;
50+
color: rgb(var(--zn-text-panel-title));
51+
margin: 0;
52+
}
53+
54+
.panel__description {
55+
font-weight: var(--zn-font-weight-semibold);
56+
font-size: var(--zn-font-size-medium);
57+
color: rgb(var(--zn-text));
4758
margin: 0;
4859
}
4960
}

0 commit comments

Comments
 (0)