mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 05:31:05 +08:00
39 lines
822 B
Plaintext
39 lines
822 B
Plaintext
```ts
|
|
// ButtonGroup.stories.ts
|
|
|
|
import { Story, Meta } from '@storybook/angular/types-6-0';
|
|
|
|
import { moduleMetadata } from '@storybook/angular';
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
import ButtonGroup from './ButtonGroup.component';
|
|
import Button from './button.component';
|
|
|
|
//👇 Imports the Button stories
|
|
import * as ButtonStories from './Button.stories';
|
|
|
|
export default {
|
|
title: 'ButtonGroup',
|
|
component: ButtonGroup,
|
|
decorators: [
|
|
moduleMetadata({
|
|
declarations: [Button],
|
|
imports: [CommonModule],
|
|
}),
|
|
],
|
|
} as Meta;
|
|
|
|
const Template: Story<ButtonGroup> = (args) => ({
|
|
props: args,
|
|
});
|
|
|
|
export const Pair = Template.bind({});
|
|
Pair.args = {
|
|
buttons: [
|
|
{ ...ButtonStories.Primary.args },
|
|
{ ...ButtonStories.Secondary.args },
|
|
],
|
|
orientation: 'horizontal',
|
|
};
|
|
```
|