travix-ui-kit
Advanced tools
Comparing version 0.6.31 to 0.6.32
# Change Log | ||
## [v0.6.31](https://github.com/Travix-International/travix-ui-kit/tree/v0.6.31) (2017-10-11) | ||
[Full Changelog](https://github.com/Travix-International/travix-ui-kit/compare/v0.6.30...v0.6.31) | ||
**Fixed bugs:** | ||
- Side panel \(close button doesn't work\). js error in safari 9.1 [\#192](https://github.com/Travix-International/travix-ui-kit/issues/192) | ||
**Merged pull requests:** | ||
- Add "className" prop to button [\#199](https://github.com/Travix-International/travix-ui-kit/pull/199) ([mAiNiNfEcTiOn](https://github.com/mAiNiNfEcTiOn)) | ||
- Fixes the demo for the sidepanel [\#198](https://github.com/Travix-International/travix-ui-kit/pull/198) ([RumataDeEstor](https://github.com/RumataDeEstor)) | ||
## [v0.6.30](https://github.com/Travix-International/travix-ui-kit/tree/v0.6.30) (2017-10-04) | ||
@@ -4,0 +16,0 @@ [Full Changelog](https://github.com/Travix-International/travix-ui-kit/compare/v0.6.29...v0.6.30) |
@@ -21,2 +21,3 @@ // Imports | ||
dataAttrs = {}, | ||
...otherProps | ||
} = props; | ||
@@ -45,3 +46,10 @@ const restProps = getDataAttributes(dataAttrs); | ||
return ( | ||
<a className={classes} href={href} {...restProps}>{children}</a> | ||
<a | ||
{...restProps} | ||
{...otherProps} | ||
className={classes} | ||
href={href} | ||
> | ||
{children} | ||
</a> | ||
); | ||
@@ -52,3 +60,11 @@ } | ||
return ( | ||
<button className={classes} disabled={disabled} type={type} {...restProps}>{children}</button> | ||
<button | ||
{...restProps} | ||
{...otherProps} | ||
className={classes} | ||
disabled={disabled} | ||
type={type} | ||
> | ||
{children} | ||
</button> | ||
); | ||
@@ -59,2 +75,4 @@ } | ||
<button | ||
{...restProps} | ||
{...otherProps} | ||
className={classes} | ||
@@ -64,3 +82,2 @@ disabled={disabled} | ||
type="button" | ||
{...restProps} | ||
> | ||
@@ -67,0 +84,0 @@ {children} |
@@ -7,3 +7,5 @@ Basic button: | ||
<Button dataAttrs={{gtm: 'some-id'}} type="reset">With GTM id</Button><br/><br/> | ||
<Button className="my-class">Example with custom class set</Button><br/><br/> | ||
<Button mods={['test']} type="reset">With mode</Button><br/><br/> | ||
<Button mods={['test']} className="my-class">Example with custom class set</Button><br/><br/> | ||
<Button onMouseUp={alert(onMouseUp)}>Example with custom event (onMouseUp)</Button><br/><br/> | ||
</div> | ||
@@ -39,2 +41,1 @@ | ||
</div> | ||
@@ -0,1 +1,2 @@ | ||
import classnames from 'classnames'; | ||
import PropTypes from 'prop-types'; | ||
@@ -43,7 +44,7 @@ import React, { Component } from 'react'; | ||
}; | ||
const classNameItem = getClassNamesWithMods('ui-toggle-button__item', mods); | ||
const classes = getClassNamesWithMods('ui-toggle-button__item', mods); | ||
return ( | ||
<li | ||
className={classNameItem} | ||
className={classes} | ||
key={index} | ||
@@ -60,2 +61,3 @@ onClick={this.handleSelectItem} | ||
const { | ||
className, | ||
mods = [], | ||
@@ -68,6 +70,9 @@ items, | ||
} | ||
const className = getClassNamesWithMods('ui-toggle-button', mods); | ||
const classes = classnames( | ||
getClassNamesWithMods('ui-toggle-button', mods), | ||
className, | ||
); | ||
return ( | ||
<ul className={className}> | ||
<ul className={classes}> | ||
{this.renderItems()} | ||
@@ -85,2 +90,8 @@ </ul> | ||
/** | ||
* Custom className(s) to be concatenated with the default ones | ||
* on the component's root element | ||
*/ | ||
className: PropTypes.string, | ||
/** | ||
* List's elements. | ||
@@ -87,0 +98,0 @@ */ |
@@ -5,2 +5,3 @@ Basic toggleButton: | ||
<ToggleButton items={['Upper deck', 'Lower deck']} handleSelect={(msg) => console.log(msg)} mods={['insurance']} /><br/><br/> | ||
</div> | ||
<ToggleButton className="container-class" items={['Example with', 'Custom Classes']} handleSelect={(msg) => console.log(msg)} /><br/><br/> | ||
</div> |
@@ -7,5 +7,4 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // Imports | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _classnames = require('classnames'); | ||
@@ -27,2 +26,5 @@ | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } // Imports | ||
/** | ||
@@ -41,3 +43,4 @@ * General Button component. Use when you need button or a link that looks like button | ||
_props$dataAttrs = props.dataAttrs, | ||
dataAttrs = _props$dataAttrs === undefined ? {} : _props$dataAttrs; | ||
dataAttrs = _props$dataAttrs === undefined ? {} : _props$dataAttrs, | ||
otherProps = _objectWithoutProperties(props, ['children', 'className', 'size', 'href', 'onClick', 'type', 'variation', 'disabled', 'dataAttrs']); | ||
@@ -64,3 +67,6 @@ var restProps = (0, _helpers.getDataAttributes)(dataAttrs); | ||
'a', | ||
_extends({ className: classes, href: href }, restProps), | ||
_extends({}, restProps, otherProps, { | ||
className: classes, | ||
href: href | ||
}), | ||
children | ||
@@ -73,3 +79,7 @@ ); | ||
'button', | ||
_extends({ className: classes, disabled: disabled, type: type }, restProps), | ||
_extends({}, restProps, otherProps, { | ||
className: classes, | ||
disabled: disabled, | ||
type: type | ||
}), | ||
children | ||
@@ -81,3 +91,3 @@ ); | ||
'button', | ||
_extends({ | ||
_extends({}, restProps, otherProps, { | ||
className: classes, | ||
@@ -87,3 +97,3 @@ disabled: disabled, | ||
type: 'button' | ||
}, restProps), | ||
}), | ||
children | ||
@@ -90,0 +100,0 @@ ); |
@@ -9,2 +9,6 @@ 'use strict'; | ||
var _classnames = require('classnames'); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
var _propTypes = require('prop-types'); | ||
@@ -86,3 +90,3 @@ | ||
}; | ||
var classNameItem = (0, _helpers.getClassNamesWithMods)('ui-toggle-button__item', mods); | ||
var classes = (0, _helpers.getClassNamesWithMods)('ui-toggle-button__item', mods); | ||
@@ -92,3 +96,3 @@ return _react2.default.createElement( | ||
{ | ||
className: classNameItem, | ||
className: classes, | ||
key: index, | ||
@@ -105,2 +109,3 @@ onClick: _this2.handleSelectItem | ||
var _props = this.props, | ||
className = _props.className, | ||
_props$mods = _props.mods, | ||
@@ -114,7 +119,7 @@ mods = _props$mods === undefined ? [] : _props$mods, | ||
} | ||
var className = (0, _helpers.getClassNamesWithMods)('ui-toggle-button', mods); | ||
var classes = (0, _classnames2.default)((0, _helpers.getClassNamesWithMods)('ui-toggle-button', mods), className); | ||
return _react2.default.createElement( | ||
'ul', | ||
{ className: className }, | ||
{ className: classes }, | ||
this.renderItems() | ||
@@ -134,2 +139,8 @@ ); | ||
/** | ||
* Custom className(s) to be concatenated with the default ones | ||
* on the component's root element | ||
*/ | ||
className: _propTypes2.default.string, | ||
/** | ||
* List's elements. | ||
@@ -136,0 +147,0 @@ */ |
{ | ||
"name": "travix-ui-kit", | ||
"version": "0.6.31", | ||
"version": "0.6.32", | ||
"description": "Travix UI kit", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2794046
40144