@cleen/ui 0.1.35 → 0.1.36
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.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import{forwardRef as E7,useMemo as sl}from"react";import{cn as mo,usePositionClo
|
|
|
6
6
|
hover:cleen-bg-primary/10
|
|
7
7
|
${l?"cleen-bg-primary/10":""}
|
|
8
8
|
${i}
|
|
9
|
-
`,onClick:()=>n?.(t),children:[Xt("div",{className:"group-hover:[filter:brightness(0)_saturate(100%)_invert(54%)_sepia(56%)_saturate(7022%)_hue-rotate(179deg)_brightness(102%)_contrast(101%)]",children:s}),o&&Xt("div",{className:"cleen-absolute -cleen-top-1 -cleen-right-1 cleen-flex cleen-items-center cleen-justify-center cleen-w-4 cleen-h-4 cleen-bg-white cleen-rounded-md cleen-border cleen-border-gray/30 cleen-font-normal cleen-text-[8px] cleen-text-gray",children:o})]},t?.id)})}import{jsx as We,jsxs as I1}from"react/jsx-runtime";function d7({navigationItems:t,bottomNavigationItems:e=[],drawerContent:n={},logo:o,onLogoClick:i,userAvatar:r,userInfo:l,drawerFooter:s,drawerWidth:c=330,defaultActiveId:p=null,activeId:a,onActiveChange:d,closeOnOutsideClick:f=!0,closeOnBlur:u=!0,className:g,classNames:v,style:h,styles:b,renderSidebarItem:w}){let[y,x]=Zp(p),I=Wp(null),P=a!==void 0?a:y,L=!!P,H=k=>{let M=P===k.id?null:k.id;a===void 0&&x(M),d?.(M)};_p(()=>{if(!f||!L)return;let k=M=>{I.current&&!I.current.contains(M.target)&&(a===void 0&&x(null),d?.(null))};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[f,L,a,d]);let N=k=>{!u||!L||I.current&&!I.current.contains(k.relatedTarget)&&(a===void 0&&x(null),d?.(null))};return I1("div",{className:Yn("cleen",g),style:{height:"100%",display:"flex",backgroundColor:"rgb(var(--cleen-sidebar))",...h},ref:I,onBlur:N,tabIndex:u?0:void 0,children:[I1("div",{className:Yn("cleen-flex cleen-flex-col cleen-items-center cleen-
|
|
9
|
+
`,onClick:()=>n?.(t),children:[Xt("div",{className:"group-hover:[filter:brightness(0)_saturate(100%)_invert(54%)_sepia(56%)_saturate(7022%)_hue-rotate(179deg)_brightness(102%)_contrast(101%)]",children:s}),o&&Xt("div",{className:"cleen-absolute -cleen-top-1 -cleen-right-1 cleen-flex cleen-items-center cleen-justify-center cleen-w-4 cleen-h-4 cleen-bg-white cleen-rounded-md cleen-border cleen-border-gray/30 cleen-font-normal cleen-text-[8px] cleen-text-gray",children:o})]},t?.id)})}import{jsx as We,jsxs as I1}from"react/jsx-runtime";function d7({navigationItems:t,bottomNavigationItems:e=[],drawerContent:n={},logo:o,onLogoClick:i,userAvatar:r,userInfo:l,drawerFooter:s,drawerWidth:c=330,defaultActiveId:p=null,activeId:a,onActiveChange:d,closeOnOutsideClick:f=!0,closeOnBlur:u=!0,className:g,classNames:v,style:h,styles:b,renderSidebarItem:w}){let[y,x]=Zp(p),I=Wp(null),P=a!==void 0?a:y,L=!!P,H=k=>{let M=P===k.id?null:k.id;a===void 0&&x(M),d?.(M)};_p(()=>{if(!f||!L)return;let k=M=>{I.current&&!I.current.contains(M.target)&&(a===void 0&&x(null),d?.(null))};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[f,L,a,d]);let N=k=>{!u||!L||I.current&&!I.current.contains(k.relatedTarget)&&(a===void 0&&x(null),d?.(null))};return I1("div",{className:Yn("cleen",g),style:{height:"100%",display:"flex",backgroundColor:"rgb(var(--cleen-sidebar))",...h},ref:I,onBlur:N,tabIndex:u?0:void 0,children:[I1("div",{className:Yn("cleen-flex cleen-flex-col cleen-items-center cleen-border-r cleen-border-r-gray/10 cleen-h-full",v?.navigation),style:b?.navigation,children:[o&&We("div",{className:"cleen-flex cleen-justify-center cleen-items-center cleen-pt-8 cleen-pb-6 cleen-w-full cleen-cursor-pointer",onClick:i,children:o}),I1("div",{className:Yn("cleen-flex cleen-flex-col cleen-flex-1 cleen-justify-between cleen-gap-2 cleen-px-4 cleen-overflow-y-auto cleen-no-scrollbar",v?.navigationItems),style:b?.navigationItems,children:[We("nav",{className:"cleen-flex cleen-flex-col cleen-gap-2",children:t.map(k=>I1("div",{children:[w?w(k,P===k.id,H):We(jt,{item:k,activeId:P,onClick:H}),k?.withBottomDivider&&We("div",{className:"cleen-bg-gray/10 cleen-mt-2 cleen-w-12 cleen-h-[1px]"})]},k.id))}),I1("div",{className:"cleen-flex cleen-flex-col cleen-items-center cleen-gap-2",children:[e.map(k=>I1("div",{children:[w?w(k,P===k.id,H):We(jt,{item:k,activeId:P,onClick:H,countBadge:k.badgeCount}),k?.withBottomDivider&&We("div",{className:"cleen-bg-gray/10 cleen-mt-2 cleen-w-12 cleen-h-[1px]"})]},k.id)),r&&We("div",{className:"cleen-mt-6 cleen-mb-8",children:r})]})]})]}),I1("div",{className:Yn("cleen-flex cleen-flex-col cleen-bg-sidebar cleen-h-full cleen-overflow-hidden cleen-transition-all cleen-duration-100",{"cleen-border-r cleen-border-r-gray/10":L},v?.drawer),style:{...b?.drawer,width:L?`${c}px`:"0px",visibility:L?"visible":"hidden"},children:[P&&n[P]&&We("div",{className:"cleen-flex-1 cleen-overflow-auto",children:n[P]}),P&&(s||l)&&We("div",{className:"cleen-flex cleen-justify-between cleen-items-start cleen-gap-4 cleen-px-5 cleen-pt-4 cleen-pb-8 cleen-border-gray/10 cleen-border-t cleen-w-full",children:typeof s=="function"?s(P):s||l})]})]})}import{jsx as u7,jsxs as Op}from"react/jsx-runtime";function C7({children:t,title:e,className:n="",renderHeader:o}){return Op("div",{className:`cleen-w-full cleen-h-full ${n}`,"data-testid":`drawer-container-${e}`,children:[o?o(e):u7("h1",{className:"cleen-text-sm cleen-font-medium cleen-pb-4 cleen-pt-9 cleen-px-4 cleen-text-gray",children:e}),u7("div",{className:"cleen-h-max cleen-w-full cleen-px-4",children:t})]})}import{jsx as Le,jsxs as Kt}from"react/jsx-runtime";function zp({items:t,title:e,iconName:n,iconSrc:o,iconSize:i=24}){return Kt("details",{className:"cleen-group",children:[Kt("summary",{className:"cleen-flex cleen-items-center cleen-justify-between cleen-gap-3 cleen-px-3 cleen-py-2 cleen-w-full cleen-rounded-md cleen-cursor-pointer hover:cleen-bg-gray/5 cleen-transition-colors cleen-duration-200 cleen-list-none [&::-webkit-details-marker]:cleen-hidden",children:[Kt("div",{"data-testid":"title-list",className:"cleen-flex cleen-items-center cleen-gap-3",children:[o?Le("img",{src:o,alt:e,className:"cleen-w-6 cleen-h-6 cleen-text-gray/50 cleen-transition-colors cleen-duration-200 group-hover:cleen-text-gray"}):n?Le(re,{name:n,width:i,height:i,className:"cleen-text-gray/50 cleen-transition-all cleen-duration-200"}):null,Le("span",{className:"cleen-font-semibold cleen-text-sm cleen-text-gray/70 group-hover:cleen-text-gray cleen-transition-colors cleen-duration-200",children:e})]}),Le(re,{name:"ChevronUp",className:"cleen-w-5 cleen-h-5 cleen-text-gray cleen-transition-transform cleen-duration-200 group-open:cleen-rotate-180"})]}),Le("div",{className:"cleen-flex cleen-flex-col cleen-gap-1 cleen-mt-1",children:t?.map(r=>Le("span",{className:"cleen-py-2 cleen-px-3 cleen-pl-12 cleen-font-semibold cleen-text-sm cleen-text-gray/70 cleen-rounded-md cleen-cursor-pointer hover:cleen-text-gray hover:cleen-bg-primary/5 cleen-transition-colors cleen-duration-200",onClick:()=>r.onClick(r),children:r?.title},r?.id))})]})}function m7({title:t,iconName:e,iconSrc:n,iconSize:o=24,badgeColor:i="gray",badgeCount:r,submenu:l,onClick:s,className:c="",titleClassName:p="",isActive:a=!1}){return Array.isArray(l)&&l.length>0?Le(zp,{items:l,title:t,iconSrc:n,iconName:e}):Kt("div",{className:`
|
|
10
10
|
cleen-flex cleen-items-center cleen-justify-between cleen-gap-3 cleen-px-3 cleen-py-2 cleen-w-full
|
|
11
11
|
cleen-rounded-md cleen-cursor-pointer cleen-transition-colors cleen-duration-200
|
|
12
12
|
hover:cleen-bg-gray/5
|