Skip to content

Commit b819f24

Browse files
dpkwhanlevithomason
authored andcommitted
style(Checkbox): update docs to the latest standards (#839)
1 parent cede560 commit b819f24

21 files changed

Lines changed: 175 additions & 195 deletions
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react'
2+
import { Checkbox } from 'semantic-ui-react'
3+
4+
const CheckboxExampleChecked = () => (
5+
<Checkbox label='This checkbox comes pre-checked' defaultChecked />
6+
)
7+
8+
export default CheckboxExampleChecked
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react'
2+
import { Form, Checkbox } from 'semantic-ui-react'
3+
4+
const CheckboxExampleDisabled = () => (
5+
<Form>
6+
<Form.Field>
7+
<Checkbox label='Disabled' disabled />
8+
</Form.Field>
9+
<Form.Field>
10+
<Checkbox toggle label='Disabled' disabled />
11+
</Form.Field>
12+
</Form>
13+
)
14+
15+
export default CheckboxExampleDisabled
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react'
2+
import { Checkbox } from 'semantic-ui-react'
3+
4+
const CheckboxExampleReadOnly = () => (
5+
<Checkbox label='This checkbox is read-only' readOnly />
6+
)
7+
8+
export default CheckboxExampleReadOnly

docs/app/Examples/modules/Checkbox/States/CheckboxRemoteControlExample.js renamed to docs/app/Examples/modules/Checkbox/States/CheckboxExampleRemoteControl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Component } from 'react'
22
import { Button, Checkbox } from 'semantic-ui-react'
33

4-
export default class CheckboxRemoteControlExample extends Component {
4+
export default class CheckboxExampleRemoteControl extends Component {
55
state = { checked: false }
66
toggle = () => this.setState({ checked: !this.state.checked })
77

docs/app/Examples/modules/Checkbox/States/Checked.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/app/Examples/modules/Checkbox/States/Disabled.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/app/Examples/modules/Checkbox/States/ReadOnly.js

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
1-
import React, { Component } from 'react'
1+
import React from 'react'
22
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'
33
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'
44
import { Message } from 'semantic-ui-react'
55

6-
export default class CheckboxStatesExamples extends Component {
7-
render() {
8-
return (
9-
<ExampleSection title='States'>
10-
<ComponentExample
11-
title='Checked'
12-
description='A checkbox can come pre-checked'
13-
examplePath='modules/Checkbox/States/Checked'
14-
>
15-
<Message>
16-
Use{' '}
17-
<a href='https://facebook.github.io/react/docs/forms.html#default-value' target='_blank'>
18-
<code>defaultChecked</code>
19-
</a>
20-
{' '}as you normally would to set default form values.
21-
</Message>
22-
</ComponentExample>
23-
<ComponentExample
24-
title='Disabled'
25-
description='Checkboxes can be disabled'
26-
examplePath='modules/Checkbox/States/Disabled'
27-
/>
28-
<ComponentExample
29-
title='Read Only'
30-
description='Make the checkbox unable to be edited by the user'
31-
examplePath='modules/Checkbox/States/ReadOnly'
32-
/>
33-
<ComponentExample
34-
title='Remote Control'
35-
description='You can trigger events remotely.'
36-
examplePath='modules/Checkbox/States/CheckboxRemoteControlExample'
37-
/>
38-
</ExampleSection>
39-
)
40-
}
41-
}
6+
const CheckboxStatesExamples = () => (
7+
<ExampleSection title='States'>
8+
<ComponentExample
9+
title='Checked'
10+
description='A checkbox can come pre-checked.'
11+
examplePath='modules/Checkbox/States/CheckboxExampleChecked'
12+
>
13+
<Message>
14+
Use{' '}
15+
<a href='https://facebook.github.io/react/docs/forms.html#default-value' target='_blank'>
16+
<code>defaultChecked</code>
17+
</a>
18+
{' '}as you normally would to set default form values.
19+
</Message>
20+
</ComponentExample>
21+
<ComponentExample
22+
title='Disabled'
23+
description='Checkboxes can be disabled.'
24+
examplePath='modules/Checkbox/States/CheckboxExampleDisabled'
25+
/>
26+
<ComponentExample
27+
title='Read Only'
28+
description='Make the checkbox unable to be edited by the user.'
29+
examplePath='modules/Checkbox/States/CheckboxExampleReadOnly'
30+
/>
31+
<ComponentExample
32+
title='Remote Control'
33+
description='You can trigger events remotely.'
34+
examplePath='modules/Checkbox/States/CheckboxExampleRemoteControl'
35+
/>
36+
</ExampleSection>
37+
)
38+
39+
export default CheckboxStatesExamples

docs/app/Examples/modules/Checkbox/Types/Checkbox.js

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react'
2+
import { Checkbox } from 'semantic-ui-react'
3+
4+
const CheckboxExampleCheckbox = () => (
5+
<Checkbox label='Make my profile visible' />
6+
)
7+
8+
export default CheckboxExampleCheckbox

0 commit comments

Comments
 (0)