-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(storybook): make clickable optionnal and manage ngContent
- Loading branch information
Showing
2 changed files
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
import { Meta, moduleMetadata, Story } from '@storybook/angular' | ||
import { | ||
componentWrapperDecorator, | ||
Meta, | ||
moduleMetadata, | ||
Story, | ||
} from '@storybook/angular' | ||
import { BadgeComponent } from './badge.component' | ||
|
||
export default { | ||
title: 'Widgets/BadgeComponent', | ||
component: BadgeComponent, | ||
decorators: [ | ||
componentWrapperDecorator(BadgeComponent), | ||
moduleMetadata({ | ||
imports: [], | ||
}), | ||
], | ||
} as Meta<BadgeComponent> | ||
|
||
type BadgeComponentWithContent = { content: string } | ||
|
||
const Template: Story<BadgeComponentWithContent> = (args: BadgeComponent) => ({ | ||
interface BadgeComponentContent extends Partial<BadgeComponent> { | ||
content: string | ||
} | ||
const Template: Story<BadgeComponentContent> = ( | ||
args: BadgeComponentContent | ||
) => ({ | ||
component: BadgeComponent, | ||
props: args, | ||
template: '<gn-ui-badge>{{content}}</gn-ui-badge>', | ||
}) | ||
|
||
export const Primary = Template.bind({}) | ||
Primary.args = { | ||
content: 'My badge!', | ||
clickable: true, | ||
content: 'My custom badge', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters