@nexusui/components
Version:
These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.
2 lines (1 loc) • 2.15 kB
JavaScript
import{jsxs as e,jsx as t}from"react/jsx-runtime";import r from"@mui/material/Typography";import o from"@mui/icons-material/FolderOpen";import i from"@mui/icons-material/StickyNote2Outlined";import a from"@mui/icons-material/KeyboardBackspaceOutlined";import m from"@mui/icons-material/EditNote";import s from"@mui/material/ListItem";import n from"@mui/material/ListItemText";import c from"@mui/material/useMediaQuery";import l from"clsx";import{styles as p}from"./ProjectSidebar.styles.js";import{useTranslate as d}from"../locales/index.js";import f from"./locale.json.js";import{Drawer as h}from"../Drawer/Drawer.container.js";import{DrawerHeader as u}from"../Drawer/components/DrawerHeader/DrawerHeader.container.js";import{DrawerContent as j}from"../Drawer/components/DrawerContent/DrawerContent.container.js";import{DrawerSection as x}from"../Drawer/components/DrawerSection/DrawerSection.container.js";const y="NexusProjectSidebar",w=56,D=256,b=w=>{const{open:D=!0,menuItems:b,projectsTitle:N,projects:$=[],emptyText:g,onMenuToggle:S,...T}=w,I=d(f),k=c("(max-width:900px)");return e(h,{open:D,width:k?1:256,...T,className:`${y}-root`,children:[k&&S&&t(u,{sx:[p.header,{height:"56px"}],label:I("back"),icon:t(a,{}),onIconClick:S,className:`${y}-header`,"data-testid":`${y}-header`}),e(j,{sx:[p.content,{height:k?"calc(100% - 56px)":1}],className:`${y}-content`,children:[(!b||b.length>0)&&t(x,{sx:p.section,dense:!0,items:b||[{nodeId:"projects",label:I("projects"),icon:t(o,{fontSize:"small"})},{nodeId:"documents",label:I("documents"),icon:t(i,{fontSize:"small"})},{nodeId:"drafts",label:I("drafts"),icon:t(m,{fontSize:"small"})}],divider:!0,className:`${y}-section`}),t(x,{sx:[p.section,p.scrollable],dense:!0,header:t(r,{sx:p.title,variant:"caption",className:l(`${y}-sectionTitle`,`${y}-section-title`),children:N||I("projectsTitle")}),items:$,className:`${y}-section`,children:0===$.length&&t(s,{className:l(`${y}-sectionEmpty`,`${y}-section-empty`),children:t(n,{primary:g||I("emptyProjects"),primaryTypographyProps:{color:"text.disabled"}})})})]})]})};export{D as DrawerWidth,w as HeaderHeight,b as ProjectSidebarComponents,y as prefix};