mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 08:01:20 +08:00
And change semantics: `docsPage:true` = `autodocs: 'tag'` and `docsPage: 'automatic'` = `autodocs: true`.
38 lines
973 B
TypeScript
38 lines
973 B
TypeScript
import { moduleMetadata } from '@storybook/angular';
|
|
import type { Meta, StoryObj } from '@storybook/angular';
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
import Button from './button.component';
|
|
import Header from './header.component';
|
|
|
|
const meta: Meta<Header> = {
|
|
title: 'Example/Header',
|
|
component: Header,
|
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/7.0/angular/writing-docs/docs-page
|
|
tags: ['autodocs'],
|
|
render: (args) => ({ props: args }),
|
|
decorators: [
|
|
moduleMetadata({
|
|
declarations: [Button],
|
|
imports: [CommonModule],
|
|
}),
|
|
],
|
|
parameters: {
|
|
// More on how to position stories at: https://storybook.js.org/docs/7.0/angular/configure/story-layout
|
|
layout: 'fullscreen',
|
|
},
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<Header>;
|
|
|
|
export const LoggedIn: Story = {
|
|
args: {
|
|
user: {
|
|
name: 'Jane Doe',
|
|
},
|
|
},
|
|
};
|
|
|
|
export const LoggedOut: Story = {};
|