-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add story for < FunctionArguments /> and < InformationBox /> (#115
- Loading branch information
Showing
5 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...components/src/components/function-arguments/__stories__/function-arguments.mdx
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Controls, Canvas, Meta } from '@storybook/blocks'; | ||
import * as FunctionArguments from './function-arguments.stories'; | ||
|
||
<Meta of={FunctionArguments} /> | ||
|
||
# FunctionArguments | ||
|
||
## Overview | ||
|
||
The FunctionArgument component is used to display details of function arguments in a react component. | ||
It allows you to provide the name, type, and description of the argument. | ||
Additionally, you can specify whether the argument is required and provide a default value if applicable. | ||
|
||
<Canvas of={FunctionArguments.Overview} /> | ||
|
||
## Props | ||
|
||
<Controls /> |
33 changes: 33 additions & 0 deletions
33
...k-components/src/components/function-arguments/__stories__/function-arguments.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import FunctionArguments from '../function-arguments'; | ||
import FunctionArgument from '../function-argument'; | ||
|
||
const meta: Meta<typeof FunctionArguments> = { | ||
component: FunctionArguments, | ||
title: 'Components/FunctionArguments', | ||
}; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof FunctionArguments>; | ||
|
||
export const Overview: Story = { | ||
args: { | ||
children: ( | ||
<FunctionArgument name="argument" type="type" description="Description of the argument"> | ||
<FunctionArgument | ||
name="callback" | ||
type="(event: Event) => void" | ||
description="Callback function to execute when the event is fired." | ||
required | ||
/> | ||
<FunctionArgument | ||
name="count" | ||
type="number" | ||
description="The number of items to process." | ||
default="0" | ||
required | ||
/> | ||
</FunctionArgument> | ||
), | ||
}, | ||
}; |
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
17 changes: 17 additions & 0 deletions
17
...ybook-components/src/components/information-box/__stories__/information-box.mdx
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Controls, Canvas, Meta } from '@storybook/blocks'; | ||
import * as InformationBox from './information-box.stories'; | ||
|
||
<Meta of={InformationBox} /> | ||
|
||
# InformationBox | ||
|
||
## Overview | ||
|
||
The InformationBox component is used to display an information box. | ||
It allows you to provide the title, component, link and description. | ||
|
||
<Canvas of={InformationBox.Overview} /> | ||
|
||
## Props | ||
|
||
<Controls /> |
19 changes: 19 additions & 0 deletions
19
...orybook-components/src/components/information-box/__stories__/information-box.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import InformationBox from '../information-box'; | ||
|
||
const meta: Meta<typeof InformationBox> = { | ||
component: InformationBox, | ||
title: 'Components/InformationBox', | ||
}; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof InformationBox>; | ||
|
||
export const Overview: Story = { | ||
args: { | ||
title: 'Title', | ||
component: <img src="/visual-description.png" alt="Example Image" width={100} />, | ||
description: 'This is a description.', | ||
href: '/?path=/docs/welcome--docs', | ||
}, | ||
}; |