Skip to content
This repository was archived by the owner on Dec 23, 2022. It is now read-only.

Commit 40a4c27

Browse files
committed
Initial commit.
0 parents  commit 40a4c27

File tree

11 files changed

+503
-0
lines changed

11 files changed

+503
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015", "stage-0", "react"]
3+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
lib

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.storybook/config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { configure } from '@kadira/storybook';
2+
3+
function loadStories() {
4+
require('../stories');
5+
}
6+
7+
configure(loadStories, module);
8+
9+
const injectTapEventPlugin = require("react-tap-event-plugin");
10+
injectTapEventPlugin();

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 Team Wertarbyte
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.

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# material-ui-chip-input
2+
This project provides a [chip input field][chipspec] for [Material-UI][mui]. It is inspired by [Angular Material's chip input][angular-chips].
3+
4+
![Demo](demo.gif)
5+
6+
[chipspec]: https://material.google.com/components/chips.html#chips-behavior
7+
[mui]: http://www.material-ui.com/#/
8+
[angular-chips]: https://material.angularjs.org/latest/demo/chips
9+
10+
## Installation
11+
```shell
12+
npm i --save material-ui-chip-input
13+
```
14+
15+
## Usage
16+
The component supports either controlled or uncontrolled input mode. If you use the controlled mode (by setting the `value` attribute), the `onChange` callback won't be called.
17+
18+
```jsx
19+
import ChipInput from 'material-ui-chip-input'
20+
21+
// uncontrolled input
22+
<ChipInput
23+
defaultValue={['foo', 'bar']}
24+
onChange={(chips) => handleChange(chips)}
25+
/>
26+
27+
// controlled input
28+
<ChipInput
29+
value={yourChips}
30+
onRequestAdd={(chip) => handleAddChip(chip)}
31+
onRequestDelete={(chip) => handleDeleteChip(chip)}
32+
/>
33+
```
34+
35+
## Properties
36+
Coming _very_ soon.
37+
38+
## Credits
39+
The code for the input component was adapted from Material UI's `TextField` that we all know and love.
40+
41+
## License
42+
The scripts included in this repository are licensed under the MIT.

demo.gif

346 KB
Loading

package.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "material-ui-chip-input",
3+
"version": "0.0.0",
4+
"description": "A chip input field using Material-UI.",
5+
"main": "lib/ChipInput.js",
6+
"scripts": {
7+
"build": "babel src -d lib",
8+
"prepublish": "babel src -d lib",
9+
"storybook": "start-storybook -p 6006",
10+
"build-storybook": "build-storybook"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git+https://github.com/TeamWertarbyte/material-ui-chip-input.git"
15+
},
16+
"keywords": [
17+
"react",
18+
"material",
19+
"chip",
20+
"input",
21+
"tags"
22+
],
23+
"author": "Wertarbyte <kontakt@wertarbyte.com> (https://wertarbyte.com)",
24+
"license": "MIT",
25+
"bugs": {
26+
"url": "https://github.com/TeamWertarbyte/material-ui-chip-input/issues"
27+
},
28+
"homepage": "https://github.com/TeamWertarbyte/material-ui-chip-input#readme",
29+
"devDependencies": {
30+
"babel-cli": "^6.14.0",
31+
"babel-core": "^6.8.0",
32+
"babel-preset-es2015": "^6.14.0",
33+
"babel-preset-react": "^6.11.1",
34+
"babel-preset-stage-0": "^6.5.0",
35+
"@kadira/storybook": "^2.5.2"
36+
},
37+
"peerDependencies": {
38+
"material-ui": "~0.15.4",
39+
"react": "~15.3.1"
40+
}
41+
}

0 commit comments

Comments
 (0)