@propellerads/badge 2.3.1 → 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 CHANGED
@@ -1,3 +1,6 @@
1
+ ### `2.4.0`
2
+ * updated peerDependencies
3
+
1
4
  #### `2.3.0`
2
5
  * update style-variables
3
6
  * apply new border-radius 8px
@@ -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) => 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,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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,IAA1B,IAAkCC,UAAlC,qBAChBH,iBADgB,CAAtC;AAAA,CAZoB,EAgBpB,UAACJ,KAAD;AAAA,SAAsCA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACU,OAA1B,IAAqCD,UAArC,qBAChBH,kBADgB,CAAtC;AAAA,CAhBoB,EAoBpB,UAACJ,KAAD;AAAA,SAAsCA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACW,MAA1B,IAAoCF,UAApC,qBAChBH,gBADgB,CAAtC;AAAA,CApBoB,EAwBpB,UAACJ,KAAD;AAAA,SAAsCA,KAAK,CAACK,IAAN,KAAeP,kBAAU,CAACY,OAA1B,IAAqCH,UAArC,qBAChBH,kBADgB,CAAtC;AAAA,CAxBoB,EA6BpB,UAACJ,KAAD;AAAA,SAAsCW,OAAO,CAACC,MAAM,CAACC,MAAP,CAAcb,KAAK,CAACc,WAApB,EAAiCC,MAAlC,CAAP,IAAoDR,UAApD,qBAClCR,cAAc,CAACC,KAAK,CAACc,WAAP,CADoB,CAAtC;AAAA,CA7BoB,CAA1B;AAkCA,IAAME,eAAe,gBAAGd,eAAM,CAACe,IAAV,mCACDb,aADC,CAArB;;ACzCA,IAAMc,KAAK,GAAG,SAARA,KAAQ;AAAA,wBACZC,KADY;AAAA,MACZA,KADY,2BACJ,EADI;AAAA,uBAEZd,IAFY;AAAA,MAEZA,IAFY,0BAELP,kBAAU,CAACQ,IAFN;AAAA,8BAGZQ,WAHY;AAAA,MAGZA,WAHY,iCAGE,EAHF;AAAA,uBAIZM,IAJY;AAAA,MAIZA,IAJY,0BAILC,SAJK;AAAA,SAMZC,mBAAA,CAACrB,oBAAD;AAAsBI,IAAAA,IAAI,EAAEA;AAAMS,IAAAA,WAAW,EAAEA;GAA/C,EACGM,IAAI,IACLE,mBAAA,CAACN,eAAD,MAAA,EACGI,IADH,CAFF,EAMGD,KANH,CANY;AAAA,CAAd;;;;"}
@@ -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) => 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,oBACPgB,MAAAA,aAAQ,SACRd,KAAAA,aAAON,mBAAWO,WAClBQ,gBACAM,KAAAA,kBAAOC,WAEVC,gBAACtB,GAAqBK,KAAMA,EAAMS,uBAHjB,MAIZM,GACGE,gBAACL,OACIG,GAGRD"}
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"}
@@ -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) => 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,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AK,GAAG,SAARA,KAAQ;AAAA,wBACPC,KADO;AAAA,MACPA,KADO,2BACC,EADD;AAAA,uBAEPd,IAFO;AAAA,MAEPA,IAFO,0BAEAP,UAAU,CAACQ,IAFX;AAAA,8BAGPQ,WAHO;AAAA,MAGPA,WAHO,iCAGO,EAHP;AAAA,uBAIPM,IAJO;AAAA,MAIPA,IAJO,0BAIAC,SAJA;AAAA,SAMVC,mBAAA,CAACrB,oBAAD;AAAsBI,IAAAA,IAAI,EAAEA;AAAMS,IAAAA,WAAW,EAAEA;GAA/C,EACKM,IAAI,IACDE,mBAAA,CAACN,eAAD,MAAA,EACKI,IADL,CAFR,EAMKD,KANL,CANU;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) => 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;AA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AA,IAAI,EAAEA;AAAMS,IAAAA,WAAW,EAAEA;GAA/C,EACGM,IAAI,IACLE,mBAAA,CAACN,eAAD,MAAA,EACGI,IADH,CAFF,EAMGD,KANH,CANY;AAAA,CAAd;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BADGE_TYPE, BadgeProps, CustomStyle } from "./types";
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
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  export declare enum BADGE_TYPE {
3
3
  INFO = "info",
4
4
  WARNING = "warning",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@propellerads/badge",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "repository": "https://github.com/propellerads/ui-components",
5
5
  "private": false,
6
6
  "license": "MIT",
@@ -20,22 +20,21 @@
20
20
  "build": "tsdx build"
21
21
  },
22
22
  "peerDependencies": {
23
- "react": ">=16"
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.3.0",
38
- "styled-components": "^5.2.0"
37
+ "@propellerads/stylevariables": "^1.3.0"
39
38
  },
40
- "gitHead": "fc7229037a81fad6786b945ad6b419ec6f4e39b7"
39
+ "gitHead": "82824622b4ac991d78567c473a46b5044cd72035"
41
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 "./types";
4
+ import {BADGE_TYPE, BadgeProps, CustomStyle} from './types';
5
5
 
6
6
  const Badge = ({
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>
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
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
 
3
3
  export enum BADGE_TYPE {
4
4
  INFO = 'info',