-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
projects/js-packages/charts/src/components/legend/stories/index.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,35 @@ | ||
import { BaseLegend } from '../index'; | ||
import type { Meta } from '@storybook/react'; | ||
|
||
const data = [ | ||
{ label: 'Desktop', value: '86%', color: '#3858E9' }, | ||
{ label: 'Mobile', value: '52%', color: '#80C8FF' }, | ||
]; | ||
|
||
export default { | ||
title: 'JS Packages/Charts/Legend', | ||
component: BaseLegend, | ||
parameters: { | ||
layout: 'centered', | ||
docs: { | ||
description: { | ||
component: | ||
'A flexible legend component that can be customized with different styles and orientations.', | ||
}, | ||
}, | ||
}, | ||
} satisfies Meta< typeof BaseLegend >; | ||
|
||
const Template = args => <BaseLegend { ...args } />; | ||
|
||
export const Default = Template.bind( {} ); | ||
Default.args = { | ||
items: data, | ||
orientation: 'horizontal', | ||
}; | ||
|
||
export const Vertical = Template.bind( {} ); | ||
Vertical.args = { | ||
items: data, | ||
orientation: 'vertical', | ||
}; |