-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
1 parent
15e04d2
commit a5a8ff6
Showing
46 changed files
with
978 additions
and
173 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
32 changes: 32 additions & 0 deletions
32
docs/app/Examples/collections/Form/Content/FormControlExample.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,32 @@ | ||
import React, { Component } from 'react' | ||
import { Form } from 'stardust' | ||
|
||
// TODO: update use Button once | ||
const options = [{ text: 'Male', value: 'male' }, { text: 'Female', value: 'female' }] | ||
|
||
class FormControlExample extends Component { | ||
state = {} | ||
|
||
handleRadioClick = (e, { value }) => this.setState({ value }) | ||
|
||
render() { | ||
const { value } = this.state | ||
return ( | ||
<Form> | ||
<Form.Input label='A Form.Input' /> | ||
<Form.Dropdown label='A Form.Dropdown' options={options} /> | ||
<Form.Select label='A Form.Select' options={options} /> | ||
<Form.Checkbox label='I agree to the Terms and Conditions' /> | ||
<Form.Group> | ||
<label>A <code>Form.Group</code> of <code>Form.Radio</code>s</label> | ||
<Form.Radio label='Foo' name='radios' value='foo' checked={value === 'foo'} onClick={this.handleRadioClick} /> | ||
<Form.Radio label='Bar' name='radios' value='bar' checked={value === 'bar'} onClick={this.handleRadioClick} /> | ||
<Form.Radio label='Baz' name='radios' value='baz' checked={value === 'baz'} onClick={this.handleRadioClick} /> | ||
</Form.Group> | ||
<Form.TextArea label='A Form.TextArea' /> | ||
</Form> | ||
) | ||
} | ||
} | ||
|
||
export default FormControlExample |
18 changes: 18 additions & 0 deletions
18
docs/app/Examples/collections/Form/Content/FormFieldControlHTMLExample.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,18 @@ | ||
import React from 'react' | ||
import { Form } from 'stardust' | ||
|
||
const FormFieldHTMLControlExample = () => ( | ||
<Form> | ||
<Form.Field control='input' label='An input' /> | ||
<Form.Field control='select' label='A select'> | ||
<option value='male'>Male</option> | ||
<option value='female'>Female</option> | ||
</Form.Field> | ||
<Form.Field control='textarea' label='A textarea' /> | ||
<Form.Field control='button' label='A button'> | ||
HTML Button | ||
</Form.Field> | ||
</Form> | ||
) | ||
|
||
export default FormFieldHTMLControlExample |
25 changes: 12 additions & 13 deletions
25
docs/app/Examples/collections/Form/Content/FormFieldExample.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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import React, { Component } from 'react' | ||
import { Form, Input } from 'stardust' | ||
import React from 'react' | ||
import { Form } from 'stardust' | ||
|
||
export default class FormFieldExample extends Component { | ||
render() { | ||
return ( | ||
<Form> | ||
<Form.Field label='User Input'> | ||
<Input placeholder='User Input' /> | ||
</Form.Field> | ||
</Form> | ||
) | ||
} | ||
} | ||
const FormFieldExample = () => ( | ||
<Form> | ||
<Form.Field> | ||
<label>User Input</label> | ||
<input /> | ||
</Form.Field> | ||
</Form> | ||
) | ||
|
||
export default FormFieldExample |
31 changes: 31 additions & 0 deletions
31
docs/app/Examples/collections/Form/Content/FormFieldInputExample.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,31 @@ | ||
import React, { Component } from 'react' | ||
import { Form } from 'stardust' | ||
|
||
const options = [{ text: 'Male', value: 'male' }, { text: 'Female', value: 'female' }] | ||
|
||
export default class FormControlExample extends Component { | ||
state = {} | ||
|
||
handleRadioClick = (e, { value }) => this.setState({ value }) | ||
|
||
render() { | ||
const { value } = this.state | ||
return ( | ||
<Form> | ||
<Form.Input label='A Form.Input' /> | ||
<Form.Dropdown label='A Form.Dropdown' options={options} /> | ||
<Form.Select label='A Form.Select' options={options} /> | ||
<Form.Checkbox label='I agree to the Terms and Conditions' /> | ||
<Form.Group> | ||
<label>A <code>Form.Group</code> of <code>Form.Radio</code>s</label> | ||
<Form.Radio label='Foo' name='radios' value='foo' checked={value === 'foo'} onClick={this.handleRadioClick} /> | ||
<Form.Radio label='Bar' name='radios' value='bar' checked={value === 'bar'} onClick={this.handleRadioClick} /> | ||
<Form.Radio label='Baz' name='radios' value='baz' checked={value === 'baz'} onClick={this.handleRadioClick} /> | ||
</Form.Group> | ||
<Form.TextArea label='A Form.TextArea' /> | ||
</Form> | ||
) | ||
} | ||
} | ||
|
||
export default FormControlExample |
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
18 changes: 18 additions & 0 deletions
18
docs/app/Examples/collections/Form/FieldControls/FormControlButtonExample.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,18 @@ | ||
import React from 'react' | ||
import { Form } from 'stardust' | ||
|
||
const { Field } = Form | ||
|
||
const FormControlButtonExample = () => ( | ||
<Form> | ||
<Field control='input'></Field> | ||
<Field control='input' /> | ||
<Field.Button /> | ||
<Field.Checkbox /> | ||
<Form.ButtonField label='A Form.Button'> | ||
Form.Button | ||
</Form.ButtonField> | ||
</Form> | ||
) | ||
|
||
export default FormControlButtonExample |
10 changes: 10 additions & 0 deletions
10
docs/app/Examples/collections/Form/FieldControls/FormControlCheckboxExample.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,10 @@ | ||
import React from 'react' | ||
import { Form } from 'stardust' | ||
|
||
const FormControlCheckboxExample = () => ( | ||
<Form> | ||
<Form.Checkbox label='I agree to the Terms and Conditions' /> | ||
</Form> | ||
) | ||
|
||
export default FormControlCheckboxExample |
10 changes: 10 additions & 0 deletions
10
docs/app/Examples/collections/Form/FieldControls/FormControlInputExample.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,10 @@ | ||
import React from 'react' | ||
import { Form } from 'stardust' | ||
|
||
const FormControlInputExample = () => ( | ||
<Form> | ||
<Form.Input label='A Form.Input' /> | ||
</Form> | ||
) | ||
|
||
export default FormControlInputExample |
41 changes: 41 additions & 0 deletions
41
docs/app/Examples/collections/Form/FieldControls/FormControlRadioExample.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,41 @@ | ||
import React, { Component } from 'react' | ||
import { Form } from 'stardust' | ||
|
||
class FormControlRadioExample extends Component { | ||
state = {} | ||
|
||
handleRadioClick = (e, { value }) => this.setState({ value }) | ||
|
||
render() { | ||
return ( | ||
<Form> | ||
<Form.Group className='grouped'> | ||
<label>A <code>Form.Group</code> of <code>Form.Radio</code>s</label> | ||
<Form.Radio | ||
label='Foo' | ||
name='formRadios' | ||
value='foo' | ||
checked={this.state.value === 'foo'} | ||
onClick={this.handleRadioClick} | ||
/> | ||
<Form.Radio | ||
label='Bar' | ||
name='formRadios' | ||
value='bar' | ||
checked={this.state.value === 'bar'} | ||
onClick={this.handleRadioClick} | ||
/> | ||
<Form.Radio | ||
label='Baz' | ||
name='formRadios' | ||
value='baz' | ||
checked={this.state.value === 'baz'} | ||
onClick={this.handleRadioClick} | ||
/> | ||
</Form.Group> | ||
</Form> | ||
) | ||
} | ||
} | ||
|
||
export default FormControlRadioExample |
15 changes: 15 additions & 0 deletions
15
docs/app/Examples/collections/Form/FieldControls/FormControlSelectExample.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,15 @@ | ||
import React from 'react' | ||
import { Form } from 'stardust' | ||
|
||
const options = [ | ||
{ text: 'Male', value: 'male' }, | ||
{ text: 'Female', value: 'female' }, | ||
] | ||
|
||
const FormControlSelectExample = () => ( | ||
<Form> | ||
<Form.Select label='A Form.Select' options={options} /> | ||
</Form> | ||
) | ||
|
||
export default FormControlSelectExample |
10 changes: 10 additions & 0 deletions
10
docs/app/Examples/collections/Form/FieldControls/FormControlTextAreaExample.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,10 @@ | ||
import React from 'react' | ||
import { Form } from 'stardust' | ||
|
||
const FormControlTextAreaExample = () => ( | ||
<Form> | ||
<Form.TextArea label='A Form.TextArea' /> | ||
</Form> | ||
) | ||
|
||
export default FormControlTextAreaExample |
14 changes: 14 additions & 0 deletions
14
docs/app/Examples/collections/Form/FieldControls/FormFieldControlButtonExample.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,14 @@ | ||
import React from 'react' | ||
import { Button, Form } from 'stardust' | ||
|
||
// TODO: update Button usage once Button is updated to v1 API | ||
|
||
const FormFieldControlButtonExample = () => ( | ||
<Form> | ||
<Form.Field control={Button} label='A Button'> | ||
A Button | ||
</Form.Field> | ||
</Form> | ||
) | ||
|
||
export default FormFieldControlButtonExample |
10 changes: 10 additions & 0 deletions
10
docs/app/Examples/collections/Form/FieldControls/FormFieldControlCheckboxExample.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,10 @@ | ||
import React from 'react' | ||
import { Checkbox, Form } from 'stardust' | ||
|
||
const FormFieldControlCheckboxExample = () => ( | ||
<Form> | ||
<Form.Field control={Checkbox} label='I agree to the Terms and Conditions' /> | ||
</Form> | ||
) | ||
|
||
export default FormFieldControlCheckboxExample |
10 changes: 10 additions & 0 deletions
10
docs/app/Examples/collections/Form/FieldControls/FormFieldControlInputExample.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,10 @@ | ||
import React from 'react' | ||
import { Input, Form } from 'stardust' | ||
|
||
const FormFieldControlInputExample = () => ( | ||
<Form> | ||
<Form.Field control={Input} label='A Input' /> | ||
</Form> | ||
) | ||
|
||
export default FormFieldControlInputExample |
45 changes: 45 additions & 0 deletions
45
docs/app/Examples/collections/Form/FieldControls/FormFieldControlRadioExample.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,45 @@ | ||
import React, { Component } from 'react' | ||
import { Form, Radio } from 'stardust' | ||
|
||
class FormFieldControlRadioExample extends Component { | ||
state = {} | ||
|
||
handleRadioClick = (e, { value }) => this.setState({ value }) | ||
|
||
render() { | ||
const { value } = this.state | ||
return ( | ||
<Form> | ||
<Form.Group> | ||
<label>A <code>Form.Group</code> containing <code>Form.Radio</code>s</label> | ||
<Form.Field | ||
control={Radio} | ||
label='Foo' | ||
name='fieldControlRadios' | ||
value='foo' | ||
checked={value === 'foo'} | ||
onClick={this.handleRadioClick} | ||
/> | ||
<Form.Field | ||
control={Radio} | ||
label='Bar' | ||
name='fieldControlRadios' | ||
value='bar' | ||
checked={value === 'bar'} | ||
onClick={this.handleRadioClick} | ||
/> | ||
<Form.Field | ||
control={Radio} | ||
label='Baz' | ||
name='fieldControlRadios' | ||
value='baz' | ||
checked={value === 'baz'} | ||
onClick={this.handleRadioClick} | ||
/> | ||
</Form.Group> | ||
</Form> | ||
) | ||
} | ||
} | ||
|
||
export default FormFieldControlRadioExample |
15 changes: 15 additions & 0 deletions
15
docs/app/Examples/collections/Form/FieldControls/FormFieldControlSelectExample.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,15 @@ | ||
import React from 'react' | ||
import { Select, Form } from 'stardust' | ||
|
||
const options = [ | ||
{ text: 'Male', value: 'male' }, | ||
{ text: 'Female', value: 'female' }, | ||
] | ||
|
||
const FormFieldControlSelectExample = () => ( | ||
<Form> | ||
<Form.Field control={Select} label='A Select' options={options} /> | ||
</Form> | ||
) | ||
|
||
export default FormFieldControlSelectExample |
10 changes: 10 additions & 0 deletions
10
docs/app/Examples/collections/Form/FieldControls/FormFieldControlTextAreaExample.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,10 @@ | ||
import React from 'react' | ||
import { TextArea, Form } from 'stardust' | ||
|
||
const FormFieldControlTextAreaExample = () => ( | ||
<Form> | ||
<Form.Field control={TextArea} label='A TextArea' /> | ||
</Form> | ||
) | ||
|
||
export default FormFieldControlTextAreaExample |
Oops, something went wrong.