@contentful/f36-entity-list 6.0.0-alpha.3 → 6.0.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.
Files changed (2) hide show
  1. package/dist/esm/index.js +1 -1
  2. package/package.json +11 -11
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import e from'react';import {css,cx}from'@emotion/css';import i from'@contentful/f36-tokens';import {EntityStatusBadge}from'@contentful/f36-badge';import {Flex,Box}from'@contentful/f36-core';import {PaintBrushIcon,FileIcon,ReleaseIcon,EntryIcon,ImageSquareIcon,DotsThreeIcon}from'@contentful/f36-icons';import {Icon}from'@contentful/f36-icon';import {Text}from'@contentful/f36-typography';import {DragHandle}from'@contentful/f36-drag-handle';import {Button}from'@contentful/f36-button';import {Menu}from'@contentful/f36-menu';import {Skeleton}from'@contentful/f36-skeleton';var K=Object.defineProperty,Q=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var k=(t,n,o)=>n in t?K(t,n,{enumerable:true,configurable:true,writable:true,value:o}):t[n]=o,l=(t,n)=>{for(var o in n||(n={}))v.call(n,o)&&k(t,o,n[o]);if(p)for(var o of p(n))N.call(n,o)&&k(t,o,n[o]);return t},d=(t,n)=>Q(t,V(n));var w=(t,n)=>{var o={};for(var r in t)v.call(t,r)&&n.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&p)for(var r of p(t))n.indexOf(r)<0&&N.call(t,r)&&(o[r]=t[r]);return o};var X=()=>({root:css({display:"block",listStyle:"none",margin:0,padding:0,border:`1px solid ${i.gray200}`,borderBottom:"none",borderRadius:i.borderRadiusMedium,overflow:"hidden"})});function A(t,n){let o=X();return e.createElement("ul",{"data-test-id":t.testId||"cf-ui-entity-list",ref:n,className:cx(o.root,t.className),style:t.style},t.children)}A.displayName="EntityList";var B=e.forwardRef(A);var $=()=>({root:t=>css(d(l({display:"flex",boxShadow:`inset 0 -1px 0 ${i.gray200}`,position:"relative",transition:`${i.transitionDurationShort} ${i.transitionEasingDefault}`,transitionProperty:"box-shadow, background-color",backgroundColor:i.colorWhite},t.isDragActive?{boxShadow:i.boxShadowHeavy}:{}),{"&:hover":{backgroundColor:i.gray100}})),card:t=>css({display:"flex",textDecoration:"none",minWidth:0,width:"100%",minHeight:i.spacing3Xl,padding:i.spacingXs,margin:0,border:"none",background:"none",textAlign:"left",cursor:t?"pointer":"inherit","&:focus-visible":{boxShadow:`inset ${i.glowPrimary}`,outline:"none"}}),content:css({flexGrow:1,minWidth:0,position:"relative"}),media:css({display:"flex",flexShrink:0,alignItems:"center",justifyContent:"center",backgroundColor:i.gray200,width:i.spacing2Xl,height:i.spacing2Xl,margin:"0",marginRight:i.spacingXs}),thumbnail:css({display:"block",width:"100%",height:"100%",objectFit:"cover"}),contentType:css({marginLeft:i.spacingXs}),entityType:css({textTransform:"capitalize"}),description:css({"&::before":{content:'"|"',color:i.gray400,height:"25%",marginTop:i.spacing2Xs,marginLeft:i.spacing2Xs,marginRight:i.spacing2Xs}}),meta:css({marginLeft:"auto",flexShrink:0}),dragHandle:css({borderBottomLeftRadius:"0",borderTopLeftRadius:"0",boxShadow:`inset 0 -1px 0 ${i.gray200}`}),menuTrigger:css({padding:"0 0.125rem",minHeight:"1.5rem",height:"1rem",margin:`${i.spacingXs} ${i.spacingXs} 0 0`})});var dt={asset:ImageSquareIcon,entry:EntryIcon,release:ReleaseIcon,page:FileIcon,experience:PaintBrushIcon},y=ct=>{var T=ct,{className:t,testId:n="cf-ui-entity-list-item",title:o,description:r,contentType:b,entityType:m="entry",withThumbnail:W=true,thumbnailUrl:I,thumbnailAltText:O,status:f,actions:h,withDragHandle:U,isDragActive:P,isLoading:j,onClick:H,href:g,cardDragHandleProps:z,cardDragHandleComponent:C,isActionsDisabled:_=false}=T,q=w(T,["className","testId","title","description","contentType","entityType","withThumbnail","thumbnailUrl","thumbnailAltText","status","actions","withDragHandle","isDragActive","isLoading","onClick","href","cardDragHandleProps","cardDragHandleComponent","isActionsDisabled"]);let s=$(),G=()=>{if(C)return C;if(U)return e.createElement(DragHandle,l({className:s.dragHandle,isActive:P,label:"Reorder entry"},z))},u="article",S=false;(g||H)&&(u=g?"a":"button",S=true);let J=f==="archived"||!I;return e.createElement("li",d(l({},q),{className:cx(s.root({isDragActive:P}),t),"data-test-id":n}),G(),j?e.createElement("article",{className:s.card(false)},e.createElement(Skeleton.Container,{svgHeight:46,clipId:"f36-entity-list-item-skeleton"},e.createElement(Skeleton.Image,{height:46,width:46}),e.createElement(Skeleton.BodyText,{numberOfLines:2,lineHeight:18,offsetLeft:54}))):e.createElement(e.Fragment,null,e.createElement(u,l(l({className:s.card(S),onClick:H,href:g},g?{target:"_blank"}:{}),u==="button"?{type:"button"}:{}),W&&e.createElement("figure",{className:s.media},J?e.createElement(Icon,{as:dt[m.toLowerCase()],color:i.gray600,testId:`thumbnail-icon-${m.toLowerCase()}`}):e.createElement("img",{src:I,className:s.thumbnail,alt:O,"data-test-id":`thumbnail-icon-${m.toLowerCase()}`})),e.createElement("div",{className:s.content},e.createElement(Flex,null,e.createElement(Text,{as:"h3",lineHeight:"lineHeightM",fontColor:"gray900",fontWeight:"fontWeightDemiBold",isTruncated:true},o),b&&e.createElement(Text,{as:"span",lineHeight:"lineHeightM",fontColor:"gray600",className:s.contentType,isTruncated:true},"(",b,")")),e.createElement(Flex,{marginTop:"spacing2Xs"},m&&e.createElement(Text,{lineHeight:"lineHeightM",fontColor:"gray600",className:s.entityType},m),r&&e.createElement(Text,{as:"p",lineHeight:"lineHeightM",fontColor:"gray900",isTruncated:true,className:s.description},r))),e.createElement(Flex,{className:s.meta,alignItems:"flex-start",paddingLeft:"spacingXs"},f&&e.createElement(Box,{marginRight:h?"spacingXs":"none"},e.createElement(EntityStatusBadge,{entityStatus:f})))),h&&e.createElement(Menu,null,e.createElement(Menu.Trigger,null,e.createElement(Button,{isDisabled:_,startIcon:e.createElement(DotsThreeIcon,null),variant:"transparent","aria-label":"Actions",size:"small",className:s.menuTrigger})),e.createElement(Menu.List,null,h))))};y.displayName="EntityListItem";var F=B;F.Item=y;export{F as EntityList,y as EntityListItem};//# sourceMappingURL=index.js.map
1
+ import e from'react';import {cx,css}from'@emotion/css';import i from'@contentful/f36-tokens';import {EntityStatusBadge}from'@contentful/f36-badge';import {Flex,Box}from'@contentful/f36-core';import {PaintBrushIcon,FileIcon,ReleaseIcon,EntryIcon,ImageSquareIcon,DotsThreeIcon}from'@contentful/f36-icons';import {Icon}from'@contentful/f36-icon';import {Text}from'@contentful/f36-typography';import {DragHandle}from'@contentful/f36-drag-handle';import {Button}from'@contentful/f36-button';import {Menu}from'@contentful/f36-menu';import {Skeleton}from'@contentful/f36-skeleton';var K=Object.defineProperty,Q=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var k=(t,n,o)=>n in t?K(t,n,{enumerable:true,configurable:true,writable:true,value:o}):t[n]=o,l=(t,n)=>{for(var o in n||(n={}))v.call(n,o)&&k(t,o,n[o]);if(p)for(var o of p(n))N.call(n,o)&&k(t,o,n[o]);return t},d=(t,n)=>Q(t,V(n));var w=(t,n)=>{var o={};for(var r in t)v.call(t,r)&&n.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&p)for(var r of p(t))n.indexOf(r)<0&&N.call(t,r)&&(o[r]=t[r]);return o};var X=()=>({root:css({display:"block",listStyle:"none",margin:0,padding:0,border:`1px solid ${i.gray200}`,borderBottom:"none",borderRadius:i.borderRadiusMedium,overflow:"hidden"})});function A(t,n){let o=X();return e.createElement("ul",{"data-test-id":t.testId||"cf-ui-entity-list",ref:n,className:cx(o.root,t.className),style:t.style},t.children)}A.displayName="EntityList";var B=e.forwardRef(A);var $=()=>({root:t=>css(d(l({display:"flex",boxShadow:`inset 0 -1px 0 ${i.gray200}`,position:"relative",transition:`${i.transitionDurationShort} ${i.transitionEasingDefault}`,transitionProperty:"box-shadow, background-color",backgroundColor:i.colorWhite},t.isDragActive?{boxShadow:i.boxShadowHeavy}:{}),{"&:hover":{backgroundColor:i.gray100}})),card:t=>css({display:"flex",textDecoration:"none",minWidth:0,width:"100%",minHeight:i.spacing3Xl,padding:i.spacingXs,margin:0,border:"none",background:"none",textAlign:"left",cursor:t?"pointer":"inherit","&:focus-visible":{boxShadow:`inset ${i.glowPrimary}`,outline:"none"}}),content:css({flexGrow:1,minWidth:0,position:"relative"}),media:css({display:"flex",flexShrink:0,alignItems:"center",justifyContent:"center",backgroundColor:i.gray200,width:i.spacing2Xl,height:i.spacing2Xl,margin:"0",marginRight:i.spacingXs}),thumbnail:css({display:"block",width:"100%",height:"100%",objectFit:"cover"}),contentType:css({marginLeft:i.spacingXs}),entityType:css({textTransform:"capitalize"}),description:css({"&::before":{content:'"|"',color:i.gray400,height:"25%",marginTop:i.spacing2Xs,marginLeft:i.spacing2Xs,marginRight:i.spacing2Xs}}),meta:css({marginLeft:"auto",flexShrink:0}),dragHandle:css({borderBottomLeftRadius:"0",borderTopLeftRadius:"0",boxShadow:`inset 0 -1px 0 ${i.gray200}`}),menuTrigger:css({padding:"0 0.125rem",minHeight:"1.5rem",height:"1rem",margin:`${i.spacingXs} ${i.spacingXs} 0 0`})});var dt={asset:ImageSquareIcon,entry:EntryIcon,release:ReleaseIcon,page:FileIcon,experience:PaintBrushIcon},y=ct=>{var T=ct,{className:t,testId:n="cf-ui-entity-list-item",title:o,description:r,contentType:b,entityType:m="entry",withThumbnail:W=true,thumbnailUrl:I,thumbnailAltText:O,status:f,actions:h,withDragHandle:U,isDragActive:P,isLoading:j,onClick:H,href:g,cardDragHandleProps:z,cardDragHandleComponent:C,isActionsDisabled:_=false}=T,q=w(T,["className","testId","title","description","contentType","entityType","withThumbnail","thumbnailUrl","thumbnailAltText","status","actions","withDragHandle","isDragActive","isLoading","onClick","href","cardDragHandleProps","cardDragHandleComponent","isActionsDisabled"]);let s=$(),G=()=>{if(C)return C;if(U)return e.createElement(DragHandle,l({className:s.dragHandle,isActive:P,label:"Reorder entry"},z))},u="article",S=false;(g||H)&&(u=g?"a":"button",S=true);let J=f==="archived"||!I;return e.createElement("li",d(l({},q),{className:cx(s.root({isDragActive:P}),t),"data-test-id":n}),G(),j?e.createElement("article",{className:s.card(false)},e.createElement(Skeleton.Container,{svgHeight:46,clipId:"f36-entity-list-item-skeleton"},e.createElement(Skeleton.Image,{height:46,width:46}),e.createElement(Skeleton.BodyText,{numberOfLines:2,lineHeight:18,offsetLeft:54}))):e.createElement(e.Fragment,null,e.createElement(u,l(l({className:s.card(S),onClick:H,href:g},g?{target:"_blank"}:{}),u==="button"?{type:"button"}:{}),W&&e.createElement("figure",{className:s.media},J?e.createElement(Icon,{as:dt[m.toLowerCase()],color:i.gray600,testId:`thumbnail-icon-${m.toLowerCase()}`}):e.createElement("img",{src:I,className:s.thumbnail,alt:O,"data-test-id":`thumbnail-icon-${m.toLowerCase()}`})),e.createElement("div",{className:s.content},e.createElement(Flex,null,e.createElement(Text,{as:"h3",lineHeight:"lineHeightM",fontColor:"gray900",fontWeight:"fontWeightDemiBold",isTruncated:true},o),b&&e.createElement(Text,{as:"span",lineHeight:"lineHeightM",fontColor:"gray600",className:s.contentType,isTruncated:true},"(",b,")")),e.createElement(Flex,{marginTop:"spacing2Xs"},m&&e.createElement(Text,{lineHeight:"lineHeightM",fontColor:"gray600",className:s.entityType},m),r&&e.createElement(Text,{as:"p",lineHeight:"lineHeightM",fontColor:"gray900",isTruncated:true,className:s.description},r))),e.createElement(Flex,{className:s.meta,alignItems:"flex-start",paddingLeft:"spacingXs"},f&&e.createElement(Box,{marginRight:h?"spacingXs":"none"},e.createElement(EntityStatusBadge,{entityStatus:f})))),h&&e.createElement(Menu,null,e.createElement(Menu.Trigger,null,e.createElement(Button,{isDisabled:_,startIcon:e.createElement(DotsThreeIcon,null),variant:"transparent","aria-label":"Actions",size:"small",className:s.menuTrigger})),e.createElement(Menu.List,null,h))))};y.displayName="EntityListItem";var F=B;F.Item=y;export{F as EntityList,y as EntityListItem};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@contentful/f36-entity-list",
3
- "version": "6.0.0-alpha.3",
3
+ "version": "6.0.0",
4
4
  "description": "Forma 36: EntityList component",
5
5
  "scripts": {
6
6
  "build": "tsup"
7
7
  },
8
8
  "dependencies": {
9
- "@contentful/f36-badge": "^6.0.0-alpha.0",
10
- "@contentful/f36-button": "^6.0.0-alpha.0",
11
- "@contentful/f36-core": "^6.0.0-alpha.0",
12
- "@contentful/f36-drag-handle": "^6.0.0-alpha.0",
13
- "@contentful/f36-icon": "^6.0.0-alpha.0",
14
- "@contentful/f36-icons": "^6.0.0-alpha.0",
15
- "@contentful/f36-menu": "^6.0.0-alpha.0",
16
- "@contentful/f36-skeleton": "^6.0.0-alpha.0",
17
- "@contentful/f36-tokens": "^6.0.0-alpha.0",
18
- "@contentful/f36-typography": "^6.0.0-alpha.0",
9
+ "@contentful/f36-badge": "^6.0.0",
10
+ "@contentful/f36-button": "^6.0.0",
11
+ "@contentful/f36-core": "^6.0.0",
12
+ "@contentful/f36-drag-handle": "^6.0.0",
13
+ "@contentful/f36-icon": "^6.0.0",
14
+ "@contentful/f36-icons": "^6.0.0",
15
+ "@contentful/f36-menu": "^6.0.0",
16
+ "@contentful/f36-skeleton": "^6.0.0",
17
+ "@contentful/f36-tokens": "^6.0.0",
18
+ "@contentful/f36-typography": "^6.0.0",
19
19
  "@emotion/css": "^11.13.5"
20
20
  },
21
21
  "peerDependencies": {