Skip to content

Commit d63e7a4

Browse files
feat: better support "header only" card use
1 parent a6b6b0e commit d63e7a4

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

src/Card/CardImageCap.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const CardImageCap = React.forwardRef(({
2727
const [showImageCap, setShowImageCap] = useState(false);
2828
const [showLogoCap, setShowLogoCap] = useState(false);
2929

30-
const wrapperClassName = `pgn__card-wrapper-image-cap ${orientation}`;
30+
const wrapperClassName = `pgn__card-wrapper-image-cap ${orientation}${showLogoCap ? ' with-logo' : ''}`;
3131

3232
if (isLoading) {
3333
return (

src/Card/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,14 @@ This header displays a title, subtitle, and may contain actions.
157157
<div>
158158
<Card className="mb-2">
159159
<Card.Header title="Title" />
160+
<Card.Footer />
160161
</Card>
161162
<Card>
162163
<Card.Header
163164
title="Title"
164165
subtitle="Subtitle"
165166
/>
167+
<Card.Footer />
166168
</Card>
167169
</div>
168170
```
@@ -191,6 +193,7 @@ The `Card.Header` supports custom actions via the actions prop and renders them
191193
</ActionRow>
192194
}
193195
/>
196+
<Card.Footer />
194197
</Card>
195198
<Card>
196199
<Card.Header
@@ -214,6 +217,7 @@ The `Card.Header` supports custom actions via the actions prop and renders them
214217
</Dropdown>
215218
}
216219
/>
220+
<Card.Footer />
217221
</Card>
218222
</div>
219223
)}
@@ -235,6 +239,7 @@ Add ``size="sm"`` for smaller header content and actions.
235239
}
236240
size="sm"
237241
/>
242+
<Card.Footer />
238243
</Card>
239244
```
240245

src/Card/index.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ a.pgn__card {
118118
.pgn__card-header-content {
119119
display: flex;
120120
flex-direction: column;
121-
margin-top: map.get($spacers, 4\.5);
121+
margin-top: var(--pgn-spacing-spacer-base);
122122
overflow: auto;
123123
text-align: start;
124124
width: 100%;
@@ -164,6 +164,8 @@ a.pgn__card {
164164
}
165165

166166
.pgn__card-header-actions {
167+
display: flex;
168+
align-items: center;
167169
margin-top: var(--pgn-spacing-spacer-base);
168170
margin-inline-start: var(--pgn-spacing-spacer-base);
169171
flex-shrink: 0;
@@ -334,8 +336,13 @@ a.pgn__card {
334336

335337
&.vertical {
336338
max-height: var(--pgn-size-card-image-vertical-max-height);
339+
340+
&.with-logo {
341+
margin-bottom: var(--pgn-spacing-spacer-base);
342+
}
337343
}
338344

345+
339346
.pgn__card-image-cap-loader {
340347
.react-loading-skeleton {
341348
margin-bottom: calc(-1 * var(--pgn-spacing-card-loading-skeleton-spacer));

0 commit comments

Comments
 (0)