-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Update Documentation for Buttons #2745
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
49 changes: 49 additions & 0 deletions
49
docs/src/app/components/pages/components/FlatButton/ExampleComplex.jsx
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,49 @@ | ||
import React from 'react'; | ||
import FlatButton from 'material-ui/lib/flat-button'; | ||
import Colors from 'material-ui/lib/styles/colors'; | ||
import FontIcon from 'material-ui/lib/font-icon'; | ||
|
||
const styles = { | ||
buttonLabel: { | ||
padding: '0px 16px 0px 8px', | ||
}, | ||
exampleImageInput: { | ||
cursor: 'pointer', | ||
position: 'absolute', | ||
top: 0, | ||
bottom: 0, | ||
right: 0, | ||
left: 0, | ||
width: '100%', | ||
opacity: 0, | ||
}, | ||
exampleFlatButtonIcon: { | ||
color: Colors.cyan500, | ||
}, | ||
}; | ||
|
||
const FlatButtonExampleComplex = () => ( | ||
<div> | ||
<FlatButton primary={true} label="Choose an Image"> | ||
<input type="file" id="imageButton" style={styles.exampleImageInput}></input> | ||
</FlatButton> | ||
<FlatButton | ||
linkButton={true} | ||
href="https://github.com/callemall/material-ui" | ||
secondary={true} | ||
label="GitHub" | ||
labelStyle={styles.buttonLabel}> | ||
<FontIcon style={styles.exampleFlatButtonIcon} className="muidocs-icon-custom-github"/> | ||
</FlatButton> | ||
<FlatButton | ||
secondary={true} | ||
label="Label after" | ||
labelPosition="after" | ||
labelStyle={styles.buttonLabel}> | ||
<FontIcon style={styles.exampleFlatButtonIcon} className="muidocs-icon-custom-github"/> | ||
</FlatButton> | ||
<FlatButton label="Disabled" disabled={true} /> | ||
</div> | ||
); | ||
|
||
export default FlatButtonExampleComplex; |
12 changes: 12 additions & 0 deletions
12
docs/src/app/components/pages/components/FlatButton/ExampleSimple.jsx
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,12 @@ | ||
import React from 'react'; | ||
import FlatButton from 'material-ui/lib/flat-button'; | ||
|
||
const FlatButtonExampleSimple = () => ( | ||
<div> | ||
<FlatButton label="Default" /> | ||
<FlatButton label="Primary" primary={true} /> | ||
<FlatButton label="Secondary" secondary={true} /> | ||
</div> | ||
); | ||
|
||
export default FlatButtonExampleSimple; |
26 changes: 26 additions & 0 deletions
26
docs/src/app/components/pages/components/FlatButton/Page.jsx
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,26 @@ | ||
import React from 'react'; | ||
import CodeExample from '../../../CodeExample'; | ||
import PropTypeDescription from '../../../PropTypeDescription'; | ||
import MarkdownElement from '../../../MarkdownElement'; | ||
|
||
import flatButtonCode from '!raw!material-ui/lib/flat-button'; | ||
import flatButtonReadmeText from './README'; | ||
import flatButtonExampleSimpleCode from '!raw!./ExampleSimple'; | ||
import FlatButtonExampleSimple from './ExampleSimple'; | ||
import flatButtonExampleComplexCode from '!raw!./ExampleComplex'; | ||
import FlatButtonExampleComplex from './ExampleComplex'; | ||
|
||
const FlatButtonPage = () => ( | ||
<div> | ||
<MarkdownElement text={flatButtonReadmeText}/> | ||
<CodeExample code={flatButtonExampleSimpleCode}> | ||
<FlatButtonExampleSimple /> | ||
</CodeExample> | ||
<CodeExample code={flatButtonExampleComplexCode}> | ||
<FlatButtonExampleComplex /> | ||
</CodeExample> | ||
<PropTypeDescription code={flatButtonCode}/> | ||
</div> | ||
); | ||
|
||
export default FlatButtonPage; |
5 changes: 5 additions & 0 deletions
5
docs/src/app/components/pages/components/FlatButton/README.md
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,5 @@ | ||
## Flat Button | ||
[Flat Buttons](https://www.google.com/design/spec/components/buttons.html#buttons-flat-raised-buttons) | ||
are used for general functions and reduce the amount of layering on the screen, making it more readable. | ||
|
||
### Examples |
31 changes: 31 additions & 0 deletions
31
docs/src/app/components/pages/components/FloatingActionButton/ExampleComplex.jsx
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 from 'react'; | ||
import FloatingActionButton from 'material-ui/lib/floating-action-button'; | ||
import Add from 'material-ui/lib/svg-icons/content/add'; | ||
|
||
const style = { | ||
marginRight: 20, | ||
}; | ||
|
||
const FloatingButtonExampleComplex = () => ( | ||
<div> | ||
<FloatingActionButton secondary={true} style={style}> | ||
<Add/> | ||
</FloatingActionButton> | ||
<FloatingActionButton mini={true} secondary={true} style={style}> | ||
<Add /> | ||
</FloatingActionButton> | ||
<FloatingActionButton | ||
disabled={true} | ||
style={style}> | ||
<Add/> | ||
</FloatingActionButton> | ||
<FloatingActionButton | ||
mini={true} | ||
disabled={true} | ||
style={style}> | ||
<Add/> | ||
</FloatingActionButton> | ||
</div> | ||
); | ||
|
||
export default FloatingButtonExampleComplex; |
20 changes: 20 additions & 0 deletions
20
docs/src/app/components/pages/components/FloatingActionButton/ExampleSimple.jsx
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,20 @@ | ||
import React from 'react'; | ||
import FloatingActionButton from 'material-ui/lib/floating-action-button'; | ||
import Add from 'material-ui/lib/svg-icons/content/add'; | ||
|
||
const style = { | ||
marginRight: 20, | ||
}; | ||
|
||
const FloatingActionButtonExampleSimple = () => ( | ||
<div> | ||
<FloatingActionButton style={style}> | ||
<Add/> | ||
</FloatingActionButton> | ||
<FloatingActionButton mini={true} style={style}> | ||
<Add/> | ||
</FloatingActionButton> | ||
</div> | ||
); | ||
|
||
export default FloatingActionButtonExampleSimple; |
26 changes: 26 additions & 0 deletions
26
docs/src/app/components/pages/components/FloatingActionButton/Page.jsx
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,26 @@ | ||
import React from 'react'; | ||
import CodeExample from '../../../CodeExample'; | ||
import PropTypeDescription from '../../../PropTypeDescription'; | ||
import MarkdownElement from '../../../MarkdownElement'; | ||
|
||
import floatingButtonCode from '!raw!material-ui/lib/floating-action-button'; | ||
import floatingButtonReadmeText from './README'; | ||
import floatingButtonExampleSimpleCode from '!raw!./ExampleSimple'; | ||
import FloatingButtonExampleSimple from './ExampleSimple'; | ||
import floatingButtonExampleComplexCode from '!raw!./ExampleComplex'; | ||
import FloatingButtonExampleComplex from './ExampleComplex'; | ||
|
||
const FloatingActionButtonPage = () => ( | ||
<div> | ||
<MarkdownElement text={floatingButtonReadmeText}/> | ||
<CodeExample code={floatingButtonExampleSimpleCode}> | ||
<FloatingButtonExampleSimple /> | ||
</CodeExample> | ||
<CodeExample code={floatingButtonExampleComplexCode}> | ||
<FloatingButtonExampleComplex /> | ||
</CodeExample> | ||
<PropTypeDescription code={floatingButtonCode}/> | ||
</div> | ||
); | ||
|
||
export default FloatingActionButtonPage; |
5 changes: 5 additions & 0 deletions
5
docs/src/app/components/pages/components/FloatingActionButton/README.md
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,5 @@ | ||
## Floating Action Button | ||
The [Floating Action Button](https://www.google.com/design/spec/components/buttons-floating-action-button.html) | ||
is used for frequently used functions. | ||
|
||
### Examples |
54 changes: 54 additions & 0 deletions
54
docs/src/app/components/pages/components/RaisedButton/ExampleComplex.jsx
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,54 @@ | ||
import React from 'react'; | ||
import RaisedButton from 'material-ui/lib/raised-button'; | ||
import FontIcon from 'material-ui/lib/font-icon'; | ||
import Typography from 'material-ui/lib/styles/typography'; | ||
|
||
const style = { | ||
buttonLabel: { | ||
padding: '0px 16px 0px 8px', | ||
}, | ||
exampleImageInput: { | ||
cursor: 'pointer', | ||
position: 'absolute', | ||
top: 0, | ||
bottom: 0, | ||
right: 0, | ||
left: 0, | ||
width: '100%', | ||
opacity: 0, | ||
}, | ||
exampleButtonIcon: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this style be handled by the |
||
color: Typography.textFullWhite, | ||
}, | ||
button: { | ||
margin: 12, | ||
}, | ||
}; | ||
|
||
const RaisedButtonExampleComplex = () => ( | ||
<div> | ||
<RaisedButton primary={true} label="Choose an Image" style={style.button}> | ||
<input type="file" style={style.exampleImageInput}></input> | ||
</RaisedButton> | ||
<RaisedButton | ||
linkButton={true} | ||
href="https://github.com/callemall/material-ui" | ||
secondary={true} | ||
style={style.button} | ||
label="Github" | ||
labelStyle={style.buttonLabel}> | ||
<FontIcon style={style.exampleButtonIcon} className="muidocs-icon-custom-github"/> | ||
</RaisedButton> | ||
<RaisedButton | ||
secondary={true} | ||
label="Label after" | ||
labelPosition="after" | ||
labelStyle={style.buttonLabel} | ||
style={style.button}> | ||
<FontIcon style={style.exampleButtonIcon} className="muidocs-icon-custom-github"/> | ||
</RaisedButton> | ||
<RaisedButton label="Disabled" disabled={true} style={style.button}/> | ||
</div> | ||
); | ||
|
||
export default RaisedButtonExampleComplex; |
16 changes: 16 additions & 0 deletions
16
docs/src/app/components/pages/components/RaisedButton/ExampleSimple.jsx
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,16 @@ | ||
import React from 'react'; | ||
import RaisedButton from 'material-ui/lib/raised-button'; | ||
|
||
const style = { | ||
margin: 12, | ||
}; | ||
|
||
const RaisedButtonExampleSimple = () => ( | ||
<div> | ||
<RaisedButton label="Default" style={style} /> | ||
<RaisedButton label="Primary" primary={true} style={style} /> | ||
<RaisedButton label="Secondary" secondary={true} style={style} /> | ||
</div> | ||
); | ||
|
||
export default RaisedButtonExampleSimple; |
26 changes: 26 additions & 0 deletions
26
docs/src/app/components/pages/components/RaisedButton/Page.jsx
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,26 @@ | ||
import React from 'react'; | ||
import CodeExample from '../../../CodeExample'; | ||
import PropTypeDescription from '../../../PropTypeDescription'; | ||
import MarkdownElement from '../../../MarkdownElement'; | ||
|
||
import raisedButtonCode from '!raw!material-ui/lib/raised-button'; | ||
import raisedButtonReadmeText from './README'; | ||
import raisedButtonExampleSimpleCode from '!raw!./ExampleSimple'; | ||
import RaisedButtonExampleSimple from './ExampleSimple'; | ||
import RaisedButtonExampleComplexCode from '!raw!./ExampleComplex'; | ||
import RaisedButtonExampleComplex from './ExampleComplex'; | ||
|
||
const FloatingActionButtonPage = () => ( | ||
<div> | ||
<MarkdownElement text={raisedButtonReadmeText}/> | ||
<CodeExample code={raisedButtonExampleSimpleCode}> | ||
<RaisedButtonExampleSimple /> | ||
</CodeExample> | ||
<CodeExample code={RaisedButtonExampleComplexCode}> | ||
<RaisedButtonExampleComplex /> | ||
</CodeExample> | ||
<PropTypeDescription code={raisedButtonCode}/> | ||
</div> | ||
); | ||
|
||
export default FloatingActionButtonPage; |
5 changes: 5 additions & 0 deletions
5
docs/src/app/components/pages/components/RaisedButton/README.md
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,5 @@ | ||
## Raised Button | ||
This [button](https://www.google.com/design/spec/components/buttons.html#buttons-flat-raised-buttons) | ||
is used to add dimension to mostly flat layouts and emphasizes important functions on your page. | ||
|
||
### Examples |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this style be handled by the
FlatButton
component?