-
Notifications
You must be signed in to change notification settings - Fork 152
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
13 changed files
with
1,393 additions
and
40 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const utils = `const [expandedSection, setExpandedSection] = React.useState("accordion-section-0");`; | ||
|
||
const code = ` | ||
<> | ||
{/* For the example to work as expected, you should also import the Accordion Utils before the return. */} | ||
<Accordion expandedSection={expandedSection} onExpand={id => setExpandedSection(String(id))}> | ||
<AccordionSection | ||
id="accordion-section-0" | ||
header={ | ||
<Stack spacing="300"> | ||
<Text type="primary">This is a header label</Text> | ||
<Text size="small">This is a header label</Text> | ||
</Stack> | ||
} | ||
> | ||
<Text type="primary">This is a content text</Text> | ||
</AccordionSection> | ||
<AccordionSection | ||
id="accordion-section-1" | ||
header={ | ||
<Stack spacing="300"> | ||
<Text type="primary">This is a header label</Text> | ||
<Text size="small">This is a header label</Text> | ||
</Stack> | ||
} | ||
> | ||
<Text type="primary">This is a content text</Text> | ||
</AccordionSection> | ||
<AccordionSection | ||
id="accordion-section-2" | ||
header={ | ||
<Stack spacing="300"> | ||
<Text type="primary">This is a header label</Text> | ||
<Text size="small">This is a header label</Text> | ||
</Stack> | ||
} | ||
> | ||
<Text type="primary">This is a content text</Text> | ||
</AccordionSection> | ||
</Accordion> | ||
</> | ||
`; | ||
|
||
export default [ | ||
{ | ||
group: "Accordion", | ||
name: "Basic Accordion", | ||
code, | ||
}, | ||
{ | ||
group: "Accordion", | ||
name: "Utils", | ||
code: utils, | ||
}, | ||
]; |
Oops, something went wrong.