@contentful/f36-badge
Advanced tools
Comparing version 4.0.1-next-v4-4389.1990 to 4.0.1-next-v4-4457.1996
@@ -1,2 +0,2 @@ | ||
function e(e){return e&&e.__esModule?e.default:e}function r(e,r,t){Object.defineProperty(e,r,{get:t,enumerable:!0})}var t=e(require("@contentful/f36-tokens")),{Box:o}=require("@contentful/f36-core"),a=e(require("react")),{cx:n,css:i}=require("emotion"),c=e(require("@babel/runtime/helpers/extends")),l={};const s=({variant:e})=>{switch(e){case"positive":return{color:t.colorGreenBase,backgroundColor:t.colorGreenLightest};case"primary":return{color:t.colorBlueBase,backgroundColor:t.colorBlueLightest};case"negative":return{color:t.colorRedBase,backgroundColor:t.colorRedLightest};case"warning":return{color:t.colorOrangeDark,backgroundColor:"#ffefd5"};case"secondary":return{color:t.colorTextBase,backgroundColor:t.colorElementLight};case"muted":return{color:t.colorTextMid,backgroundColor:t.colorElementLightest};case"primary-filled":return{color:t.colorWhite,backgroundColor:t.colorPrimary};case"featured":return{color:t.colorPurpleBase,backgroundColor:t.colorPurpleLightest};default:return{}}},u=({size:e})=>{switch(e){case"small":return{padding:`3px ${t.spacing2Xs}`,fontSize:"0.625rem",lineHeight:"0.625rem",maxHeight:"16px"};default:return{padding:`0 ${t.spacingXs}`,fontSize:`calc(1rem * (12 / ${t.fontBaseDefault}))`,lineHeight:"20px",maxHeight:"20px"}}},d=({variant:e,size:r})=>i({fontFamily:t.fontStackPrimary,fontWeight:t.fontWeightDemiBold,textTransform:"uppercase",letterSpacing:"0.06rem",borderRadius:`${t.borderRadiusSmall}`,...s({variant:e}),...u({size:r})},""),g=(e,r)=>{const{children:t,variant:i="primary",size:l="default",className:s,...u}=e;return a.createElement(o,c({as:"div",testId:"cf-ui-badge",display:"inline-block",className:n(d({variant:i,size:l}),s)},u,{ref:r}),t)},f=a.forwardRef(g);exports.Badge=f;const m={published:"positive",draft:"warning",archived:"negative",changed:"primary",deleted:"negative",new:"primary-filled"};function p(e,r){const{entityStatus:t,...o}=e,n=m[t];return a.createElement(f,c({},o,{variant:n,ref:r}),t)}const h=a.forwardRef(p);exports.EntityStatusBadge=h,r(l,"Badge",(function(){return f})),r(l,"EntityStatusBadge",(function(){return h})); | ||
var e=c(require("@babel/runtime/helpers/extends")),{cx:r,css:t}=require("emotion"),o=c(require("react")),{Box:a}=require("@contentful/f36-core"),n=c(require("@contentful/f36-tokens"));function i(e,r,t,o){Object.defineProperty(e,r,{get:t,set:o,enumerable:!0,configurable:!0})}function c(e){return e&&e.__esModule?e.default:e}var l={};i(l,"Badge",(()=>g)),i(l,"EntityStatusBadge",(()=>b));const s=({variant:e})=>{switch(e){case"positive":return{color:n.colorGreenBase,backgroundColor:n.colorGreenLightest};case"primary":return{color:n.colorBlueBase,backgroundColor:n.colorBlueLightest};case"negative":return{color:n.colorRedBase,backgroundColor:n.colorRedLightest};case"warning":return{color:n.colorOrangeDark,backgroundColor:"#ffefd5"};case"secondary":return{color:n.colorTextBase,backgroundColor:n.colorElementLight};case"muted":return{color:n.colorTextMid,backgroundColor:n.colorElementLightest};case"primary-filled":return{color:n.colorWhite,backgroundColor:n.colorPrimary};case"featured":return{color:n.colorPurpleBase,backgroundColor:n.colorPurpleLightest};default:return{}}},u=({size:e})=>{switch(e){case"small":return{padding:`3px ${n.spacing2Xs}`,fontSize:"0.625rem",lineHeight:"0.625rem",maxHeight:"16px"};default:return{padding:`0 ${n.spacingXs}`,fontSize:`calc(1rem * (12 / ${n.fontBaseDefault}))`,lineHeight:"20px",maxHeight:"20px"}}},d=({variant:e,size:r})=>t({fontFamily:n.fontStackPrimary,fontWeight:n.fontWeightDemiBold,textTransform:"uppercase",letterSpacing:"0.06rem",borderRadius:`${n.borderRadiusSmall}`,...s({variant:e}),...u({size:r})},""),f=(t,n)=>{const{children:i,variant:c="primary",size:l="default",className:s,...u}=t;return o.createElement(a,e({as:"div",testId:"cf-ui-badge",display:"inline-block",className:r(d({variant:c,size:l}),s)},u,{ref:n}),i)},g=o.forwardRef(f),m={published:"positive",draft:"warning",archived:"negative",changed:"primary",deleted:"negative",new:"primary-filled"};function p(r,t){const{entityStatus:a,...n}=r,i=m[a];return o.createElement(g,e({},n,{variant:i,ref:t}),a)}const b=o.forwardRef(p);var h,v;h=module.exports,v=l,Object.keys(v).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(h,e,{enumerable:!0,get:function(){return v[e]}})})); | ||
//# sourceMappingURL=main.js.map |
@@ -1,2 +0,2 @@ | ||
function e(e,r,t){Object.defineProperty(e,r,{get:t,enumerable:!0})}import r from"@contentful/f36-tokens";import{Box as t}from"@contentful/f36-core";import o from"react";import{cx as a,css as n}from"emotion";import i from"@babel/runtime/helpers/esm/extends";var c={};const l=({variant:e})=>{switch(e){case"positive":return{color:r.colorGreenBase,backgroundColor:r.colorGreenLightest};case"primary":return{color:r.colorBlueBase,backgroundColor:r.colorBlueLightest};case"negative":return{color:r.colorRedBase,backgroundColor:r.colorRedLightest};case"warning":return{color:r.colorOrangeDark,backgroundColor:"#ffefd5"};case"secondary":return{color:r.colorTextBase,backgroundColor:r.colorElementLight};case"muted":return{color:r.colorTextMid,backgroundColor:r.colorElementLightest};case"primary-filled":return{color:r.colorWhite,backgroundColor:r.colorPrimary};case"featured":return{color:r.colorPurpleBase,backgroundColor:r.colorPurpleLightest};default:return{}}},s=({size:e})=>{switch(e){case"small":return{padding:`3px ${r.spacing2Xs}`,fontSize:"0.625rem",lineHeight:"0.625rem",maxHeight:"16px"};default:return{padding:`0 ${r.spacingXs}`,fontSize:`calc(1rem * (12 / ${r.fontBaseDefault}))`,lineHeight:"20px",maxHeight:"20px"}}},d=({variant:e,size:t})=>n({fontFamily:r.fontStackPrimary,fontWeight:r.fontWeightDemiBold,textTransform:"uppercase",letterSpacing:"0.06rem",borderRadius:`${r.borderRadiusSmall}`,...l({variant:e}),...s({size:t})},""),u=(e,r)=>{const{children:n,variant:c="primary",size:l="default",className:s,...u}=e;return o.createElement(t,i({as:"div",testId:"cf-ui-badge",display:"inline-block",className:a(d({variant:c,size:l}),s)},u,{ref:r}),n)};export const Badge=o.forwardRef(u);const g={published:"positive",draft:"warning",archived:"negative",changed:"primary",deleted:"negative",new:"primary-filled"};function f(e,r){const{entityStatus:t,...a}=e,n=g[t];return o.createElement(Badge,i({},a,{variant:n,ref:r}),t)}export const EntityStatusBadge=o.forwardRef(f);e(c,"Badge",(function(){return Badge})),e(c,"EntityStatusBadge",(function(){return EntityStatusBadge})); | ||
import e from"@babel/runtime/helpers/esm/extends";import{cx as r,css as o}from"emotion";import t from"react";import{Box as a}from"@contentful/f36-core";import n from"@contentful/f36-tokens";function i(e,r,o,t){Object.defineProperty(e,r,{get:o,set:t,enumerable:!0,configurable:!0})}var c={};i(c,"Badge",(()=>f)),i(c,"EntityStatusBadge",(()=>p));const l=({variant:e})=>{switch(e){case"positive":return{color:n.colorGreenBase,backgroundColor:n.colorGreenLightest};case"primary":return{color:n.colorBlueBase,backgroundColor:n.colorBlueLightest};case"negative":return{color:n.colorRedBase,backgroundColor:n.colorRedLightest};case"warning":return{color:n.colorOrangeDark,backgroundColor:"#ffefd5"};case"secondary":return{color:n.colorTextBase,backgroundColor:n.colorElementLight};case"muted":return{color:n.colorTextMid,backgroundColor:n.colorElementLightest};case"primary-filled":return{color:n.colorWhite,backgroundColor:n.colorPrimary};case"featured":return{color:n.colorPurpleBase,backgroundColor:n.colorPurpleLightest};default:return{}}},s=({size:e})=>{switch(e){case"small":return{padding:`3px ${n.spacing2Xs}`,fontSize:"0.625rem",lineHeight:"0.625rem",maxHeight:"16px"};default:return{padding:`0 ${n.spacingXs}`,fontSize:`calc(1rem * (12 / ${n.fontBaseDefault}))`,lineHeight:"20px",maxHeight:"20px"}}},d=({variant:e,size:r})=>o({fontFamily:n.fontStackPrimary,fontWeight:n.fontWeightDemiBold,textTransform:"uppercase",letterSpacing:"0.06rem",borderRadius:`${n.borderRadiusSmall}`,...l({variant:e}),...s({size:r})},""),u=(o,n)=>{const{children:i,variant:c="primary",size:l="default",className:s,...u}=o;return t.createElement(a,e({as:"div",testId:"cf-ui-badge",display:"inline-block",className:r(d({variant:c,size:l}),s)},u,{ref:n}),i)},f=t.forwardRef(u),g={published:"positive",draft:"warning",archived:"negative",changed:"primary",deleted:"negative",new:"primary-filled"};function m(r,o){const{entityStatus:a,...n}=r,i=g[a];return t.createElement(f,e({},n,{variant:i,ref:o}),a)}const p=t.forwardRef(m);export{f as Badge,p as EntityStatusBadge}; | ||
//# sourceMappingURL=module.js.map |
{ | ||
"name": "@contentful/f36-badge", | ||
"version": "4.0.1-next-v4-4389.1990+46acac9e", | ||
"version": "4.0.1-next-v4-4457.1996+a8e784c0", | ||
"description": "Forma 36: Badge React Component", | ||
@@ -25,8 +25,8 @@ "license": "MIT", | ||
"@babel/runtime": "^7.6.2", | ||
"@contentful/f36-core": "4.0.1-next-v4-4389.1990+46acac9e", | ||
"@contentful/f36-tokens": "4.0.1-next-v4-4389.1990+46acac9e", | ||
"@contentful/f36-core": "4.0.1-next-v4-4457.1996+a8e784c0", | ||
"@contentful/f36-tokens": "4.0.1-next-v4-4457.1996+a8e784c0", | ||
"emotion": "^10.0.17" | ||
}, | ||
"devDependencies": { | ||
"@contentful/f36-typography": "4.0.1-next-v4-4389.1990+46acac9e" | ||
"@contentful/f36-typography": "4.0.1-next-v4-4457.1996+a8e784c0" | ||
}, | ||
@@ -39,3 +39,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "46acac9e2ca6e5eab92567ca267a3066f2bafce0" | ||
"gitHead": "a8e784c0a708a6ff8f86b1e95e882b7333126c48" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
43094