Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(Accordion): update docs to the latest standards #838

Merged
merged 1 commit into from
Nov 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions docs/app/Examples/modules/Accordion/Types/Accordion.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const panels = _.times(3, () => ({
content: faker.lorem.paragraphs(),
}))

export default class AccordionActiveIndexExample extends Component {
class AccordionExampleActiveIndex extends Component {
state = { activeIndex: 0 }

handleSliderChange = (e) => this.setState({
Expand Down Expand Up @@ -40,3 +40,5 @@ export default class AccordionActiveIndexExample extends Component {
)
}
}

export default AccordionExampleActiveIndex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import React from 'react'
import { Accordion } from 'semantic-ui-react'
import faker from 'faker'
import _ from 'lodash'
Expand All @@ -8,10 +8,8 @@ const panels = _.times(3, () => ({
content: faker.lorem.paragraphs(),
}))

export default class AccordionPanelsPropExample extends Component {
render() {
return (
<Accordion panels={panels} />
)
}
}
const AccordionExamplePanelsProp = () => (
<Accordion panels={panels} />
)

export default AccordionExamplePanelsProp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from 'react'
import { Accordion, Icon } from 'semantic-ui-react'

const AccordionExampleStandard = () => (
<Accordion>
<Accordion.Title>
<Icon name='dropdown' />
What is a dog?
</Accordion.Title>
<Accordion.Content>
<p>
A dog is a type of domesticated animal. Known for its loyalty and faithfulness,
{' '}it can be found as a welcome guest in many households across the world.
</p>
</Accordion.Content>
<Accordion.Title>
<Icon name='dropdown' />
What kinds of dogs are there?
</Accordion.Title>
<Accordion.Content>
<p>
There are many breeds of dogs. Each breed varies in size and temperament.
{' '}Owners often select a breed of dog that they find to be compatible
with their own lifestyle and desires from a companion.
</p>
</Accordion.Content>
<Accordion.Title>
<Icon name='dropdown' />
How do you acquire a dog?
</Accordion.Title>
<Accordion.Content>
<p>
Three common ways for a prospective owner to acquire a dog is from pet shops,
{' '}private owners, or shelters.
</p>
<p> A pet shop may be the most convenient way to buy a dog.
{' '}Buying a dog from a private owner allows you to assess the pedigree and
{' '}upbringing of your dog before choosing to take it home. Lastly, finding your dog
{' '}from a shelter, helps give a good home to a dog who may not find one so readily.
</p>
</Accordion.Content>
</Accordion>
)

export default AccordionExampleStandard
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import _ from 'lodash'
import faker from 'faker'
import React, { Component } from 'react'
import React from 'react'
import { Accordion } from 'semantic-ui-react'

const panels = _.times(3, () => ({
title: faker.lorem.sentence(),
content: faker.lorem.paragraphs(),
}))

export default class AccordionFluidExample extends Component {
render() {
return (
<Accordion panels={panels} fluid />
)
}
}
const AccordionExampleStyled = () => (
<Accordion panels={panels} styled />
)

export default AccordionExampleStyled
78 changes: 38 additions & 40 deletions docs/app/Examples/modules/Accordion/Types/index.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
import React, { Component } from 'react'
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'

export default class AccordionTypesExamples extends Component {
render() {
return (
<ExampleSection title='Types'>
<ComponentExample
title='Accordion'
description='A standard Accordion.'
examplePath='modules/Accordion/Types/Accordion'
/>
<ComponentExample
title='Panels Prop'
description='Accordion panels can be define using the `panels` prop.'
examplePath='modules/Accordion/Types/PanelsProp'
>
<Message info>
Panel objects can define an <code>active</code> key to open/close the panel.
{' '}They can also define an <code>onClick</code> key to be applied to the <code>Accordion.Title</code>.
</Message>
</ComponentExample>
<ComponentExample
title='Active Index'
description='The `activeIndex` prop controls which panel is open.'
examplePath='modules/Accordion/Types/ActiveIndex'
>
<Message info>
An <code>active</code> prop on an
{' '}<code>&lt;Accordion.Title&gt;</code> or <code>&lt;Accordion.Content&gt;</code>
{' '}will override the <code>&lt;Accordion&gt;</code> <code>&lt;activeIndex&gt;</code> prop.
</Message>
</ComponentExample>
<ComponentExample
title='Styled'
description='A styled accordion adds basic formatting'
examplePath='modules/Accordion/Types/Styled'
/>
</ExampleSection>
)
}
}
const AccordionTypesExamples = () => (
<ExampleSection title='Types'>
<ComponentExample
title='Accordion'
description='A standard Accordion.'
examplePath='modules/Accordion/Types/AccordionExampleStandard'
/>
<ComponentExample
title='Panels Prop'
description='Accordion panels can be define using the `panels` prop.'
examplePath='modules/Accordion/Types/AccordionExamplePanelsProp'
>
<Message info>
Panel objects can define an <code>active</code> key to open/close the panel.
{' '}They can also define an <code>onClick</code> key to be applied to the <code>Accordion.Title</code>.
</Message>
</ComponentExample>
<ComponentExample
title='Active Index'
description='The `activeIndex` prop controls which panel is open.'
examplePath='modules/Accordion/Types/AccordionExampleActiveIndex'
>
<Message info>
An <code>active</code> prop on an
{' '}<code>&lt;Accordion.Title&gt;</code> or <code>&lt;Accordion.Content&gt;</code>
{' '}will override the <code>&lt;Accordion&gt;</code> <code>&lt;activeIndex&gt;</code> prop.
</Message>
</ComponentExample>
<ComponentExample
title='Styled'
description='A styled accordion adds basic formatting.'
examplePath='modules/Accordion/Types/AccordionExampleStyled'
/>
</ExampleSection>
)

export default AccordionTypesExamples
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import _ from 'lodash'
import faker from 'faker'
import React, { Component } from 'react'
import React from 'react'
import { Accordion } from 'semantic-ui-react'

const panels = _.times(3, () => ({
title: faker.lorem.sentence(),
content: faker.lorem.paragraphs(),
}))

export default class AccordionStyledExample extends Component {
render() {
return (
<Accordion panels={panels} styled />
)
}
}
const AccordionExampleFluid = () => (
<Accordion panels={panels} fluid />
)

export default AccordionExampleFluid
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import _ from 'lodash'
import faker from 'faker'
import React from 'react'
import { Accordion, Segment } from 'semantic-ui-react'

const panels = _.times(3, () => ({
title: faker.lorem.sentence(),
content: faker.lorem.paragraphs(),
}))

const AccordionExampleInverted = () => (
<Segment inverted>
<Accordion panels={panels} inverted />
</Segment>
)

export default AccordionExampleInverted
19 changes: 0 additions & 19 deletions docs/app/Examples/modules/Accordion/Variations/Inverted.js

This file was deleted.

36 changes: 17 additions & 19 deletions docs/app/Examples/modules/Accordion/Variations/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import React, { Component } from 'react'
import React from 'react'
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'

export default class AccordionTypesExamples extends Component {
render() {
return (
<ExampleSection title='Variations'>
<ComponentExample
title='Fluid'
description='An accordion can take up the width of its container'
examplePath='modules/Accordion/Variations/Fluid'
/>
<ComponentExample
title='Inverted'
description='An accordion can be formatted to appear on dark backgrounds'
examplePath='modules/Accordion/Variations/Inverted'
/>
</ExampleSection>
)
}
}
const AccordionTypesExamples = () => (
<ExampleSection title='Variations'>
<ComponentExample
title='Fluid'
description='An accordion can take up the width of its container.'
examplePath='modules/Accordion/Variations/AccordionExampleFluid'
/>
<ComponentExample
title='Inverted'
description='An accordion can be formatted to appear on dark backgrounds.'
examplePath='modules/Accordion/Variations/AccordionExampleInverted'
/>
</ExampleSection>
)

export default AccordionTypesExamples
20 changes: 9 additions & 11 deletions docs/app/Examples/modules/Accordion/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { Component } from 'react'
import React from 'react'
import Types from './Types'
import Variations from './Variations'

export default class AccordionExamples extends Component {
render() {
return (
<div>
<Types />
<Variations />
</div>
)
}
}
const AccordionExamples = () => (
<div>
<Types />
<Variations />
</div>
)

export default AccordionExamples