Skip to content

Commit

Permalink
docs(Button): refactor to v1 structure
Browse files Browse the repository at this point in the history
  • Loading branch information
levithomason committed Sep 2, 2016
1 parent b8c494f commit 30f0d0a
Show file tree
Hide file tree
Showing 57 changed files with 652 additions and 732 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class FormOnSubmitExample extends Component {
</Form.Group>
<Form.TextArea name='details' label='Details' placeholder='Anything else we should know?' rows='3' />
<Form.Checkbox name='terms' label='I agree to the Terms and Conditions' />
<Button className='primary' type='submit'>Submit</Button>
<Button primary type='submit'>Submit</Button>

<Message>
<pre>serializedForm: {JSON.stringify(serializedForm, null, 2)}</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const MessageAttachedExample = () => (
<Form.Input label='Username' placeholder='Username' type='text' />
<Form.Input label='Password' type='password' />
<Form.Checkbox inline label='I agree to the terms and conditions' />
<Button className='blue submit button'>Submit</Button>
<Button color='blue'>Submit</Button>
</Form>
<Message attached='bottom' warning>
<Icon name='help' />
Expand Down
20 changes: 0 additions & 20 deletions docs/app/Examples/elements/Button/ButtonExamples.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { Component } from 'react'
import React from 'react'
import { Button } from 'stardust'

export default class ButtonConditionalsExample extends Component {
render() {
return (
<Button.Group>
<Button>Cancel</Button>
<div className='or' />
<Button className='positive'>Save</Button>
</Button.Group>
)
}
}
const ButtonConditionalsExample = () => (
<Button.Group>
<Button>Cancel</Button>
<div className='or' />
<Button positive>Save</Button>
</Button.Group>
)

export default ButtonConditionalsExample
23 changes: 0 additions & 23 deletions docs/app/Examples/elements/Button/Content/ButtonContentExamples.js

This file was deleted.

21 changes: 21 additions & 0 deletions docs/app/Examples/elements/Button/Content/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react'
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'
import { Message } from 'stardust'

const ButtonContentExamples = () => (
<ExampleSection title='Content'>
<ComponentExample
title='Conditionals'
description='Button groups can contain conditionals'
examplePath='elements/Button/Content/ButtonConditionalsExample'
>
<Message warning>
Or buttons can have their text localized, or adjusted by using the data-text attribute.
If the size of the conditional changes you will need to adjust @orCircleSize.
</Message>
</ComponentExample>
</ExampleSection>
)

export default ButtonContentExamples
22 changes: 10 additions & 12 deletions docs/app/Examples/elements/Button/Groups/ButtonButtonsExample.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 { Button } from 'stardust'

export default class ButtonButtonsExample extends Component {
render() {
return (
<Button.Group>
<Button>One</Button>
<Button>Two</Button>
<Button>Three</Button>
</Button.Group>
)
}
}
const ButtonButtonsExample = () => (
<Button.Group>
<Button>One</Button>
<Button>Two</Button>
<Button>Three</Button>
</Button.Group>
)

export default ButtonButtonsExample
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { Component } from 'react'
import React from 'react'
import { Button } from 'stardust'

export default class ButtonColoredButtonsExample extends Component {
render() {
return (
<Button.Group color='blue'>
<Button>One</Button>
<Button>Two</Button>
<Button>Three</Button>
</Button.Group>
)
}
}
const ButtonColoredButtonsExample = () => (
<Button.Group color='blue'>
<Button>One</Button>
<Button>Two</Button>
<Button>Three</Button>
</Button.Group>
)

export default ButtonColoredButtonsExample
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import React, { Component } from 'react'
import React from 'react'
import { Button } from 'stardust'

export default class ButtonEqualWidthsButtonsExample extends Component {
render() {
return (
<div>
<Button.Group widths='five'>
<Button>Overview</Button>
<Button>Specs</Button>
<Button>Warrantee</Button>
<Button>Reviews</Button>
<Button>Support</Button>
</Button.Group>
<Button.Group widths='three'>
<Button>Overview</Button>
<Button>Specs</Button>
<Button>Support</Button>
</Button.Group>
</div>
)
}
}
const ButtonEqualWidthsButtonsExample = () => (
<div>
<Button.Group widths='five'>
<Button>Overview</Button>
<Button>Specs</Button>
<Button>Warrantee</Button>
<Button>Reviews</Button>
<Button>Support</Button>
</Button.Group>
<Button.Group widths='three'>
<Button>Overview</Button>
<Button>Specs</Button>
<Button>Support</Button>
</Button.Group>
</div>
)

export default ButtonEqualWidthsButtonsExample
42 changes: 0 additions & 42 deletions docs/app/Examples/elements/Button/Groups/ButtonGroupsExamples.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { Component } from 'react'
import React from 'react'
import { Button } from 'stardust'

export default class ButtonIconButtonsExample extends Component {
render() {
return (
<Button.Group icon>
<Button icon='save' />
<Button icon='delete' />
<Button icon='edit' />
</Button.Group>
)
}
}
const ButtonIconButtonsExample = () => (
<Button.Group icon>
<Button icon='save' />
<Button icon='delete' />
<Button icon='edit' />
</Button.Group>
)

export default ButtonIconButtonsExample
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { Component } from 'react'
import React from 'react'
import { Button } from 'stardust'

export default class ButtonLabeledIconButtonsExample extends Component {
render() {
return (
<Button.Group vertical labeled='icon'>
<Button icon='save'>Pause</Button>
<Button icon='play'>Play</Button>
<Button icon='shuffle'>Shuffle</Button>
</Button.Group>
)
}
}
const ButtonLabeledIconButtonsExample = () => (
<Button.Group vertical labeled='icon'>
<Button icon='save'>Pause</Button>
<Button icon='play'>Play</Button>
<Button icon='shuffle'>Shuffle</Button>
</Button.Group>
)

export default ButtonLabeledIconButtonsExample
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import React, { Component } from 'react'
import React from 'react'
import { Button } from 'stardust'

export default class ButtonMixedGroupButtonsExample extends Component {
render() {
return (
<Button.Group>
<Button labeled='icon'>Feed</Button>
<Button>Messages</Button>
<Button>Events</Button>
<Button>Photos</Button>
</Button.Group>
)
}
}
const ButtonMixedGroupButtonsExample = () => (
<Button.Group>
<Button labeled='icon'>Feed</Button>
<Button>Messages</Button>
<Button>Events</Button>
<Button>Photos</Button>
</Button.Group>
)

export default ButtonMixedGroupButtonsExample
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import React, { Component } from 'react'
import React from 'react'
import { Button } from 'stardust'

export default class ButtonVerticalButtonsExample extends Component {
render() {
return (
<Button.Group vertical>
<Button>Feed</Button>
<Button>Messages</Button>
<Button>Events</Button>
<Button>Photos</Button>
</Button.Group>
)
}
}
const ButtonVerticalButtonsExample = () => (
<Button.Group vertical>
<Button>Feed</Button>
<Button>Messages</Button>
<Button>Events</Button>
<Button>Photos</Button>
</Button.Group>
)

export default ButtonVerticalButtonsExample
40 changes: 40 additions & 0 deletions docs/app/Examples/elements/Button/Groups/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react'
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'

const ButtonGroupsExamples = () => (
<ExampleSection title='Groups'>
<ComponentExample
title='Buttons'
description='Buttons can exist together as a group'
examplePath='elements/Button/Groups/ButtonButtonsExample'
/>
<ComponentExample
title='Vertical Buttons'
description='Groups can be formatted to appear vertically'
examplePath='elements/Button/Groups/ButtonVerticalButtonsExample'
/>
<ComponentExample
title='Icon Buttons'
description='Button groups can show groups of icons'
examplePath='elements/Button/Groups/ButtonIconButtonsExample'
/>
<ComponentExample
title='Labeled Icon Buttons'
description='Groups can be formatted as labeled icons'
examplePath='elements/Button/Groups/ButtonLabeledIconButtonsExample'
/>
<ComponentExample
title='Equal Widths'
description='Groups can have their widths divided evenly'
examplePath='elements/Button/Groups/ButtonEqualWidthsButtonsExample'
/>
<ComponentExample
title='Colored Buttons'
description='Groups can have a shared color'
examplePath='elements/Button/Groups/ButtonColoredButtonsExample'
/>
</ExampleSection>
)

export default ButtonGroupsExamples
Loading

0 comments on commit 30f0d0a

Please sign in to comment.