Skip to content

Commit d87a49a

Browse files
chore: Update cards permutation to match expected usage (#1418)
1 parent 5fb7188 commit d87a49a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

pages/cards/permutations.page.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ function createSimpleItems(count: number) {
2828
}
2929

3030
const cardDefinition: CardsProps.CardDefinition<Item> = {
31-
header: item => (item.number === 2 ? <Link href="#">{item.text}</Link> : item.text),
31+
header: item =>
32+
item.number === 2 ? (
33+
<Link href="#" fontSize="inherit">
34+
{item.text}
35+
</Link>
36+
) : (
37+
item.text
38+
),
3239
sections: [
3340
{
3441
id: 'description',

src/__tests__/__snapshots__/documenter.test.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -3587,7 +3587,7 @@ add a meaningful description to the whole selection.",
35873587
Object {
35883588
"description": " Defines what to display in each card. It has the following properties:
35893589
* \`header\` ((item) => ReactNode) - Responsible for displaying the card header. You receive the current item as an argument.
3590-
Use \`fontSize=\\"heading-m\\"\` on [link](/components/link/) components inside card header.
3590+
Use \`fontSize=\\"inherit\\"\` on [link](/components/link/) components inside card header.
35913591
* \`sections\` (array) - Responsible for displaying the card content. Cards can have many sections in their
35923592
body. Each entry in the array is responsible for displaying a section. An entry has the following properties:
35933593
* \`id\`: (string) - A unique identifier for the section. The property is used as a [keys](https://reactjs.org/docs/lists-and-keys.html#keys)

src/cards/interfaces.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export interface CardsProps<T = any> extends BaseComponentProps {
6464
/**
6565
* Defines what to display in each card. It has the following properties:
6666
* * `header` ((item) => ReactNode) - Responsible for displaying the card header. You receive the current item as an argument.
67-
* Use `fontSize="heading-m"` on [link](/components/link/) components inside card header.
67+
* Use `fontSize="inherit"` on [link](/components/link/) components inside card header.
6868
* * `sections` (array) - Responsible for displaying the card content. Cards can have many sections in their
6969
* body. Each entry in the array is responsible for displaying a section. An entry has the following properties:
7070
* * `id`: (string) - A unique identifier for the section. The property is used as a [keys](https://reactjs.org/docs/lists-and-keys.html#keys)

0 commit comments

Comments
 (0)