@ied/badge
Advanced tools
Comparing version 1.0.0-beta.1 to 1.0.0-beta.2
@@ -1,139 +0,2 @@ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(require("react"), require("styled-components")); | ||
else if(typeof define === 'function' && define.amd) | ||
define(["react", "styled-components"], factory); | ||
else { | ||
var a = typeof exports === 'object' ? factory(require("react"), require("styled-components")) : factory(root["react"], root["styled-components"]); | ||
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; | ||
} | ||
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) { | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.l = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = function(module) { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ function getDefault() { return module['default']; } : | ||
/******/ function getModuleExports() { return module; }; | ||
/******/ __webpack_require__.d(getter, 'a', getter); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ | ||
/******/ // Object.prototype.hasOwnProperty.call | ||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _react = _interopRequireWildcard(__webpack_require__(1)); | ||
var _styledComponents = _interopRequireDefault(__webpack_require__(2)); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
const StyledBadge = _styledComponents.default.div` | ||
font-family: Open sans, sans-serif; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: 50%; | ||
background-color: grey; | ||
width: 40px; | ||
height: 40px; | ||
color: white; | ||
font-size: 16px; | ||
`; | ||
class Badge extends _react.Component { | ||
render() { | ||
const { | ||
firstName, | ||
lastName | ||
} = this.props; | ||
const [firstLetter] = firstName; | ||
const [secondLetter] = lastName; | ||
return _react.default.createElement(StyledBadge, null, `${firstLetter}${secondLetter}`); | ||
} | ||
} | ||
exports.default = Badge; | ||
/***/ }), | ||
/* 1 */ | ||
/***/ (function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_1__; | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports) { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE_2__; | ||
/***/ }) | ||
/******/ ]); | ||
}); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("@ied/color"),require("styled-components"),require("prop-types"));else if("function"==typeof define&&define.amd)define(["react","@ied/color","styled-components","prop-types"],t);else{var r="object"==typeof exports?t(require("react"),require("@ied/color"),require("styled-components"),require("prop-types")):t(e.react,e["@ied/color"],e["styled-components"],e["prop-types"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,function(e,t,r,n){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var u,c=e[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}function i(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return o(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=n(r(1)),c=r(2),s=r(3),a=n(r(5)),f=function(e){var t=e.firstName,r=e.lastName,n=i(t,1),o=n[0],a=i(r,1),f=a[0],l=(0,c.getColorFromString)("".concat(t).concat(r));return u.default.createElement(s.Container,{color:l},"".concat(o).concat(f))};f.propTypes={firstName:a.default.string.isRequired,lastName:a.default.string.isRequired};var l=f;t.default=l},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Container=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(r(4)),o=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n font-family: Open sans, sans-serif;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n background-color: ",";\n width: 40px;\n height: 40px;\n color: white;\n font-size: 16px;\n"],["\n font-family: Open sans, sans-serif;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n background-color: ",";\n width: 40px;\n height: 40px;\n color: white;\n font-size: 16px;\n"]),i=n.default.div(o,function(e){return e.color||"grey"});t.Container=i},function(e,t){e.exports=r},function(e,t){e.exports=n}])}); | ||
//# sourceMappingURL=bundle.js.map |
{ | ||
"name": "@ied/badge", | ||
"version": "1.0.0-beta.1", | ||
"version": "1.0.0-beta.2", | ||
"main": "dist/bundle.js", | ||
@@ -9,2 +9,4 @@ "author": "Didier Franc", | ||
"dependencies": { | ||
"@ied/color": "^1.0.0-beta.4", | ||
"prop-types": "^15.6.0", | ||
"react": "^16.2.0", | ||
@@ -21,2 +23,4 @@ "react-dom": "^16.2.0", | ||
"babel-loader": "8.0.0-beta.0", | ||
"babel-plugin-flow-react-proptypes": "^17.1.0", | ||
"flow-bin": "^0.65.0", | ||
"webpack": "^3.10.0", | ||
@@ -27,4 +31,6 @@ "webpack-dev-server": "^2.11.1" | ||
"dev": "webpack-dev-server --config webpack.config.dev.js", | ||
"build": "webpack --config webpack.config.prod.js" | ||
"build": "yarn build:js && yarn build:flow", | ||
"build:js": "webpack --config webpack.config.prod.js", | ||
"build:flow": "flow gen-flow-files src/Badge.js > dist/bundle.js.flow" | ||
} | ||
} |
# Badge | ||
## Install | ||
```js | ||
yarn add @ied/badge | ||
``` | ||
## Use | ||
```js | ||
import Badge from '@ied/badge' | ||
<Badge firstName="Clark" lastName="Kent" /> | ||
``` | ||
## Types | ||
```js | ||
type Props = { | ||
firstName: string, | ||
lastName: string, | ||
} | ||
``` |
Sorry, the diff of this file is not supported yet
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
20366
5
25
5
10
11
3
+ Added@ied/color@^1.0.0-beta.4
+ Addedprop-types@^15.6.0
+ Added@ied/color@1.0.0-beta.6(transitive)