mirror of
https://github.com/aleleba/create-react-component-library.git
synced 2025-09-13 08:36:26 -06:00
PR-500824updating packages.
This commit is contained in:
@ -1,19 +1,37 @@
|
||||
import React from 'react';
|
||||
import { StoryFn, Meta } from '@storybook/react-webpack5';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { Card } from '@components';
|
||||
|
||||
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
||||
export default {
|
||||
const meta: Meta<typeof Card> = {
|
||||
title: 'Example/Card',
|
||||
component: Card,
|
||||
} as Meta<typeof Card>;
|
||||
|
||||
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
||||
const Template: StoryFn<typeof Card> = (args) => <Card {...args} />;
|
||||
|
||||
export const Basic = Template.bind({});
|
||||
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
||||
Basic.args = {
|
||||
title: 'Test Title',
|
||||
children: <p>Test Content</p>,
|
||||
parameters: {
|
||||
docs: {
|
||||
description: {
|
||||
component: 'A reusable Card component for displaying content with an optional title.',
|
||||
},
|
||||
},
|
||||
},
|
||||
argTypes: {
|
||||
title: {
|
||||
control: 'text',
|
||||
description: 'The title of the card',
|
||||
},
|
||||
children: {
|
||||
control: false,
|
||||
description: 'The content to display inside the card',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
||||
export const Basic: Story = {
|
||||
args: {
|
||||
title: 'Test Title',
|
||||
children: <p>Test Content</p>,
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user