├── .npmignore ├── .gitignore ├── publish-examples.sh ├── .prettierrc.json ├── scss ├── input-textarea.scss ├── _group.scss ├── _input-generic.scss ├── index.scss ├── _input-radio.scss ├── _input-dropdown.scss ├── _input-checkbox.scss ├── _variables.scss ├── _template.scss ├── _input-toggle.scss └── _input-range.scss ├── .travis.yml ├── tsconfig.examples.json ├── tsconfig.json ├── src ├── input-generic.tsx ├── input-textarea.tsx ├── group.tsx ├── input-toggle.tsx ├── input-range.tsx ├── input-radio.tsx ├── input-checkbox.tsx ├── input-dropdown.tsx ├── types.ts ├── utils.ts ├── template.tsx └── index.tsx ├── LICENSE ├── examples ├── src │ ├── index.scss │ ├── index.ejs │ ├── form-config.tsx │ └── index.tsx └── dist │ ├── common.js │ ├── index.html │ └── main.css ├── webpack.config.js ├── tslint.json ├── package.json └── README.md /.npmignore: -------------------------------------------------------------------------------- 1 | src 2 | examples 3 | node_modules 4 | .rpt2_cache 5 | dist 6 | *.sh 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | es 2 | lib 3 | node_modules 4 | css 5 | .rpt2_cache 6 | *.log 7 | yarn.lock 8 | -------------------------------------------------------------------------------- /publish-examples.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Publishing examples to Github pages...." 4 | 5 | git config --global user.email "travis@travis-ci.org" 6 | git config --global user.name "Travis CI" 7 | yarn publish:examples 8 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all", 4 | "semi": false, 5 | "overrides": [ 6 | { 7 | "files": "*.scss", 8 | "options": { 9 | "singleQuote": false 10 | } 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /scss/input-textarea.scss: -------------------------------------------------------------------------------- 1 | .input-textarea { 2 | textarea { 3 | width: 100%; 4 | min-height: 100px; 5 | @include common; 6 | @include transition; 7 | &:focus { 8 | border-color: $input-border-color-dark; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '8' 4 | before_script: yarn build 5 | after_success: ./publish-examples.sh 6 | deploy: 7 | provider: npm 8 | email: praneshpranesh@gmail.com 9 | api_key: $NPM_API_KEY 10 | skip_cleanup: true 11 | on: 12 | tags: true 13 | branch: master 14 | -------------------------------------------------------------------------------- /tsconfig.examples.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "experimentalDecorators": true, 4 | "jsx": "react", 5 | "module": "es6", 6 | "moduleResolution": "node", 7 | "noImplicitAny": true, 8 | "target": "es5", 9 | "downlevelIteration": true, 10 | "lib": ["es2017", "dom"] 11 | }, 12 | "exclude": ["node_modules"] 13 | } 14 | -------------------------------------------------------------------------------- /scss/_group.scss: -------------------------------------------------------------------------------- 1 | .formland-group { 2 | margin-bottom: 40px; 3 | padding-bottom: 40px; 4 | border-bottom: 1px solid $input-border-color; 5 | &:last-child { 6 | border-bottom: none; 7 | } 8 | .group-title { 9 | font-size: 18px; 10 | font-weight: 600; 11 | margin-bottom: 10px; 12 | } 13 | .group-description { 14 | margin-bottom: 30px; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "experimentalDecorators": true, 4 | "jsx": "react", 5 | "module": "es6", 6 | "moduleResolution": "node", 7 | "noImplicitAny": true, 8 | "target": "es5", 9 | "declaration": true, 10 | "downlevelIteration": true, 11 | "lib": ["es2017", "dom"] 12 | }, 13 | "include": ["./src/*"], 14 | "exclude": ["node_modules"] 15 | } 16 | -------------------------------------------------------------------------------- /src/input-generic.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | const cn = require('classnames') 3 | 4 | import { IFormElementProps } from './types' 5 | 6 | const InputGeneric: React.SFC = ({ 7 | value = '', 8 | config, 9 | callbacks = {}, 10 | }) => { 11 | return ( 12 |
13 | 22 |
23 | ) 24 | } 25 | 26 | export default InputGeneric 27 | -------------------------------------------------------------------------------- /src/input-textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | const cn = require('classnames') 3 | 4 | import { IFormElementProps } from './types' 5 | 6 | const InputTextArea: React.SFC = ({ 7 | callbacks = {}, 8 | config, 9 | value = '', 10 | }) => { 11 | return ( 12 |
13 |