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

bee-badge

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bee-badge - npm Package Compare versions

Comparing version 0.0.4 to 0.1.0

build/Badge.js

3

demo/BadgeDemo.js

@@ -14,2 +14,5 @@ import Badge from '../src';

<h2>不同背景的徽章</h2>
<div className="margin-right-20 inline" clsPrefix = "ahua">
<Badge colors="primary">a</Badge>
</div>
<div className="margin-right-20 inline">

@@ -16,0 +19,0 @@ <Badge colors="primary">a</Badge>

@@ -1,3 +0,33 @@

import Demo from './BadgeDemo';
import Badge from '../src';
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(<Demo/>, document.getElementById('tinperBeeDemo'));
function demo1() {
return (
<div className="demo-badge">
<Badge colors="primary">primary</Badge>
<Badge colors="info">info</Badge>
<Badge colors="dark">dark</Badge>
<Badge colors="success">success</Badge>
<Badge colors="warning">warning</Badge>
<Badge colors="danger">danger</Badge>
</div>
);
}
function demo2() {
return (
<div className="demo-badge">
<Badge colors="primary">
<i className="uf uf-bellmusicaltool"></i>
</Badge>
<Badge colors="info">
<i className="uf uf-femalesilhouette"></i>
</Badge>
</div>
);
}
ReactDOM.render(demo1(), document.getElementById('ReactBadgeDemo1'));
ReactDOM.render(demo2(), document.getElementById('ReactBadgeDemo2'));

12

package.json
{
"name": "bee-badge",
"version": "0.0.4",
"version": "0.1.0",
"description": "bee-badge ui component for react",

@@ -32,7 +32,11 @@ "keywords": [

"browsers": "bee-tools run browsers",
"pub": "bee-tools run pub"
"pub": "bee-tools run pub",
"coveralls": "bee-tools run coverage"
},
"dependencies": {
"bee-input-group": "0.0.4",
"bee-input-group-addon": "0.0.5",
"bee-input-group-button": "0.0.5",
"classnames": "^2.2.5",
"tinper-bee-core": "0.0.6"
"tinper-bee-core": "latest"
},

@@ -43,3 +47,3 @@ "devDependencies": {

"react": "~0.14.0",
"react-addons-test-utils": "^15.3.2",
"react-addons-test-utils": "15.3.2",
"react-dom": "~0.14.0",

@@ -46,0 +50,0 @@ "console-polyfill": "~0.2.1",

# bee-badge
[![npm version](https://img.shields.io/npm/v/bee-badge.svg)](https://www.npmjs.com/package/bee-badge)
[![Build Status](https://img.shields.io/travis/tinper-bee/generator-tinper-bee/master.svg)](https://travis-ci.org/tinper-bee/bee-badge)
[![devDependency Status](https://img.shields.io/david/dev/tinper-bee/bee-badge.svg)](https://david-dm.org/tinper-bee/bee-badge#info=devDependencies)
[![Build Status](https://img.shields.io/travis/tinper-bee/bee-badge/master.svg)](https://travis-ci.org/tinper-bee/bee-badge)
[![Coverage Status](https://coveralls.io/repos/github/tinper-bee/bee-badge/badge.svg?branch=master)](https://coveralls.io/github/tinper-bee/bee-badge?branch=master)

@@ -47,5 +47,5 @@

import "./node_modules/build/bee-badge.css"
```
## API

@@ -52,0 +52,0 @@ |参数|说明|类型|默认值|

@@ -5,9 +5,9 @@ import React, { PropTypes } from 'react';

/**
* @title badge 默认显示内容1
* badge 默认显示内容1
*/
const defaultProps = {
children: "1"
children: "1",
clsPrefix: 'u-badge'
};
const clsPrefix = 'u-badge';

@@ -19,3 +19,3 @@ class Badge extends React.Component {

render(){
let {colors,className,children, ...others} = this.props;
let {colors,className,children,clsPrefix, ...others} = this.props;
let clsObj = {};

@@ -26,3 +26,3 @@ if(className){

/**
* @title 以u-badge起头的颜色类判断
* 以u-badge起头的颜色类判断
*/

@@ -29,0 +29,0 @@ if(colors){

@@ -6,3 +6,3 @@ import React from 'react';

describe('Enzyme Shallow', function() {
describe('Badge test', function() {
it('Badge should be exist', function() {

@@ -12,2 +12,22 @@ let badge = shallow(<Badge/>);

})
it('primary Badge should be exist', function() {
let badge = shallow(<Badge colors="primary"/>);
expect(badge.hasClass('u-badge-primary')).to.equal(true);
})
it('info Badge should be exist', function() {
let badge = shallow(<Badge colors="info"/>);
expect(badge.hasClass('u-badge-info')).to.equal(true);
})
it('dark Badge should be exist', function() {
let badge = shallow(<Badge colors="dark"/>);
expect(badge.hasClass('u-badge-dark')).to.equal(true);
})
it('danger Badge should be exist', function() {
let badge = shallow(<Badge colors="danger"/>);
expect(badge.hasClass('u-badge-danger')).to.equal(true);
})
it('warning Badge should be exist', function() {
let badge = shallow(<Badge colors="warning"/>);
expect(badge.hasClass('u-badge-warning')).to.equal(true);
})
})

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 not supported yet

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