├── .travis.yml ├── gulpfile.js ├── react-topcoat.sublime-project ├── .gitignore ├── dist ├── topcoat │ ├── button_spec.js │ ├── tabbar.js │ ├── range.js │ ├── notification.js │ ├── listheader.js │ ├── input.js │ ├── switch.js │ ├── tab.js │ ├── list.js │ ├── searchinput.js │ ├── buttonbarbutton.js │ ├── navigationbar.js │ ├── textarea.js │ ├── button.js │ ├── buttonbar.js │ ├── listitems.js │ ├── checkbox.js │ ├── navigationbaritem.js │ └── radiobutton.js └── index.js ├── app ├── src │ ├── topcoat │ │ ├── tabbar.coffee │ │ ├── notification.coffee │ │ ├── range.coffee │ │ ├── listheader.coffee │ │ ├── list.coffee │ │ ├── switch.coffee │ │ ├── tab.coffee │ │ ├── input.coffee │ │ ├── navigationbar.coffee │ │ ├── searchinput.coffee │ │ ├── listitems.coffee │ │ ├── buttonbarbutton.coffee │ │ ├── textarea.coffee │ │ ├── button.coffee │ │ ├── buttonbar.coffee │ │ ├── checkbox.coffee │ │ ├── radiobutton.coffee │ │ ├── navigationbaritem.coffee │ │ └── button_spec.coffee │ ├── index.coffee │ └── test.coffee └── index.html ├── .editorconfig ├── README.md ├── package.json └── gulpfile.coffee /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | require('coffee-script/register'); 2 | require('./gulpfile.coffee'); 3 | -------------------------------------------------------------------------------- /react-topcoat.sublime-project: -------------------------------------------------------------------------------- 1 | { 2 | "folders": 3 | [ 4 | { 5 | "follow_symlinks": true, 6 | "path": "." 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.sublime-workspace 2 | .*.swp 3 | ._* 4 | .DS_Store 5 | .git 6 | .hg 7 | .lock-wscript 8 | .svn 9 | .tmp/ 10 | .wafpickle-* 11 | build/ 12 | CVS 13 | node_modules 14 | npm-debug.log 15 | -------------------------------------------------------------------------------- /dist/topcoat/button_spec.js: -------------------------------------------------------------------------------- 1 | var button;button=require("./button"),describe("Button",function(){return it("should have a props property",function(){var t;return t=button(),t.should.have.ownProperty("props")})}); -------------------------------------------------------------------------------- /dist/topcoat/tabbar.js: -------------------------------------------------------------------------------- 1 | var React,TabBar,div;React=require("react/addons"),div=React.DOM.div,TabBar=React.createClass({render:function(){return div({className:"topcoat-tab-bar"},this.props.children)}}),module.exports=TabBar; -------------------------------------------------------------------------------- /dist/topcoat/range.js: -------------------------------------------------------------------------------- 1 | var Range,React,input;React=require("react/addons"),input=React.DOM.input,Range=React.createClass({render:function(){return this.transferPropsTo(input({type:"range",className:"topcoat-range"}))}}),module.exports=Range; -------------------------------------------------------------------------------- /dist/topcoat/notification.js: -------------------------------------------------------------------------------- 1 | var Notification,React,span;React=require("react/addons"),span=React.DOM.span,Notification=React.createClass({render:function(){return span({className:"topcoat-notification"},this.props.children)}}),module.exports=Notification; -------------------------------------------------------------------------------- /app/src/topcoat/tabbar.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {div} = React.DOM 4 | 5 | TabBar = React.createClass 6 | 7 | render: -> 8 | div className: 'topcoat-tab-bar', 9 | @props.children 10 | 11 | module.exports = TabBar 12 | -------------------------------------------------------------------------------- /dist/topcoat/listheader.js: -------------------------------------------------------------------------------- 1 | var ListHeader,React,h3;React=require("react/addons"),h3=React.DOM.h3,ListHeader=React.createClass({componentName:"ListHeader",render:function(){return h3({className:"topcoat-list__header"},this.props.children)}}),module.exports=ListHeader; -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /app/src/topcoat/notification.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {span} = React.DOM 4 | 5 | Notification = React.createClass 6 | 7 | render: -> 8 | span className: 'topcoat-notification', 9 | @props.children 10 | 11 | module.exports = Notification 12 | -------------------------------------------------------------------------------- /app/src/topcoat/range.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {input} = React.DOM 4 | 5 | Range = React.createClass 6 | 7 | render: -> 8 | @transferPropsTo input 9 | type: 'range' 10 | className: 'topcoat-range' 11 | 12 | module.exports = Range 13 | -------------------------------------------------------------------------------- /app/src/topcoat/listheader.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {h3} = React.DOM 4 | 5 | ListHeader = React.createClass 6 | 7 | componentName: 'ListHeader' 8 | 9 | render: -> 10 | h3 className: 'topcoat-list__header', 11 | @props.children 12 | 13 | module.exports = ListHeader 14 | -------------------------------------------------------------------------------- /app/src/topcoat/list.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {div, h3, ul, li} = React.DOM 4 | 5 | List = React.createClass 6 | 7 | propTypes: 8 | large: React.PropTypes.bool 9 | 10 | render: -> 11 | newList = true 12 | div className: 'topcoat-list', 13 | child for child in @props.children 14 | 15 | module.exports = List 16 | -------------------------------------------------------------------------------- /dist/topcoat/input.js: -------------------------------------------------------------------------------- 1 | var Input,React,input;React=require("react/addons"),input=React.DOM.input,Input=React.createClass({propTypes:{large:React.PropTypes.bool},render:function(){return this.transferPropsTo(input({type:"text",className:""+this._className()}))},_className:function(){var t;return t="topcoat-text-input",this.props.large&&(t=t.concat("--large")),t}}),module.exports=Input; -------------------------------------------------------------------------------- /dist/topcoat/switch.js: -------------------------------------------------------------------------------- 1 | var React,Switch,div,input,label,_ref;React=require("react/addons"),_ref=React.DOM,label=_ref.label,input=_ref.input,div=_ref.div,Switch=React.createClass({render:function(){return label({className:"topcoat-switch"},this.transferPropsTo(input({type:"checkbox",className:"topcoat-switch__input"})),div({className:"topcoat-switch__toggle"}))}}),module.exports=Switch; -------------------------------------------------------------------------------- /dist/topcoat/tab.js: -------------------------------------------------------------------------------- 1 | var React,Tab,button,input,label,_ref;React=require("react/addons"),_ref=React.DOM,label=_ref.label,input=_ref.input,button=_ref.button,Tab=React.createClass({render:function(){return label({className:"topcoat-tab-bar__item"},this.transferPropsTo(input({type:"radio",name:"tab-bar"})),button({className:"topcoat-tab-bar__button"},this.props.children))}}),module.exports=Tab; -------------------------------------------------------------------------------- /app/src/topcoat/switch.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {label, input, div} = React.DOM 4 | 5 | Switch = React.createClass 6 | 7 | render: -> 8 | label className: 'topcoat-switch', 9 | @transferPropsTo input 10 | type: 'checkbox' 11 | className: 'topcoat-switch__input' 12 | div className: 'topcoat-switch__toggle' 13 | 14 | module.exports = Switch 15 | -------------------------------------------------------------------------------- /dist/topcoat/list.js: -------------------------------------------------------------------------------- 1 | var List,React,div,h3,li,ul,_ref;React=require("react/addons"),_ref=React.DOM,div=_ref.div,h3=_ref.h3,ul=_ref.ul,li=_ref.li,List=React.createClass({propTypes:{large:React.PropTypes.bool},render:function(){var e,r;return r=!0,div({className:"topcoat-list"},function(){var r,t,a,i;for(a=this.props.children,i=[],r=0,t=a.length;t>r;r++)e=a[r],i.push(e);return i}.call(this))}}),module.exports=List; -------------------------------------------------------------------------------- /app/src/topcoat/tab.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {label, input, button} = React.DOM 4 | 5 | Tab = React.createClass 6 | 7 | render: -> 8 | label className: 'topcoat-tab-bar__item', 9 | @transferPropsTo input 10 | type: 'radio' 11 | name: 'tab-bar' 12 | button className: 'topcoat-tab-bar__button', 13 | @props.children 14 | 15 | module.exports = Tab 16 | -------------------------------------------------------------------------------- /dist/topcoat/searchinput.js: -------------------------------------------------------------------------------- 1 | var React,SearchInput,input;React=require("react/addons"),input=React.DOM.input,SearchInput=React.createClass({propTypes:{large:React.PropTypes.bool},render:function(){return input({type:"search",className:""+this._className(),placeholder:null!=this.props.placeholder||"search"})},_className:function(){var e;return e="topcoat-search-input",this.props.large&&(e=e.concat("--large")),e}}),module.exports=SearchInput; -------------------------------------------------------------------------------- /dist/topcoat/buttonbarbutton.js: -------------------------------------------------------------------------------- 1 | var ButtonBarButton,React,button;React=require("react/addons"),button=React.DOM.button,ButtonBarButton=React.createClass({propTypes:{large:React.PropTypes.bool},render:function(){return this.transferPropsTo(button({className:""+this._className()},this.props.children))},_className:function(){var t;return t="topcoat-button-bar__button",this.props.large&&(t=t.concat("--large")),t}}),module.exports=ButtonBarButton; -------------------------------------------------------------------------------- /dist/topcoat/navigationbar.js: -------------------------------------------------------------------------------- 1 | var NavigationBar,NavigationBarItem,React,div,h1,_ref;React=require("react/addons"),NavigationBarItem=require("./navigationbaritem"),_ref=React.DOM,div=_ref.div,h1=_ref.h1,NavigationBar=React.createClass({propTypes:{onTop:React.PropTypes.bool},render:function(){var a;return a=React.addons.classSet({"topcoat-navigation-bar":!0,"on-top":this.props.onTop}),div({className:a},this.props.children)}}),module.exports=NavigationBar; -------------------------------------------------------------------------------- /app/src/topcoat/input.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {input} = React.DOM 4 | 5 | Input = React.createClass 6 | 7 | propTypes: 8 | large: React.PropTypes.bool 9 | 10 | render: -> 11 | @transferPropsTo input 12 | type: 'text' 13 | className: "#{@_className()}" 14 | 15 | _className: -> 16 | className = 'topcoat-text-input' 17 | className = className.concat '--large' if @props.large 18 | className 19 | 20 | module.exports = Input 21 | -------------------------------------------------------------------------------- /dist/topcoat/textarea.js: -------------------------------------------------------------------------------- 1 | var React,TextArea,textarea;React=require("react/addons"),textarea=React.DOM.textarea,TextArea=React.createClass({propTypes:{value:React.PropTypes.string,large:React.PropTypes.bool},getDefaultProps:function(){return{rows:"6"}},render:function(){return this.transferPropsTo(textarea({type:"text",rows:this.props.rows,className:""+this._className()}))},_className:function(){var e;return e="topcoat-textarea",this.props.large&&(e=e.concat("--large")),e}}),module.exports=TextArea; -------------------------------------------------------------------------------- /app/src/topcoat/navigationbar.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | NavigationBarItem = require './navigationbaritem' 3 | 4 | {div, h1} = React.DOM 5 | 6 | NavigationBar = React.createClass 7 | 8 | propTypes: 9 | onTop: React.PropTypes.bool 10 | 11 | render: -> 12 | classSet = React.addons.classSet 13 | 'topcoat-navigation-bar': true 14 | 'on-top': @props.onTop 15 | div className: classSet, 16 | @props.children 17 | 18 | module.exports = NavigationBar 19 | -------------------------------------------------------------------------------- /dist/topcoat/button.js: -------------------------------------------------------------------------------- 1 | var Button,React,button;React=require("react/addons"),button=React.DOM.button,Button=React.createClass({propTypes:{cta:React.PropTypes.bool,quiet:React.PropTypes.bool,large:React.PropTypes.bool},render:function(){return this.transferPropsTo(button({className:""+this._className()},this.props.children))},_className:function(){var t;return t="topcoat-button",this.props.large&&(t=t.concat("--large")),this.props.cta&&(t=t.concat("--cta")),this.props.quiet&&(t=t.concat("--quiet")),t}}),module.exports=Button; -------------------------------------------------------------------------------- /dist/topcoat/buttonbar.js: -------------------------------------------------------------------------------- 1 | var ButtonBar,ButtonBarButton,React,div;React=require("react/addons"),ButtonBarButton=require("./buttonbarbutton"),div=React.DOM.div,ButtonBar=React.createClass({render:function(){var t,r;return div({className:"topcoat-button-bar"},function(){var a,e,o,n;if(Array.isArray(this.props.children)){for(o=this.props.children,n=[],r=a=0,e=o.length;e>a;r=++a)t=o[r],n.push(div({key:r,className:"topcoat-button-bar__item"},t));return n}return div({className:"topcoat-button-bar__item"},t)}.call(this))}}),module.exports=ButtonBar; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | React Topcoat 2 | ======= 3 | 4 | [Topcoat](http://topcoat.io) components built with [React](http://facebook.github.io/react/). 5 | 6 | #### Build tasks 7 | 8 | - `gulp` defaults to `gulp build` 9 | - `gulp clean` 10 | 11 | #### Test tasks 12 | 13 | - `gulp test:console` runs mocha tests in console 14 | - `gulp test:web` runs the web/test server at http://localhost:3000 15 | 16 | #### Demo App 17 | 18 | A demo app that builds for Web/Chrome/iOS/Android can be found at: 19 | 20 | - https://github.com/plaxdan/react-topcoat-demo 21 | -------------------------------------------------------------------------------- /app/src/topcoat/searchinput.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {input} = React.DOM 4 | 5 | SearchInput = React.createClass 6 | 7 | propTypes: 8 | large: React.PropTypes.bool 9 | 10 | render: -> 11 | input 12 | type: 'search' 13 | className: "#{@_className()}" 14 | placeholder: @props.placeholder? or 'search' 15 | 16 | _className: -> 17 | className = 'topcoat-search-input' 18 | className = className.concat '--large' if @props.large 19 | className 20 | 21 | module.exports = SearchInput 22 | -------------------------------------------------------------------------------- /dist/topcoat/listitems.js: -------------------------------------------------------------------------------- 1 | var ListItems,React,li,ul,_ref;React=require("react/addons"),_ref=React.DOM,ul=_ref.ul,li=_ref.li,ListItems=React.createClass({propTypes:{large:React.PropTypes.bool},render:function(){var t;return ul({className:"topcoat-list__container"},function(){var e,r,s,i;if(Array.isArray(this.props.children)){for(s=this.props.children,i=[],e=0,r=s.length;r>e;e++)t=s[e],i.push(this._listItem(t));return i}return this._listItem(this.props.children)}.call(this))},_listItem:function(t){return li({className:"topcoat-list__item"},t)}}),module.exports=ListItems; -------------------------------------------------------------------------------- /app/src/topcoat/listitems.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {ul, li} = React.DOM 4 | 5 | ListItems = React.createClass 6 | 7 | propTypes: 8 | large: React.PropTypes.bool 9 | 10 | render: -> 11 | ul className: 'topcoat-list__container', 12 | if Array.isArray @props.children 13 | for child in @props.children 14 | @_listItem child 15 | else 16 | @_listItem @props.children 17 | 18 | _listItem: (child) -> 19 | li className: 'topcoat-list__item', 20 | child 21 | 22 | module.exports = ListItems 23 | -------------------------------------------------------------------------------- /app/src/topcoat/buttonbarbutton.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {button} = React.DOM 4 | 5 | ButtonBarButton = React.createClass 6 | 7 | # TODO: set large at the parent ButtonBar 8 | propTypes: 9 | large: React.PropTypes.bool 10 | 11 | render: -> 12 | @transferPropsTo button 13 | className: "#{@_className()}", 14 | 15 | @props.children 16 | 17 | _className: -> 18 | className = 'topcoat-button-bar__button' 19 | className = className.concat '--large' if @props.large 20 | className 21 | 22 | module.exports = ButtonBarButton 23 | -------------------------------------------------------------------------------- /app/src/topcoat/textarea.coffee: -------------------------------------------------------------------------------- 1 | React = require 'react/addons' 2 | 3 | {textarea} = React.DOM 4 | 5 | TextArea = React.createClass 6 | 7 | propTypes: 8 | value: React.PropTypes.string 9 | large: React.PropTypes.bool 10 | 11 | getDefaultProps: -> 12 | rows: '6' 13 | 14 | render: -> 15 | @transferPropsTo textarea 16 | type: 'text' 17 | rows: @props.rows 18 | className: "#{@_className()}", 19 | 20 | _className: -> 21 | className = 'topcoat-textarea' 22 | className = className.concat '--large' if @props.large 23 | className 24 | 25 | module.exports = TextArea 26 | -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |