@propellerads/badge 3.0.0 → 3.0.1

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 ADDED
@@ -0,0 +1,35 @@
1
+ ## `3.0.1`
2
+
3
+ - Fixed dependencies
4
+
5
+ ## `3.0.0`
6
+
7
+ - upgrade to React 18
8
+
9
+ ## `2.4.0`
10
+
11
+ - updated peerDependencies
12
+
13
+ ## `2.3.0`
14
+
15
+ - update style-variables
16
+ - apply new border-radius 8px
17
+
18
+ ## `2.2.0`
19
+
20
+ - exported interface `CustomStyle`
21
+ - Badge component exported as default module
22
+
23
+ ## `2.1.0`
24
+
25
+ - exported enum `BADGE_TYPE`
26
+
27
+ ## `2.0.0`
28
+
29
+ - TS
30
+ - Production build
31
+ - Breaking changes - an icon component became external
32
+
33
+ ## `1.1.0`
34
+
35
+ - Badge styles now fully customizable
@@ -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: ", "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"]);
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;
@@ -1 +1 @@
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) =>\n props.type === BADGE_TYPE.INFO &&\n css`\n background-color: ${style.actionColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.WARNING &&\n css`\n background-color: ${style.warningColor};\n `}\n \n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.DANGER &&\n css`\n background-color: ${style.errorColor};\n `}\n \n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.SUCCESS &&\n css`\n background-color: ${style.successColor};\n `}\n \n // Have priority\n ${(props: StyledBadgeContainerProps) =>\n Boolean(Object.values(props.customStyle).length) &&\n 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 = ({label = '', type = BADGE_TYPE.INFO, customStyle = {}, icon = undefined}: BadgeProps) => (\n <StyledBadgeContainer type={type} customStyle={customStyle}>\n {icon && <StyledBadgeIcon>{icon}</StyledBadgeIcon>}\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;AACVA,EAAAA,kBAAA,SAAA;AACAA,EAAAA,qBAAA,YAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,qBAAA,YAAA;AACD,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,kCAGXC,aAHW,EAKfA,WALe,EAMPA,kBAAA,GAAqB,CANd,EAYtB,UAACJ,KAAD;AAAA,SACAA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACQ,IAA1B,IACAC,UADA,qBAEsBH,iBAFtB,CADA;AAAA,CAZsB,EAkBtB,UAACJ,KAAD;AAAA,SACAA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACU,OAA1B,IACAD,UADA,qBAEsBH,kBAFtB,CADA;AAAA,CAlBsB,EAwBpB,UAACJ,KAAD;AAAA,SACFA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACW,MAA1B,IACAF,UADA,qBAEsBH,gBAFtB,CADE;AAAA,CAxBoB,EA8BpB,UAACJ,KAAD;AAAA,SACFA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACY,OAA1B,IACAH,UADA,qBAEsBH,kBAFtB,CADE;AAAA,CA9BoB,EAqCpB,UAACJ,KAAD;AAAA,SACFW,OAAO,CAACC,MAAM,CAACC,MAAP,CAAcb,KAAK,CAACc,WAApB,EAAiCC,MAAlC,CAAP,IACAR,UADA,qBAEIR,cAAc,CAACC,KAAK,CAACc,WAAP,CAFlB,CADE;AAAA,CArCoB,CAA1B;AA4CA,IAAME,eAAe,gBAAGd,eAAM,CAACe,IAAV,mCACHb,aADG,CAArB;;ACnDA,IAAMc,KAAK,GAAG,SAARA,KAAQ;AAAA,wBAAEC,KAAF;AAAA,MAAEA,KAAF,2BAAU,EAAV;AAAA,uBAAcd,IAAd;AAAA,MAAcA,IAAd,0BAAqBP,kBAAU,CAACQ,IAAhC;AAAA,8BAAsCQ,WAAtC;AAAA,MAAsCA,WAAtC,iCAAoD,EAApD;AAAA,uBAAwDM,IAAxD;AAAA,MAAwDA,IAAxD,0BAA+DC,SAA/D;AAAA,SACZC,mBAAA,CAACrB,oBAAD;AAAsBI,IAAAA,IAAI,EAAEA;AAAMS,IAAAA,WAAW,EAAEA;GAA/C,EACGM,IAAI,IAAIE,mBAAA,CAACN,eAAD,MAAA,EAAkBI,IAAlB,CADX,EAEGD,KAFH,CADY;AAAA,CAAd;;;;"}
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) =>\n props.type === BADGE_TYPE.INFO &&\n css`\n background-color: ${style.actionColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.WARNING &&\n css`\n background-color: ${style.warningColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.DANGER &&\n css`\n background-color: ${style.errorColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.SUCCESS &&\n css`\n background-color: ${style.successColor};\n `}\n\n // Have priority\n ${(props: StyledBadgeContainerProps) =>\n Boolean(Object.values(props.customStyle).length) &&\n 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 = ({label = '', type = BADGE_TYPE.INFO, customStyle = {}, icon = undefined}: BadgeProps) => (\n <StyledBadgeContainer type={type} customStyle={customStyle}>\n {icon && <StyledBadgeIcon>{icon}</StyledBadgeIcon>}\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;AACVA,EAAAA,kBAAA,SAAA;AACAA,EAAAA,qBAAA,YAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,qBAAA,YAAA;AACD,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,kCAGXC,aAHW,EAKfA,WALe,EAMPA,kBAAA,GAAqB,CANd,EAYtB,UAACJ,KAAD;AAAA,SACAA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACQ,IAA1B,IACAC,UADA,qBAEsBH,iBAFtB,CADA;AAAA,CAZsB,EAkBtB,UAACJ,KAAD;AAAA,SACAA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACU,OAA1B,IACAD,UADA,qBAEsBH,kBAFtB,CADA;AAAA,CAlBsB,EAwBpB,UAACJ,KAAD;AAAA,SACFA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACW,MAA1B,IACAF,UADA,qBAEsBH,gBAFtB,CADE;AAAA,CAxBoB,EA8BpB,UAACJ,KAAD;AAAA,SACFA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACY,OAA1B,IACAH,UADA,qBAEsBH,kBAFtB,CADE;AAAA,CA9BoB,EAqCpB,UAACJ,KAAD;AAAA,SACFW,OAAO,CAACC,MAAM,CAACC,MAAP,CAAcb,KAAK,CAACc,WAApB,EAAiCC,MAAlC,CAAP,IACAR,UADA,qBAEIR,cAAc,CAACC,KAAK,CAACc,WAAP,CAFlB,CADE;AAAA,CArCoB,CAA1B;AA4CA,IAAME,eAAe,gBAAGd,eAAM,CAACe,IAAV,mCACHb,aADG,CAArB;;ACnDA,IAAMc,KAAK,GAAG,SAARA,KAAQ;AAAA,wBAAEC,KAAF;AAAA,MAAEA,KAAF,2BAAU,EAAV;AAAA,uBAAcd,IAAd;AAAA,MAAcA,IAAd,0BAAqBP,kBAAU,CAACQ,IAAhC;AAAA,8BAAsCQ,WAAtC;AAAA,MAAsCA,WAAtC,iCAAoD,EAApD;AAAA,uBAAwDM,IAAxD;AAAA,MAAwDA,IAAxD,0BAA+DC,SAA/D;AAAA,SACZC,mBAAA,CAACrB,oBAAD;AAAsBI,IAAAA,IAAI,EAAEA;AAAMS,IAAAA,WAAW,EAAEA;GAA/C,EACGM,IAAI,IAAIE,mBAAA,CAACN,eAAD,MAAA,EAAkBI,IAAlB,CADX,EAEGD,KAFH,CADY;AAAA,CAAd;;;;"}
@@ -1,2 +1,2 @@
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)};
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 '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) =>\n props.type === BADGE_TYPE.INFO &&\n css`\n background-color: ${style.actionColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.WARNING &&\n css`\n background-color: ${style.warningColor};\n `}\n \n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.DANGER &&\n css`\n background-color: ${style.errorColor};\n `}\n \n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.SUCCESS &&\n css`\n background-color: ${style.successColor};\n `}\n \n // Have priority\n ${(props: StyledBadgeContainerProps) =>\n Boolean(Object.values(props.customStyle).length) &&\n 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 = ({label = '', type = BADGE_TYPE.INFO, customStyle = {}, icon = undefined}: BadgeProps) => (\n <StyledBadgeContainer type={type} customStyle={customStyle}>\n {icon && <StyledBadgeIcon>{icon}</StyledBadgeIcon>}\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,uyCAAAA,EAAAA,qBAAAA,oCAEVA,oBACAA,kBACAA,oBCDF,IAOMC,EAAuBC,EAAOC,QAGrBC,UAEJA,QACQA,eAAqB,GAMpC,SAACC,UACDA,EAAMC,OAASN,mBAAWO,MAC1BC,UACsBJ,kBAGtB,SAACC,UACDA,EAAMC,OAASN,mBAAWS,SAC1BD,UACsBJ,mBAGpB,SAACC,UACHA,EAAMC,OAASN,mBAAWU,QAC1BF,UACsBJ,iBAGpB,SAACC,UACHA,EAAMC,OAASN,mBAAWW,SAC1BH,UACsBJ,mBAIpB,SAACC,UACHO,QAAQC,OAAOC,OAAOT,EAAMU,aAAaC,SACzCR,UA9CmB,SAACH,eAA4BA,GA+C5CY,CAAeZ,EAAMU,iBAIvBG,EAAkBhB,EAAOiB,SACbf,2BCpDJ,oBAAEgB,MAAAA,aAAQ,SAAId,KAAAA,aAAON,mBAAWO,WAAMQ,gBAAkBM,KAAAA,kBAAOC,WAC3EC,gBAACtB,GAAqBK,KAAMA,EAAMS,uBAD8B,MAE7DM,GAAQE,gBAACL,OAAiBG,GAC1BD"}
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) =>\n props.type === BADGE_TYPE.INFO &&\n css`\n background-color: ${style.actionColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.WARNING &&\n css`\n background-color: ${style.warningColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.DANGER &&\n css`\n background-color: ${style.errorColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.SUCCESS &&\n css`\n background-color: ${style.successColor};\n `}\n\n // Have priority\n ${(props: StyledBadgeContainerProps) =>\n Boolean(Object.values(props.customStyle).length) &&\n 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 = ({label = '', type = BADGE_TYPE.INFO, customStyle = {}, icon = undefined}: BadgeProps) => (\n <StyledBadgeContainer type={type} customStyle={customStyle}>\n {icon && <StyledBadgeIcon>{icon}</StyledBadgeIcon>}\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,+wCAAAA,EAAAA,qBAAAA,oCAEVA,oBACAA,kBACAA,oBCDF,IAOMC,EAAuBC,EAAOC,QAGrBC,UAEJA,QACQA,eAAqB,GAMpC,SAACC,UACDA,EAAMC,OAASN,mBAAWO,MAC1BC,UACsBJ,kBAGtB,SAACC,UACDA,EAAMC,OAASN,mBAAWS,SAC1BD,UACsBJ,mBAGpB,SAACC,UACHA,EAAMC,OAASN,mBAAWU,QAC1BF,UACsBJ,iBAGpB,SAACC,UACHA,EAAMC,OAASN,mBAAWW,SAC1BH,UACsBJ,mBAIpB,SAACC,UACHO,QAAQC,OAAOC,OAAOT,EAAMU,aAAaC,SACzCR,UA9CmB,SAACH,eAA4BA,GA+C5CY,CAAeZ,EAAMU,iBAIvBG,EAAkBhB,EAAOiB,SACbf,2BCpDJ,oBAAEgB,MAAAA,aAAQ,SAAId,KAAAA,aAAON,mBAAWO,WAAMQ,gBAAkBM,KAAAA,kBAAOC,WAC3EC,gBAACtB,GAAqBK,KAAMA,EAAMS,uBAD8B,MAE7DM,GAAQE,gBAACL,OAAiBG,GAC1BD"}
package/dist/badge.esm.js CHANGED
@@ -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: ", "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"]);
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;
@@ -1 +1 @@
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) =>\n props.type === BADGE_TYPE.INFO &&\n css`\n background-color: ${style.actionColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.WARNING &&\n css`\n background-color: ${style.warningColor};\n `}\n \n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.DANGER &&\n css`\n background-color: ${style.errorColor};\n `}\n \n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.SUCCESS &&\n css`\n background-color: ${style.successColor};\n `}\n \n // Have priority\n ${(props: StyledBadgeContainerProps) =>\n Boolean(Object.values(props.customStyle).length) &&\n 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 = ({label = '', type = BADGE_TYPE.INFO, customStyle = {}, icon = undefined}: BadgeProps) => (\n <StyledBadgeContainer type={type} customStyle={customStyle}>\n {icon && <StyledBadgeIcon>{icon}</StyledBadgeIcon>}\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;AACVA,EAAAA,kBAAA,SAAA;AACAA,EAAAA,qBAAA,YAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,qBAAA,YAAA;AACD,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,kCAGXC,OAHW,EAKfA,KALe,EAMPA,YAAA,GAAqB,CANd,EAYtB,UAACJ,KAAD;AAAA,SACAA,KAAK,CAACK,IAAN,KAAeP,UAAU,CAACQ,IAA1B,IACAC,GADA,qBAEsBH,WAFtB,CADA;AAAA,CAZsB,EAkBtB,UAACJ,KAAD;AAAA,SACAA,KAAK,CAACK,IAAN,KAAeP,UAAU,CAACU,OAA1B,IACAD,GADA,qBAEsBH,YAFtB,CADA;AAAA,CAlBsB,EAwBpB,UAACJ,KAAD;AAAA,SACFA,KAAK,CAACK,IAAN,KAAeP,UAAU,CAACW,MAA1B,IACAF,GADA,qBAEsBH,UAFtB,CADE;AAAA,CAxBoB,EA8BpB,UAACJ,KAAD;AAAA,SACFA,KAAK,CAACK,IAAN,KAAeP,UAAU,CAACY,OAA1B,IACAH,GADA,qBAEsBH,YAFtB,CADE;AAAA,CA9BoB,EAqCpB,UAACJ,KAAD;AAAA,SACFW,OAAO,CAACC,MAAM,CAACC,MAAP,CAAcb,KAAK,CAACc,WAApB,EAAiCC,MAAlC,CAAP,IACAR,GADA,qBAEIR,cAAc,CAACC,KAAK,CAACc,WAAP,CAFlB,CADE;AAAA,CArCoB,CAA1B;AA4CA,IAAME,eAAe,gBAAGd,MAAM,CAACe,IAAV,mCACHb,OADG,CAArB;;ACnDA,IAAMc,KAAK,GAAG,SAARA,KAAQ;AAAA,wBAAEC,KAAF;AAAA,MAAEA,KAAF,2BAAU,EAAV;AAAA,uBAAcd,IAAd;AAAA,MAAcA,IAAd,0BAAqBP,UAAU,CAACQ,IAAhC;AAAA,8BAAsCQ,WAAtC;AAAA,MAAsCA,WAAtC,iCAAoD,EAApD;AAAA,uBAAwDM,IAAxD;AAAA,MAAwDA,IAAxD,0BAA+DC,SAA/D;AAAA,SACZC,mBAAA,CAACrB,oBAAD;AAAsBI,IAAAA,IAAI,EAAEA;AAAMS,IAAAA,WAAW,EAAEA;GAA/C,EACGM,IAAI,IAAIE,mBAAA,CAACN,eAAD,MAAA,EAAkBI,IAAlB,CADX,EAEGD,KAFH,CADY;AAAA,CAAd;;;;;"}
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) =>\n props.type === BADGE_TYPE.INFO &&\n css`\n background-color: ${style.actionColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.WARNING &&\n css`\n background-color: ${style.warningColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.DANGER &&\n css`\n background-color: ${style.errorColor};\n `}\n\n ${(props: StyledBadgeContainerProps) =>\n props.type === BADGE_TYPE.SUCCESS &&\n css`\n background-color: ${style.successColor};\n `}\n\n // Have priority\n ${(props: StyledBadgeContainerProps) =>\n Boolean(Object.values(props.customStyle).length) &&\n 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 = ({label = '', type = BADGE_TYPE.INFO, customStyle = {}, icon = undefined}: BadgeProps) => (\n <StyledBadgeContainer type={type} customStyle={customStyle}>\n {icon && <StyledBadgeIcon>{icon}</StyledBadgeIcon>}\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;AACVA,EAAAA,kBAAA,SAAA;AACAA,EAAAA,qBAAA,YAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,qBAAA,YAAA;AACD,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,kCAGXC,OAHW,EAKfA,KALe,EAMPA,YAAA,GAAqB,CANd,EAYtB,UAACJ,KAAD;AAAA,SACAA,KAAK,CAACK,IAAN,KAAeP,UAAU,CAACQ,IAA1B,IACAC,GADA,qBAEsBH,WAFtB,CADA;AAAA,CAZsB,EAkBtB,UAACJ,KAAD;AAAA,SACAA,KAAK,CAACK,IAAN,KAAeP,UAAU,CAACU,OAA1B,IACAD,GADA,qBAEsBH,YAFtB,CADA;AAAA,CAlBsB,EAwBpB,UAACJ,KAAD;AAAA,SACFA,KAAK,CAACK,IAAN,KAAeP,UAAU,CAACW,MAA1B,IACAF,GADA,qBAEsBH,UAFtB,CADE;AAAA,CAxBoB,EA8BpB,UAACJ,KAAD;AAAA,SACFA,KAAK,CAACK,IAAN,KAAeP,UAAU,CAACY,OAA1B,IACAH,GADA,qBAEsBH,YAFtB,CADE;AAAA,CA9BoB,EAqCpB,UAACJ,KAAD;AAAA,SACFW,OAAO,CAACC,MAAM,CAACC,MAAP,CAAcb,KAAK,CAACc,WAApB,EAAiCC,MAAlC,CAAP,IACAR,GADA,qBAEIR,cAAc,CAACC,KAAK,CAACc,WAAP,CAFlB,CADE;AAAA,CArCoB,CAA1B;AA4CA,IAAME,eAAe,gBAAGd,MAAM,CAACe,IAAV,mCACHb,OADG,CAArB;;ACnDA,IAAMc,KAAK,GAAG,SAARA,KAAQ;AAAA,wBAAEC,KAAF;AAAA,MAAEA,KAAF,2BAAU,EAAV;AAAA,uBAAcd,IAAd;AAAA,MAAcA,IAAd,0BAAqBP,UAAU,CAACQ,IAAhC;AAAA,8BAAsCQ,WAAtC;AAAA,MAAsCA,WAAtC,iCAAoD,EAApD;AAAA,uBAAwDM,IAAxD;AAAA,MAAwDA,IAAxD,0BAA+DC,SAA/D;AAAA,SACZC,mBAAA,CAACrB,oBAAD;AAAsBI,IAAAA,IAAI,EAAEA;AAAMS,IAAAA,WAAW,EAAEA;GAA/C,EACGM,IAAI,IAAIE,mBAAA,CAACN,eAAD,MAAA,EAAkBI,IAAlB,CADX,EAEGD,KAFH,CADY;AAAA,CAAd;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@propellerads/badge",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "repository": "https://github.com/propellerads/ui-components",
5
5
  "private": false,
6
6
  "license": "MIT",
@@ -21,17 +21,18 @@
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": ">=18 <19",
24
- "styled-components": "5.1.1",
25
- "@types/styled-components": "5.1.34"
24
+ "styled-components": "5.1.1"
26
25
  },
27
26
  "module": "dist/badge.esm.js",
28
27
  "devDependencies": {
28
+ "@types/react": ">=18 <19",
29
+ "@types/styled-components": "5.1.34",
29
30
  "tsdx": "^0.13.3",
30
31
  "tslib": "^2.0.1",
31
- "typescript": "^4.9.5",
32
- "@types/react": ">=18 <19"
32
+ "typescript": "^4.9.5"
33
33
  },
34
34
  "dependencies": {
35
35
  "@propellerads/stylevariables": "^1.3.0"
36
- }
36
+ },
37
+ "gitHead": "e4a84ba8a4df9120d4940351f91ceaa947919574"
37
38
  }
package/src/style.tsx CHANGED
@@ -33,19 +33,19 @@ const StyledBadgeContainer = styled.div`
33
33
  css`
34
34
  background-color: ${style.warningColor};
35
35
  `}
36
-
36
+
37
37
  ${(props: StyledBadgeContainerProps) =>
38
38
  props.type === BADGE_TYPE.DANGER &&
39
39
  css`
40
40
  background-color: ${style.errorColor};
41
41
  `}
42
-
42
+
43
43
  ${(props: StyledBadgeContainerProps) =>
44
44
  props.type === BADGE_TYPE.SUCCESS &&
45
45
  css`
46
46
  background-color: ${style.successColor};
47
47
  `}
48
-
48
+
49
49
  // Have priority
50
50
  ${(props: StyledBadgeContainerProps) =>
51
51
  Boolean(Object.values(props.customStyle).length) &&