mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 05:41:07 +08:00
41 lines
949 B
Plaintext
41 lines
949 B
Plaintext
```ts
|
|
// ButtonGroup.stories.ts
|
|
|
|
import { Meta, moduleMetadata, Story } 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 {
|
|
/* 👇 The title prop is optional.
|
|
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
|
|
* to learn how to generate automatic titles
|
|
*/
|
|
title: 'ButtonGroup',
|
|
component: ButtonGroup,
|
|
decorators: [
|
|
moduleMetadata({
|
|
declarations: [Button],
|
|
imports: [CommonModule],
|
|
}),
|
|
],
|
|
} as Meta;
|
|
|
|
const Template: Story = (args) => ({
|
|
props: args,
|
|
});
|
|
|
|
export const Pair = Template.bind({});
|
|
Pair.args = {
|
|
buttons: [
|
|
{ ...ButtonStories.Primary.args },
|
|
{ ...ButtonStories.Secondary.args },
|
|
],
|
|
orientation: 'horizontal',
|
|
};
|
|
``` |