@contentful/f36-core
Advanced tools
Comparing version 4.56.0 to 4.56.2
import * as _ from 'react'; | ||
import ___default, { useMemo, useState, useCallback, useRef, useEffect } from 'react'; | ||
import { css, Global } from '@emotion/core'; | ||
import u from '@contentful/f36-tokens'; | ||
import P from '@contentful/f36-tokens'; | ||
import { cx, css as css$1 } from 'emotion'; | ||
@@ -85,10 +85,10 @@ | ||
body { | ||
color: ${u.gray800}; | ||
font-family: ${u.fontStackPrimary}; | ||
font-size: ${u.fontSizeM}; | ||
line-height: ${u.lineHeightM}; | ||
color: ${P.gray800}; | ||
font-family: ${P.fontStackPrimary}; | ||
font-size: ${P.fontSizeM}; | ||
line-height: ${P.lineHeightM}; | ||
} | ||
code { | ||
font-family: ${u.fontStackMonospace}; | ||
font-family: ${P.fontStackMonospace}; | ||
} | ||
@@ -111,3 +111,3 @@ | ||
${t}; | ||
`});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}`),{}}}; | ||
`});var ge={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 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:u,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:u}))),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:u,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:u==="none"?0:(N=P[u])!=null?N:u,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(u,x){var R=u,{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:u,Element:R}=g(l);return _.createElement(R,p(i({},u),{className:cx(css$1({gridArea:x,order:n}),u.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: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}`),{}}}; | ||
@@ -114,0 +114,0 @@ 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 }; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var core = require('@emotion/core'); | ||
var u = require('@contentful/f36-tokens'); | ||
var P = require('@contentful/f36-tokens'); | ||
var emotion = require('emotion'); | ||
@@ -30,3 +30,3 @@ | ||
var ___namespace = /*#__PURE__*/_interopNamespace(_); | ||
var u__default = /*#__PURE__*/_interopDefault(u); | ||
var P__default = /*#__PURE__*/_interopDefault(P); | ||
@@ -111,10 +111,10 @@ 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` | ||
body { | ||
color: ${u__default.default.gray800}; | ||
font-family: ${u__default.default.fontStackPrimary}; | ||
font-size: ${u__default.default.fontSizeM}; | ||
line-height: ${u__default.default.lineHeightM}; | ||
color: ${P__default.default.gray800}; | ||
font-family: ${P__default.default.fontStackPrimary}; | ||
font-size: ${P__default.default.fontSizeM}; | ||
line-height: ${P__default.default.lineHeightM}; | ||
} | ||
code { | ||
font-family: ${u__default.default.fontStackMonospace}; | ||
font-family: ${P__default.default.fontStackMonospace}; | ||
} | ||
@@ -137,3 +137,3 @@ | ||
${t}; | ||
`});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 ___namespace.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}`),{}}}; | ||
`});var ge={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 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:u,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:u}))),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:u,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:u==="none"?0:(N=P__default.default[u])!=null?N:u,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(u,x){var R=u,{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:u,Element:R}=g(l);return ___namespace.createElement(R,p(i({},u),{className:emotion.cx(emotion.css({gridArea:x,order:n}),u.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 ___namespace.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: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}`),{}}}; | ||
@@ -140,0 +140,0 @@ exports.Box = q; |
{ | ||
"name": "@contentful/f36-core", | ||
"version": "4.56.0", | ||
"version": "4.56.2", | ||
"description": "Forma 36 core", | ||
@@ -22,3 +22,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@contentful/f36-tokens": "^4.0.2", | ||
"@contentful/f36-tokens": "^4.0.3", | ||
"@emotion/core": "^10.1.1", | ||
@@ -25,0 +25,0 @@ "@emotion/is-prop-valid": "^1.2.0", |
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
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
112874