react-alerts
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -1,153 +0,95 @@ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(require("React")); | ||
else if(typeof define === 'function' && define.amd) | ||
define(["React"], factory); | ||
else if(typeof exports === 'object') | ||
exports["ReactAlerts"] = factory(require("React")); | ||
else | ||
root["ReactAlerts"] = factory(root["React"]); | ||
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
(function (global, factory) { | ||
if (typeof define === "function" && define.amd) { | ||
define('ReactAlerts', ['exports', 'react'], factory); | ||
} else if (typeof exports !== "undefined") { | ||
factory(exports, require('react')); | ||
} else { | ||
var mod = { | ||
exports: {} | ||
}; | ||
factory(mod.exports, global.react); | ||
global.ReactAlerts = mod.exports; | ||
} | ||
})(this, function (exports, _react) { | ||
'use strict'; | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) | ||
/******/ return installedModules[moduleId].exports; | ||
var _react2 = _interopRequireDefault(_react); | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ }; | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : { | ||
default: obj | ||
}; | ||
} | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
var _extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
return target; | ||
}; | ||
function _objectWithoutProperties(obj, keys) { | ||
var target = {}; | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
for (var i in obj) { | ||
if (keys.indexOf(i) >= 0) continue; | ||
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; | ||
target[i] = obj[i]; | ||
} | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
return target; | ||
} | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
var ReactAlerts = _react2.default.createClass({ | ||
displayName: 'ReactAlerts', | ||
propTypes: { | ||
alertStyle: _react2.default.PropTypes.oneOf(['info', 'success', 'warning', 'danger']), | ||
className: _react2.default.PropTypes.string, | ||
dismissable: _react2.default.PropTypes.bool, | ||
onDismiss: _react2.default.PropTypes.func | ||
}, | ||
getDefaultProps: function getDefaultProps() { | ||
return { | ||
alertStyle: 'info', | ||
className: '', | ||
dismissable: true, | ||
onDismiss: function onDismiss() {} | ||
}; | ||
}, | ||
render: function render() { | ||
var _props = this.props; | ||
var className = _props.className; | ||
var alertStyle = _props.alertStyle; | ||
var children = _props.children; | ||
var dismissable = _props.dismissable; | ||
var onDismiss = _props.onDismiss; | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
var props = _objectWithoutProperties(_props, ['className', 'alertStyle', 'children', 'dismissable', 'onDismiss']); | ||
'use strict'; | ||
className += ' react-alerts react-alerts-' + alertStyle; | ||
if (dismissable) className += ' react-alerts-dismissable'; | ||
return _react2.default.createElement('div', _extends({}, props, { | ||
className: className | ||
}), dismissable && _react2.default.createElement('button', { | ||
type: 'button', | ||
className: 'close', | ||
onClick: onDismiss | ||
}, '×'), children); | ||
} | ||
}); | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
ReactAlerts.version = '0.1.0'; | ||
exports.default = ReactAlerts; | ||
}); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _react = __webpack_require__(1); | ||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
/** | ||
* A React component for displaying pretty alert banners. | ||
*/ | ||
var ReactAlerts = _react2.default.createClass({ | ||
displayName: 'ReactAlerts', | ||
propTypes: { | ||
/** | ||
* Specify the type of alert style. | ||
* | ||
* defaults to "info" | ||
*/ | ||
alertStyle: _react2.default.PropTypes.oneOf(['info', 'success', 'warning', 'danger']), | ||
/** | ||
* The css class name of the root element. | ||
*/ | ||
className: _react2.default.PropTypes.string, | ||
/** | ||
* When `true` allows the user to dismiss the alert. When a user dismisses | ||
* an alert, the `onDismiss` function will be executed. | ||
*/ | ||
dismissable: _react2.default.PropTypes.bool, | ||
/** | ||
* Fires when a user clicks on the dismiss button. | ||
*/ | ||
onDismiss: _react2.default.PropTypes.func | ||
}, | ||
getDefaultProps: function getDefaultProps() { | ||
return { | ||
alertStyle: 'info', | ||
className: '', | ||
dismissable: true, | ||
onDismiss: function onDismiss() {} | ||
}; | ||
}, | ||
render: function render() { | ||
var _props = this.props; | ||
var className = _props.className; | ||
var alertStyle = _props.alertStyle; | ||
var children = _props.children; | ||
var dismissable = _props.dismissable; | ||
var onDismiss = _props.onDismiss; | ||
var props = _objectWithoutProperties(_props, ['className', 'alertStyle', 'children', 'dismissable', 'onDismiss']); | ||
className += ' react-alerts react-alerts-' + alertStyle; | ||
if (dismissable) className += ' react-alerts-dismissable'; | ||
return _react2.default.createElement( | ||
'div', | ||
_extends({}, props, { className: className }), | ||
dismissable && _react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'close', onClick: onDismiss }, | ||
'×' | ||
), | ||
children | ||
); | ||
} | ||
}); | ||
ReactAlert.version = '0.1.0'; | ||
exports.default = ReactAlerts; | ||
/***/ }, | ||
/* 1 */ | ||
/***/ function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_1__; | ||
/***/ } | ||
/******/ ]) | ||
}); | ||
; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define(["React"],t):"object"==typeof exports?exports.ReactAlerts=t(require("React")):e.ReactAlerts=t(e.React)}(this,function(e){return function(e){function t(s){if(r[s])return r[s].exports;var a=r[s]={exports:{},id:s,loaded:!1};return e[s].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){var r={};for(var s in e)t.indexOf(s)>=0||Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s]);return r}var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e};Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),l=s(o),i=l["default"].createClass({displayName:"ReactAlerts",propTypes:{alertStyle:l["default"].PropTypes.oneOf(["info","success","warning","danger"]),className:l["default"].PropTypes.string,dismissable:l["default"].PropTypes.bool,onDismiss:l["default"].PropTypes.func},getDefaultProps:function(){return{alertStyle:"info",className:"",dismissable:!0,onDismiss:function(){}}},render:function(){var e=this.props,t=e.className,r=e.alertStyle,s=e.children,o=e.dismissable,i=e.onDismiss,c=a(e,["className","alertStyle","children","dismissable","onDismiss"]);return t+=" react-alerts react-alerts-"+r,o&&(t+=" react-alerts-dismissable"),l["default"].createElement("div",n({},c,{className:t}),o&&l["default"].createElement("button",{type:"button",className:"close",onClick:i},"×"),s)}});ReactAlert.version="0.1.0",t["default"]=i},function(t,r){t.exports=e}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactAlerts=t(require("react")):e.ReactAlerts=t(e.React)}(this,function(e){return function(e){function t(s){if(r[s])return r[s].exports;var a=r[s]={exports:{},id:s,loaded:!1};return e[s].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){var r={};for(var s in e)t.indexOf(s)>=0||Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s]);return r}var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e};Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),l=s(o),i=l["default"].createClass({displayName:"ReactAlerts",propTypes:{alertStyle:l["default"].PropTypes.oneOf(["info","success","warning","danger"]),className:l["default"].PropTypes.string,dismissable:l["default"].PropTypes.bool,onDismiss:l["default"].PropTypes.func},getDefaultProps:function(){return{alertStyle:"info",className:"",dismissable:!0,onDismiss:function(){}}},render:function(){var e=this.props,t=e.className,r=e.alertStyle,s=e.children,o=e.dismissable,i=e.onDismiss,c=a(e,["className","alertStyle","children","dismissable","onDismiss"]);return t+=" react-alerts react-alerts-"+r,o&&(t+=" react-alerts-dismissable"),l["default"].createElement("div",n({},c,{className:t}),o&&l["default"].createElement("button",{type:"button",className:"close",onClick:i},"×"),s)}});i.version="0.1.0",t["default"]=i,e.exports=t["default"]},function(t,r){t.exports=e}])}); |
{ | ||
"name": "react-alerts", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A simple react component for displaying Alert banners.", | ||
"main": "dist/react-alerts.js", | ||
"scripts": { | ||
"build": "NODE_ENV=development && webpack", | ||
"deploy": "NODE_ENV=production && webpack -p", | ||
"build": "babel --plugins transform-es2015-modules-umd --module-id ReactAlerts -m umd src/index.js > dist/react-alerts.js", | ||
"deploy": "NODE_ENV=production webpack -p", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
@@ -27,10 +27,15 @@ "watch": "webpack --progress --colors --watch" | ||
"devDependencies": { | ||
"babel-core": "^6.4.0", | ||
"babel-loader": "^6.2.1", | ||
"babel-plugin-syntax-object-rest-spread": "^6.3.13", | ||
"babel-preset-es2015": "^6.3.13", | ||
"babel-preset-react": "^6.3.13", | ||
"react": "^0.14.6", | ||
"webpack": "^1.12.11" | ||
"babel": "6.3.26", | ||
"babel-cli": "6.4.0", | ||
"babel-core": "6.4.0", | ||
"babel-loader": "6.2.1", | ||
"babel-plugin-add-module-exports": "0.1.2", | ||
"babel-plugin-syntax-object-rest-spread": "6.3.13", | ||
"babel-plugin-transform-es2015-modules-umd": "6.4.3", | ||
"babel-preset-es2015": "6.3.13", | ||
"babel-preset-react": "6.3.13", | ||
"babel-preset-stage-0": "6.3.13", | ||
"react": "0.14.6", | ||
"webpack": "1.12.11" | ||
} | ||
} |
@@ -69,4 +69,4 @@ import React from 'react'; | ||
ReactAlert.version = '0.1.0'; | ||
ReactAlerts.version = '0.1.0'; | ||
export default ReactAlerts; |
@@ -9,3 +9,3 @@ var path = require('path'); | ||
} else { | ||
entry["react-alerts"] = './src/index.js'; | ||
entry["react-alerts.dev"] = './src/index.js'; | ||
} | ||
@@ -15,4 +15,8 @@ | ||
externals: { | ||
"classnames": "classNames", | ||
"react": "React" | ||
react: { | ||
root: 'React', | ||
commonjs: 'react', | ||
commonjs2: 'react', | ||
amd: 'react' | ||
} | ||
}, | ||
@@ -44,4 +48,9 @@ | ||
query: { | ||
presets: ['es2015', 'react'], | ||
presets: [ | ||
'es2015', | ||
'react', | ||
'stage-0' | ||
], | ||
plugins: [ | ||
'add-module-exports', | ||
'syntax-object-rest-spread' | ||
@@ -48,0 +57,0 @@ ] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10
13597
12
290