This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update nodejs versions in Travis configuration (to latest, 6, 5 and 4) * Fix ResponsiveNavigation resize handler leak (#27) * Fix ResponsiveNavigation resize event leak * Use bind instead of class properties * Add accordion component (#30) * Add accordion component * Add missing isActive prop on AccordionContent * Add tests for isActive prop on AccordionContent * Add yarn.lock * Change to use prop-types library * Fix warning in progress bar test * Fix linting errors * Add precommit hook
- Loading branch information
Showing
26 changed files
with
3,907 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import React, { PropTypes } from 'react'; | ||
import { GeneralPropTypes, createClassName, generalClassNames, removeProps, objectKeys } from '../utils'; | ||
|
||
/** | ||
* Accordion component. | ||
* http://foundation.zurb.com/sites/docs/accordion.html | ||
* | ||
* @param {Object} props | ||
* @returns {Object} | ||
*/ | ||
export const Accordion = (props) => { | ||
const className = createClassName( | ||
props.noDefaultClassName ? null : 'accordion', | ||
props.className, | ||
generalClassNames(props) | ||
); | ||
|
||
const passProps = removeProps(props, objectKeys(Accordion.propTypes)); | ||
|
||
return <ul {...passProps} className={className}>{props.children || []}</ul>; | ||
}; | ||
|
||
Accordion.propTypes = { | ||
...GeneralPropTypes, | ||
children: PropTypes.any, | ||
}; | ||
|
||
/** | ||
* Accordion item component. | ||
* | ||
* @param {Object} props | ||
* @returns {Object} | ||
*/ | ||
export const AccordionItem = (props) => { | ||
const className = createClassName( | ||
props.noDefaultClassName ? null : 'accordion-item', | ||
props.className, | ||
{ | ||
'is-active': props.isActive | ||
}, | ||
generalClassNames(props) | ||
); | ||
|
||
const passProps = removeProps(props, objectKeys(AccordionItem.propTypes)); | ||
|
||
return <li {...passProps} className={className}/>; | ||
}; | ||
|
||
AccordionItem.propTypes = { | ||
...GeneralPropTypes, | ||
isActive: PropTypes.bool | ||
}; | ||
|
||
/** | ||
* Accordion panel container component. | ||
* | ||
* @param {Object} props | ||
* @returns {Object} | ||
*/ | ||
export const AccordionContent = (props) => { | ||
const className = createClassName( | ||
props.noDefaultClassName ? null : 'accordion-content', | ||
props.className, | ||
{ | ||
'is-active': props.isActive | ||
}, | ||
generalClassNames(props) | ||
); | ||
|
||
const passProps = removeProps(props, objectKeys(AccordionContent.propTypes)); | ||
|
||
return <div {...passProps} className={className}/>; | ||
}; | ||
|
||
AccordionContent.propTypes = { | ||
...GeneralPropTypes, | ||
isActive: PropTypes.bool | ||
}; | ||
|
||
/** | ||
* Accordion panel title component. | ||
* | ||
* @param {Object} props | ||
* @returns {Object} | ||
*/ | ||
export const AccordionTitle = (props) => { | ||
const className = createClassName( | ||
props.noDefaultClassName ? null : 'accordion-title', | ||
props.className, | ||
generalClassNames(props) | ||
); | ||
|
||
const passProps = removeProps(props, objectKeys(AccordionContent.propTypes)); | ||
|
||
return <a {...passProps} className={className}/>; | ||
}; | ||
|
||
AccordionTitle.propTypes = { | ||
...GeneralPropTypes, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.