├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── docs ├── api │ ├── checkbox-group.md │ ├── checkbox.md │ ├── component-common.md │ ├── form.md │ ├── input-file.md │ ├── input.md │ ├── radio-group.md │ ├── select.md │ └── textarea.md ├── component-properties.md ├── components │ ├── README.md │ └── file.md ├── css-classes.md ├── layouts.md ├── migrating-to-1.0.0.md └── refs.md ├── examples ├── README.md ├── playground │ ├── index.html │ └── src │ │ ├── App.test.tsx │ │ ├── App.tsx │ │ ├── index.tsx │ │ ├── options.tsx │ │ └── playground.tsx └── refs │ ├── index.html │ └── src │ └── index.tsx ├── jest.config.js ├── package.json ├── scripts ├── component-common-for-docs.js ├── generate-docs.sh └── prepublish.sh ├── src ├── components │ ├── __tests__ │ │ ├── checkbox-group-test.ts │ │ ├── checkbox-test.ts │ │ ├── component.tsx │ │ ├── input-file-test.ts │ │ ├── input-test.tsx │ │ ├── radio-group-test.ts │ │ ├── select-test.tsx │ │ ├── test-helper.ts │ │ └── textarea-test.tsx │ ├── checkbox-group.tsx │ ├── checkbox.tsx │ ├── component-common.ts │ ├── controls │ │ ├── common-prop-types.ts │ │ ├── input-file.tsx │ │ ├── input.tsx │ │ ├── select.tsx │ │ └── textarea.tsx │ ├── error-messages.tsx │ ├── form-check-group.tsx │ ├── help.tsx │ ├── input-file.tsx │ ├── input-group.tsx │ ├── input.tsx │ ├── label.tsx │ ├── radio-group.tsx │ ├── required-symbol.tsx │ ├── row.tsx │ ├── select.tsx │ └── textarea.tsx ├── context │ └── frc.ts ├── debounce.ts ├── form.tsx ├── hoc │ ├── __tests__ │ │ └── component-test.tsx │ └── component.tsx ├── index.ts ├── types.ts └── utils.ts ├── tsconfig.json ├── webpack.config.js ├── webpack.examples.config.js └── yarn.lock /.eslintignore: -------------------------------------------------------------------------------- 1 | examples/build/* 2 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | "plugin:@typescript-eslint/recommended", 4 | "plugin:jsx-a11y/recommended", 5 | "plugin:react/recommended", 6 | "plugin:prettier/recommended", 7 | "plugin:import/errors", 8 | "plugin:import/warnings", 9 | "plugin:import/typescript", 10 | ], 11 | plugins: ["prettier"], 12 | rules: { 13 | "import/no-unresolved": "error", 14 | "prettier/prettier": [ 15 | "error", 16 | { 17 | singleQuote: true, 18 | trailingComma: "all", 19 | bracketSpacing: false, 20 | jsxBracketSameLine: true, 21 | }, 22 | ], 23 | "react/jsx-filename-extension": [1, { extensions: [".jsx", ".tsx"] }], 24 | "react/prop-types": [ 25 | "error", 26 | { 27 | skipUndeclared: true, 28 | }, 29 | ], 30 | "jsx-a11y/label-has-for": "off", 31 | "jsx-a11y/label-has-associated-control": [ 32 | "error", 33 | { 34 | labelComponents: [], 35 | labelAttributes: [], 36 | controlComponents: [], 37 | assert: "either", 38 | depth: 25, 39 | }, 40 | ], 41 | "@typescript-eslint/explicit-function-return-type": [ 42 | "warn", 43 | { 44 | allowTypedFunctionExpressions: true, 45 | }, 46 | ], 47 | }, 48 | parser: "@typescript-eslint/parser", 49 | parserOptions: { 50 | ecmaVersion: 2018, 51 | sourceType: "module", 52 | ecmaFeatures: { 53 | jsx: true, 54 | }, 55 | }, 56 | settings: { 57 | react: { 58 | version: "detect", 59 | }, 60 | "import/parsers": { 61 | "@typescript-eslint/parser": [".ts", ".tsx"], 62 | }, 63 | "import/resolver": { 64 | // use /tsconfig.json 65 | typescript: {}, 66 | }, 67 | }, 68 | }; 69 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | examples/build 3 | node_modules/ 4 | notes/ 5 | dist-esm/ 6 | dist-umd/ 7 | *.log 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "stable" 4 | before_install: 5 | - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.15.2 6 | - export PATH=$HOME/.yarn/bin:$PATH 7 | cache: 8 | yarn: true 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | Releases are documented on github. 4 | 5 | See: https://github.com/twisty/formsy-react-components/releases 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Tim Brayshaw 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # formsy-react-components 2 | 3 | [![Build Status](https://travis-ci.org/twisty/formsy-react-components.svg?branch=bootstrap-4-dev)](https://travis-ci.org/twisty/formsy-react-components) 4 | [![npm version](https://badge.fury.io/js/formsy-react-components.svg)](https://badge.fury.io/js/formsy-react-components) 5 | [![GitHub release](https://img.shields.io/github/release/twisty/formsy-react-components.svg)](https://github.com/twisty/formsy-react-components/releases) 6 | [![GitHub contributors](https://img.shields.io/github/contributors/twisty/formsy-react-components.svg)](https://github.com/twisty/formsy-react-components/contributors) 7 | 8 | **Note:** The work here on the [`master`](https://github.com/twisty/formsy-react-components/tree/master) branch is for upcoming release that supports Bootstrap 4. The source for current (1.x) releases can be found on the [`release-1.x`](https://github.com/twisty/formsy-react-components/tree/release-1.x) branch. 9 | 10 | --- 11 | 12 | `formsy-react-components` is a selection of React components that render form elements for use in a [formsy-react](https://github.com/formsy/formsy-react) form. 13 | 14 | The components render markup to be quickly included in a [Bootstrap 4 form](https://getbootstrap.com/docs/4.3/components/forms/). This includes a `