@eaze/accordion
Advanced tools
Comparing version 1.0.9 to 1.1.0
@@ -19,4 +19,2 @@ 'use strict'; | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -30,2 +28,5 @@ | ||
var defaultCaretColor = '#373838'; | ||
var defaultFontColor = '#000'; | ||
var AccordionElement = function (_PureComponent) { | ||
@@ -62,5 +63,7 @@ _inherits(AccordionElement, _PureComponent); | ||
var _props = this.props, | ||
caretColor = _props.caretColor, | ||
children = _props.children, | ||
buttonContent = _props.buttonContent, | ||
buttonClass = _props.buttonClass; | ||
buttonClass = _props.buttonClass, | ||
fontColor = _props.fontColor; | ||
@@ -73,3 +76,3 @@ | ||
{ | ||
className: 'jsx-1298011311' | ||
className: _style2.default.dynamic([['1127797005', [fontColor]]]) | ||
}, | ||
@@ -80,3 +83,3 @@ _react2.default.createElement( | ||
onClick: this.toggleContent, | ||
className: 'jsx-1298011311' + ' ' + (buttonClass || '') | ||
className: _style2.default.dynamic([['1127797005', [fontColor]]]) + ' ' + (buttonClass || '') | ||
}, | ||
@@ -91,3 +94,3 @@ _react2.default.createElement( | ||
xmlnsXlink: 'http://www.w3.org/1999/xlink', | ||
className: 'jsx-1298011311' | ||
className: _style2.default.dynamic([['1127797005', [fontColor]]]) | ||
}, | ||
@@ -98,10 +101,11 @@ _react2.default.createElement( | ||
transform: caretDirection, | ||
stroke: '#373838', | ||
strokeWidth: '1.5', | ||
stroke: caretColor | ||
// TODO: consider making this a prop similar to above and calculate svg width and height based on the value ( the tag component does this for example ) | ||
, strokeWidth: 1.5, | ||
fill: 'none', | ||
fillRule: 'evenodd', | ||
strokeLinecap: 'round', | ||
className: 'jsx-1298011311' | ||
className: _style2.default.dynamic([['1127797005', [fontColor]]]) | ||
}, | ||
_react2.default.createElement('path', { d: 'M0 0l9 9m0 0l-9 8.485', className: 'jsx-1298011311' | ||
_react2.default.createElement('path', { d: 'M0 0l9 9m0 0l-9 8.485', className: _style2.default.dynamic([['1127797005', [fontColor]]]) | ||
}) | ||
@@ -114,4 +118,5 @@ ) | ||
_react2.default.createElement(_style2.default, { | ||
styleId: '1298011311', | ||
css: ['.button.jsx-1298011311{padding:0;width:100%;border:none;background-color:#FFFFFF;color:#000000;font-size:1rem;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}'] | ||
styleId: '1127797005', | ||
css: ['.button.__jsx-style-dynamic-selector{padding:0;width:100%;border:none;background-color:transparent;color:' + fontColor + ';font-size:1rem;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}'], | ||
dynamic: [fontColor] | ||
}) | ||
@@ -126,9 +131,13 @@ ); | ||
AccordionElement.propTypes = { | ||
buttonClass: _propTypes2.default.string, | ||
buttonContent: _propTypes2.default.node, | ||
children: _propTypes2.default.node | ||
buttonClass: _propTypes.string, | ||
buttonContent: _propTypes.node, | ||
caretColor: _propTypes.string, | ||
children: _propTypes.node, | ||
fontColor: _propTypes.string | ||
}; | ||
AccordionElement.defaultProps = { | ||
buttonClass: 'button' | ||
buttonClass: 'button', | ||
caretColor: defaultCaretColor, | ||
fontColor: defaultFontColor | ||
}; | ||
exports.default = AccordionElement; |
{ | ||
"name": "@eaze/accordion", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "React components: AccordionElement", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
import React, { PureComponent } from 'react' | ||
import PropTypes from 'prop-types' | ||
import {node, string} from 'prop-types' | ||
const defaultCaretColor = '#373838' | ||
const defaultFontColor = '#000' | ||
export default class AccordionElement extends PureComponent { | ||
static propTypes = { | ||
buttonClass: PropTypes.string, | ||
buttonContent: PropTypes.node, | ||
children: PropTypes.node | ||
buttonClass: string, | ||
buttonContent: node, | ||
caretColor: string, | ||
children: node, | ||
fontColor: string | ||
} | ||
static defaultProps = { | ||
buttonClass: 'button' | ||
buttonClass: 'button', | ||
caretColor: defaultCaretColor, | ||
fontColor: defaultFontColor | ||
} | ||
@@ -30,5 +37,7 @@ | ||
const { | ||
caretColor, | ||
children, | ||
buttonContent, | ||
buttonClass | ||
buttonClass, | ||
fontColor | ||
} = this.props | ||
@@ -55,4 +64,5 @@ | ||
transform={caretDirection} | ||
stroke='#373838' | ||
strokeWidth='1.5' | ||
stroke={caretColor} | ||
// TODO: consider making this a prop similar to above and calculate svg width and height based on the value ( the tag component does this for example ) | ||
strokeWidth={1.5} | ||
fill='none' | ||
@@ -73,4 +83,4 @@ fillRule='evenodd' | ||
border: none; | ||
background-color: #FFFFFF; | ||
color: #000000; | ||
background-color: transparent; | ||
color: ${fontColor}; | ||
font-size: 1rem; | ||
@@ -80,2 +90,3 @@ cursor: pointer; | ||
align-items: center; | ||
user-select: none; | ||
} | ||
@@ -82,0 +93,0 @@ `}</style> |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
13544
315
1