Skip to content

Commit

Permalink
Merge pull request #25 in FFE/ffe-accordion-react from master_use-pro…
Browse files Browse the repository at this point in the history
…p-types-package to master

* commit '164101e7d52fb0a5c1a8a97ba3e5547da9c24253':
  * Use PropTypes from prop-types package.
  • Loading branch information
orhels committed Sep 6, 2017
2 parents 3fb2e73 + 468053d commit 99de35a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/lib
# Created by https://www.gitignore.io/api/node

.idea

### Node ###
# Logs
logs
Expand Down Expand Up @@ -36,4 +38,4 @@ node_modules
# Optional REPL history
.node_repl_history

example.html
example.html
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v.2.0.3
* Use PropTypes from prop-types package

## v2.0.2
Remove the `--white` modifier classes, since they are now the default.

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffe-accordion-react",
"version": "2.0.2",
"version": "2.0.3",
"main": "lib/index.js",
"scripts": {
"build": "babel -d lib/. --ignore=*.test.js src/. && npm run example",
Expand All @@ -25,6 +25,7 @@
"classnames": "^2.2.5",
"ffe-expandable-react": "^1.0.5",
"ffe-icons-react": "^2.1.0",
"prop-types": "*",
"uuid": "^3.0.1"
},
"devDependencies": {
Expand Down
31 changes: 20 additions & 11 deletions src/accordion-item.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import {
arrayOf,
bool,
func,
node,
number,
oneOf,
string
} from 'prop-types';
import FFEExpandable from 'ffe-expandable-react';
import Chevron from 'ffe-icons-react/chevron-ikon';
import classNames from 'classnames';
Expand Down Expand Up @@ -93,16 +102,16 @@ class AccordionItem extends Component {
}

AccordionItem.propTypes = {
ariaLabel: PropTypes.string,
children: PropTypes.node,
expandedContent: PropTypes.node,
ignoredNodeNames: PropTypes.arrayOf(PropTypes.string),
index: PropTypes.number,
isOpen: PropTypes.bool,
onClose: PropTypes.func,
onOpen: PropTypes.func,
type: PropTypes.oneOf(['blue']),
uuid: PropTypes.string,
ariaLabel: string,
children: node,
expandedContent: node,
ignoredNodeNames: arrayOf(string),
index: number,
isOpen: bool,
onClose: func,
onOpen: func,
type: oneOf(['blue']),
uuid: string,
};

AccordionItem.defaultProps = {
Expand Down
7 changes: 4 additions & 3 deletions src/accordion.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes, cloneElement } from 'react';
import React, { cloneElement } from 'react';
import { node, oneOf } from 'prop-types';
import uuid from 'uuid';

function Accordion(props) {
Expand All @@ -18,8 +19,8 @@ function Accordion(props) {
}

Accordion.propTypes = {
children: PropTypes.node.isRequired,
type: PropTypes.oneOf(['blue']),
children: node.isRequired,
type: oneOf(['blue']),
};

export default Accordion;

0 comments on commit 99de35a

Please sign in to comment.