@commercetools-uikit/primary-button
Advanced tools
Comparing version 10.27.1 to 10.30.1
# @commercetools-uikit/primary-button | ||
## 10.30.1 | ||
### Patch Changes | ||
- [`cc40d76`](https://github.com/commercetools/ui-kit/commit/cc40d765fdeff8626a9886e080eab35dad97b805) [#1502](https://github.com/commercetools/ui-kit/pull/1502) Thanks [@renovate](https://github.com/apps/renovate)! - Updated dependencies | ||
* [`db6b77c`](https://github.com/commercetools/ui-kit/commit/db6b77c3baf110136440dfc7c6d42cace74eb85e) [#1492](https://github.com/commercetools/ui-kit/pull/1492) Thanks [@emmenko](https://github.com/emmenko)! - Use ranged versions for emotion dependencies | ||
* Updated dependencies [[`cc40d76`](https://github.com/commercetools/ui-kit/commit/cc40d765fdeff8626a9886e080eab35dad97b805), [`db6b77c`](https://github.com/commercetools/ui-kit/commit/db6b77c3baf110136440dfc7c6d42cace74eb85e)]: | ||
- @commercetools-uikit/accessible-button@10.30.1 | ||
- @commercetools-uikit/text@10.30.1 | ||
- @commercetools-uikit/spacings-inline@10.30.1 | ||
## 10.27.1 | ||
@@ -4,0 +17,0 @@ |
@@ -5,15 +5,23 @@ 'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var PropTypes = _interopDefault(require('prop-types')); | ||
var React = _interopDefault(require('react')); | ||
var isNil = _interopDefault(require('lodash/isNil')); | ||
var omit = _interopDefault(require('lodash/omit')); | ||
var requiredIf = _interopDefault(require('react-required-if')); | ||
var PropTypes = require('prop-types'); | ||
var React = require('react'); | ||
var isNil = require('lodash/isNil'); | ||
var omit = require('lodash/omit'); | ||
var requiredIf = require('react-required-if'); | ||
var core = require('@emotion/core'); | ||
var Inline = _interopDefault(require('@commercetools-uikit/spacings-inline')); | ||
var Inline = require('@commercetools-uikit/spacings-inline'); | ||
var designSystem = require('@commercetools-uikit/design-system'); | ||
var utils = require('@commercetools-uikit/utils'); | ||
var AccessibleButton = _interopDefault(require('@commercetools-uikit/accessible-button')); | ||
var AccessibleButton = require('@commercetools-uikit/accessible-button'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes); | ||
var React__default = /*#__PURE__*/_interopDefaultLegacy(React); | ||
var isNil__default = /*#__PURE__*/_interopDefaultLegacy(isNil); | ||
var omit__default = /*#__PURE__*/_interopDefaultLegacy(omit); | ||
var requiredIf__default = /*#__PURE__*/_interopDefaultLegacy(requiredIf); | ||
var Inline__default = /*#__PURE__*/_interopDefaultLegacy(Inline); | ||
var AccessibleButton__default = /*#__PURE__*/_interopDefaultLegacy(AccessibleButton); | ||
function _defineProperty(obj, key, value) { | ||
@@ -109,7 +117,7 @@ if (key in obj) { | ||
'data-track-component': 'PrimaryButton' | ||
}, utils.filterInvalidAttributes(omit(props, propsToOmit))), {}, { | ||
}, utils.filterInvalidAttributes(omit__default['default'](props, propsToOmit))), {}, { | ||
disabled: props.isDisabled | ||
}); | ||
var isActive = props.isToggleButton && props.isToggled; | ||
return core.jsx(AccessibleButton, { | ||
return core.jsx(AccessibleButton__default['default'], { | ||
as: props.as, | ||
@@ -124,3 +132,3 @@ type: props.type, | ||
css: getButtonStyles(props.isDisabled, isActive, props.tone, props.size) | ||
}, core.jsx(Inline, { | ||
}, core.jsx(Inline__default['default'], { | ||
alignItems: "center", | ||
@@ -130,3 +138,3 @@ scale: "xs" | ||
css: core.css("margin:0 ", designSystem.customProperties.spacingXs, " 0 0;display:flex;align-items:center;justify-content:center;") | ||
}, React.cloneElement(props.iconLeft, { | ||
}, React__default['default'].cloneElement(props.iconLeft, { | ||
color: props.isDisabled ? 'neutral60' : 'surface', | ||
@@ -137,8 +145,8 @@ size: props.size === 'small' ? 'medium' : 'big' | ||
PrimaryButton.propTypes = process.env.NODE_ENV !== "production" ? { | ||
as: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]), | ||
type: PropTypes.oneOf(['submit', 'reset', 'button']), | ||
label: PropTypes.string.isRequired, | ||
buttonAttributes: PropTypes.object, | ||
iconLeft: PropTypes.node, | ||
isToggleButton: PropTypes.bool.isRequired, | ||
as: PropTypes__default['default'].oneOfType([PropTypes__default['default'].string, PropTypes__default['default'].elementType]), | ||
type: PropTypes__default['default'].oneOf(['submit', 'reset', 'button']), | ||
label: PropTypes__default['default'].string.isRequired, | ||
buttonAttributes: PropTypes__default['default'].object, | ||
iconLeft: PropTypes__default['default'].node, | ||
isToggleButton: PropTypes__default['default'].bool.isRequired, | ||
isToggled: function isToggled(props, propName, componentName) { | ||
@@ -150,13 +158,13 @@ for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { | ||
var _PropTypes$bool; | ||
return (_PropTypes$bool = PropTypes.bool).isRequired.apply(_PropTypes$bool, [props, propName, componentName].concat(rest)); | ||
return (_PropTypes$bool = PropTypes__default['default'].bool).isRequired.apply(_PropTypes$bool, [props, propName, componentName].concat(rest)); | ||
} | ||
if (!isNil(props[propName])) return new Error("Invalid prop `".concat(propName, "` supplied to `").concat(componentName, "`. `").concat(propName, "` does not have any effect when the button is not a toggle button.")); | ||
return PropTypes.bool.apply(PropTypes, [props, propName, componentName].concat(rest)); | ||
if (!isNil__default['default'](props[propName])) return new Error("Invalid prop `".concat(propName, "` supplied to `").concat(componentName, "`. `").concat(propName, "` does not have any effect when the button is not a toggle button.")); | ||
return PropTypes__default['default'].bool.apply(PropTypes__default['default'], [props, propName, componentName].concat(rest)); | ||
}, | ||
isDisabled: PropTypes.bool, | ||
onClick: requiredIf(PropTypes.func, function (props) { | ||
isDisabled: PropTypes__default['default'].bool, | ||
onClick: requiredIf__default['default'](PropTypes__default['default'].func, function (props) { | ||
return !props.as; | ||
}), | ||
size: PropTypes.oneOf(['big', 'small']), | ||
tone: PropTypes.oneOf(['urgent', 'primary']) | ||
size: PropTypes__default['default'].oneOf(['big', 'small']), | ||
tone: PropTypes__default['default'].oneOf(['urgent', 'primary']) | ||
} : {}; | ||
@@ -171,5 +179,5 @@ PrimaryButton.defaultProps = { | ||
var version = '10.27.1'; | ||
var version = '10.30.1'; | ||
exports.default = PrimaryButton; | ||
exports.version = version; |
@@ -159,5 +159,5 @@ import PropTypes from 'prop-types'; | ||
var version = '10.27.1'; | ||
var version = '10.30.1'; | ||
export default PrimaryButton; | ||
export { version }; |
{ | ||
"name": "@commercetools-uikit/primary-button", | ||
"version": "10.27.1", | ||
"version": "10.30.1", | ||
"description": "", | ||
@@ -20,11 +20,11 @@ "main": "dist/primary-button.cjs.js", | ||
"dependencies": { | ||
"@commercetools-uikit/accessible-button": "10.27.0", | ||
"@commercetools-uikit/accessible-button": "10.30.1", | ||
"@commercetools-uikit/design-system": "10.18.4", | ||
"@commercetools-uikit/spacings-inline": "10.27.1", | ||
"@commercetools-uikit/text": "10.27.0", | ||
"@commercetools-uikit/spacings-inline": "10.30.1", | ||
"@commercetools-uikit/text": "10.30.1", | ||
"@commercetools-uikit/utils": "10.21.0", | ||
"@emotion/core": "10.0.28", | ||
"@emotion/styled": "10.0.27", | ||
"@emotion/core": "^10.0.34", | ||
"@emotion/styled": "^10.0.27", | ||
"common-tags": "1.8.0", | ||
"lodash": "4.17.19", | ||
"lodash": "4.17.20", | ||
"prop-types": "15.7.2", | ||
@@ -31,0 +31,0 @@ "react-required-if": "1.0.3" |
24183
315
+ Added@commercetools-uikit/accessible-button@10.30.1(transitive)
+ Added@commercetools-uikit/spacings-inline@10.30.1(transitive)
+ Added@commercetools-uikit/text@10.30.1(transitive)
+ Added@emotion/core@10.3.1(transitive)
+ Added@emotion/styled@10.3.0(transitive)
+ Addedlodash@4.17.20(transitive)
- Removed@commercetools-uikit/accessible-button@10.27.0(transitive)
- Removed@commercetools-uikit/spacings-inline@10.27.1(transitive)
- Removed@commercetools-uikit/text@10.27.0(transitive)
- Removed@emotion/core@10.0.28(transitive)
- Removed@emotion/styled@10.0.27(transitive)
- Removedlodash@4.17.19(transitive)
Updated@emotion/core@^10.0.34
Updated@emotion/styled@^10.0.27
Updatedlodash@4.17.20