-
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.
docs(Example): add ShorthandExample and ability to version docs (#1868)
* docs(Example): add ShorthandExample and ability to version docs * docs(Example): add versions to examples * docs(Example): use Shorthand example * fix(ComponentExample): remove cruft `divided` * mixed(ComponentExample): merge with master, update version position
- Loading branch information
1 parent
85a2b99
commit 7f39631
Showing
19 changed files
with
132 additions
and
79 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
40 changes: 40 additions & 0 deletions
40
docs/app/Components/ComponentDoc/ComponentExample/ComponentExampleTitle.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,40 @@ | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import { Header, Label } from 'semantic-ui-react' | ||
|
||
import { pure } from 'docs/app/HOC' | ||
|
||
const titleStyle = { | ||
margin: 0, | ||
} | ||
const descriptionStyle = { | ||
maxWidth: '50rem', | ||
} | ||
|
||
const ComponentExampleTitle = ({ description, title, suiVersion }) => ( | ||
<div> | ||
{title && ( | ||
<Header as='h3' className='no-anchor' style={titleStyle}> | ||
{title} | ||
{suiVersion && ( | ||
<Label | ||
as='a' | ||
color='teal' | ||
content={suiVersion} | ||
size='tiny' | ||
title={`Available from Semantic UI ${suiVersion}`} | ||
/> | ||
)} | ||
</Header> | ||
)} | ||
{description && <p style={descriptionStyle}>{description}</p>} | ||
</div> | ||
) | ||
|
||
ComponentExampleTitle.propTypes = { | ||
description: PropTypes.node, | ||
title: PropTypes.node, | ||
suiVersion: PropTypes.string, | ||
} | ||
|
||
export default pure(ComponentExampleTitle) |
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 PropTypes from 'prop-types' | ||
import React from 'react' | ||
|
||
import ComponentExample from './ComponentExample' | ||
|
||
const ShorthandExample = ({ description, ...rest }) => <ComponentExample {...rest} description={description} /> | ||
|
||
ShorthandExample.propTypes = { | ||
description: PropTypes.node, | ||
} | ||
|
||
ShorthandExample.defaultProps = { | ||
description: 'You can do the same using shorthands.', | ||
} | ||
|
||
export default ShorthandExample |
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
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
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
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
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
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
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
Oops, something went wrong.