├── .gitignore ├── circle.yml ├── css ├── icon.eot ├── icon.woff └── base.css ├── .babelrc ├── src ├── utils.js ├── constants │ └── action_types.js ├── modal_style.js ├── components │ ├── error.js │ ├── form_types │ │ ├── textarea.js │ │ ├── native.js │ │ ├── radio.js │ │ ├── checkbox.js │ │ ├── add_single.js │ │ ├── add.js │ │ └── select.js │ ├── filter.js │ └── form.js ├── containers │ ├── notfound.js │ ├── new.js │ ├── app.js │ ├── edit.js │ └── index.js ├── reducers │ └── index.js ├── index.js ├── initial_state.js └── actions │ └── index.js ├── index.js ├── index.html ├── LICENCE ├── .eslintrc ├── CONTRIBUTING.md ├── test └── test.js ├── README.md ├── team.json ├── package.json ├── data └── form.json ├── CHANGELOG.md ├── dist └── team-directory.css └── GETTING_STARTED.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env.sh 3 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | general: 2 | branches: 3 | ignore: 4 | - test-data 5 | -------------------------------------------------------------------------------- /css/icon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cutting-room-floor/team-directory/HEAD/css/icon.eot -------------------------------------------------------------------------------- /css/icon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cutting-room-floor/team-directory/HEAD/css/icon.woff -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "stage": 0, 3 | "env": { 4 | "development": { 5 | "plugins": [ 6 | "object-assign" 7 | ] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | var utils = {}; 2 | 3 | utils.colN = function(n) { 4 | if (n === 2) return 6; 5 | if (n === 3) return 4; 6 | if (n === 4) return 3; 7 | if (n > 4 || n === 1) return 12; 8 | }; 9 | 10 | module.exports = utils; 11 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import TeamDirectory from './src'; 2 | 3 | function Directory(id, options) { 4 | return new TeamDirectory(id, options); 5 | } 6 | 7 | if (window && typeof module !== 'undefined' && module.exports) { 8 | window.TeamDirectory = module.exports = Directory; 9 | } else if (typeof module !== 'undefined' && module.exports) { 10 | module.exports = Directory; 11 | } else { 12 | window.TeamDirectory = Directory; 13 | } 14 | -------------------------------------------------------------------------------- /src/constants/action_types.js: -------------------------------------------------------------------------------- 1 | export const VALIDATORS = 'VALIDATORS'; 2 | export const NORMALIZERS = 'NORMALIZERS'; 3 | export const STATS_TEMPLATE = 'STATS_TEMPLATE'; 4 | export const LISTING_TEMPLATE = 'LISTING_TEMPLATE'; 5 | export const SORTS = 'SORTS'; 6 | export const SORT_KEYS = 'SORT_KEYS'; 7 | export const OPTIONS = 'OPTIONS'; 8 | export const USER = 'USER'; 9 | export const ACTOR = 'ACTOR'; 10 | export const TEAM = 'TEAM'; 11 | export const FILTER_LIST = 'FILTER_LIST'; 12 | export const FORM = 'FORM'; 13 | export const MESSAGE = 'MESSAGE'; 14 | export const ERROR = 'ERROR'; 15 | export const EVENTS = 'EVENTS'; 16 | export const LOADING = 'LOADING'; 17 | -------------------------------------------------------------------------------- /src/modal_style.js: -------------------------------------------------------------------------------- 1 | export default { 2 | overlay: { 3 | backgroundColor:'rgba(0,0,0,0.5)', 4 | position: 'fixed', 5 | top: 0, 6 | left: 0, 7 | right: 0, 8 | bottom: 0 9 | }, 10 | content: { 11 | background: '#fff', 12 | position: 'absolute', 13 | top: '0', 14 | right: '0', 15 | left: '0', 16 | padding: '0', 17 | bottom: 'auto', 18 | width: '400px', 19 | border: 'none', 20 | overflow: 'hidden', 21 | WebkitOverflowScrolling: 'touch', 22 | borderRadius: '3px', 23 | outline: 'none', 24 | marginTop: '40px', 25 | marginLeft: 'auto', 26 | marginRight: 'auto' 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2015, Mapbox 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /src/components/error.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react'; 2 | 3 | export default class ErrorDialog extends Component { 4 | render() { 5 | const { error, dismissError } = this.props; 6 | const active = (error) ? 'active' : ''; 7 | if (active) window.setTimeout(dismissError, 3000); 8 | return ( 9 |
10 |
11 |
12 | {error} 13 |
14 |
15 |
16 | ); 17 | } 18 | } 19 | 20 | ErrorDialog.propTypes = { 21 | error: PropTypes.string.isRequired, 22 | dismissError: PropTypes.func.isRequired 23 | }; 24 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "browser": true 5 | }, 6 | "parser": "babel-eslint", 7 | "plugins": [ 8 | "react" 9 | ], 10 | "rules": { 11 | "curly": [0], 12 | "react/prop-types": 1, 13 | "react/no-multi-comp": 2, 14 | "react/no-danger": 2, 15 | "react/display-name": [2, { "acceptTranspilerName": true }], 16 | "react/no-unknown-property": [2], 17 | "react/prop-types": 2, 18 | "react/require-extension": [2, { "extensions": [".js", ".jsx"] }], 19 | "react/self-closing-comp": [2], 20 | "no-alert": [0], 21 | "new-cap": [0], 22 | "quotes": [2, "single"], 23 | "eol-last": [0], 24 | "no-mixed-requires": [0], 25 | "camelcase": [0], 26 | "consistent-return": [0], 27 | "no-underscore-dangle": [0], 28 | "comma-spacing": [0], 29 | "key-spacing": [0], 30 | "no-use-before-define": [0] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/components/form_types/textarea.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | 4 | export default class Textarea extends Component { 5 | 6 | constructor() { 7 | super(); 8 | this.change = this.change.bind(this); 9 | } 10 | 11 | change(e) { 12 | const { onChange, id } = this.props; 13 | onChange(id, e.target.value); 14 | } 15 | 16 | render() { 17 | const { placeholder, required, value } = this.props; 18 | return ( 19 |