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

bpk-component-button

Package Overview
Dependencies
Maintainers
1
Versions
562
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpk-component-button - npm Package Compare versions

Comparing version 1.0.11 to 1.0.13-alpha.273912ea

dist/BpkButton.css

5

index.js

@@ -1,3 +0,2 @@

import component from './src/BpkButton'
export default component
require('./dist/BpkButton.css')
module.exports = require('./dist/BpkButton.js')
{
"name": "bpk-component-button",
"version": "1.0.11",
"version": "1.0.13-alpha.273912ea",
"description": "Backpack button component.",
"main": "index.js",
"scripts": {
"build:sass": "node-sass src -o dist --importer=./../../scripts/node_sass_tilde_importer.js",
"build:js": "babel src --out-dir dist --ignore test.js ",
"build": "npm run build:js && npm run build:sass"
},
"repository": {

@@ -16,4 +21,5 @@ "type": "git",

"dependencies": {
"bpk-mixins": "^3.0.0"
"bpk-mixins": "^3.1.1-alpha.273912ea",
"react-themeable": "^1.1.0"
}
}

59

src/BpkButton.js
import React, { PropTypes } from 'react'
import './bpk-button.scss'
import themeable from 'react-themeable'
const BpkButton = ({
children,
disabled,
href,
submit,
secondary,
selected,
large,
link,
onClick
}) => {
const classNames = [ 'bpk-button' ]
const defaultTheme = {
'button': 'bpk-button',
'secondary': 'bpk-button--secondary',
'selected': 'bpk-button--selected',
'large': 'bpk-button--large',
'link': 'bpk-button--link'
}
secondary ? classNames.push('bpk-button--secondary') : null
selected ? classNames.push('bpk-button--selected') : null
large ? classNames.push('bpk-button--large') : null
link ? classNames.push('bpk-button--link') : null
const BpkButton = (props) => {
const theme = themeable(props.theme)
const themeNames = [ 'button' ]
const className = classNames.join(' ')
props.secondary ? themeNames.push('secondary') : null
props.selected ? themeNames.push('selected') : null
props.large ? themeNames.push('large') : null
props.link ? themeNames.push('link') : null
if (href) {
if (props.href) {
return <a
href={href}
className={className}
children={children}
onClick={onClick}
href={props.href}
children={props.children}
onClick={props.onClick}
{...theme(1, ...themeNames)}
/>

@@ -34,7 +31,7 @@ }

return <button
type={submit ? 'submit' : 'button'}
disabled={disabled}
className={className}
children={children}
onClick={onClick}
type={props.submit ? 'submit' : 'button'}
disabled={props.disabled}
children={props.children}
onClick={props.onClick}
{...theme(1, ...themeNames)}
/>

@@ -55,3 +52,4 @@ }

link: PropTypes.bool,
onClick: PropTypes.func
onClick: PropTypes.func,
theme: PropTypes.object
}

@@ -67,5 +65,6 @@

link: false,
onClick: null
onClick: null,
theme: defaultTheme
}
export default BpkButton
import React from 'react'
import { storiesOf, action } from '@kadira/storybook'
import BpkButton from './index'
import './src/BpkButton.scss'
import BpkButton from './src/BpkButton'

@@ -6,0 +7,0 @@ storiesOf('bpk-component-button', module)

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