Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cf-component-button

Package Overview
Dependencies
Maintainers
8
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.1.2 to 2.2.0

21

lib/Button.js

@@ -7,9 +7,21 @@ 'use strict';

function Button(props) {
var disabled = props.disabled;
var loading = props.loading;
var type = props.submit ? 'submit' : 'button';
var className = 'cf-btn cf-btn--' + props.type;
if (loading) {
className += ' cf-btn--loading';
}
// Unless the disabled state is explicitly set, the button is disabled when loading.
var isDisabled = disabled ? loading : disabled;
return React.createElement(
'button',
{
type: type,
className: className,
disabled: props.disabled,
disabled: isDisabled,
onClick: props.onClick },

@@ -22,7 +34,10 @@ props.children

onClick: PropTypes.func.isRequired,
submit: PropTypes.bool,
type: PropTypes.oneOf(['default', 'primary', 'success', 'warning', 'error']).isRequired,
disabled: PropTypes.bool
disabled: PropTypes.bool,
loading: PropTypes.bool
};
Button.defaultProps = {
type: 'default'
type: 'default',
submit: false
};

@@ -29,0 +44,0 @@ ;

2

package.json
{
"name": "cf-component-button",
"description": "CloudFlare Button Component",
"version": "2.1.2",
"version": "2.2.0",
"main": "lib/index.js",

@@ -6,0 +6,0 @@ "author": "James Kyle <jkyle@cloudflare.com>",

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