Skip to content

Commit 5be32e8

Browse files
committed
Minor fixes on #196
1 parent e2f0ceb commit 5be32e8

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

src/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export const Card = memo(
194194
alt={imageAlt}
195195
/>
196196
</div>
197-
{badge && (
197+
{badge !== undefined && (
198198
<ul className={cx(fr.cx("fr-badges-group"), classes.badge)}>
199199
<li>{badge}</li>
200200
</ul>

stories/Card.stories.tsx

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const { meta, getStory } = getStoryFactory({
1919
- [See source code](https://github.com/codegouvfr/react-dsfr/blob/main/src/Card.tsx)`,
2020
"argTypes": {
2121
"title": { "description": `Required.` },
22-
titleAs: {
22+
"titleAs": {
2323
"description": `Heading level`,
2424
"options": (() => {
2525
const headings = ["h2", "h3", "h4", "h5", "h6"] as const;
@@ -29,15 +29,15 @@ const { meta, getStory } = getStoryFactory({
2929
"control": { "type": "radio" }
3030
},
3131
"desc": { "description": `` },
32-
linkProps: {
32+
"linkProps": {
3333
"description": `Required only if enlargeLink is true. The Card Link props.`
3434
},
35-
enlargeLink: {
35+
"enlargeLink": {
3636
"description": `Set to false to restrict the link area to the Card title only.`,
37-
defaultValue: false,
37+
"defaultValue": false,
3838
"control": { "type": "boolean" }
3939
},
40-
iconId: {
40+
"iconId": {
4141
"options": (() => {
4242
const options = ["fr-icon-checkbox-circle-line", "ri-ancient-gate-fill"] as const;
4343

@@ -49,65 +49,65 @@ const { meta, getStory } = getStoryFactory({
4949
})(),
5050
"control": { "type": "radio" }
5151
},
52-
size: {
52+
"size": {
5353
"description": "Card title text sizing",
5454
"options": (() => {
5555
const sizes = ["small", "medium", "large"] as const;
5656
assert<Equals<typeof sizes[number] | undefined, CardProps["size"]>>();
5757
return sizes;
5858
})(),
59-
defaultValue: "medium",
59+
"defaultValue": "medium",
6060
"control": { "type": "radio" }
6161
},
62-
imageUrl: {
62+
"imageUrl": {
6363
"description": "Use any image URL, or none"
6464
},
65-
imageAlt: {
65+
"imageAlt": {
6666
"description": "Alternative text for the image"
6767
},
68-
badge: {
69-
description: "Badge in the header"
68+
"badge": {
69+
"description": "Badge in the header"
7070
},
71-
start: {
72-
description:
71+
"start": {
72+
"description":
7373
"Zone containing either tags group or badges group (not both) located above the card title"
7474
},
75-
detail: {
76-
description: "Hint text about the `start` zone"
75+
"detail": {
76+
"description": "Hint text about the `start` zone"
7777
},
78-
end: {
79-
description: "Extra details or actions below the card content"
78+
"end": {
79+
"description": "Extra details or actions below the card content"
8080
},
81-
endDetail: {
82-
description: "Hint text about the `end` zone"
81+
"endDetail": {
82+
"description": "Hint text about the `end` zone"
8383
},
84-
footer: {
85-
description: "Footer"
84+
"footer": {
85+
"description": "Footer"
8686
},
87-
horizontal: {
88-
description: "Horizontal alignment",
89-
defaultValue: false,
90-
type: "boolean"
87+
"horizontal": {
88+
"description": "Horizontal alignment",
89+
"defaultValue": false,
90+
"type": "boolean"
9191
},
92-
background: {
93-
description: "Card with opaque background",
94-
defaultValue: true,
95-
type: "boolean"
92+
"background": {
93+
"description": "Card with opaque background",
94+
"defaultValue": true,
95+
"type": "boolean"
9696
},
97-
border: {
98-
description: "Card with border",
99-
defaultValue: true,
100-
type: "boolean"
97+
"border": {
98+
"description": "Card with border",
99+
"defaultValue": true,
100+
"type": "boolean"
101101
},
102-
shadow: {
103-
description: "Card with shadow",
104-
defaultValue: false,
105-
type: "boolean"
102+
"shadow": {
103+
"description": "Card with shadow",
104+
"defaultValue": false,
105+
"type": "boolean"
106106
},
107-
grey: {
108-
description: "Card content zone with grey background",
109-
defaultValue: false,
110-
type: "boolean"
107+
"grey": {
108+
"description": "Card content zone with grey background",
109+
"defaultValue": false,
110+
"type": "boolean"
111111
}
112112
},
113113
"disabledProps": ["lang"]

0 commit comments

Comments
 (0)