forked from Semantic-Org/Semantic-UI-React
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Accordion): support panel's title as custom element Semantic-Org…
…#1144 (Semantic-Org#1281) * feat(Accordion): support panel's title as custom element Semantic-Org#1144 * refactor(Accordion) panels created using createShorthandFactory * fix(Accordion) title and content custom elements not wrapped in div with class names * docs(Accordion) add example use case for custom title component to Accordion docs * refactor(Accordion): remove unused import * Revert "docs(Accordion) add example use case for custom title component to Accordion docs" This reverts commit 1b84e22. * fix(Accordion): Accordion Title does not have dropdown for panels with string title * docs(Accordion): added separate example for Accordion with custom title and content * feat(Accordion): Accordion consistently renders dropdown icon for panels' titles * docs(Accordion): Move custom title and content example to Usages * docs(Accordion): reorganize panels shorthand * feat(Accordion): support all child keys in panels
- Loading branch information
1 parent
c72a5eb
commit 774c558
Showing
12 changed files
with
165 additions
and
43 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
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
...p/Examples/modules/Accordion/Usage/AccordionExamplePanelsPropWithCustomTitleAndContent.js
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,22 @@ | ||
import React from 'react' | ||
import { Accordion, Label, Message } from 'semantic-ui-react' | ||
import faker from 'faker' | ||
import _ from 'lodash' | ||
|
||
const panels = _.times(3, i => ({ | ||
key: `panel-${i}`, | ||
title: <Label color='blue' content={faker.lorem.sentence()} />, | ||
content: ( | ||
<Message | ||
info | ||
header={faker.lorem.sentence()} | ||
content={faker.lorem.paragraph()} | ||
/> | ||
), | ||
})) | ||
|
||
const AccordionExamplePanelsPropWithCustomTitleAndContent = () => ( | ||
<Accordion panels={panels} /> | ||
) | ||
|
||
export default AccordionExamplePanelsPropWithCustomTitleAndContent |
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,28 @@ | ||
import React from 'react' | ||
|
||
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample' | ||
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection' | ||
|
||
import { Message } from 'semantic-ui-react' | ||
|
||
const AccordionUsageExamples = () => ( | ||
<ExampleSection title='Usage'> | ||
<ComponentExample | ||
title='Active Index' | ||
description='The `activeIndex` prop controls which panel is open.' | ||
examplePath='modules/Accordion/Usage/AccordionExampleActiveIndex' | ||
> | ||
<Message info> | ||
An <code>active</code> prop on an | ||
{' '}<code><Accordion.Title></code> or <code><Accordion.Content></code> | ||
{' '}will override the <code><Accordion></code> <code><activeIndex></code> prop. | ||
</Message> | ||
</ComponentExample> | ||
<ComponentExample | ||
title='Panels Prop with custom title and content' | ||
examplePath='modules/Accordion/Usage/AccordionExamplePanelsPropWithCustomTitleAndContent' | ||
/> | ||
</ExampleSection> | ||
) | ||
|
||
export default AccordionUsageExamples |
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 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 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 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 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 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 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 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