-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: remove unuseful comments * refactor: rename Docx to Docs * fix: move Accordion example inside the story * fix: add different sizes * docs: remove example and update headers * fix: update paddings based on the designer's feedbacks * fix: fix horizontal divider width --------- Co-authored-by: Andrea Forni <[email protected]>
- Loading branch information
1 parent
708710a
commit 035afe1
Showing
4 changed files
with
102 additions
and
111 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,29 +1,74 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
import { AccordionDemo } from './Accordion.example' | ||
import { | ||
Accordion, | ||
AccordionItem, | ||
AccordionTrigger, | ||
AccordionContent | ||
} from '@/components' | ||
|
||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export | ||
const meta = { | ||
title: 'Components/Accordion', | ||
component: AccordionDemo, | ||
component: Accordion, | ||
parameters: { | ||
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout | ||
layout: 'centered' | ||
}, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs | ||
argTypes: { | ||
className: { | ||
controle: 'text', | ||
description: 'Alter the className to change the style' | ||
type: { | ||
options: ['single', 'multiple'], | ||
control: 'radio' | ||
}, | ||
size: { | ||
options: ['sm', 'md', 'lg'], | ||
control: 'radio' | ||
} | ||
} | ||
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes | ||
} satisfies Meta<typeof AccordionDemo> | ||
}, | ||
render: props => ( | ||
<Accordion {...props}> | ||
<AccordionItem value="item-1"> | ||
<AccordionTrigger>Item 1</AccordionTrigger> | ||
<AccordionContent> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse | ||
facilisis ac ligula ut luctus. Nulla sed tortor tempor, auctor mi at, | ||
mollis nulla. | ||
</AccordionContent> | ||
</AccordionItem> | ||
|
||
<AccordionItem value="item-2"> | ||
<AccordionTrigger>Item 2</AccordionTrigger> | ||
<AccordionContent> | ||
<div className="px-6 text-foreground-muted bg-blue-50 dark:bg-blue-900 dark:text-foreground-inverse h-40 font-semibold items-center flex justify-center"> | ||
Replace this component with your content | ||
</div> | ||
</AccordionContent> | ||
</AccordionItem> | ||
|
||
<AccordionItem value="item-3"> | ||
<AccordionTrigger>Item 3</AccordionTrigger> | ||
<AccordionContent> | ||
<div className="px-6 text-foreground-muted bg-blue-50 dark:bg-blue-900 dark:text-foreground-inverse h-40 font-semibold items-center flex justify-center"> | ||
Replace this component with your content | ||
</div> | ||
</AccordionContent> | ||
</AccordionItem> | ||
</Accordion> | ||
) | ||
} satisfies Meta<typeof Accordion> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args | ||
export const Default: Story = { | ||
args: {} | ||
export const Single: Story = { | ||
args: { | ||
type: 'single', | ||
collapsible: true, | ||
size: 'md' | ||
} | ||
} | ||
|
||
export const Multiple: Story = { | ||
args: { | ||
type: 'multiple', | ||
size: 'md' | ||
} | ||
} |
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