Skip to content

Commit afb5e94

Browse files
committed
feat(card): removed unused code & improve doc
1 parent 2996336 commit afb5e94

File tree

4 files changed

+8
-25
lines changed

4 files changed

+8
-25
lines changed

packages/ods-react/src/components/card/src/components/ods-card/OdsCard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const OdsCard: FC<OdsCardProp> = forwardRef(({
1717
className={ classNames(
1818
style['ods-card'],
1919
style[`ods-card--${color}`],
20-
className
20+
className,
2121
) }
2222
ref={ ref }
2323
{ ...props }>

packages/ods-react/src/components/card/src/constants/card-color.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export {
1111
ODS_CARD_COLOR,
1212
ODS_CARD_COLORS,
1313
type OdsCardColor,
14-
};
14+
};

packages/storybook/stories/components/card/card.stories.tsx

+5-16
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ type Story = StoryObj<OdsCardProp>;
88

99
const meta: Meta<OdsCardProp> = {
1010
component: OdsCard,
11-
// @ts-ignore see https://github.com/storybookjs/storybook/issues/27535
12-
// subcomponents: { OdsCardXxx }, // Uncomment if sub components, otherwise remove
1311
title: 'ODS Components/Card',
1412
};
1513

@@ -35,39 +33,30 @@ export const Demo: Story = {
3533
},
3634
}),
3735
args: {
38-
color: 'primary',
3936
children: 'Hello, world!',
4037
},
4138
};
4239

4340
export const Default: Story = {
4441
tags: ['!dev'],
45-
render: () => (
42+
render: ({}) => (
4643
<OdsCard>
4744
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<br />Interdum et malesuada fames ac ante ipsum primis in faucibus.</p>
4845
</OdsCard>
4946
),
5047
};
5148

5249
export const Color: Story = {
50+
decorators: [(story) => <div style={{ display: 'flex', gap: '16px' }}>{ story() }</div>],
5351
tags: ['!dev'],
54-
render: () => (
55-
<div style={{ display: 'flex', gap: '16px' }}>
52+
render: ({}) => (
53+
<>
5654
<OdsCard color="primary">
5755
<p>Primary Card</p>
5856
</OdsCard>
5957
<OdsCard color="neutral">
6058
<p>Neutral Card</p>
6159
</OdsCard>
62-
</div>
63-
),
64-
};
65-
66-
export const CustomCSS: Story = {
67-
tags: ['!dev'],
68-
render: () => (
69-
<OdsCard style={{ width: '500px', display: 'flex', justifyContent: 'center', border: '3px solid green' }}>
70-
<p>Custom styled card</p>
71-
</OdsCard>
60+
</>
7261
),
7362
};

packages/storybook/stories/components/card/technical-information.mdx

+1-7
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ import * as CardStories from './card.stories';
1515

1616
<TechnicalSpecification data={ SpecificationsCard } of={ CardStories } />
1717

18-
<Heading label="Style customization" level={ 2 } />
19-
20-
You can add your own style on the card element directly by selecting it.
21-
2218
<Heading label="Examples" level={ 2 } />
2319

2420
<Heading label="Default" level={ 3 } />
@@ -27,6 +23,4 @@ You can add your own style on the card element directly by selecting it.
2723

2824
<Heading label="Color" level={ 3 } />
2925

30-
<Canvas of={ CardStories.Demo } sourceState="shown" />
31-
32-
...
26+
<Canvas of={ CardStories.Color } sourceState="shown" />

0 commit comments

Comments
 (0)