-
Notifications
You must be signed in to change notification settings - Fork 3
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
Jodie Doubleday
committed
Jul 6, 2015
1 parent
0efe772
commit 43b61d0
Showing
14 changed files
with
185 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,8 @@ | ||
var example = ( | ||
<div> | ||
<UIToolkit.Quote author="Brad Frost" role="Web Designer">It's not about what we do, it's about what we enable other people to do</UIToolkit.Quote> | ||
<UIToolkit.Quote author="Christian Heilmann" role="Developer Evangelist" cite="Twitter" purpose="warning">Fix the broken things before you build the shiney new broken things</UIToolkit.Quote> | ||
</div> | ||
); | ||
|
||
React.render(example, mountNode); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** @jsx React.DOM */ | ||
|
||
var React = require('react'); | ||
var AlertComponent = require('../code/views/quoteView.jsx'); | ||
|
||
describe('AlertComponent', function() { | ||
|
||
it('should render an Quote', function() { | ||
var quote = TestUtils.renderIntoDocument( | ||
<QuoteComponent>I am content</QuoteComponent> | ||
); | ||
|
||
var renderedAlert = TestUtils.findRenderedDOMComponentWithClass(quote, 'component-quote'); | ||
assert.equal(renderedQuote.getDOMNode().textContent, 'I am content'); | ||
|
||
}); | ||
|
||
}); |
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 @@ | ||
module.exports = require('./views/quoteView.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,73 @@ | ||
/*------------------------------------*\ | ||
#Quote | ||
\*------------------------------------*/ | ||
|
||
.component-quote { | ||
border-left: solid .25em; | ||
margin:0; | ||
padding:1em; | ||
font-size:1em; | ||
quotes: "“" "”" "‘" "’"; | ||
&.inline { | ||
border-left:none; | ||
} | ||
p { | ||
&:first-of-type { | ||
margin-top:0; | ||
} | ||
font-style: italic; | ||
font-size: 1em; | ||
&:before { | ||
content: open-quote; | ||
} | ||
&:after { | ||
content: close-quote; | ||
} | ||
} | ||
footer { | ||
font-size:1em; | ||
} | ||
small, cite { | ||
.small; | ||
} | ||
cite:before { | ||
content: "Source: " | ||
} | ||
& + .component-quote { | ||
margin-top: .5em; | ||
} | ||
} | ||
|
||
// | ||
// == Functional Colours == | ||
// | ||
|
||
// Mixin | ||
.quote-variant(@background) { | ||
color: @background; | ||
border-color: lighten(@background, 30%); | ||
small, cite { | ||
color: lighten(@background, 20%); | ||
} | ||
} | ||
|
||
.component-quote { | ||
&.primary { | ||
.quote-variant(@primary); | ||
} | ||
&.secondary { | ||
.quote-variant(@secondary); | ||
} | ||
&.success { | ||
.quote-variant(@success); | ||
} | ||
&.info { | ||
.quote-variant(@info); | ||
} | ||
&.warning { | ||
.quote-variant(@warning); | ||
} | ||
&.danger { | ||
.quote-variant(@danger); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/components/quote/code/templates/blockQuoteTemplate.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,19 @@ | ||
var classNames = require('classnames'); | ||
var getComponentClasses = require('../../../../utils/getComponentClasses'); | ||
|
||
module.exports = function() { | ||
|
||
var propClasses = ['size', 'purpose', 'orientation']; | ||
var classes = getComponentClasses('component-quote', propClasses, this.props); | ||
|
||
return ( | ||
<blockquote cite={this.props.cite} className={classNames(classes)} itemScope itemType="http://schema.org/CreativeWork"> | ||
<p itemProp="text">{this.props.children}</p> | ||
<footer itemProp="author" itemScope itemType="http://schema.org/Person"> | ||
<span itemProp="name">{this.props.author}</span> | ||
<small itemProp="jobTitle">{this.props.role}</small> | ||
{(this.props.cite) ? <cite itemProp="citation">{this.props.cite}</cite> : null} | ||
</footer> | ||
</blockquote> | ||
); | ||
}; |
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 @@ | ||
var classNames = require('classnames'); | ||
var getComponentClasses = require('../../../../utils/getComponentClasses'); | ||
|
||
module.exports = function() { | ||
|
||
var propClasses = ['size', 'purpose', 'orientation']; | ||
var classes = getComponentClasses('component-quote', propClasses, this.props); | ||
|
||
return ( | ||
<q cite={this.props.cite} className={classNames(classes)} itemScope itemType="http://schema.org/CreativeWork" itemProp="text"> | ||
{this.props.children} | ||
<span itemProp="author" itemScope itemType="http://schema.org/Person"> | ||
<meta itemProp="name" content={this.props.author} /> | ||
<meta itemProp="jobTitle" content={this.props.role} /> | ||
</span> | ||
</q> | ||
); | ||
}; |
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,19 @@ | ||
var React = require('react'); | ||
|
||
module.exports = React.createClass({ | ||
|
||
propTypes: { | ||
purpose: React.PropTypes.oneOf(['default', 'primary', 'secondary', 'success', 'warning', 'danger', 'info']), | ||
size: React.PropTypes.oneOf(['default', 'small', 'medium', 'large', 'extra-large']), | ||
orientation: React.PropTypes.oneOf(['default', 'horizontal', 'vertical']), | ||
type: React.PropTypes.oneOf(['block', 'inline']) | ||
}, | ||
|
||
render: function() { | ||
if(this.props.type === 'inline') { | ||
return require('../templates/quoteTemplate.jsx').call(this); | ||
} | ||
return require('../templates/blockQuoteTemplate.jsx').call(this); | ||
} | ||
}); | ||
|
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 @@ | ||
module.exports = require('./code/index'); |
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