@propellerads/badge 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/badge.cjs.development.js +2 -2
- package/dist/badge.cjs.development.js.map +1 -1
- package/dist/badge.cjs.production.min.js +1 -1
- package/dist/badge.cjs.production.min.js.map +1 -1
- package/dist/badge.esm.js +3 -3
- package/dist/badge.esm.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/types.d.ts +1 -1
- package/package.json +10 -10
- package/src/index.tsx +16 -16
- package/src/style.tsx +3 -3
- package/src/types.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -104,7 +104,7 @@ function _templateObject2() {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
function _templateObject() {
|
|
107
|
-
var data = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n padding: 0 ", "px;\n text-transform: uppercase;\n color: ", ";\n border-radius:
|
|
107
|
+
var data = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n padding: 0 ", "px;\n text-transform: uppercase;\n color: ", ";\n border-radius: ", "px;\n font-size: 10px;\n line-height: 1.5;\n min-height: 16px;\n \n // Color\n ", "\n \n ", "\n \n ", "\n \n ", "\n \n // Have priority\n ", "\n"]);
|
|
108
108
|
|
|
109
109
|
_templateObject = function _templateObject() {
|
|
110
110
|
return data;
|
|
@@ -117,7 +117,7 @@ var getCustomStyle = function getCustomStyle(props) {
|
|
|
117
117
|
return _extends({}, props);
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
var StyledBadgeContainer = /*#__PURE__*/styled__default.div( /*#__PURE__*/_templateObject(), style.spacing, style.white, function (props) {
|
|
120
|
+
var StyledBadgeContainer = /*#__PURE__*/styled__default.div( /*#__PURE__*/_templateObject(), style.spacing, style.white, style.borderRadius / 2, function (props) {
|
|
121
121
|
return props.type === exports.BADGE_TYPE.INFO && styled.css(_templateObject2(), style.actionColor);
|
|
122
122
|
}, function (props) {
|
|
123
123
|
return props.type === exports.BADGE_TYPE.WARNING && styled.css(_templateObject3(), style.warningColor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.cjs.development.js","sources":["../src/types.ts","../src/style.tsx","../src/index.tsx"],"sourcesContent":["import React from
|
|
1
|
+
{"version":3,"file":"badge.cjs.development.js","sources":["../src/types.ts","../src/style.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport enum BADGE_TYPE {\n INFO = 'info',\n WARNING = 'warning',\n DANGER = 'danger',\n SUCCESS = 'success',\n}\n\nexport interface CustomStyle {\n color?: string\n background?: string\n}\n\nexport interface BadgeProps {\n label?: React.ReactChildren | string | React.ComponentElement<any, any>\n type?: BADGE_TYPE,\n customStyle?: CustomStyle,\n icon?: React.ComponentElement<any, any>\n}\n\nexport default class Badge extends React.Component<BadgeProps> {}\n","import styled, {css} from 'styled-components';\nimport * as style from '@propellerads/stylevariables';\n\nimport {BADGE_TYPE, CustomStyle} from './types';\n\nconst getCustomStyle = (props: CustomStyle) => ({...props});\n\ninterface StyledBadgeContainerProps {\n type: BADGE_TYPE\n customStyle: CustomStyle\n}\n\nconst StyledBadgeContainer = styled.div`\n display: inline-flex;\n align-items: center;\n padding: 0 ${style.spacing}px;\n text-transform: uppercase;\n color: ${style.white};\n border-radius: ${style.borderRadius / 2}px;\n font-size: 10px;\n line-height: 1.5;\n min-height: 16px;\n \n // Color\n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.INFO && css`\n background-color: ${style.actionColor};\n `}\n \n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.WARNING && css`\n background-color: ${style.warningColor};\n `}\n \n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.DANGER && css`\n background-color: ${style.errorColor};\n `}\n \n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.SUCCESS && css`\n background-color: ${style.successColor};\n `}\n \n // Have priority\n ${(props: StyledBadgeContainerProps) => Boolean(Object.values(props.customStyle).length) && css`\n ${getCustomStyle(props.customStyle)},\n `}\n`;\n\nconst StyledBadgeIcon = styled.span`\n margin-right: ${style.spacing}px;\n display: flex;\n align-items: center;\n`;\n\nexport {StyledBadgeContainer, StyledBadgeIcon};\n","import React from 'react';\n\nimport {StyledBadgeContainer, StyledBadgeIcon} from './style';\nimport {BADGE_TYPE, BadgeProps, CustomStyle} from './types';\n\nconst Badge = ({\n label = '',\n type = BADGE_TYPE.INFO,\n customStyle = {},\n icon = undefined,\n}: BadgeProps) => (\n <StyledBadgeContainer type={type} customStyle={customStyle}>\n {icon && (\n <StyledBadgeIcon>\n {icon}\n </StyledBadgeIcon>\n )}\n {label}\n </StyledBadgeContainer>\n);\n\nexport default Badge;\nexport {BADGE_TYPE, CustomStyle};\n"],"names":["BADGE_TYPE","getCustomStyle","props","StyledBadgeContainer","styled","div","style","type","INFO","css","WARNING","DANGER","SUCCESS","Boolean","Object","values","customStyle","length","StyledBadgeIcon","span","Badge","label","icon","undefined","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,WAAYA;AACRA,EAAAA,kBAAA,SAAA;AACAA,EAAAA,qBAAA,YAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,qBAAA,YAAA;AACH,CALD,EAAYA,kBAAU,KAAVA,kBAAU,KAAA,CAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACGA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,KAAD;AAAA,sBAA6BA,KAA7B;AAAA,CAAvB;;AAOA,IAAMC,oBAAoB,gBAAGC,eAAM,CAACC,GAAV,kCAGTC,aAHS,EAKbA,WALa,EAMLA,kBAAA,GAAqB,CANhB,EAYpB,UAACJ,KAAD;AAAA,SAAsCA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACQ,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n&&"object"==typeof n&&"default"in n?n.default:n}Object.defineProperty(exports,"__esModule",{value:!0});var r,
|
|
1
|
+
"use strict";function n(n){return n&&"object"==typeof n&&"default"in n?n.default:n}Object.defineProperty(exports,"__esModule",{value:!0});var r,e=n(require("react")),t=require("styled-components"),o=n(t),u=require("@propellerads/stylevariables");function i(){return(i=Object.assign||function(n){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n}).apply(this,arguments)}function c(n,r){return r||(r=n.slice(0)),n.raw=r,n}function s(){var n=c(["\n margin-right: ","px;\n display: flex;\n align-items: center;\n"]);return s=function(){return n},n}function a(){var n=c(["\n ",",\n "]);return a=function(){return n},n}function l(){var n=c(["\n background-color: ",";\n "]);return l=function(){return n},n}function p(){var n=c(["\n background-color: ",";\n "]);return p=function(){return n},n}function f(){var n=c(["\n background-color: ",";\n "]);return f=function(){return n},n}function d(){var n=c(["\n background-color: ",";\n "]);return d=function(){return n},n}function v(){var n=c(["\n display: inline-flex;\n align-items: center;\n padding: 0 ","px;\n text-transform: uppercase;\n color: ",";\n border-radius: ","px;\n font-size: 10px;\n line-height: 1.5;\n min-height: 16px;\n \n // Color\n ","\n \n ","\n \n ","\n \n ","\n \n // Have priority\n ","\n"]);return v=function(){return n},n}(r=exports.BADGE_TYPE||(exports.BADGE_TYPE={})).INFO="info",r.WARNING="warning",r.DANGER="danger",r.SUCCESS="success";var y=o.div(v(),u.spacing,u.white,u.borderRadius/2,(function(n){return n.type===exports.BADGE_TYPE.INFO&&t.css(d(),u.actionColor)}),(function(n){return n.type===exports.BADGE_TYPE.WARNING&&t.css(f(),u.warningColor)}),(function(n){return n.type===exports.BADGE_TYPE.DANGER&&t.css(p(),u.errorColor)}),(function(n){return n.type===exports.BADGE_TYPE.SUCCESS&&t.css(l(),u.successColor)}),(function(n){return Boolean(Object.values(n.customStyle).length)&&t.css(a(),function(n){return i({},n)}(n.customStyle))})),E=o.span(s(),u.spacing);exports.default=function(n){var r=n.label,t=void 0===r?"":r,o=n.type,u=void 0===o?exports.BADGE_TYPE.INFO:o,i=n.customStyle,c=n.icon,s=void 0===c?void 0:c;return e.createElement(y,{type:u,customStyle:void 0===i?{}:i},s&&e.createElement(E,null,s),t)};
|
|
2
2
|
//# sourceMappingURL=badge.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.cjs.production.min.js","sources":["../src/types.ts","../src/style.tsx","../src/index.tsx"],"sourcesContent":["import React from
|
|
1
|
+
{"version":3,"file":"badge.cjs.production.min.js","sources":["../src/types.ts","../src/style.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport enum BADGE_TYPE {\n INFO = 'info',\n WARNING = 'warning',\n DANGER = 'danger',\n SUCCESS = 'success',\n}\n\nexport interface CustomStyle {\n color?: string\n background?: string\n}\n\nexport interface BadgeProps {\n label?: React.ReactChildren | string | React.ComponentElement<any, any>\n type?: BADGE_TYPE,\n customStyle?: CustomStyle,\n icon?: React.ComponentElement<any, any>\n}\n\nexport default class Badge extends React.Component<BadgeProps> {}\n","import styled, {css} from 'styled-components';\nimport * as style from '@propellerads/stylevariables';\n\nimport {BADGE_TYPE, CustomStyle} from './types';\n\nconst getCustomStyle = (props: CustomStyle) => ({...props});\n\ninterface StyledBadgeContainerProps {\n type: BADGE_TYPE\n customStyle: CustomStyle\n}\n\nconst StyledBadgeContainer = styled.div`\n display: inline-flex;\n align-items: center;\n padding: 0 ${style.spacing}px;\n text-transform: uppercase;\n color: ${style.white};\n border-radius: ${style.borderRadius / 2}px;\n font-size: 10px;\n line-height: 1.5;\n min-height: 16px;\n \n // Color\n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.INFO && css`\n background-color: ${style.actionColor};\n `}\n \n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.WARNING && css`\n background-color: ${style.warningColor};\n `}\n \n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.DANGER && css`\n background-color: ${style.errorColor};\n `}\n \n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.SUCCESS && css`\n background-color: ${style.successColor};\n `}\n \n // Have priority\n ${(props: StyledBadgeContainerProps) => Boolean(Object.values(props.customStyle).length) && css`\n ${getCustomStyle(props.customStyle)},\n `}\n`;\n\nconst StyledBadgeIcon = styled.span`\n margin-right: ${style.spacing}px;\n display: flex;\n align-items: center;\n`;\n\nexport {StyledBadgeContainer, StyledBadgeIcon};\n","import React from 'react';\n\nimport {StyledBadgeContainer, StyledBadgeIcon} from './style';\nimport {BADGE_TYPE, BadgeProps, CustomStyle} from './types';\n\nconst Badge = ({\n label = '',\n type = BADGE_TYPE.INFO,\n customStyle = {},\n icon = undefined,\n}: BadgeProps) => (\n <StyledBadgeContainer type={type} customStyle={customStyle}>\n {icon && (\n <StyledBadgeIcon>\n {icon}\n </StyledBadgeIcon>\n )}\n {label}\n </StyledBadgeContainer>\n);\n\nexport default Badge;\nexport {BADGE_TYPE, CustomStyle};\n"],"names":["BADGE_TYPE","StyledBadgeContainer","styled","div","style","props","type","INFO","css","WARNING","DANGER","SUCCESS","Boolean","Object","values","customStyle","length","getCustomStyle","StyledBadgeIcon","span","label","icon","undefined","React"],"mappings":"8IAEYA,+1CAAAA,EAAAA,qBAAAA,oCAERA,oBACAA,kBACAA,oBCDJ,IAOMC,EAAuBC,EAAOC,QAGnBC,UAEJA,QACQA,eAAqB,GAMpC,SAACC,UAAqCA,EAAMC,OAASN,mBAAWO,MAAQC,UAClDJ,kBAGtB,SAACC,UAAqCA,EAAMC,OAASN,mBAAWS,SAAWD,UACrDJ,mBAGtB,SAACC,UAAqCA,EAAMC,OAASN,mBAAWU,QAAUF,UACpDJ,iBAGtB,SAACC,UAAqCA,EAAMC,OAASN,mBAAWW,SAAWH,UACrDJ,mBAItB,SAACC,UAAqCO,QAAQC,OAAOC,OAAOT,EAAMU,aAAaC,SAAWR,UApCzE,SAACH,eAA4BA,GAqC1CY,CAAeZ,EAAMU,iBAIzBG,EAAkBhB,EAAOiB,SACXf,2BC1CN,oBACZgB,MAAAA,aAAQ,SACRd,KAAAA,aAAON,mBAAWO,WAClBQ,gBACAM,KAAAA,kBAAOC,WAEPC,gBAACtB,GAAqBK,KAAMA,EAAMS,uBAHpB,MAIXM,GACDE,gBAACL,OACEG,GAGFD"}
|
package/dist/badge.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { spacing, white, actionColor, warningColor, errorColor, successColor } from '@propellerads/stylevariables';
|
|
3
|
+
import { spacing, white, borderRadius, actionColor, warningColor, errorColor, successColor } from '@propellerads/stylevariables';
|
|
4
4
|
|
|
5
5
|
function _extends() {
|
|
6
6
|
_extends = Object.assign || function (target) {
|
|
@@ -99,7 +99,7 @@ function _templateObject2() {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
function _templateObject() {
|
|
102
|
-
var data = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n padding: 0 ", "px;\n text-transform: uppercase;\n color: ", ";\n border-radius:
|
|
102
|
+
var data = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n padding: 0 ", "px;\n text-transform: uppercase;\n color: ", ";\n border-radius: ", "px;\n font-size: 10px;\n line-height: 1.5;\n min-height: 16px;\n \n // Color\n ", "\n \n ", "\n \n ", "\n \n ", "\n \n // Have priority\n ", "\n"]);
|
|
103
103
|
|
|
104
104
|
_templateObject = function _templateObject() {
|
|
105
105
|
return data;
|
|
@@ -112,7 +112,7 @@ var getCustomStyle = function getCustomStyle(props) {
|
|
|
112
112
|
return _extends({}, props);
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
var StyledBadgeContainer = /*#__PURE__*/styled.div( /*#__PURE__*/_templateObject(), spacing, white, function (props) {
|
|
115
|
+
var StyledBadgeContainer = /*#__PURE__*/styled.div( /*#__PURE__*/_templateObject(), spacing, white, borderRadius / 2, function (props) {
|
|
116
116
|
return props.type === BADGE_TYPE.INFO && css(_templateObject2(), actionColor);
|
|
117
117
|
}, function (props) {
|
|
118
118
|
return props.type === BADGE_TYPE.WARNING && css(_templateObject3(), warningColor);
|
package/dist/badge.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.esm.js","sources":["../src/types.ts","../src/style.tsx","../src/index.tsx"],"sourcesContent":["import React from
|
|
1
|
+
{"version":3,"file":"badge.esm.js","sources":["../src/types.ts","../src/style.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\n\nexport enum BADGE_TYPE {\n INFO = 'info',\n WARNING = 'warning',\n DANGER = 'danger',\n SUCCESS = 'success',\n}\n\nexport interface CustomStyle {\n color?: string\n background?: string\n}\n\nexport interface BadgeProps {\n label?: React.ReactChildren | string | React.ComponentElement<any, any>\n type?: BADGE_TYPE,\n customStyle?: CustomStyle,\n icon?: React.ComponentElement<any, any>\n}\n\nexport default class Badge extends React.Component<BadgeProps> {}\n","import styled, {css} from 'styled-components';\nimport * as style from '@propellerads/stylevariables';\n\nimport {BADGE_TYPE, CustomStyle} from './types';\n\nconst getCustomStyle = (props: CustomStyle) => ({...props});\n\ninterface StyledBadgeContainerProps {\n type: BADGE_TYPE\n customStyle: CustomStyle\n}\n\nconst StyledBadgeContainer = styled.div`\n display: inline-flex;\n align-items: center;\n padding: 0 ${style.spacing}px;\n text-transform: uppercase;\n color: ${style.white};\n border-radius: ${style.borderRadius / 2}px;\n font-size: 10px;\n line-height: 1.5;\n min-height: 16px;\n \n // Color\n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.INFO && css`\n background-color: ${style.actionColor};\n `}\n \n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.WARNING && css`\n background-color: ${style.warningColor};\n `}\n \n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.DANGER && css`\n background-color: ${style.errorColor};\n `}\n \n ${(props: StyledBadgeContainerProps) => props.type === BADGE_TYPE.SUCCESS && css`\n background-color: ${style.successColor};\n `}\n \n // Have priority\n ${(props: StyledBadgeContainerProps) => Boolean(Object.values(props.customStyle).length) && css`\n ${getCustomStyle(props.customStyle)},\n `}\n`;\n\nconst StyledBadgeIcon = styled.span`\n margin-right: ${style.spacing}px;\n display: flex;\n align-items: center;\n`;\n\nexport {StyledBadgeContainer, StyledBadgeIcon};\n","import React from 'react';\n\nimport {StyledBadgeContainer, StyledBadgeIcon} from './style';\nimport {BADGE_TYPE, BadgeProps, CustomStyle} from './types';\n\nconst Badge = ({\n label = '',\n type = BADGE_TYPE.INFO,\n customStyle = {},\n icon = undefined,\n}: BadgeProps) => (\n <StyledBadgeContainer type={type} customStyle={customStyle}>\n {icon && (\n <StyledBadgeIcon>\n {icon}\n </StyledBadgeIcon>\n )}\n {label}\n </StyledBadgeContainer>\n);\n\nexport default Badge;\nexport {BADGE_TYPE, CustomStyle};\n"],"names":["BADGE_TYPE","getCustomStyle","props","StyledBadgeContainer","styled","div","style","type","INFO","css","WARNING","DANGER","SUCCESS","Boolean","Object","values","customStyle","length","StyledBadgeIcon","span","Badge","label","icon","undefined","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEYA;;AAAZ,WAAYA;AACRA,EAAAA,kBAAA,SAAA;AACAA,EAAAA,qBAAA,YAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,qBAAA,YAAA;AACH,CALD,EAAYA,UAAU,KAAVA,UAAU,KAAA,CAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACGA,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,KAAD;AAAA,sBAA6BA,KAA7B;AAAA,CAAvB;;AAOA,IAAMC,oBAAoB,gBAAGC,MAAM,CAACC,GAAV,kCAGTC,OAHS,EAKbA,KALa,EAMLA,YAAA,GAAqB,CANhB,EAYpB,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;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BADGE_TYPE, BadgeProps, CustomStyle } from
|
|
2
|
-
declare const Badge: ({ label, type, customStyle, icon }: BadgeProps) => JSX.Element;
|
|
1
|
+
import { BADGE_TYPE, BadgeProps, CustomStyle } from './types';
|
|
2
|
+
declare const Badge: ({ label, type, customStyle, icon, }: BadgeProps) => JSX.Element;
|
|
3
3
|
export default Badge;
|
|
4
4
|
export { BADGE_TYPE, CustomStyle };
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@propellerads/badge",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"repository": "https://github.com/propellerads/ui-components",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,21 +20,21 @@
|
|
|
20
20
|
"build": "tsdx build"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"react": "
|
|
23
|
+
"@types/react": "^17.0.2",
|
|
24
|
+
"@types/react-dom": "^17.0.2",
|
|
25
|
+
"@types/styled-components": "5.1.1",
|
|
26
|
+
"react": "^17.0.2",
|
|
27
|
+
"react-dom": "^17.0.2",
|
|
28
|
+
"styled-components": "5.1.1"
|
|
24
29
|
},
|
|
25
30
|
"module": "dist/badge.esm.js",
|
|
26
31
|
"devDependencies": {
|
|
27
|
-
"@types/react": "^16.9.49",
|
|
28
|
-
"@types/react-dom": "^16.9.8",
|
|
29
|
-
"@types/styled-components": "^5.1.3",
|
|
30
|
-
"react": "^16.13.1",
|
|
31
|
-
"react-dom": "^16.13.1",
|
|
32
32
|
"tsdx": "^0.13.3",
|
|
33
33
|
"tslib": "^2.0.1",
|
|
34
34
|
"typescript": "^4.0.2"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@propellerads/stylevariables": "^1.
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
"@propellerads/stylevariables": "^1.3.0"
|
|
38
|
+
},
|
|
39
|
+
"gitHead": "82824622b4ac991d78567c473a46b5044cd72035"
|
|
40
40
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {StyledBadgeContainer, StyledBadgeIcon} from './style';
|
|
4
|
-
import {BADGE_TYPE, BadgeProps, CustomStyle} from
|
|
4
|
+
import {BADGE_TYPE, BadgeProps, CustomStyle} from './types';
|
|
5
5
|
|
|
6
6
|
const Badge = ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
label = '',
|
|
8
|
+
type = BADGE_TYPE.INFO,
|
|
9
|
+
customStyle = {},
|
|
10
|
+
icon = undefined,
|
|
11
|
+
}: BadgeProps) => (
|
|
12
|
+
<StyledBadgeContainer type={type} customStyle={customStyle}>
|
|
13
|
+
{icon && (
|
|
14
|
+
<StyledBadgeIcon>
|
|
15
|
+
{icon}
|
|
16
|
+
</StyledBadgeIcon>
|
|
17
|
+
)}
|
|
18
|
+
{label}
|
|
19
|
+
</StyledBadgeContainer>
|
|
20
20
|
);
|
|
21
21
|
|
|
22
|
-
export default Badge
|
|
23
|
-
export {BADGE_TYPE, CustomStyle}
|
|
22
|
+
export default Badge;
|
|
23
|
+
export {BADGE_TYPE, CustomStyle};
|
package/src/style.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import styled, {css} from 'styled-components';
|
|
2
2
|
import * as style from '@propellerads/stylevariables';
|
|
3
3
|
|
|
4
|
-
import {BADGE_TYPE, CustomStyle} from './types'
|
|
4
|
+
import {BADGE_TYPE, CustomStyle} from './types';
|
|
5
5
|
|
|
6
|
-
const getCustomStyle = (props: CustomStyle) => ({...props})
|
|
6
|
+
const getCustomStyle = (props: CustomStyle) => ({...props});
|
|
7
7
|
|
|
8
8
|
interface StyledBadgeContainerProps {
|
|
9
9
|
type: BADGE_TYPE
|
|
@@ -16,7 +16,7 @@ const StyledBadgeContainer = styled.div`
|
|
|
16
16
|
padding: 0 ${style.spacing}px;
|
|
17
17
|
text-transform: uppercase;
|
|
18
18
|
color: ${style.white};
|
|
19
|
-
border-radius:
|
|
19
|
+
border-radius: ${style.borderRadius / 2}px;
|
|
20
20
|
font-size: 10px;
|
|
21
21
|
line-height: 1.5;
|
|
22
22
|
min-height: 16px;
|
package/src/types.ts
CHANGED