Skip to content

Commit

Permalink
Merge pull request #855 from Infineon/806-card-storybook-section-misa…
Browse files Browse the repository at this point in the history
…lignment

Update card.stories.ts to fix #806
  • Loading branch information
tishoyanchev authored Jan 12, 2024
2 parents e6629cd + 6540595 commit c1bba5a
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions packages/components/src/components/card/card.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ export default {

position: {
options: ['left', 'right'],
control: { type: 'radio' }
control: { type: 'radio'},
if: { arg: 'direction', eq: 'horizontal'}
},

target: {
options: ['_blank', '_self', '_parent'],
control: { type: 'radio' }
Expand Down Expand Up @@ -71,13 +73,8 @@ const DefaultTemplate = (args) =>
</ifx-card>`;

export const Default = DefaultTemplate.bind({});
Default.argTypes = {
src: "https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg",
position: {
table: {
disable: true
}
}
Default.args = {
src: "https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg"
}

const HorizontalTemplate = (args) =>
Expand All @@ -98,6 +95,11 @@ const HorizontalTemplate = (args) =>
${args.description}
</ifx-card-text>`
: ""}
${args.button === 'button'
? `<ifx-card-links slot="buttons">
<ifx-button variant="primary">Button</ifx-button>
<ifx-button variant="secondary">Button</ifx-button>
</ifx-card-links>` : ""}
${args.button === 'link'
? `<ifx-card-links slot="buttons">
<ifx-link color="primary" href="https://google.com" target="_blank" underline="false">
Expand All @@ -113,17 +115,14 @@ const HorizontalTemplate = (args) =>


export const Horizontal = HorizontalTemplate.bind({});
Horizontal.argTypes = {
Horizontal.args = {
direction: 'horizontal',
src: "https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg",
image: {
table: {
src: "https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg"
}
Horizontal.argTypes = {
direction: {
table:{
disable: true
}
},
button: {
options: ['link', 'none'],
control: { type: 'radio' },
},
}
}

0 comments on commit c1bba5a

Please sign in to comment.