New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cf-component-button

Package Overview
Dependencies
Maintainers
9
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-component-button - npm Package Compare versions

Comparing version 2.2.3 to 3.0.0

54

lib/Button.js
'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -18,30 +20,33 @@

return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
return _possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).apply(this, arguments));
}
Button.prototype.render = function render() {
var _props = this.props;
var disabled = _props.disabled;
var loading = _props.loading;
_createClass(Button, [{
key: 'render',
value: function render() {
var _props = this.props,
disabled = _props.disabled,
loading = _props.loading;
var type = this.props.submit ? 'submit' : 'button';
var className = 'cf-btn cf-btn--' + this.props.type;
var type = this.props.submit ? 'submit' : 'button';
var className = 'cf-btn cf-btn--' + this.props.type;
if (loading) {
className += ' cf-btn--loading';
}
if (loading) {
className += ' cf-btn--loading';
}
// Unless the disabled state is explicitly set, the button is disabled when loading.
var isDisabled = (disabled !== undefined ? disabled : loading) || false;
// Unless the disabled state is explicitly set, the button is disabled when loading.
var isDisabled = (disabled !== undefined ? disabled : loading) || false;
return React.createElement(
'button',
{
type: type,
className: className,
disabled: isDisabled,
onClick: this.props.onClick },
this.props.children
);
};
return React.createElement(
'button',
{
type: type,
className: className,
disabled: isDisabled,
onClick: this.props.onClick },
this.props.children
);
}
}]);

@@ -56,4 +61,6 @@ return Button;

disabled: PropTypes.bool,
loading: PropTypes.bool
loading: PropTypes.bool,
children: PropTypes.node
};
Button.defaultProps = {

@@ -63,4 +70,3 @@ type: 'default',

};
;
module.exports = Button;
'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -10,2 +12,3 @@

var React = require('react');
var PropTypes = React.PropTypes;

@@ -18,12 +21,15 @@ var ButtonGroup = function (_React$Component) {

return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
return _possibleConstructorReturn(this, (ButtonGroup.__proto__ || Object.getPrototypeOf(ButtonGroup)).apply(this, arguments));
}
ButtonGroup.prototype.render = function render() {
return React.createElement(
'div',
{ className: 'cf-btn__group' },
this.props.children
);
};
_createClass(ButtonGroup, [{
key: 'render',
value: function render() {
return React.createElement(
'div',
{ className: 'cf-btn__group' },
this.props.children
);
}
}]);

@@ -33,4 +39,6 @@ return ButtonGroup;

;
ButtonGroup.propTypes = {
children: PropTypes.node
};
module.exports = ButtonGroup;
{
"name": "cf-component-button",
"description": "CloudFlare Button Component",
"version": "2.2.3",
"version": "3.0.0",
"main": "lib/index.js",

@@ -12,8 +12,8 @@ "author": "James Kyle <jkyle@cloudflare.com>",

"dependencies": {
"react": "^0.14.2"
"react": "^0.14.2 || ^15.0.0-0"
},
"devDependencies": {
"assert-equal-jsx": "^1.0.0",
"react-dom": "^0.14.2"
"react-dom": "^15.0.0-0"
}
}

@@ -21,7 +21,8 @@ # cf-component-button

export default class Application extends React.Component {
handleButtonOneClick = () => {
handleButtonOneClick() {
// clicked...
};
handleButtonTwoClick = () => {
handleButtonTwoClick() {
// clicked...

@@ -34,6 +35,6 @@ };

<ButtonGroup>
<Button type="primary" onClick={this.handleButtonOneClick}>
<Button type="primary" onClick={this.handleButtonOneClick.bind(this)}>
Button One
</Button>
<Button type="primary" onClick={this.handleButtonTwoClick}>
<Button type="primary" onClick={this.handleButtonTwoClick.bind(this)}>
Button Two

@@ -40,0 +41,0 @@ </Button>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc