@famalabs/web-ui 1.0.0-beta.6 → 1.0.0-beta.7

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.
@@ -5,8 +5,8 @@ import { SidebarItem } from '../sidebar/SidebarLayout.js';
5
5
 
6
6
  interface MenuItemsProps {
7
7
  items: SidebarItem[];
8
- itemComponent?: React.ElementType;
9
- itemComponentProps?: React.ComponentProps<React.ElementType>;
8
+ linkComponent?: React.ElementType;
9
+ linkComponentProps?: React.ComponentProps<React.ElementType>;
10
10
  onItemSelect: (item: SidebarItem) => void;
11
11
  onItemHover?: (item: SidebarItem) => Promise<void> | void;
12
12
  selectedLink?: string;
@@ -1 +1 @@
1
- import{c as t}from"react/compiler-runtime";import e from"@mui/material/Collapse";import i from"@mui/material/List";import n from"@mui/material/ListItem";import o from"@mui/material/ListItemButton";import r from"@mui/material/ListItemIcon";import m from"@mui/material/ListItemText";import{useTheme as l}from"@mui/material/styles";import{ChevronUpIcon as a,ChevronDownIcon as s}from"lucide-react";import c from"react";import{jsx as d,jsxs as p}from"react/jsx-runtime";function u(u){const g=t(25),{items:k,itemComponent:v,itemComponentProps:x,onItemSelect:y,onItemHover:I,selectedLink:b,listProps:S,iconOnly:C,mobile:L}=u;let $;g[0]!==S?($=void 0===S?{}:S,g[0]=S,g[1]=$):$=g[1];const P=$,_=void 0!==C&&C,j=void 0!==L&&L,B=l();let O;g[2]===Symbol.for("react.memo_cache_sentinel")?(O=new Set,g[2]=O):O=g[2];const[W,w]=c.useState(O);let z;g[3]===Symbol.for("react.memo_cache_sentinel")?(z=t=>{w(e=>{const i=new Set(e);return i.has(t)?i.delete(t):i.add(t),i})},g[3]=z):z=g[3];const E=z;let F;g[4]!==k||g[5]!==b?(F=((t,e)=>{if(!t.length||!e)return"";let i="";for(const n of t)if((e===n.link||e.startsWith(`${n.link}/`))&&n.link.length>i.length&&(i=n.link),n.items)for(const t of n.items)(e===t.link||e.startsWith(`${t.link}/`))&&t.link.length>i.length&&(i=t.link);return i})(k,b),g[4]=k,g[5]=b,g[6]=F):F=g[6];const H=F;let M,T,Y,q;if(g[7]!==W||g[8]!==_||g[9]!==v||g[10]!==x||g[11]!==k||g[12]!==P||g[13]!==H||g[14]!==j||g[15]!==I||g[16]!==y||g[17]!==B){const t=(l,u,g)=>{const k=void 0!==g&&g,b="items"in l&&l.items&&l.items.length>0,S=`${l.title}-${u}`,C=_||W.has(S),L=H===l.link,$=l.component??v,O=l.componentProps??x,w=Boolean($)&&(!b||_);return p(c.Fragment,{children:[d(n,{component:"div",disablePadding:!0,children:p(o,{component:w?$:"div",onClick:()=>{b&&!_?E(S):y(l)},onMouseOver:()=>I?.(l),disabled:Boolean(l.disabled),sx:{...L&&{color:h},justifyContent:"center",paddingInline:_?0:"auto",paddingY:j?2:_?.8:.5,transition:`padding ${B.transitions.easing.sharp} ${B.transitions.duration.leavingScreen}ms`,px:"auto",pl:k&&!_?4:void 0},...w?O:{},children:[d(r,{sx:{...L&&{color:f},minWidth:"32px",padding:0,justifyContent:"center"},children:l.icon}),!_&&d(m,{primary:l.title,sx:{paddingInline:1}}),!_&&b&&d(C?a:s,{size:18})]})}),b&&d(e,{in:C,timeout:"auto",unmountOnExit:!_,children:d(i,{...P,disablePadding:!0,sx:{my:_?0:1},children:l.items?.map((e,i)=>t(e,i,!0))})})]},S)};M=i,T=P,Y=k?.map((e,i)=>t(e,i)),g[7]=W,g[8]=_,g[9]=v,g[10]=x,g[11]=k,g[12]=P,g[13]=H,g[14]=j,g[15]=I,g[16]=y,g[17]=B,g[18]=M,g[19]=T,g[20]=Y}else M=g[18],T=g[19],Y=g[20];return g[21]!==M||g[22]!==T||g[23]!==Y?(q=d(M,{...T,children:Y}),g[21]=M,g[22]=T,g[23]=Y,g[24]=q):q=g[24],q}function f(t){return t.palette.primary.main}function h(t){return t.palette.primary.main}export{u as MenuItems};
1
+ import{c as t}from"react/compiler-runtime";import i from"@mui/material/Collapse";import e from"@mui/material/List";import n from"@mui/material/ListItem";import o from"@mui/material/ListItemButton";import r from"@mui/material/ListItemIcon";import m from"@mui/material/ListItemText";import{useTheme as l}from"@mui/material/styles";import{ChevronUpIcon as a,ChevronDownIcon as s}from"lucide-react";import c from"react";import{jsx as d,jsxs as p}from"react/jsx-runtime";function u(u){const g=t(25),{items:k,linkComponent:x,linkComponentProps:y,onItemSelect:b,onItemHover:v,selectedLink:I,listProps:C,iconOnly:L,mobile:S}=u;let $;g[0]!==C?($=void 0===C?{}:C,g[0]=C,g[1]=$):$=g[1];const P=$,_=void 0!==L&&L,j=void 0!==S&&S,O=l();let W;g[2]===Symbol.for("react.memo_cache_sentinel")?(W=new Set,g[2]=W):W=g[2];const[w,B]=c.useState(W);let z;g[3]===Symbol.for("react.memo_cache_sentinel")?(z=t=>{B(i=>{const e=new Set(i);return e.has(t)?e.delete(t):e.add(t),e})},g[3]=z):z=g[3];const E=z;let F;g[4]!==k||g[5]!==I?(F=((t,i)=>{if(!t.length||!i)return"";let e="";for(const n of t)if((i===n.link||i.startsWith(`${n.link}/`))&&n.link.length>e.length&&(e=n.link),n.items)for(const t of n.items)(i===t.link||i.startsWith(`${t.link}/`))&&t.link.length>e.length&&(e=t.link);return e})(k,I),g[4]=k,g[5]=I,g[6]=F):F=g[6];const H=F;let M,T,Y,q;if(g[7]!==w||g[8]!==_||g[9]!==k||g[10]!==x||g[11]!==y||g[12]!==P||g[13]!==H||g[14]!==j||g[15]!==v||g[16]!==b||g[17]!==O){const t=(l,u,g)=>{const k=void 0!==g&&g,I="items"in l&&l.items&&l.items.length>0,C=`${l.title}-${u}`,L=_||w.has(C),S=H===l.link,$=l.linkProps??y,W=x&&l.link&&!l.disabled&&!I;return p(c.Fragment,{children:[d(n,{component:"div",disablePadding:!0,children:p(o,{LinkComponent:W?x:"a",...W?{href:l.link,prefetch:!0}:{},onClick:()=>{I&&!_?E(C):b(l)},onMouseOver:()=>v?.(l),disabled:Boolean(l.disabled),draggable:!1,sx:{...S&&{color:h},justifyContent:"center",paddingInline:_?0:"auto",paddingY:j?2:_?.8:.5,transition:`padding ${O.transitions.easing.sharp} ${O.transitions.duration.leavingScreen}ms`,px:"auto",pl:k&&!_?4:void 0},...W?$:{},children:[d(r,{sx:{...S&&{color:f},minWidth:"32px",padding:0,justifyContent:"center"},children:l.icon}),!_&&d(m,{primary:l.title,sx:{paddingInline:1}}),!_&&I&&d(L?a:s,{size:18})]})}),I&&d(i,{in:L,timeout:"auto",unmountOnExit:!_,children:d(e,{...P,disablePadding:!0,sx:{my:_?0:1},children:l.items?.map((i,e)=>t(i,e,!0))})})]},C)};M=e,T=P,Y=k?.map((i,e)=>t(i,e)),g[7]=w,g[8]=_,g[9]=k,g[10]=x,g[11]=y,g[12]=P,g[13]=H,g[14]=j,g[15]=v,g[16]=b,g[17]=O,g[18]=M,g[19]=T,g[20]=Y}else M=g[18],T=g[19],Y=g[20];return g[21]!==M||g[22]!==T||g[23]!==Y?(q=d(M,{...T,children:Y}),g[21]=M,g[22]=T,g[23]=Y,g[24]=q):q=g[24],q}function f(t){return t.palette.primary.main}function h(t){return t.palette.primary.main}export{u as MenuItems};
@@ -4,8 +4,8 @@ import { SidebarItem } from './SidebarLayout.js';
4
4
 
5
5
  interface FooterData {
6
6
  items: SidebarItem[];
7
- itemComponent?: React.ElementType;
8
- itemComponentProps?: React.ComponentProps<React.ElementType>;
7
+ linkComponent?: React.ElementType;
8
+ linkComponentProps?: React.ComponentProps<React.ElementType>;
9
9
  onItemSelect?: (item: SidebarItem) => void;
10
10
  onItemHover?: (item: SidebarItem) => Promise<void> | void;
11
11
  avatar: {
@@ -18,6 +18,7 @@ interface SidebarFooterProps {
18
18
  footerData: FooterData;
19
19
  sidebarOpen: boolean;
20
20
  setSidebarOpen: (open: boolean) => void;
21
+ collapsible?: boolean;
21
22
  mobile?: boolean;
22
23
  }
23
24
 
@@ -1 +1 @@
1
- import{c as e}from"react/compiler-runtime";import o from"@mui/material/Avatar";import t from"@mui/material/Box";import r from"@mui/material/Grid";import i from"@mui/material/IconButton";import m from"@mui/material/List";import n from"@mui/material/ListItem";import a from"@mui/material/ListItemAvatar";import l from"@mui/material/ListItemButton";import c from"@mui/material/ListItemText";import p from"@mui/material/Popover";import{useTheme as s}from"@mui/material/styles";import d from"@mui/material/Typography";import{ChevronLeftIcon as u,ChevronRightIcon as h}from"lucide-react";import f from"react";import{MenuItems as b}from"../common/MenuItems.js";import{jsx as g,jsxs as v,Fragment as x}from"react/jsx-runtime";function y(y){const I=e(39),{footerData:S,sidebarOpen:_,setSidebarOpen:C,mobile:w}=y,P=void 0!==w&&w,{items:z,itemComponent:L,itemComponentProps:O,onItemSelect:k,onItemHover:B,avatar:R,listProps:A}=S;let T;I[0]!==z?(T=void 0===z?[]:z,I[0]=z,I[1]=T):T=I[1];const j=T;let H;I[2]!==A?(H=void 0===A?{}:A,I[2]=A,I[3]=H):H=I[3];const D=H,E=s(),[G,M]=f.useState(null);let U;I[4]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{M(e.currentTarget)},I[4]=U):U=I[4];const q=U;let F;I[5]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{M(null)},I[5]=F):F=I[5];const J=F,K=Boolean(G),N=K?"popover":void 0,Q=j.length>0?l:"div";let V,W,X;I[6]===Symbol.for("react.memo_cache_sentinel")?(V=e=>q(e),I[6]=V):V=I[6],I[7]!==P||I[8]!==C||I[9]!==_||I[10]!==E?(W=P?void 0:g(i,{edge:"end",color:"inherit",disableRipple:!0,onClick:e=>{e.stopPropagation(),C(!_)},sx:{position:"absolute",backgroundColor:E.palette.background.paper,border:"1px solid rgba(0, 0, 0, 0.12)",borderRadius:"8px",padding:0,right:_?"5px":"-15px",bottom:"-10px"},children:g(_?u:h,{size:"1rem"})}),I[7]=P,I[8]=C,I[9]=_,I[10]=E,I[11]=W):W=I[11],I[12]===Symbol.for("react.memo_cache_sentinel")?(X={paddingInline:"12px",paddingRight:"32px"},I[12]=X):X=I[12];const Y=R.username||"",Z=R.imageSrc||"";let $,ee;I[13]!==Y||I[14]!==Z?($=g(a,{children:g(o,{alt:Y,src:Z})}),I[13]=Y,I[14]=Z,I[15]=$):$=I[15],I[16]===Symbol.for("react.memo_cache_sentinel")?(ee={textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},I[16]=ee):ee=I[16];const oe=R.username||"User";let te,re,ie,me;return I[17]!==oe?(te=g(c,{primary:g(d,{sx:ee,children:oe})}),I[17]=oe,I[18]=te):te=I[18],I[19]!==N||I[20]!==$||I[21]!==te||I[22]!==Q||I[23]!==W?(re=g(m,{children:v(n,{component:Q,"aria-describedby":N,onClick:V,disableRipple:!0,secondaryAction:W,sx:X,children:[$,te]})}),I[19]=N,I[20]=$,I[21]=te,I[22]=Q,I[23]=W,I[24]=re):re=I[24],I[25]!==G||I[26]!==N||I[27]!==K||I[28]!==L||I[29]!==O||I[30]!==j||I[31]!==D||I[32]!==P||I[33]!==B||I[34]!==k?(ie=j.length>0&&g(p,{id:N,open:K,anchorEl:G,onClose:J,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"left"},elevation:6,children:g(t,{sx:{width:P?"100dvw":260},children:g(r,{container:!0,size:12,children:g(r,{size:12,children:g(b,{items:j,itemComponent:L,itemComponentProps:O,onItemSelect:e=>{k?.(e),J()},onItemHover:B,listProps:{...D,sx:{margin:"auto 0",...D.sx||{}}},mobile:P})})})})}),I[25]=G,I[26]=N,I[27]=K,I[28]=L,I[29]=O,I[30]=j,I[31]=D,I[32]=P,I[33]=B,I[34]=k,I[35]=ie):ie=I[35],I[36]!==re||I[37]!==ie?(me=v(x,{children:[re,ie]}),I[36]=re,I[37]=ie,I[38]=me):me=I[38],me}export{y as SidebarFooter};
1
+ import{c as e}from"react/compiler-runtime";import o from"@mui/material/Avatar";import r from"@mui/material/Box";import t from"@mui/material/Grid";import i from"@mui/material/IconButton";import m from"@mui/material/List";import n from"@mui/material/ListItem";import a from"@mui/material/ListItemAvatar";import l from"@mui/material/ListItemButton";import c from"@mui/material/ListItemText";import p from"@mui/material/Popover";import{useTheme as s}from"@mui/material/styles";import d from"@mui/material/Typography";import{ChevronLeftIcon as u,ChevronRightIcon as h}from"lucide-react";import f from"react";import{MenuItems as b}from"../common/MenuItems.js";import{jsx as v,jsxs as g,Fragment as x}from"react/jsx-runtime";function y(y){const I=e(40),{footerData:S,sidebarOpen:_,setSidebarOpen:k,collapsible:C,mobile:w}=y,P=void 0===C||C,z=void 0!==w&&w,{items:L,linkComponent:O,linkComponentProps:B,onItemSelect:R,onItemHover:A,avatar:T,listProps:j}=S;let H;I[0]!==L?(H=void 0===L?[]:L,I[0]=L,I[1]=H):H=I[1];const D=H;let E;I[2]!==j?(E=void 0===j?{}:j,I[2]=j,I[3]=E):E=I[3];const G=E,M=s(),[U,q]=f.useState(null);let F;I[4]===Symbol.for("react.memo_cache_sentinel")?(F=e=>{q(e.currentTarget)},I[4]=F):F=I[4];const J=F;let K;I[5]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{q(null)},I[5]=K):K=I[5];const N=K,Q=Boolean(U),V=Q?"popover":void 0,W=D.length>0?l:"div";let X,Y,Z;I[6]===Symbol.for("react.memo_cache_sentinel")?(X=e=>J(e),I[6]=X):X=I[6],I[7]!==P||I[8]!==z||I[9]!==k||I[10]!==_||I[11]!==M?(Y=!z&&P?v(i,{edge:"end",color:"inherit",disableRipple:!0,onClick:e=>{e.stopPropagation(),k(!_)},sx:{position:"absolute",backgroundColor:M.palette.background.paper,border:"1px solid rgba(0, 0, 0, 0.12)",borderRadius:"8px",padding:0,right:_?"5px":"-15px",bottom:"-10px"},children:v(_?u:h,{size:"1rem"})}):void 0,I[7]=P,I[8]=z,I[9]=k,I[10]=_,I[11]=M,I[12]=Y):Y=I[12],I[13]===Symbol.for("react.memo_cache_sentinel")?(Z={paddingInline:"12px",paddingRight:"32px"},I[13]=Z):Z=I[13];const $=T.username||"",ee=T.imageSrc||"";let oe,re;I[14]!==$||I[15]!==ee?(oe=v(a,{children:v(o,{alt:$,src:ee})}),I[14]=$,I[15]=ee,I[16]=oe):oe=I[16],I[17]===Symbol.for("react.memo_cache_sentinel")?(re={textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},I[17]=re):re=I[17];const te=T.username||"User";let ie,me,ne,ae;return I[18]!==te?(ie=v(c,{primary:v(d,{sx:re,children:te})}),I[18]=te,I[19]=ie):ie=I[19],I[20]!==V||I[21]!==Y||I[22]!==oe||I[23]!==ie||I[24]!==W?(me=v(m,{children:g(n,{component:W,"aria-describedby":V,onClick:X,disableRipple:!0,secondaryAction:Y,sx:Z,children:[oe,ie]})}),I[20]=V,I[21]=Y,I[22]=oe,I[23]=ie,I[24]=W,I[25]=me):me=I[25],I[26]!==U||I[27]!==V||I[28]!==Q||I[29]!==D||I[30]!==O||I[31]!==B||I[32]!==G||I[33]!==z||I[34]!==A||I[35]!==R?(ne=D.length>0&&v(p,{id:V,open:Q,anchorEl:U,onClose:N,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"left"},elevation:6,children:v(r,{sx:{width:z?"100dvw":260},children:v(t,{container:!0,size:12,children:v(t,{size:12,children:v(b,{items:D,linkComponent:O,linkComponentProps:B,onItemSelect:e=>{R?.(e),N()},onItemHover:A,listProps:{...G,sx:{margin:"auto 0",...G.sx||{}}},mobile:z})})})})}),I[26]=U,I[27]=V,I[28]=Q,I[29]=D,I[30]=O,I[31]=B,I[32]=G,I[33]=z,I[34]=A,I[35]=R,I[36]=ne):ne=I[36],I[37]!==me||I[38]!==ne?(ae=g(x,{children:[me,ne]}),I[37]=me,I[38]=ne,I[39]=ae):ae=I[39],ae}export{y as SidebarFooter};
@@ -16,8 +16,7 @@ interface SidebarItem {
16
16
  disabled?: boolean;
17
17
  items?: Omit<SidebarItem, 'items'>[];
18
18
  icon?: React.ReactNode;
19
- component?: React.ElementType;
20
- componentProps?: React.ComponentProps<React.ElementType>;
19
+ linkProps?: React.ComponentProps<React.ElementType>;
21
20
  }
22
21
  interface SidebarLogo {
23
22
  fullLogo: string;
@@ -29,8 +28,8 @@ interface SidebarLayoutProps {
29
28
  open?: boolean;
30
29
  onClose?: () => void;
31
30
  items: SidebarItem[];
32
- itemComponent?: React.ElementType;
33
- itemComponentProps?: React.ComponentProps<React.ElementType>;
31
+ linkComponent?: React.ElementType;
32
+ linkComponentProps?: React.ComponentProps<React.ElementType>;
34
33
  customHeader?: React.ReactNode;
35
34
  customHeaderCompact?: React.ReactNode;
36
35
  mainLogo?: SidebarLogo;
@@ -39,6 +38,7 @@ interface SidebarLayoutProps {
39
38
  onItemHover?: (item: SidebarItem) => Promise<void> | void;
40
39
  selectedLink?: string;
41
40
  isLoading?: boolean;
41
+ collapsible?: boolean;
42
42
  footer?: FooterData;
43
43
  listProps?: ListProps;
44
44
  drawerProps?: DrawerProps;
@@ -1 +1 @@
1
- import{c as e}from"react/compiler-runtime";import i from"@mui/material/Avatar";import o from"@mui/material/Box";import t from"@mui/material/Divider";import r from"@mui/material/Drawer";import n from"@mui/material/Fab";import a from"@mui/material/IconButton";import m from"@mui/material/List";import s from"@mui/material/ListItem";import l from"@mui/material/ListItemIcon";import d from"@mui/material/ListItemText";import p from"@mui/material/Skeleton";import{styled as c,alpha as h,useTheme as u}from"@mui/material/styles";import f from"@mui/material/useMediaQuery";import{ArrowRightIcon as g,ChevronLeftIcon as b}from"lucide-react";import x,{useEffect as w}from"react";import{MenuItems as v}from"../common/MenuItems.js";import{SidebarFooter as y}from"./SidebarFooter.js";import{jsx as S,jsxs as k,Fragment as C}from"react/jsx-runtime";const L=e=>({width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}),I=e=>({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${e.spacing(8)})`}),z=c(r,{shouldForwardProp:e=>"open"!==e})(({theme:e,open:i})=>({width:240,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",overflow:"hidden",zIndex:1e3,"& .MuiDrawer-paper":{overflow:"visible"},...i&&{...L(e),"& .MuiDrawer-paper":{...L(e),overflow:"visible"}},...!i&&{...I(e),"& .MuiDrawer-paper":{...I(e),overflow:"visible"}}})),M=c(e=>S(r,{...e}))(()=>({flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",overflow:"hidden",zIndex:999,"& .MuiDrawer-paper":{width:"100%"}})),O=c(n)(({theme:e})=>({position:"fixed",bottom:e.spacing(2),left:e.spacing(2),zIndex:e.zIndex.drawer+100,backgroundColor:h(e.palette.grey[800],.3),boxShadow:"none","&:hover":{backgroundColor:h(e.palette.grey[900],.5)}})),D=i=>{const t=e(31);let r,n,a,m,s;t[0]!==i?(({children:r,sidebarOpen:s,setSidebarOpen:m,mainContent:n,...a}=i),t[0]=i,t[1]=r,t[2]=n,t[3]=a,t[4]=m,t[5]=s):(r=t[1],n=t[2],a=t[3],m=t[4],s=t[5]);const l=u();let d;t[6]!==l.breakpoints?(d=l.breakpoints.down("sm"),t[6]=l.breakpoints,t[7]=d):d=t[7];const p=f(d);let c,h,b,w,v;if(t[8]!==p||t[9]!==m?(c=()=>{p&&m(!1)},h=[p,m],t[8]=p,t[9]=m,t[10]=c,t[11]=h):(c=t[10],h=t[11]),x.useEffect(c,h),p){let e,i,o;return t[12]!==m||t[13]!==s?(e=!s&&S(O,{color:"inherit","aria-label":"swipe-sidebar-button",onClick:()=>m(!0),size:"medium",children:S(g,{size:20})}),t[12]=m,t[13]=s,t[14]=e):e=t[14],t[15]!==r||t[16]!==m||t[17]!==s?(i=s&&S(M,{anchor:"left",open:s,onClose:()=>m(!s),onOpen:()=>m(!s),children:r}),t[15]=r,t[16]=m,t[17]=s,t[18]=i):i=t[18],t[19]!==n||t[20]!==e||t[21]!==i?(o=k(C,{children:[e,i,n]}),t[19]=n,t[20]=e,t[21]=i,t[22]=o):o=t[22],o}return t[23]===Symbol.for("react.memo_cache_sentinel")?(b={overflow:"visible"},t[23]=b):b=t[23],t[24]!==r||t[25]!==a||t[26]!==s?(w=S(z,{open:s,elevation:10,variant:"permanent",sx:b,...a,children:r}),t[24]=r,t[25]=a,t[26]=s,t[27]=w):w=t[27],t[28]!==n||t[29]!==w?(v=k(o,{display:"flex",children:[w,n]}),t[28]=n,t[29]=w,t[30]=v):v=t[30],v};function j(r){const n=e(56),{open:c,onClose:h,items:g,itemComponent:C,itemComponentProps:L,customHeader:I,customHeaderCompact:z,mainLogo:M,brandLogo:O,onItemSelect:j,onItemHover:P,selectedLink:_,isLoading:F,footer:B,listProps:H,drawerProps:T,children:q}=r,A=void 0!==F&&F;let X;n[0]!==H?(X=void 0===H?{}:H,n[0]=H,n[1]=X):X=n[1];const $=X;let E;n[2]!==T?(E=void 0===T?{}:T,n[2]=T,n[3]=E):E=n[3];const G=E,Q=u();let W;n[4]!==Q.breakpoints?(W=Q.breakpoints.down("sm"),n[4]=Q.breakpoints,n[5]=W):W=n[5];const Y=f(W),[J,K]=x.useState(!0),N=!J&&!Y;let R,U,V,Z,ee,ie,oe,te,re;n[6]!==c?(R=()=>{"boolean"==typeof c&&K(c)},U=[c],n[6]=c,n[7]=R,n[8]=U):(R=n[7],U=n[8]),w(R,U),n[9]!==h||n[10]!==J?(V=()=>{h&&!J&&h()},Z=[J,h],n[9]=h,n[10]=J,n[11]=V,n[12]=Z):(V=n[11],Z=n[12]),w(V,Z),n[13]===Symbol.for("react.memo_cache_sentinel")?(ee={padding:"1rem 0 0.5rem 0",position:"relative"},n[13]=ee):ee=n[13],n[14]!==Y||n[15]!==J?(ie=Y&&S(o,{component:"div",sx:{position:"absolute",top:10,right:0,pr:2},children:S(a,{size:"small",onClick:()=>K(!J),children:S(b,{})})}),n[14]=Y,n[15]=J,n[16]=ie):ie=n[16],n[17]!==M||n[18]!==J?(oe=M&&S(l,{sx:{display:"flex",justifyContent:"center"},children:S(o,{component:"div",children:J?S("img",{src:M.fullLogo||"",alt:"FullLogo",style:{width:"10rem",height:"auto"}}):S(i,{variant:M.variant||"square",alt:"Minilogo",src:M.miniLogo,sx:{padding:"4px"}})})}),n[17]=M,n[18]=J,n[19]=oe):oe=n[19],n[20]!==ie||n[21]!==oe?(te=k(m,{sx:ee,children:[ie,oe]}),n[20]=ie,n[21]=oe,n[22]=te):te=n[22],n[23]!==M?(re=M&&S(t,{}),n[23]=M,n[24]=re):re=n[24];const ne=J&&I,ae=!J&&z;let me,se,le,de,pe;return n[25]!==N||n[26]!==A||n[27]!==Y||n[28]!==C||n[29]!==L||n[30]!==g||n[31]!==$||n[32]!==P||n[33]!==j||n[34]!==_||n[35]!==J?(me=A?S(m,{...$,dense:!Y,sx:{margin:"0",marginTop:Y?"auto":1,marginBottom:"auto",...$.sx||{}},children:Array.from({length:Math.min(g?.length||6,8)}).map((e,i)=>k(s,{disableGutters:!0,sx:{px:J?2:1},children:[S(l,{sx:{minWidth:40,display:"flex",justifyContent:"center",paddingY:Y?2:N?.8:.5},children:S(p,{variant:J?"circular":"rounded",width:22,height:22,animation:"wave"})}),J&&S(d,{primary:S(p,{variant:"text",width:150,animation:"wave"}),sx:{my:0}})]},`skeleton-item-${i}`))}):S(v,{items:g??[],itemComponent:C,itemComponentProps:L,iconOnly:N,onItemSelect:e=>{j(e),Y&&K(!1)},onItemHover:P,selectedLink:_,listProps:{dense:!Y,sx:{margin:"0",marginTop:Y?"auto":1,marginBottom:"auto",...$.sx||{}},...$},mobile:Y}),n[25]=N,n[26]=A,n[27]=Y,n[28]=C,n[29]=L,n[30]=g,n[31]=$,n[32]=P,n[33]=j,n[34]=_,n[35]=J,n[36]=me):me=n[36],n[37]!==O||n[38]!==J?(se=O&&S(m,{children:S(l,{sx:{display:"flex",justifyContent:"center",padding:"10px 0"},children:S(o,{component:"div",children:J?S("img",{src:O.fullLogo||"",alt:"FullLogo",style:{width:"10rem",height:"auto"}}):S(i,{variant:O.variant||"square",alt:"Minilogo",src:O.miniLogo})})})}),n[37]=O,n[38]=J,n[39]=se):se=n[39],n[40]===Symbol.for("react.memo_cache_sentinel")?(le=S(t,{}),n[40]=le):le=n[40],n[41]!==B||n[42]!==Y||n[43]!==J?(de=B&&S(y,{footerData:B,sidebarOpen:J,setSidebarOpen:K,mobile:Y}),n[41]=B,n[42]=Y,n[43]=J,n[44]=de):de=n[44],n[45]!==q||n[46]!==G||n[47]!==J||n[48]!==te||n[49]!==re||n[50]!==ne||n[51]!==ae||n[52]!==me||n[53]!==se||n[54]!==de?(pe=k(D,{sidebarOpen:J,setSidebarOpen:K,mainContent:q,...G,children:[te,re,ne,ae,me,se,le,de]}),n[45]=q,n[46]=G,n[47]=J,n[48]=te,n[49]=re,n[50]=ne,n[51]=ae,n[52]=me,n[53]=se,n[54]=de,n[55]=pe):pe=n[55],pe}export{j as SidebarLayout};
1
+ import{c as e}from"react/compiler-runtime";import i from"@mui/material/Avatar";import o from"@mui/material/Box";import t from"@mui/material/Divider";import r from"@mui/material/Drawer";import n from"@mui/material/Fab";import a from"@mui/material/IconButton";import m from"@mui/material/List";import l from"@mui/material/ListItem";import s from"@mui/material/ListItemIcon";import d from"@mui/material/ListItemText";import p from"@mui/material/Skeleton";import{styled as c,alpha as h,useTheme as u}from"@mui/material/styles";import f from"@mui/material/useMediaQuery";import{ArrowRightIcon as g,ChevronLeftIcon as b}from"lucide-react";import x,{useEffect as v}from"react";import{MenuItems as w}from"../common/MenuItems.js";import{SidebarFooter as y}from"./SidebarFooter.js";import{jsx as k,jsxs as S,Fragment as C}from"react/jsx-runtime";const L=e=>({width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}),I=e=>({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:`calc(${e.spacing(8)})`}),z=c(r,{shouldForwardProp:e=>"open"!==e})(({theme:e,open:i})=>({width:240,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",overflow:"hidden",zIndex:1e3,"& .MuiDrawer-paper":{overflow:"visible"},...i&&{...L(e),"& .MuiDrawer-paper":{...L(e),overflow:"visible"}},...!i&&{...I(e),"& .MuiDrawer-paper":{...I(e),overflow:"visible"}}})),M=c(e=>k(r,{...e}))(()=>({flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",overflow:"hidden",zIndex:999,"& .MuiDrawer-paper":{width:"100%"}})),O=c(n)(({theme:e})=>({position:"fixed",bottom:e.spacing(2),left:e.spacing(2),zIndex:e.zIndex.drawer+100,backgroundColor:h(e.palette.grey[800],.3),boxShadow:"none","&:hover":{backgroundColor:h(e.palette.grey[900],.5)}})),D=i=>{const t=e(31);let r,n,a,m,l;t[0]!==i?(({children:r,sidebarOpen:l,setSidebarOpen:m,mainContent:n,...a}=i),t[0]=i,t[1]=r,t[2]=n,t[3]=a,t[4]=m,t[5]=l):(r=t[1],n=t[2],a=t[3],m=t[4],l=t[5]);const s=u();let d;t[6]!==s.breakpoints?(d=s.breakpoints.down("sm"),t[6]=s.breakpoints,t[7]=d):d=t[7];const p=f(d);let c,h,b,v,w;if(t[8]!==p||t[9]!==m?(c=()=>{p&&m(!1)},h=[p,m],t[8]=p,t[9]=m,t[10]=c,t[11]=h):(c=t[10],h=t[11]),x.useEffect(c,h),p){let e,i,o;return t[12]!==m||t[13]!==l?(e=!l&&k(O,{color:"inherit","aria-label":"swipe-sidebar-button",onClick:()=>m(!0),size:"medium",children:k(g,{size:20})}),t[12]=m,t[13]=l,t[14]=e):e=t[14],t[15]!==r||t[16]!==m||t[17]!==l?(i=l&&k(M,{anchor:"left",open:l,onClose:()=>m(!l),onOpen:()=>m(!l),children:r}),t[15]=r,t[16]=m,t[17]=l,t[18]=i):i=t[18],t[19]!==n||t[20]!==e||t[21]!==i?(o=S(C,{children:[e,i,n]}),t[19]=n,t[20]=e,t[21]=i,t[22]=o):o=t[22],o}return t[23]===Symbol.for("react.memo_cache_sentinel")?(b={overflow:"visible"},t[23]=b):b=t[23],t[24]!==r||t[25]!==a||t[26]!==l?(v=k(z,{open:l,elevation:10,variant:"permanent",sx:b,...a,children:r}),t[24]=r,t[25]=a,t[26]=l,t[27]=v):v=t[27],t[28]!==n||t[29]!==v?(w=S(o,{display:"flex",children:[v,n]}),t[28]=n,t[29]=v,t[30]=w):w=t[30],w};function j(r){const n=e(57),{open:c,onClose:h,items:g,linkComponent:C,linkComponentProps:L,customHeader:I,customHeaderCompact:z,mainLogo:M,brandLogo:O,onItemSelect:j,onItemHover:P,selectedLink:_,isLoading:F,collapsible:B,footer:H,listProps:T,drawerProps:q,children:A}=r,X=void 0!==F&&F,$=void 0===B||B;let E;n[0]!==T?(E=void 0===T?{}:T,n[0]=T,n[1]=E):E=n[1];const G=E;let Q;n[2]!==q?(Q=void 0===q?{}:q,n[2]=q,n[3]=Q):Q=n[3];const W=Q,Y=u();let J;n[4]!==Y.breakpoints?(J=Y.breakpoints.down("sm"),n[4]=Y.breakpoints,n[5]=J):J=n[5];const K=f(J),[N,R]=x.useState(!0),U=!N&&!K;let V,Z,ee,ie,oe,te,re,ne,ae;n[6]!==c?(V=()=>{"boolean"==typeof c&&R(c)},Z=[c],n[6]=c,n[7]=V,n[8]=Z):(V=n[7],Z=n[8]),v(V,Z),n[9]!==h||n[10]!==N?(ie=()=>{h&&!N&&h()},ee=[N,h],n[9]=h,n[10]=N,n[11]=ee,n[12]=ie):(ee=n[11],ie=n[12]),v(ie,ee),n[13]===Symbol.for("react.memo_cache_sentinel")?(oe={padding:"1rem 0 0.5rem 0",position:"relative"},n[13]=oe):oe=n[13],n[14]!==K||n[15]!==N?(te=K&&k(o,{component:"div",sx:{position:"absolute",top:10,right:0,pr:2},children:k(a,{size:"small",onClick:()=>R(!N),children:k(b,{})})}),n[14]=K,n[15]=N,n[16]=te):te=n[16],n[17]!==M||n[18]!==N?(re=M&&k(s,{sx:{display:"flex",justifyContent:"center"},children:k(o,{component:"div",children:N?k("img",{src:M.fullLogo||"",alt:"FullLogo",style:{width:"10rem",height:"auto"}}):k(i,{variant:M.variant||"square",alt:"Minilogo",src:M.miniLogo,sx:{padding:"4px"}})})}),n[17]=M,n[18]=N,n[19]=re):re=n[19],n[20]!==te||n[21]!==re?(ne=S(m,{sx:oe,children:[te,re]}),n[20]=te,n[21]=re,n[22]=ne):ne=n[22],n[23]!==M?(ae=M&&k(t,{}),n[23]=M,n[24]=ae):ae=n[24];const me=N&&I,le=!N&&z;let se,de,pe,ce,he;return n[25]!==U||n[26]!==X||n[27]!==K||n[28]!==g||n[29]!==C||n[30]!==L||n[31]!==G||n[32]!==P||n[33]!==j||n[34]!==_||n[35]!==N?(se=X?k(m,{...G,dense:!K,sx:{margin:"0",marginTop:K?"auto":1,marginBottom:"auto",...G.sx||{}},children:Array.from({length:Math.min(g?.length||6,8)}).map((e,i)=>S(l,{disableGutters:!0,sx:{px:N?2:1},children:[k(s,{sx:{minWidth:40,display:"flex",justifyContent:"center",paddingY:K?2:U?.8:.5},children:k(p,{variant:N?"circular":"rounded",width:22,height:22,animation:"wave"})}),N&&k(d,{primary:k(p,{variant:"text",width:150,animation:"wave"}),sx:{my:0}})]},`skeleton-item-${i}`))}):k(w,{items:g??[],linkComponent:C,linkComponentProps:L,iconOnly:U,onItemSelect:e=>{j(e),K&&R(!1)},onItemHover:P,selectedLink:_,listProps:{dense:!K,sx:{margin:"0",marginTop:K?"auto":1,marginBottom:"auto",...G.sx||{}},...G},mobile:K}),n[25]=U,n[26]=X,n[27]=K,n[28]=g,n[29]=C,n[30]=L,n[31]=G,n[32]=P,n[33]=j,n[34]=_,n[35]=N,n[36]=se):se=n[36],n[37]!==O||n[38]!==N?(de=O&&k(m,{children:k(s,{sx:{display:"flex",justifyContent:"center",padding:"10px 0"},children:k(o,{component:"div",children:N?k("img",{src:O.fullLogo||"",alt:"FullLogo",style:{width:"10rem",height:"auto"}}):k(i,{variant:O.variant||"square",alt:"Minilogo",src:O.miniLogo})})})}),n[37]=O,n[38]=N,n[39]=de):de=n[39],n[40]===Symbol.for("react.memo_cache_sentinel")?(pe=k(t,{}),n[40]=pe):pe=n[40],n[41]!==$||n[42]!==H||n[43]!==K||n[44]!==N?(ce=H&&k(y,{footerData:H,sidebarOpen:N,setSidebarOpen:R,collapsible:$,mobile:K}),n[41]=$,n[42]=H,n[43]=K,n[44]=N,n[45]=ce):ce=n[45],n[46]!==A||n[47]!==W||n[48]!==N||n[49]!==ne||n[50]!==ae||n[51]!==me||n[52]!==le||n[53]!==se||n[54]!==de||n[55]!==ce?(he=S(D,{sidebarOpen:N,setSidebarOpen:R,mainContent:A,...W,children:[ne,ae,me,le,se,de,pe,ce]}),n[46]=A,n[47]=W,n[48]=N,n[49]=ne,n[50]=ae,n[51]=me,n[52]=le,n[53]=se,n[54]=de,n[55]=ce,n[56]=he):he=n[56],he}export{j as SidebarLayout};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@famalabs/web-ui",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.7",
4
4
  "author": " Fama Labs <info@famalabs.com>",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",