Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contentful/f36-badge

Package Overview
Dependencies
Maintainers
99
Versions
406
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/f36-badge - npm Package Compare versions

Comparing version 4.0.1-next-v4-3661.1921 to 4.0.1-next-v4-3678.1922

2

dist/main.js

@@ -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{jsx:t}=require("@emotion/core"),o=e(require("@contentful/f36-tokens")),{Box:n}=require("@contentful/f36-core"),a=e(require("react")),i=e(require("@babel/runtime/helpers/extends")),c={};const l=({variant:e})=>{switch(e){case"positive":return{color:o.colorGreenBase,backgroundColor:o.colorGreenLightest};case"primary":return{color:o.colorBlueBase,backgroundColor:o.colorBlueLightest};case"negative":return{color:o.colorRedBase,backgroundColor:o.colorRedLightest};case"warning":return{color:o.colorOrangeDark,backgroundColor:"#ffefd5"};case"secondary":return{color:o.colorTextBase,backgroundColor:o.colorElementLight};case"muted":return{color:o.colorTextMid,backgroundColor:o.colorElementLightest};case"primary-filled":return{color:o.colorWhite,backgroundColor:o.colorPrimary};default:return{}}},s=({size:e})=>{switch(e){case"small":return{padding:`3px ${o.spacing2Xs}`,fontSize:"0.625rem",lineHeight:"0.625rem",maxHeight:"16px"};default:return{padding:`0 ${o.spacingXs}`,fontSize:`calc(1rem * (12 / ${o.fontBaseDefault}))`,lineHeight:"20px",maxHeight:"20px"}}},u=({variant:e,size:r})=>[{fontFamily:o.fontStackPrimary,fontWeight:o.fontWeightDemiBold,textTransform:"uppercase",letterSpacing:"0.06rem",borderRadius:`${o.borderRadiusSmall}`},l({variant:e}),s({size:r})],d=(e,r)=>{const{children:o,variant:a="primary",size:c="default",...l}=e;return t(n,i({as:"div",testId:"cf-ui-badge",display:"inline-block",css:u({variant:a,size:c})},l,{ref:r}),o)},f=a.forwardRef(d);exports.Badge=f;const g={published:"positive",draft:"warning",archived:"negative",changed:"primary",deleted:"negative",new:"primary-filled"};function m(e,r){const{entityStatus:o,...n}=e;return t(f,i({},n,{variant:g[o],ref:r}),o)}const p=a.forwardRef(m);exports.EntityStatusBadge=p,r(c,"Badge",(function(){return f})),r(c,"EntityStatusBadge",(function(){return p}));
function e(e){return e&&e.__esModule?e.default:e}function r(e,r,t){Object.defineProperty(e,r,{get:t,enumerable:!0})}var{jsx:t}=require("@emotion/core"),o=e(require("@contentful/f36-tokens")),{Box:a}=require("@contentful/f36-core"),n=e(require("react")),i=e(require("@babel/runtime/helpers/extends")),c={};const l=({variant:e})=>{switch(e){case"positive":return{color:o.colorGreenBase,backgroundColor:o.colorGreenLightest};case"primary":return{color:o.colorBlueBase,backgroundColor:o.colorBlueLightest};case"negative":return{color:o.colorRedBase,backgroundColor:o.colorRedLightest};case"warning":return{color:o.colorOrangeDark,backgroundColor:"#ffefd5"};case"secondary":return{color:o.colorTextBase,backgroundColor:o.colorElementLight};case"muted":return{color:o.colorTextMid,backgroundColor:o.colorElementLightest};case"primary-filled":return{color:o.colorWhite,backgroundColor:o.colorPrimary};case"featured":return{color:o.colorPurpleBase,backgroundColor:o.colorPurpleLightest};default:return{}}},s=({size:e})=>{switch(e){case"small":return{padding:`3px ${o.spacing2Xs}`,fontSize:"0.625rem",lineHeight:"0.625rem",maxHeight:"16px"};default:return{padding:`0 ${o.spacingXs}`,fontSize:`calc(1rem * (12 / ${o.fontBaseDefault}))`,lineHeight:"20px",maxHeight:"20px"}}},u=({variant:e,size:r})=>[{fontFamily:o.fontStackPrimary,fontWeight:o.fontWeightDemiBold,textTransform:"uppercase",letterSpacing:"0.06rem",borderRadius:`${o.borderRadiusSmall}`},l({variant:e}),s({size:r})],d=(e,r)=>{const{children:o,variant:n="primary",size:c="default",...l}=e;return t(a,i({as:"div",testId:"cf-ui-badge",display:"inline-block",css:u({variant:n,size:c})},l,{ref:r}),o)},g=n.forwardRef(d);exports.Badge=g;const f={published:"positive",draft:"warning",archived:"negative",changed:"primary",deleted:"negative",new:"primary-filled"};function p(e,r){const{entityStatus:o,...a}=e;return t(g,i({},a,{variant:f[o],ref:r}),o)}const m=n.forwardRef(p);exports.EntityStatusBadge=m,r(c,"Badge",(function(){return g})),r(c,"EntityStatusBadge",(function(){return m}));
//# sourceMappingURL=main.js.map

@@ -1,2 +0,2 @@

function e(e,r,t){Object.defineProperty(e,r,{get:t,enumerable:!0})}import{jsx as r}from"@emotion/core";import t from"@contentful/f36-tokens";import{Box as o}from"@contentful/f36-core";import a from"react";import n from"@babel/runtime/helpers/esm/extends";var i={};const c=({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};default:return{}}},l=({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"}}},s=({variant:e,size:r})=>[{fontFamily:t.fontStackPrimary,fontWeight:t.fontWeightDemiBold,textTransform:"uppercase",letterSpacing:"0.06rem",borderRadius:`${t.borderRadiusSmall}`},c({variant:e}),l({size:r})],d=(e,t)=>{const{children:a,variant:i="primary",size:c="default",...l}=e;return r(o,n({as:"div",testId:"cf-ui-badge",display:"inline-block",css:s({variant:i,size:c})},l,{ref:t}),a)};export const Badge=a.forwardRef(d);const u={published:"positive",draft:"warning",archived:"negative",changed:"primary",deleted:"negative",new:"primary-filled"};function f(e,t){const{entityStatus:o,...a}=e;return r(Badge,n({},a,{variant:u[o],ref:t}),o)}export const EntityStatusBadge=a.forwardRef(f);e(i,"Badge",(function(){return Badge})),e(i,"EntityStatusBadge",(function(){return EntityStatusBadge}));
function e(e,r,o){Object.defineProperty(e,r,{get:o,enumerable:!0})}import{jsx as r}from"@emotion/core";import o from"@contentful/f36-tokens";import{Box as t}from"@contentful/f36-core";import a from"react";import n from"@babel/runtime/helpers/esm/extends";var i={};const c=({variant:e})=>{switch(e){case"positive":return{color:o.colorGreenBase,backgroundColor:o.colorGreenLightest};case"primary":return{color:o.colorBlueBase,backgroundColor:o.colorBlueLightest};case"negative":return{color:o.colorRedBase,backgroundColor:o.colorRedLightest};case"warning":return{color:o.colorOrangeDark,backgroundColor:"#ffefd5"};case"secondary":return{color:o.colorTextBase,backgroundColor:o.colorElementLight};case"muted":return{color:o.colorTextMid,backgroundColor:o.colorElementLightest};case"primary-filled":return{color:o.colorWhite,backgroundColor:o.colorPrimary};case"featured":return{color:o.colorPurpleBase,backgroundColor:o.colorPurpleLightest};default:return{}}},l=({size:e})=>{switch(e){case"small":return{padding:`3px ${o.spacing2Xs}`,fontSize:"0.625rem",lineHeight:"0.625rem",maxHeight:"16px"};default:return{padding:`0 ${o.spacingXs}`,fontSize:`calc(1rem * (12 / ${o.fontBaseDefault}))`,lineHeight:"20px",maxHeight:"20px"}}},s=({variant:e,size:r})=>[{fontFamily:o.fontStackPrimary,fontWeight:o.fontWeightDemiBold,textTransform:"uppercase",letterSpacing:"0.06rem",borderRadius:`${o.borderRadiusSmall}`},c({variant:e}),l({size:r})],d=(e,o)=>{const{children:a,variant:i="primary",size:c="default",...l}=e;return r(t,n({as:"div",testId:"cf-ui-badge",display:"inline-block",css:s({variant:i,size:c})},l,{ref:o}),a)};export const Badge=a.forwardRef(d);const u={published:"positive",draft:"warning",archived:"negative",changed:"primary",deleted:"negative",new:"primary-filled"};function g(e,o){const{entityStatus:t,...a}=e;return r(Badge,n({},a,{variant:u[t],ref:o}),t)}export const EntityStatusBadge=a.forwardRef(g);e(i,"Badge",(function(){return Badge})),e(i,"EntityStatusBadge",(function(){return EntityStatusBadge}));
//# sourceMappingURL=module.js.map
import { ComponentVariant, CommonProps, EntityStatus } from "@contentful/f36-core";
import React from "react";
type BadgeSize = 'default' | 'small';
export type BadgeVariant = ComponentVariant | 'muted' | 'primary-filled';
export type BadgeVariant = ComponentVariant | 'muted' | 'primary-filled' | 'featured';
export interface BadgeProps extends CommonProps {

@@ -6,0 +6,0 @@ /**

{
"name": "@contentful/f36-badge",
"version": "4.0.1-next-v4-3661.1921+6d00d55b",
"version": "4.0.1-next-v4-3678.1922+cb3b7293",
"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-3661.1921+6d00d55b",
"@contentful/f36-tokens": "4.0.1-next-v4-3661.1921+6d00d55b",
"@contentful/f36-core": "4.0.1-next-v4-3678.1922+cb3b7293",
"@contentful/f36-tokens": "4.0.1-next-v4-3678.1922+cb3b7293",
"@emotion/core": "^10.1.1"
},
"devDependencies": {
"@contentful/f36-typography": "4.0.1-next-v4-3661.1921+6d00d55b"
"@contentful/f36-typography": "4.0.1-next-v4-3678.1922+cb3b7293"
},

@@ -39,3 +39,3 @@ "peerDependencies": {

},
"gitHead": "6d00d55b79d034e6677b277adabee0fc342162d7"
"gitHead": "cb3b72932d95ca398b0bdf9c823677b0f807ae05"
}

@@ -47,2 +47,7 @@ import tokens from '@contentful/f36-tokens';

};
case 'featured':
return {
color: tokens.colorPurpleBase,
backgroundColor: tokens.colorPurpleLightest,
};
default:

@@ -49,0 +54,0 @@ return {};

@@ -5,2 +5,6 @@ import type { ComponentVariant } from '@contentful/f36-core';

export type BadgeVariant = ComponentVariant | 'muted' | 'primary-filled';
export type BadgeVariant =
| ComponentVariant
| 'muted'
| 'primary-filled'
| 'featured';

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc