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

@contentful/f36-core

Package Overview
Dependencies
Maintainers
164
Versions
406
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/f36-core - npm Package Compare versions

Comparing version 4.42.0 to 4.43.0

22

dist/esm/index.js
import * as _ from 'react';
import ___default, { useMemo, useState, useCallback } from 'react';
import ___default, { useMemo, useState, useCallback, useRef, useEffect } from 'react';
import { css, Global } from '@emotion/core';
import P from '@contentful/f36-tokens';
import u from '@contentful/f36-tokens';
import { cx, css as css$1 } from 'emotion';
var le=Object.defineProperty,me=Object.defineProperties;var ce=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var X=(e,t,o)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,i=(e,t)=>{for(var o in t||(t={}))v.call(t,o)&&X(e,o,t[o]);if(A)for(var o of A(t))j.call(t,o)&&X(e,o,t[o]);return e},a=(e,t)=>me(e,ce(t));var c=(e,t)=>{var o={};for(var r in e)v.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&A)for(var r of A(e))t.indexOf(r)<0&&j.call(e,r)&&(o[r]=e[r]);return o};var fe=css`
var me=Object.defineProperty,ce=Object.defineProperties;var de=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var X=(e,t,o)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,i=(e,t)=>{for(var o in t||(t={}))v.call(t,o)&&X(e,o,t[o]);if(A)for(var o of A(t))j.call(t,o)&&X(e,o,t[o]);return e},p=(e,t)=>ce(e,de(t));var c=(e,t)=>{var o={};for(var r in e)v.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&A)for(var r of A(e))t.indexOf(r)<0&&j.call(e,r)&&(o[r]=e[r]);return o};var ye=css`
/* Remove default margin */

@@ -76,3 +76,3 @@ /* Button has default margin in some browsers, like safari */

`,W=({withNormalize:e=!0,styles:t})=>_.createElement(Global,{styles:css`
${e?fe:void 0};
${e?ye:void 0};
html {

@@ -86,10 +86,10 @@ border: 0;

body {
color: ${P.gray800};
font-family: ${P.fontStackPrimary};
font-size: ${P.fontSizeM};
line-height: ${P.lineHeightM};
color: ${u.gray800};
font-family: ${u.fontStackPrimary};
font-size: ${u.fontSizeM};
line-height: ${u.lineHeightM};
}
code {
font-family: ${P.fontStackMonospace};
font-family: ${u.fontStackMonospace};
}

@@ -112,5 +112,5 @@

${t};
`});var ye={none:0,spacing2Xs:P.spacing2Xs,spacingXs:P.spacingXs,spacingS:P.spacingS,spacingM:P.spacingM,spacingL:P.spacingL,spacingXl:P.spacingXl,spacing2Xl:P.spacing2Xl,spacing3Xl:P.spacing3Xl,spacing4Xl:P.spacing4Xl};function m(e){return ye[e]}function J(e){return Object.assign({},e.margin?{margin:m(e.margin)}:null,e.marginLeft?{marginLeft:m(e.marginLeft)}:null,e.marginRight?{marginRight:m(e.marginRight)}:null,e.marginTop?{marginTop:m(e.marginTop)}:null,e.marginBottom?{marginBottom:m(e.marginBottom)}:null,e.padding?{padding:m(e.padding)}:null,e.paddingLeft?{paddingLeft:m(e.paddingLeft)}:null,e.paddingRight?{paddingRight:m(e.paddingRight)}:null,e.paddingTop?{paddingTop:m(e.paddingTop)}:null,e.paddingBottom?{paddingBottom:m(e.paddingBottom)}:null)}var xe="div";function g(e){let E=e,{display:t,className:o,margin:r,marginBottom:s,marginLeft:p,marginRight:n,marginTop:l,padding:d,paddingBottom:f,paddingLeft:y,paddingRight:x,paddingTop:S,testId:R,as:h=xe}=E,T=c(E,["display","className","margin","marginBottom","marginLeft","marginRight","marginTop","padding","paddingBottom","paddingLeft","paddingRight","paddingTop","testId","as"]);return {boxProps:i({className:cx(css$1({display:t}),css$1(i({},J({margin:r,marginBottom:s,marginLeft:p,marginRight:n,marginTop:l,padding:d,paddingBottom:f,paddingLeft:y,paddingRight:x,paddingTop:S}))),o),["data-test-id"]:R},T),Element:h}}function H(e,t){let{boxProps:o,Element:r}=g(e);return _.createElement(r,a(i({},o),{ref:t}),e.children)}H.displayName="Box";var q=_.forwardRef(H);var Re="div";function V(we,pe){var O=we,{isInline:e,alignItems:t,alignSelf:o,alignContent:r,flex:s,flexBasis:p,flexShrink:n,flexDirection:l,flexGrow:d,flexWrap:f,fullHeight:y,fullWidth:x,gap:S,justifyContent:R,justifyItems:h,justifySelf:T,order:b,children:E,as:I}=O,G=c(O,["isInline","alignItems","alignSelf","alignContent","flex","flexBasis","flexShrink","flexDirection","flexGrow","flexWrap","fullHeight","fullWidth","gap","justifyContent","justifyItems","justifySelf","order","children","as"]);var N;let{boxProps:U,Element:se}=g(a(i({},G),{as:I||Re}));return _.createElement(se,a(i({},U),{className:cx(css$1({display:e?"inline-flex":"flex",width:x?"100%":void 0,height:y?"100%":void 0,flex:s,flexBasis:p,flexShrink:n,flexDirection:l,gap:(N=P[S])!=null?N:S,justifyContent:R,justifyItems:h,justifySelf:T,alignItems:t,alignSelf:o,alignContent:r,order:b,flexWrap:f,flexGrow:d}),U.className),ref:pe}),E)}V.displayName="Flex";var k=_.forwardRef(V);var Te="div";function Q(S,x){var R=S,{alignContent:e,children:t,columnGap:o="spacingM",columns:r="auto",flow:s,isInline:p,justifyContent:n,rowGap:l="none",rows:d="auto",as:f}=R,y=c(R,["alignContent","children","columnGap","columns","flow","isInline","justifyContent","rowGap","rows","as"]);var E,I;let h=G=>typeof G=="number"?`repeat(${G}, minmax(0, 1fr))`:G,{boxProps:T,Element:b}=g(a(i({},y),{as:f||Te}));return _.createElement(b,a(i({},T),{className:cx(css$1({display:p?"inline-grid":"grid",gridTemplateColumns:h(r),gridTemplateRows:h(d),flow:s,justifyContent:n,alignContent:e,columnGap:(E=m(o))!=null?E:0,rowGap:(I=m(l))!=null?I:0}),T.className),ref:x}),t)}Q.displayName="Grid";var Y=_.forwardRef(Q);function Z(f,d){var y=f,{children:e,columnStart:t,columnEnd:o,rowStart:r,rowEnd:s,area:p,order:n}=y,l=c(y,["children","columnStart","columnEnd","rowStart","rowEnd","area","order"]);let x=p||[r||"auto",t||"auto",s||"auto",o||"auto"].join(" / "),{boxProps:S,Element:R}=g(l);return _.createElement(R,a(i({},S),{className:cx(css$1({gridArea:x,order:n}),S.className),ref:d}),e)}Z.displayName="GridItem";var w=_.forwardRef(Z);var M=Y;M.Item=w;var be="div";function ee(d,l){var f=d,{flexDirection:e="row",alignItems:t="center",isInline:o=!1,spacing:r="spacingM",children:s,as:p}=f,n=c(f,["flexDirection","alignItems","isInline","spacing","children","as"]);let{boxProps:y,Element:x}=g(a(i({},n),{as:p||be}));return _.createElement(k,a(i({},y),{as:x,flexDirection:e,alignItems:t,isInline:o,className:y.className,gap:r,ref:l}),s)}ee.displayName="Stack";var te=_.forwardRef(ee);function oe(){return {screenReaderOnly:css$1({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",border:0})}}var re=p=>{var n=p,{children:e,className:t,testId:o="cf-ui-ScreenReaderOnly",as:r="div"}=n,s=c(n,["children","className","testId","as"]);let l=oe();return ___default.createElement(r,a(i({},s),{"data-test-id":o,className:cx(l.screenReaderOnly,t)}),e)};function ne(e,t){return useMemo(()=>e||[t||"id",Math.round(Math.random()*1e4)].join("_"),[])}function ae({isOpen:e,defaultIsOpen:t,onOpen:o,onClose:r}){let[s,p]=useState(t||!1),n=e!==void 0,l=n?e:s,d=useCallback(()=>{n||p(!1),r==null||r();},[n,r]),f=useCallback(()=>{n||p(!0),o==null||o();},[n,o]);return {isOpen:l,isControlled:n,handleClose:d,handleOpen:f}}function Be(...e){return t=>{e.forEach(o=>{typeof o=="function"?o(t):o!=null&&(o.current=t);});}}var Le=({status:e})=>{switch(e){case"published":return {color:P.colorGreenBase,backgroundColor:P.colorGreenLightest};case"changed":return {color:P.colorBlueBase,backgroundColor:P.colorBlueLightest};case"deleted":case"archived":return {color:P.colorRedBase,backgroundColor:P.colorRedLightest};case"draft":return {color:P.colorOrangeDark,backgroundColor:"#ffefd5"};case"new":return {color:P.colorWhite,backgroundColor:P.blue500};default:return console.warn(`Unknown EntityStatus: ${e}`),{}}};
`});var ge={none:0,spacing2Xs:u.spacing2Xs,spacingXs:u.spacingXs,spacingS:u.spacingS,spacingM:u.spacingM,spacingL:u.spacingL,spacingXl:u.spacingXl,spacing2Xl:u.spacing2Xl,spacing3Xl:u.spacing3Xl,spacing4Xl:u.spacing4Xl};function m(e){return ge[e]}function H(e){return Object.assign({},e.margin?{margin:m(e.margin)}:null,e.marginLeft?{marginLeft:m(e.marginLeft)}:null,e.marginRight?{marginRight:m(e.marginRight)}:null,e.marginTop?{marginTop:m(e.marginTop)}:null,e.marginBottom?{marginBottom:m(e.marginBottom)}:null,e.padding?{padding:m(e.padding)}:null,e.paddingLeft?{paddingLeft:m(e.paddingLeft)}:null,e.paddingRight?{paddingRight:m(e.paddingRight)}:null,e.paddingTop?{paddingTop:m(e.paddingTop)}:null,e.paddingBottom?{paddingBottom:m(e.paddingBottom)}:null)}var ue="div";function g(e){let E=e,{display:t,className:o,margin:r,marginBottom:a,marginLeft:s,marginRight:n,marginTop:l,padding:d,paddingBottom:f,paddingLeft:y,paddingRight:x,paddingTop:S,testId:R,as:h=ue}=E,T=c(E,["display","className","margin","marginBottom","marginLeft","marginRight","marginTop","padding","paddingBottom","paddingLeft","paddingRight","paddingTop","testId","as"]);return {boxProps:i({className:cx(css$1({display:t}),css$1(i({},H({margin:r,marginBottom:a,marginLeft:s,marginRight:n,marginTop:l,padding:d,paddingBottom:f,paddingLeft:y,paddingRight:x,paddingTop:S}))),o),["data-test-id"]:R},T),Element:h}}function K(e,t){let{boxProps:o,Element:r}=g(e);return _.createElement(r,p(i({},o),{ref:t}),e.children)}K.displayName="Box";var q=_.forwardRef(K);var Ee="div";function V(Ne,se){var U=Ne,{isInline:e,alignItems:t,alignSelf:o,alignContent:r,flex:a,flexBasis:s,flexShrink:n,flexDirection:l,flexGrow:d,flexWrap:f,fullHeight:y,fullWidth:x,gap:S,justifyContent:R,justifyItems:h,justifySelf:T,order:b,children:E,as:I}=U,G=c(U,["isInline","alignItems","alignSelf","alignContent","flex","flexBasis","flexShrink","flexDirection","flexGrow","flexWrap","fullHeight","fullWidth","gap","justifyContent","justifyItems","justifySelf","order","children","as"]);var N;let{boxProps:O,Element:le}=g(p(i({},G),{as:I||Ee}));return _.createElement(le,p(i({},O),{className:cx(css$1({display:e?"inline-flex":"flex",width:x?"100%":void 0,height:y?"100%":void 0,flex:a,flexBasis:s,flexShrink:n,flexDirection:l,gap:(N=u[S])!=null?N:S,justifyContent:R,justifyItems:h,justifySelf:T,alignItems:t,alignSelf:o,alignContent:r,order:b,flexWrap:f,flexGrow:d}),O.className),ref:se}),E)}V.displayName="Flex";var k=_.forwardRef(V);var Ge="div";function Q(S,x){var R=S,{alignContent:e,children:t,columnGap:o="spacingM",columns:r="auto",flow:a,isInline:s,justifyContent:n,rowGap:l="none",rows:d="auto",as:f}=R,y=c(R,["alignContent","children","columnGap","columns","flow","isInline","justifyContent","rowGap","rows","as"]);var E,I;let h=G=>typeof G=="number"?`repeat(${G}, minmax(0, 1fr))`:G,{boxProps:T,Element:b}=g(p(i({},y),{as:f||Ge}));return _.createElement(b,p(i({},T),{className:cx(css$1({display:s?"inline-grid":"grid",gridTemplateColumns:h(r),gridTemplateRows:h(d),flow:a,justifyContent:n,alignContent:e,columnGap:(E=m(o))!=null?E:0,rowGap:(I=m(l))!=null?I:0}),T.className),ref:x}),t)}Q.displayName="Grid";var Y=_.forwardRef(Q);function Z(f,d){var y=f,{children:e,columnStart:t,columnEnd:o,rowStart:r,rowEnd:a,area:s,order:n}=y,l=c(y,["children","columnStart","columnEnd","rowStart","rowEnd","area","order"]);let x=s||[r||"auto",t||"auto",a||"auto",o||"auto"].join(" / "),{boxProps:S,Element:R}=g(l);return _.createElement(R,p(i({},S),{className:cx(css$1({gridArea:x,order:n}),S.className),ref:d}),e)}Z.displayName="GridItem";var w=_.forwardRef(Z);var M=Y;M.Item=w;var Ie="div";function ee(d,l){var f=d,{flexDirection:e="row",alignItems:t="center",isInline:o=!1,spacing:r="spacingM",children:a,as:s}=f,n=c(f,["flexDirection","alignItems","isInline","spacing","children","as"]);let{boxProps:y,Element:x}=g(p(i({},n),{as:s||Ie}));return _.createElement(k,p(i({},y),{as:x,flexDirection:e,alignItems:t,isInline:o,className:y.className,gap:r,ref:l}),a)}ee.displayName="Stack";var te=_.forwardRef(ee);function oe(){return {screenReaderOnly:css$1({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",border:0})}}var re=s=>{var n=s,{children:e,className:t,testId:o="cf-ui-ScreenReaderOnly",as:r="div"}=n,a=c(n,["children","className","testId","as"]);let l=oe();return ___default.createElement(r,p(i({},a),{"data-test-id":o,className:cx(l.screenReaderOnly,t)}),e)};function ne(e,t){return useMemo(()=>e||[t||"id",Math.round(Math.random()*1e4)].join("_"),[])}function ie({isOpen:e,defaultIsOpen:t,onOpen:o,onClose:r}){let[a,s]=useState(t||!1),n=e!==void 0,l=n?e:a,d=useCallback(()=>{n||s(!1),r==null||r();},[n,r]),f=useCallback(()=>{n||s(!0),o==null||o();},[n,o]);return {isOpen:l,isControlled:n,handleClose:d,handleOpen:f}}function pe({onLoad:e}={}){let[t,o]=useState(!1),r=useRef(),a=useCallback(()=>{e==null||e(),o(!0);},[e]);return useEffect(()=>{r.current&&r.current.complete&&a();},[a]),{ref:r,loaded:t,onLoad:a}}function Ue(...e){return t=>{e.forEach(o=>{typeof o=="function"?o(t):o!=null&&(o.current=t);});}}var Oe=({status:e})=>{switch(e){case"published":return {color:u.colorGreenBase,backgroundColor:u.colorGreenLightest};case"changed":return {color:u.colorBlueBase,backgroundColor:u.colorBlueLightest};case"deleted":case"archived":return {color:u.colorRedBase,backgroundColor:u.colorRedLightest};case"draft":return {color:u.colorOrangeDark,backgroundColor:"#ffefd5"};case"new":return {color:u.colorWhite,backgroundColor:u.blue500};default:return console.warn(`Unknown EntityStatus: ${e}`),{}}};
export { q as Box, k as Flex, W as GlobalStyles, M as Grid, w as GridItem, re as ScreenReaderOnly, te as Stack, Le as getEntityStatusStyles, Be as mergeRefs, g as useBox, ae as useControllableState, ne as useId };
export { q as Box, k as Flex, W as GlobalStyles, M as Grid, w as GridItem, re as ScreenReaderOnly, te as Stack, Oe as getEntityStatusStyles, Ue as mergeRefs, g as useBox, ie as useControllableState, ne as useId, pe as useImageLoaded };
//# sourceMappingURL=index.js.map

@@ -306,2 +306,11 @@ import { SerializedStyles } from '@emotion/core';

interface UseImageLoadedProps {
onLoad?: () => unknown;
}
declare function useImageLoaded({ onLoad: onLoadProp, }?: UseImageLoadedProps): {
ref: React.MutableRefObject<HTMLImageElement>;
loaded: boolean;
onLoad: () => void;
};
declare type ReactRef<T> = React__default.Ref<T> | React__default.MutableRefObject<T>;

@@ -320,2 +329,2 @@ declare function mergeRefs<T>(...refs: Array<ReactRef<T> | undefined>): React__default.RefCallback<T>;

export { Box, BoxProps, CommonProps, EntityStatus, ExpandProps, Flex, FlexProps, GlobalStyles, Grid, GridItem, GridItemProps, GridProps, MarginProps, PaddingProps, PickUnion, PolymorphicComponent, PolymorphicProps, PropsWithHTMLElement, ScreenReaderOnly, ScreenReaderOnlyProps, Spacing, Stack, StackProps, UseControllableStateProps, getEntityStatusStyles, mergeRefs, useBox, useControllableState, useId };
export { Box, BoxProps, CommonProps, EntityStatus, ExpandProps, Flex, FlexProps, GlobalStyles, Grid, GridItem, GridItemProps, GridProps, MarginProps, PaddingProps, PickUnion, PolymorphicComponent, PolymorphicProps, PropsWithHTMLElement, ScreenReaderOnly, ScreenReaderOnlyProps, Spacing, Stack, StackProps, UseControllableStateProps, getEntityStatusStyles, mergeRefs, useBox, useControllableState, useId, useImageLoaded };

@@ -7,3 +7,3 @@ 'use strict';

var core = require('@emotion/core');
var P = require('@contentful/f36-tokens');
var u = require('@contentful/f36-tokens');
var emotion = require('emotion');

@@ -33,5 +33,5 @@

var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
var P__default = /*#__PURE__*/_interopDefaultLegacy(P);
var u__default = /*#__PURE__*/_interopDefaultLegacy(u);
var le=Object.defineProperty,me=Object.defineProperties;var ce=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var X=(e,t,o)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,i=(e,t)=>{for(var o in t||(t={}))v.call(t,o)&&X(e,o,t[o]);if(A)for(var o of A(t))j.call(t,o)&&X(e,o,t[o]);return e},a=(e,t)=>me(e,ce(t));var c=(e,t)=>{var o={};for(var r in e)v.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&A)for(var r of A(e))t.indexOf(r)<0&&j.call(e,r)&&(o[r]=e[r]);return o};var fe=core.css`
var me=Object.defineProperty,ce=Object.defineProperties;var de=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var X=(e,t,o)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,i=(e,t)=>{for(var o in t||(t={}))v.call(t,o)&&X(e,o,t[o]);if(A)for(var o of A(t))j.call(t,o)&&X(e,o,t[o]);return e},p=(e,t)=>ce(e,de(t));var c=(e,t)=>{var o={};for(var r in e)v.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&A)for(var r of A(e))t.indexOf(r)<0&&j.call(e,r)&&(o[r]=e[r]);return o};var ye=core.css`
/* Remove default margin */

@@ -105,3 +105,3 @@ /* Button has default margin in some browsers, like safari */

`,W=({withNormalize:e=!0,styles:t})=>___namespace.createElement(core.Global,{styles:core.css`
${e?fe:void 0};
${e?ye:void 0};
html {

@@ -115,10 +115,10 @@ border: 0;

body {
color: ${P__default["default"].gray800};
font-family: ${P__default["default"].fontStackPrimary};
font-size: ${P__default["default"].fontSizeM};
line-height: ${P__default["default"].lineHeightM};
color: ${u__default["default"].gray800};
font-family: ${u__default["default"].fontStackPrimary};
font-size: ${u__default["default"].fontSizeM};
line-height: ${u__default["default"].lineHeightM};
}
code {
font-family: ${P__default["default"].fontStackMonospace};
font-family: ${u__default["default"].fontStackMonospace};
}

@@ -141,3 +141,3 @@

${t};
`});var ye={none:0,spacing2Xs:P__default["default"].spacing2Xs,spacingXs:P__default["default"].spacingXs,spacingS:P__default["default"].spacingS,spacingM:P__default["default"].spacingM,spacingL:P__default["default"].spacingL,spacingXl:P__default["default"].spacingXl,spacing2Xl:P__default["default"].spacing2Xl,spacing3Xl:P__default["default"].spacing3Xl,spacing4Xl:P__default["default"].spacing4Xl};function m(e){return ye[e]}function J(e){return Object.assign({},e.margin?{margin:m(e.margin)}:null,e.marginLeft?{marginLeft:m(e.marginLeft)}:null,e.marginRight?{marginRight:m(e.marginRight)}:null,e.marginTop?{marginTop:m(e.marginTop)}:null,e.marginBottom?{marginBottom:m(e.marginBottom)}:null,e.padding?{padding:m(e.padding)}:null,e.paddingLeft?{paddingLeft:m(e.paddingLeft)}:null,e.paddingRight?{paddingRight:m(e.paddingRight)}:null,e.paddingTop?{paddingTop:m(e.paddingTop)}:null,e.paddingBottom?{paddingBottom:m(e.paddingBottom)}:null)}var xe="div";function g(e){let E=e,{display:t,className:o,margin:r,marginBottom:s,marginLeft:p,marginRight:n,marginTop:l,padding:d,paddingBottom:f,paddingLeft:y,paddingRight:x,paddingTop:S,testId:R,as:h=xe}=E,T=c(E,["display","className","margin","marginBottom","marginLeft","marginRight","marginTop","padding","paddingBottom","paddingLeft","paddingRight","paddingTop","testId","as"]);return {boxProps:i({className:emotion.cx(emotion.css({display:t}),emotion.css(i({},J({margin:r,marginBottom:s,marginLeft:p,marginRight:n,marginTop:l,padding:d,paddingBottom:f,paddingLeft:y,paddingRight:x,paddingTop:S}))),o),["data-test-id"]:R},T),Element:h}}function H(e,t){let{boxProps:o,Element:r}=g(e);return ___namespace.createElement(r,a(i({},o),{ref:t}),e.children)}H.displayName="Box";var q=___namespace.forwardRef(H);var Re="div";function V(we,pe){var O=we,{isInline:e,alignItems:t,alignSelf:o,alignContent:r,flex:s,flexBasis:p,flexShrink:n,flexDirection:l,flexGrow:d,flexWrap:f,fullHeight:y,fullWidth:x,gap:S,justifyContent:R,justifyItems:h,justifySelf:T,order:b,children:E,as:I}=O,G=c(O,["isInline","alignItems","alignSelf","alignContent","flex","flexBasis","flexShrink","flexDirection","flexGrow","flexWrap","fullHeight","fullWidth","gap","justifyContent","justifyItems","justifySelf","order","children","as"]);var N;let{boxProps:U,Element:se}=g(a(i({},G),{as:I||Re}));return ___namespace.createElement(se,a(i({},U),{className:emotion.cx(emotion.css({display:e?"inline-flex":"flex",width:x?"100%":void 0,height:y?"100%":void 0,flex:s,flexBasis:p,flexShrink:n,flexDirection:l,gap:(N=P__default["default"][S])!=null?N:S,justifyContent:R,justifyItems:h,justifySelf:T,alignItems:t,alignSelf:o,alignContent:r,order:b,flexWrap:f,flexGrow:d}),U.className),ref:pe}),E)}V.displayName="Flex";var k=___namespace.forwardRef(V);var Te="div";function Q(S,x){var R=S,{alignContent:e,children:t,columnGap:o="spacingM",columns:r="auto",flow:s,isInline:p,justifyContent:n,rowGap:l="none",rows:d="auto",as:f}=R,y=c(R,["alignContent","children","columnGap","columns","flow","isInline","justifyContent","rowGap","rows","as"]);var E,I;let h=G=>typeof G=="number"?`repeat(${G}, minmax(0, 1fr))`:G,{boxProps:T,Element:b}=g(a(i({},y),{as:f||Te}));return ___namespace.createElement(b,a(i({},T),{className:emotion.cx(emotion.css({display:p?"inline-grid":"grid",gridTemplateColumns:h(r),gridTemplateRows:h(d),flow:s,justifyContent:n,alignContent:e,columnGap:(E=m(o))!=null?E:0,rowGap:(I=m(l))!=null?I:0}),T.className),ref:x}),t)}Q.displayName="Grid";var Y=___namespace.forwardRef(Q);function Z(f,d){var y=f,{children:e,columnStart:t,columnEnd:o,rowStart:r,rowEnd:s,area:p,order:n}=y,l=c(y,["children","columnStart","columnEnd","rowStart","rowEnd","area","order"]);let x=p||[r||"auto",t||"auto",s||"auto",o||"auto"].join(" / "),{boxProps:S,Element:R}=g(l);return ___namespace.createElement(R,a(i({},S),{className:emotion.cx(emotion.css({gridArea:x,order:n}),S.className),ref:d}),e)}Z.displayName="GridItem";var w=___namespace.forwardRef(Z);var M=Y;M.Item=w;var be="div";function ee(d,l){var f=d,{flexDirection:e="row",alignItems:t="center",isInline:o=!1,spacing:r="spacingM",children:s,as:p}=f,n=c(f,["flexDirection","alignItems","isInline","spacing","children","as"]);let{boxProps:y,Element:x}=g(a(i({},n),{as:p||be}));return ___namespace.createElement(k,a(i({},y),{as:x,flexDirection:e,alignItems:t,isInline:o,className:y.className,gap:r,ref:l}),s)}ee.displayName="Stack";var te=___namespace.forwardRef(ee);function oe(){return {screenReaderOnly:emotion.css({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",border:0})}}var re=p=>{var n=p,{children:e,className:t,testId:o="cf-ui-ScreenReaderOnly",as:r="div"}=n,s=c(n,["children","className","testId","as"]);let l=oe();return ___default["default"].createElement(r,a(i({},s),{"data-test-id":o,className:emotion.cx(l.screenReaderOnly,t)}),e)};function ne(e,t){return _.useMemo(()=>e||[t||"id",Math.round(Math.random()*1e4)].join("_"),[])}function ae({isOpen:e,defaultIsOpen:t,onOpen:o,onClose:r}){let[s,p]=_.useState(t||!1),n=e!==void 0,l=n?e:s,d=_.useCallback(()=>{n||p(!1),r==null||r();},[n,r]),f=_.useCallback(()=>{n||p(!0),o==null||o();},[n,o]);return {isOpen:l,isControlled:n,handleClose:d,handleOpen:f}}function Be(...e){return t=>{e.forEach(o=>{typeof o=="function"?o(t):o!=null&&(o.current=t);});}}var Le=({status:e})=>{switch(e){case"published":return {color:P__default["default"].colorGreenBase,backgroundColor:P__default["default"].colorGreenLightest};case"changed":return {color:P__default["default"].colorBlueBase,backgroundColor:P__default["default"].colorBlueLightest};case"deleted":case"archived":return {color:P__default["default"].colorRedBase,backgroundColor:P__default["default"].colorRedLightest};case"draft":return {color:P__default["default"].colorOrangeDark,backgroundColor:"#ffefd5"};case"new":return {color:P__default["default"].colorWhite,backgroundColor:P__default["default"].blue500};default:return console.warn(`Unknown EntityStatus: ${e}`),{}}};
`});var ge={none:0,spacing2Xs:u__default["default"].spacing2Xs,spacingXs:u__default["default"].spacingXs,spacingS:u__default["default"].spacingS,spacingM:u__default["default"].spacingM,spacingL:u__default["default"].spacingL,spacingXl:u__default["default"].spacingXl,spacing2Xl:u__default["default"].spacing2Xl,spacing3Xl:u__default["default"].spacing3Xl,spacing4Xl:u__default["default"].spacing4Xl};function m(e){return ge[e]}function H(e){return Object.assign({},e.margin?{margin:m(e.margin)}:null,e.marginLeft?{marginLeft:m(e.marginLeft)}:null,e.marginRight?{marginRight:m(e.marginRight)}:null,e.marginTop?{marginTop:m(e.marginTop)}:null,e.marginBottom?{marginBottom:m(e.marginBottom)}:null,e.padding?{padding:m(e.padding)}:null,e.paddingLeft?{paddingLeft:m(e.paddingLeft)}:null,e.paddingRight?{paddingRight:m(e.paddingRight)}:null,e.paddingTop?{paddingTop:m(e.paddingTop)}:null,e.paddingBottom?{paddingBottom:m(e.paddingBottom)}:null)}var ue="div";function g(e){let E=e,{display:t,className:o,margin:r,marginBottom:a,marginLeft:s,marginRight:n,marginTop:l,padding:d,paddingBottom:f,paddingLeft:y,paddingRight:x,paddingTop:S,testId:R,as:h=ue}=E,T=c(E,["display","className","margin","marginBottom","marginLeft","marginRight","marginTop","padding","paddingBottom","paddingLeft","paddingRight","paddingTop","testId","as"]);return {boxProps:i({className:emotion.cx(emotion.css({display:t}),emotion.css(i({},H({margin:r,marginBottom:a,marginLeft:s,marginRight:n,marginTop:l,padding:d,paddingBottom:f,paddingLeft:y,paddingRight:x,paddingTop:S}))),o),["data-test-id"]:R},T),Element:h}}function K(e,t){let{boxProps:o,Element:r}=g(e);return ___namespace.createElement(r,p(i({},o),{ref:t}),e.children)}K.displayName="Box";var q=___namespace.forwardRef(K);var Ee="div";function V(Ne,se){var U=Ne,{isInline:e,alignItems:t,alignSelf:o,alignContent:r,flex:a,flexBasis:s,flexShrink:n,flexDirection:l,flexGrow:d,flexWrap:f,fullHeight:y,fullWidth:x,gap:S,justifyContent:R,justifyItems:h,justifySelf:T,order:b,children:E,as:I}=U,G=c(U,["isInline","alignItems","alignSelf","alignContent","flex","flexBasis","flexShrink","flexDirection","flexGrow","flexWrap","fullHeight","fullWidth","gap","justifyContent","justifyItems","justifySelf","order","children","as"]);var N;let{boxProps:O,Element:le}=g(p(i({},G),{as:I||Ee}));return ___namespace.createElement(le,p(i({},O),{className:emotion.cx(emotion.css({display:e?"inline-flex":"flex",width:x?"100%":void 0,height:y?"100%":void 0,flex:a,flexBasis:s,flexShrink:n,flexDirection:l,gap:(N=u__default["default"][S])!=null?N:S,justifyContent:R,justifyItems:h,justifySelf:T,alignItems:t,alignSelf:o,alignContent:r,order:b,flexWrap:f,flexGrow:d}),O.className),ref:se}),E)}V.displayName="Flex";var k=___namespace.forwardRef(V);var Ge="div";function Q(S,x){var R=S,{alignContent:e,children:t,columnGap:o="spacingM",columns:r="auto",flow:a,isInline:s,justifyContent:n,rowGap:l="none",rows:d="auto",as:f}=R,y=c(R,["alignContent","children","columnGap","columns","flow","isInline","justifyContent","rowGap","rows","as"]);var E,I;let h=G=>typeof G=="number"?`repeat(${G}, minmax(0, 1fr))`:G,{boxProps:T,Element:b}=g(p(i({},y),{as:f||Ge}));return ___namespace.createElement(b,p(i({},T),{className:emotion.cx(emotion.css({display:s?"inline-grid":"grid",gridTemplateColumns:h(r),gridTemplateRows:h(d),flow:a,justifyContent:n,alignContent:e,columnGap:(E=m(o))!=null?E:0,rowGap:(I=m(l))!=null?I:0}),T.className),ref:x}),t)}Q.displayName="Grid";var Y=___namespace.forwardRef(Q);function Z(f,d){var y=f,{children:e,columnStart:t,columnEnd:o,rowStart:r,rowEnd:a,area:s,order:n}=y,l=c(y,["children","columnStart","columnEnd","rowStart","rowEnd","area","order"]);let x=s||[r||"auto",t||"auto",a||"auto",o||"auto"].join(" / "),{boxProps:S,Element:R}=g(l);return ___namespace.createElement(R,p(i({},S),{className:emotion.cx(emotion.css({gridArea:x,order:n}),S.className),ref:d}),e)}Z.displayName="GridItem";var w=___namespace.forwardRef(Z);var M=Y;M.Item=w;var Ie="div";function ee(d,l){var f=d,{flexDirection:e="row",alignItems:t="center",isInline:o=!1,spacing:r="spacingM",children:a,as:s}=f,n=c(f,["flexDirection","alignItems","isInline","spacing","children","as"]);let{boxProps:y,Element:x}=g(p(i({},n),{as:s||Ie}));return ___namespace.createElement(k,p(i({},y),{as:x,flexDirection:e,alignItems:t,isInline:o,className:y.className,gap:r,ref:l}),a)}ee.displayName="Stack";var te=___namespace.forwardRef(ee);function oe(){return {screenReaderOnly:emotion.css({position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",border:0})}}var re=s=>{var n=s,{children:e,className:t,testId:o="cf-ui-ScreenReaderOnly",as:r="div"}=n,a=c(n,["children","className","testId","as"]);let l=oe();return ___default["default"].createElement(r,p(i({},a),{"data-test-id":o,className:emotion.cx(l.screenReaderOnly,t)}),e)};function ne(e,t){return _.useMemo(()=>e||[t||"id",Math.round(Math.random()*1e4)].join("_"),[])}function ie({isOpen:e,defaultIsOpen:t,onOpen:o,onClose:r}){let[a,s]=_.useState(t||!1),n=e!==void 0,l=n?e:a,d=_.useCallback(()=>{n||s(!1),r==null||r();},[n,r]),f=_.useCallback(()=>{n||s(!0),o==null||o();},[n,o]);return {isOpen:l,isControlled:n,handleClose:d,handleOpen:f}}function pe({onLoad:e}={}){let[t,o]=_.useState(!1),r=_.useRef(),a=_.useCallback(()=>{e==null||e(),o(!0);},[e]);return _.useEffect(()=>{r.current&&r.current.complete&&a();},[a]),{ref:r,loaded:t,onLoad:a}}function Ue(...e){return t=>{e.forEach(o=>{typeof o=="function"?o(t):o!=null&&(o.current=t);});}}var Oe=({status:e})=>{switch(e){case"published":return {color:u__default["default"].colorGreenBase,backgroundColor:u__default["default"].colorGreenLightest};case"changed":return {color:u__default["default"].colorBlueBase,backgroundColor:u__default["default"].colorBlueLightest};case"deleted":case"archived":return {color:u__default["default"].colorRedBase,backgroundColor:u__default["default"].colorRedLightest};case"draft":return {color:u__default["default"].colorOrangeDark,backgroundColor:"#ffefd5"};case"new":return {color:u__default["default"].colorWhite,backgroundColor:u__default["default"].blue500};default:return console.warn(`Unknown EntityStatus: ${e}`),{}}};

@@ -151,7 +151,8 @@ exports.Box = q;

exports.Stack = te;
exports.getEntityStatusStyles = Le;
exports.mergeRefs = Be;
exports.getEntityStatusStyles = Oe;
exports.mergeRefs = Ue;
exports.useBox = g;
exports.useControllableState = ae;
exports.useControllableState = ie;
exports.useId = ne;
exports.useImageLoaded = pe;
//# sourceMappingURL=index.js.map
{
"name": "@contentful/f36-core",
"version": "4.42.0",
"version": "4.43.0",
"description": "Forma 36 core",

@@ -5,0 +5,0 @@ "license": "MIT",

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