Skip to content

Commit

Permalink
Fix controls of expandable-card story (#3809)
Browse files Browse the repository at this point in the history
* doc(watt, expandable-card): add togglePosition prop for stories with options for positioning

* style: format

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 646e244 commit 93010da
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,22 @@ export default {
imports: [WattBadgeComponent, WATT_EXPANDABLE_CARD_COMPONENTS],
}),
],
argTypes: {
variant: {
options: ['elevation', 'solid'],
control: { type: 'radio' },
},
togglePosition: {
options: ['before', 'after'],
control: { type: 'radio' },
},
},
} as Meta;

export const Overview: StoryFn<WattExpandableCardComponent> = (args) => ({
props: args,
template: `
<watt-expandable-card [expanded]="expanded" [variant]="variant">
<watt-expandable-card [expanded]="expanded" [variant]="variant" [togglePosition]="togglePosition">
<watt-badge size="large">02</watt-badge>
<watt-expandable-card-title>The Cosmos Awaits</watt-expandable-card-title>
<p>
Expand All @@ -57,6 +67,7 @@ export const Overview: StoryFn<WattExpandableCardComponent> = (args) => ({
Overview.args = {
expanded: false,
variant: 'elevation',
togglePosition: 'after',
};

export const WithNestedCards: StoryFn<WattExpandableCardComponent> = (args) => ({
Expand All @@ -83,4 +94,5 @@ export const WithNestedCards: StoryFn<WattExpandableCardComponent> = (args) => (
WithNestedCards.args = {
expanded: true,
variant: 'solid',
togglePosition: 'after',
};

0 comments on commit 93010da

Please sign in to comment.