cortex-react-components 2.0.4 → 2.0.5
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/{chunk-OCYVZBS7.mjs → chunk-2GZQYAN3.mjs} +1 -1
- package/dist/chunk-2VR4KIQL.mjs +4 -0
- package/dist/{chunk-MXFCHKIK.mjs → chunk-45DDMEV4.mjs} +1 -1
- package/dist/{chunk-TWGRQW4P.mjs → chunk-5KS3DITB.mjs} +1 -1
- package/dist/{chunk-BA53AOCS.mjs → chunk-66ODXUVL.mjs} +1 -1
- package/dist/{chunk-CLGBBNRB.mjs → chunk-75WE6ZXB.mjs} +1 -1
- package/dist/{chunk-6UADPSC5.mjs → chunk-BDNY6OKE.mjs} +1 -1
- package/dist/{chunk-77YVLEKT.mjs → chunk-BGADMIWV.mjs} +1 -1
- package/dist/{chunk-7SPSOAIQ.mjs → chunk-BN747TQM.mjs} +1 -1
- package/dist/{chunk-EW64VNFT.mjs → chunk-FXTFE74U.mjs} +1 -1
- package/dist/{chunk-UCHNFFXQ.mjs → chunk-GH3F4DKW.mjs} +1 -1
- package/dist/{chunk-EZEZEBLI.mjs → chunk-GIL2SMPM.mjs} +1 -1
- package/dist/{chunk-4VWCJYTN.mjs → chunk-I4LKRX2X.mjs} +1 -1
- package/dist/chunk-IPV2NFB6.mjs +1 -0
- package/dist/chunk-JHSHXYPK.mjs +4 -0
- package/dist/{chunk-VIPT3OVD.mjs → chunk-JLUX7EHB.mjs} +1 -1
- package/dist/{chunk-CK2TFJB2.mjs → chunk-JT65KF7C.mjs} +1 -1
- package/dist/chunk-LUPNE23E.mjs +1 -0
- package/dist/{chunk-PEOZPVWF.mjs → chunk-M74BIPBM.mjs} +1 -1
- package/dist/{chunk-XR55FO72.mjs → chunk-NBWEIVGC.mjs} +1 -1
- package/dist/{chunk-DA2H3N3G.mjs → chunk-NXG2Y4N4.mjs} +1 -1
- package/dist/chunk-PA4ZBJDO.mjs +1 -0
- package/dist/{chunk-WG6ATCG3.mjs → chunk-PRK2XFAZ.mjs} +1 -1
- package/dist/{chunk-4ZEATBUU.mjs → chunk-RVDQVN5C.mjs} +1 -1
- package/dist/{chunk-546LLRCZ.mjs → chunk-S5BLSQXV.mjs} +1 -1
- package/dist/chunk-SWA5TRPZ.mjs +4 -0
- package/dist/{chunk-LG2AWHTC.mjs → chunk-T36QUKC6.mjs} +1 -1
- package/dist/{chunk-P6VHSIQK.mjs → chunk-TRFGSHZW.mjs} +1 -1
- package/dist/{chunk-TO2UDP5T.mjs → chunk-UA76VX54.mjs} +1 -1
- package/dist/{chunk-CAKJOTEE.mjs → chunk-V5W32NJ4.mjs} +1 -1
- package/dist/{chunk-JXFCIH2E.mjs → chunk-WDZOGIT2.mjs} +1 -1
- package/dist/{chunk-IPXOPQPI.mjs → chunk-Y62OBV2E.mjs} +1 -1
- package/dist/chunk-ZCEVYZEO.mjs +4 -0
- package/dist/{chunk-2JBVESQ2.mjs → chunk-ZZ6VZFRV.mjs} +1 -1
- package/dist/components/AdvancedComponents/sidebar.js +1 -1
- package/dist/components/AdvancedComponents/sidebar.mjs +3 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/Chat/CAPABILITIES_README.js +12 -5
- package/dist/components/Chat/CAPABILITIES_README.mjs +12 -5
- package/dist/components/Chat/{EnhancedChatInterface.d.ts → ChatInterface.d.ts} +4 -6
- package/dist/components/Chat/ChatInterface.js +5 -0
- package/dist/components/Chat/ChatInterface.mjs +1 -0
- package/dist/components/Chat/CopilotInterface.d.ts +27 -86
- package/dist/components/Chat/CopilotInterface.js +1 -1
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/chat-session-sidebar.d.ts +0 -2
- package/dist/components/Chat/chat-session-sidebar.js +1 -1
- package/dist/components/Chat/chat-session-sidebar.mjs +1 -1
- package/dist/components/Chat/demo.d.ts +7 -0
- package/dist/components/Chat/demo.js +5 -0
- package/dist/components/Chat/demo.mjs +1 -0
- package/dist/components/Chat/example-usage.d.ts +39 -0
- package/dist/components/Chat/example-usage.js +5 -0
- package/dist/components/Chat/example-usage.mjs +1 -0
- package/dist/components/Chat/index.d.ts +2 -0
- package/dist/components/Chat/index.js +2 -2
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/Chat/types.d.ts +16 -0
- package/dist/components/Chat/types.js +1 -0
- package/dist/components/Chat/types.mjs +1 -0
- package/dist/components/DigitalColleagues/DigitalColleageusLayout.d.ts +2 -1
- package/dist/components/DigitalColleagues/DigitalColleageusLayout.js +1 -1
- package/dist/components/DigitalColleagues/DigitalColleageusLayout.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.js +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/sidebar-favorites-readme.js +228 -0
- package/dist/components/DigitalColleagues/sidebar-favorites-readme.mjs +228 -0
- package/dist/components/{dc-temp/sidebar.d.ts → DigitalColleagues/sidebar-new.d.ts} +3 -2
- package/dist/components/DigitalColleagues/sidebar-new.js +5 -0
- package/dist/components/DigitalColleagues/sidebar-new.mjs +4 -0
- package/dist/components/DigitalColleagues/sidebar.css +1 -0
- package/dist/components/DigitalColleagues/sidebar.d.ts +17 -0
- package/dist/components/DigitalColleagues/sidebar.js +5 -0
- package/dist/components/DigitalColleagues/sidebar.mjs +2 -0
- package/dist/components/DigitalColleagues/test-data.js +1 -1
- package/dist/components/DigitalColleagues/test-data.mjs +1 -1
- package/dist/components/DigitalColleagues/types.d.ts +3 -0
- package/dist/components/DigitalColleagues/types.js +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/enhanced-header.css +1 -0
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.mjs +1 -1
- package/dist/components/Holidays/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.js +1 -1
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/dc-temp/dashboard-integration-example.mjs +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +11 -11
- package/dist/components/index.mjs +1 -1
- package/dist/globals.css +1 -1
- package/dist/index.js +16 -16
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +6 -2
- package/dist/chunk-5Z5PL7N3.mjs +0 -1
- package/dist/chunk-DLUWDQSW.mjs +0 -4
- package/dist/chunk-R7LPCFUJ.mjs +0 -4
- package/dist/chunk-TO7KJNKC.mjs +0 -4
- package/dist/chunk-WBJENB4Y.mjs +0 -4
- package/dist/components/.archive/ai-chat-interface.d.ts +0 -70
- package/dist/components/Chat/EnhancedChatInterface.js +0 -5
- package/dist/components/Chat/EnhancedChatInterface.mjs +0 -4
- package/dist/components/Chat/ai-chat-interface.d.ts +0 -70
- package/dist/components/Chat/ai-chat-interface.js +0 -5
- package/dist/components/Chat/ai-chat-interface.mjs +0 -4
- package/dist/components/dc-temp/sidebar.js +0 -5
- package/dist/components/dc-temp/sidebar.mjs +0 -4
- /package/dist/components/Chat/{EnhancedChatInterface.css → ChatInterface.css} +0 -0
- /package/dist/components/Chat/{ai-chat-interface.css → demo.css} +0 -0
- /package/dist/components/{dc-temp/enhanced-header.css → Chat/example-usage.css} +0 -0
- /package/dist/components/{dc-temp/sidebar.css → DigitalColleagues/sidebar-new.css} +0 -0
- /package/dist/components/{dc-temp → HeaderFooter}/enhanced-header.d.ts +0 -0
- /package/dist/components/{dc-temp → HeaderFooter}/enhanced-header.js +0 -0
- /package/dist/components/{dc-temp → HeaderFooter}/enhanced-header.mjs +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
"use client";import{a as S}from"../../../chunk-TCXAETN2.mjs";import{a as O}from"../../../chunk-PEQOQ7BK.mjs";import{a as
|
|
4
|
+
"use client";import{a as S}from"../../../chunk-TCXAETN2.mjs";import{a as O}from"../../../chunk-PEQOQ7BK.mjs";import{a as p,b as B,d as I}from"../../../chunk-5OQF3MNO.mjs";import{a as F}from"../../../chunk-5RTGHMF3.mjs";import{a as j}from"../../../chunk-KTET6W73.mjs";import{a as T}from"../../../chunk-3U3PZBHQ.mjs";import"../../../chunk-637VXITY.mjs";import"../../../chunk-OB5WMODY.mjs";import"../../../chunk-SNZ5BAQQ.mjs";import"../../../chunk-RUOYGMOR.mjs";import"../../../chunk-WN2LPOQP.mjs";import"../../../chunk-BADFWNRL.mjs";import"../../../chunk-TUI4S4GI.mjs";import"../../../chunk-AVHFRD6D.mjs";import{a as i}from"../../../chunk-2NMVE5M4.mjs";import{a as P}from"../../../chunk-JHSHXYPK.mjs";import"../../../chunk-SWA5TRPZ.mjs";import"../../../chunk-PM35MWKG.mjs";import"../../../chunk-AZKOVKSK.mjs";import"../../../chunk-M245YHYF.mjs";import"../../../chunk-3KITWLRN.mjs";import{a as w,b as k,e as A}from"../../../chunk-PA4ZBJDO.mjs";import"../../../chunk-YFAZQYK4.mjs";import"../../../chunk-INCYANPB.mjs";import"../../../chunk-RLVKIMGU.mjs";import"../../../chunk-OCPX4QPC.mjs";import"../../../chunk-FT3AE7L2.mjs";import"../../../chunk-B4H6T2GP.mjs";import"../../../chunk-TVZOULLL.mjs";import"../../../chunk-3UMMMQEH.mjs";import"../../../chunk-L5JPAKPM.mjs";import"../../../chunk-KY7WQYN4.mjs";import{b as m}from"../../../chunk-ZUA4KNIR.mjs";import"../../../chunk-SOLZ4VQH.mjs";import{b as v}from"../../../chunk-CSBGSBEU.mjs";import{a as h,b,c as N,d as x,e as y,f as C}from"../../../chunk-YO3GQYRJ.mjs";import"../../../chunk-MDJREBVI.mjs";import"../../../chunk-ZWHGOTSF.mjs";import"../../../chunk-Q3G5UAAD.mjs";import"../../../chunk-XGRRLABA.mjs";import"../../../chunk-FLHDNCNY.mjs";import"../../../chunk-YEKQJ4YC.mjs";import{useState as U}from"react";import{motion as W,AnimatePresence as _}from"framer-motion";import{Bot as $}from"lucide-react";import{motion as Y}from"framer-motion";import{Star as K}from"lucide-react";import{jsx as s,jsxs as r}from"react/jsx-runtime";function g({app:a,onOpen:d,onFavorite:l,showProgress:n=!1,className:c}){return s(Y.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:c,children:r(h,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[s(b,{className:"pb-2",children:r("div",{className:"flex items-center justify-between",children:[s("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:a.icon}),a.new?s(v,{className:"rounded-xl bg-amber-500",children:"New"}):s(m,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>l?.(a),children:s(K,{className:"h-4 w-4"})})]})}),r(y,{className:"pb-2",children:[s(N,{className:"text-lg",children:a.name}),s(x,{children:a.description}),n&&a.progress<100&&r("div",{className:"mt-2",children:[r("div",{className:"flex items-center justify-between text-sm",children:[s("span",{children:"Installation"}),r("span",{children:[a.progress,"%"]})]}),s(F,{value:a.progress,className:"h-2 mt-1 rounded-xl"})]})]}),s(C,{children:s(m,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>d?.(a),children:a.progress<100?"Continue Install":"Open"})})]})})}import{jsx as e,jsxs as o}from"react/jsx-runtime";function q({title:a="Digital Colleagues",businessUnits:d}){let[l,n]=U("home"),[c,D]=U(d[0]),u=t=>{console.log("Opening app:",t.name)},f=t=>{console.log("Favoriting app:",t.name)},R=t=>{console.log("Opening file:",t.name)},J=t=>{console.log("Sharing file:",t.name)},H=t=>{console.log("Opening project:",t.name)},L=t=>{console.log("Sharing project:",t.name)},V=t=>{D(t),console.log("Business unit changed to:",t.name)},z=()=>{console.log("Copilot clicked - navigating to chat"),n("chat")},E=t=>{console.log("Notification removed:",t)},G=()=>{console.log("All notifications removed")},M=()=>{switch(l){case"home":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[o("section",{className:"text-center py-12",children:[o("h1",{className:"text-4xl font-bold mb-4",children:["Welcome to the ",c.name," team"]}),e("p",{className:"text-xl text-muted-foreground mb-8",children:"This is your collaborative workspace for productivity and knowledge sharing."})]}),o("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),e("p",{className:"text-3xl font-bold text-primary",children:"12"}),e("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),e("p",{className:"text-3xl font-bold text-primary",children:"8"}),e("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),o("div",{className:"bg-card p-6 rounded-lg border",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),e("p",{className:"text-3xl font-bold text-primary",children:"156"}),e("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),e(i,{title:"Chat with your team",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Go",onClick:()=>n("chat")}})]});case"colleagues":return e(S,{});case"chat":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[o("section",{className:"text-center py-12",children:[e("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),o("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",c.name," team members and collaborate in real-time."]})]}),e(i,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return o("div",{className:"space-y-8",children:[e(i,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"New Releases"}),e("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:p.filter(t=>t.new).map(t=>e(g,{app:t,showProgress:!0,onOpen:u,onFavorite:f},t.name))})]}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"All Apps"}),e("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:p.map(t=>e(g,{app:t,onOpen:u,onFavorite:f},t.name))})]})]});case"knowledge":return e(j,{});case"files":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[e(i,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),o("section",{className:"space-y-4",children:[e("div",{className:"flex items-center justify-between",children:e("h2",{className:"text-2xl font-semibold",children:"All Files"})}),e(T,{files:B,onFileClick:R})]})]});case"projects":return o("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[e(i,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:()=>console.log("New project clicked")}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),e("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:A.map(t=>e(O,{project:t,onOpen:H,onShare:L},t.name))})]})]});case"learn":return o("div",{className:"space-y-8",children:[e(i,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Upgrade to Pro",onClick:()=>console.log("Upgrade to pro clicked")}}),o("section",{className:"space-y-4",children:[e("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),e("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:I.slice(0,3).map(t=>o("div",{className:"rounded-3xl border p-6",children:[e("h3",{className:"font-semibold mb-2",children:t.title}),e("p",{className:"text-sm text-muted-foreground mb-4",children:t.description}),o("div",{className:"flex items-center justify-between text-sm",children:[e("span",{children:t.duration}),e("span",{children:t.level})]})]},t.title))})]})]});default:return null}};return e(P,{sidebarItems:w,title:a,notifications:k,businessUnits:d,currentBusinessUnit:c,onBusinessUnitChange:V,activeTab:l,onTabChange:n,showTabs:!0,onActionClick:z,actionIcon:e($,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:E,onRemoveAll:G,children:e(_,{mode:"wait",children:e(W.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:M()},l)})})}export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"../../../chunk-TCXAETN2.mjs";import{a as
|
|
1
|
+
import{a as f}from"../../../chunk-TCXAETN2.mjs";import{a as t}from"../../../chunk-2SAKLSZ4.mjs";import"../../../chunk-PEQOQ7BK.mjs";import"../../../chunk-D3B2YO7G.mjs";import{a as r}from"../../../chunk-S5BLSQXV.mjs";import"../../../chunk-PXPSM7OQ.mjs";import"../../../chunk-KOXC4RIH.mjs";import"../../../chunk-UA76VX54.mjs";import"../../../chunk-FOISWNF5.mjs";import"../../../chunk-PFLESLNT.mjs";import"../../../chunk-AB43AQKL.mjs";import"../../../chunk-6YHVVP3S.mjs";import"../../../chunk-AMV3MECK.mjs";import"../../../chunk-NZS3XKXU.mjs";import"../../../chunk-ORNGKQM7.mjs";import"../../../chunk-6DEY5ZDD.mjs";import"../../../chunk-2VZWOBGP.mjs";import"../../../chunk-5RTGHMF3.mjs";import{a as o}from"../../../chunk-KTET6W73.mjs";import{a}from"../../../chunk-FV3W3WL7.mjs";import"../../../chunk-3U3PZBHQ.mjs";import{a as e}from"../../../chunk-FRKGQKEM.mjs";import"../../../chunk-MNI6AM7Q.mjs";import"../../../chunk-637VXITY.mjs";import"../../../chunk-OB5WMODY.mjs";import"../../../chunk-SNZ5BAQQ.mjs";import"../../../chunk-RUOYGMOR.mjs";import"../../../chunk-WN2LPOQP.mjs";import"../../../chunk-BADFWNRL.mjs";import"../../../chunk-ABGNIQRP.mjs";import"../../../chunk-EOXVYLPB.mjs";import"../../../chunk-TUI4S4GI.mjs";import"../../../chunk-AVHFRD6D.mjs";import"../../../chunk-2NMVE5M4.mjs";import"../../../chunk-DFIXTV2M.mjs";import"../../../chunk-M245YHYF.mjs";import"../../../chunk-6SWKEZN6.mjs";import"../../../chunk-E4TE4NV6.mjs";import"../../../chunk-JFFTEK6Z.mjs";import"../../../chunk-JHNVX4UB.mjs";import"../../../chunk-7BXIU4ZM.mjs";import"../../../chunk-YFAZQYK4.mjs";import"../../../chunk-INCYANPB.mjs";import"../../../chunk-RLVKIMGU.mjs";import"../../../chunk-OCPX4QPC.mjs";import"../../../chunk-FT3AE7L2.mjs";import"../../../chunk-B4H6T2GP.mjs";import"../../../chunk-TVZOULLL.mjs";import"../../../chunk-3UMMMQEH.mjs";import"../../../chunk-ZFUP5NVF.mjs";import"../../../chunk-4UIARERB.mjs";import"../../../chunk-D4IMQTVU.mjs";import"../../../chunk-7GSXNSLD.mjs";import"../../../chunk-L5JPAKPM.mjs";import"../../../chunk-KY7WQYN4.mjs";import"../../../chunk-ZUA4KNIR.mjs";import"../../../chunk-SOLZ4VQH.mjs";import"../../../chunk-CSBGSBEU.mjs";import"../../../chunk-YO3GQYRJ.mjs";import"../../../chunk-MDJREBVI.mjs";import"../../../chunk-ZWHGOTSF.mjs";import"../../../chunk-Q3G5UAAD.mjs";import"../../../chunk-XGRRLABA.mjs";import"../../../chunk-FRWX5YES.mjs";import"../../../chunk-FLHDNCNY.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{f as ColleaguesView,a as FileView,o as KnowledgeView,r as ProjectView,t as ProjectsIndexView,e as TeamsIndexView};
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
var t=`# Sidebar Component with Per-Item Favorites Management
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Sidebar component has been enhanced with per-item favorites management functionality, allowing individual sidebar sections to limit their displayed items and let users choose favorites for each section.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
### Basic Features
|
|
10
|
+
- Responsive sidebar with mobile support
|
|
11
|
+
- Collapsible/expandable sections
|
|
12
|
+
- Badge support for notifications
|
|
13
|
+
- Active state indication
|
|
14
|
+
- Business unit switching
|
|
15
|
+
- Search functionality
|
|
16
|
+
|
|
17
|
+
### New: Per-Item Favorites Management
|
|
18
|
+
- **Per-Section Limits**: Each \`SidebarItem\` can have its own \`maxItems\` limit
|
|
19
|
+
- **Independent Favorites**: Users manage favorites separately for each section
|
|
20
|
+
- **Visual Management**: Each limited section shows item counts and "Manage" button
|
|
21
|
+
- **Persistent Storage**: Favorites stored per-section using \`localStorage\`
|
|
22
|
+
- **Priority Display**: Favorite items always appear first within each section
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Basic Usage
|
|
27
|
+
\`\`\`tsx
|
|
28
|
+
import { Sidebar } from "@/components/DigitalColleagues/sidebar"
|
|
29
|
+
|
|
30
|
+
<Sidebar
|
|
31
|
+
items={sidebarItems}
|
|
32
|
+
isOpen={true}
|
|
33
|
+
/>
|
|
34
|
+
\`\`\`
|
|
35
|
+
|
|
36
|
+
### With Per-Item Limits
|
|
37
|
+
\`\`\`tsx
|
|
38
|
+
const sidebarItems = [
|
|
39
|
+
{
|
|
40
|
+
id: "teams",
|
|
41
|
+
title: "Teams",
|
|
42
|
+
icon: <Users />,
|
|
43
|
+
maxItems: 3, // Only show 3 teams, allow favorites selection
|
|
44
|
+
items: [
|
|
45
|
+
{ id: "design", title: "Design", url: "#" },
|
|
46
|
+
{ id: "marketing", title: "Marketing", url: "#" },
|
|
47
|
+
{ id: "engineering", title: "Engineering", url: "#" },
|
|
48
|
+
{ id: "finance", title: "Finance", url: "#" },
|
|
49
|
+
{ id: "sales", title: "Sales", url: "#" },
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
<Sidebar
|
|
55
|
+
items={sidebarItems}
|
|
56
|
+
isOpen={true}
|
|
57
|
+
/>
|
|
58
|
+
\`\`\`
|
|
59
|
+
|
|
60
|
+
## Props
|
|
61
|
+
|
|
62
|
+
| Prop | Type | Default | Description |
|
|
63
|
+
|------|------|---------|-------------|
|
|
64
|
+
| \`items\` | \`SidebarItem[]\` | Required | Array of sidebar items to display |
|
|
65
|
+
| \`isOpen\` | \`boolean\` | Required | Whether the sidebar is open |
|
|
66
|
+
| \`isMobile\` | \`boolean\` | \`false\` | Whether to use mobile layout |
|
|
67
|
+
| \`onClose\` | \`() => void\` | \`undefined\` | Callback when sidebar is closed (mobile) |
|
|
68
|
+
| \`currentBusinessUnit\` | \`BusinessUnit\` | First unit | Currently selected business unit |
|
|
69
|
+
| \`onBusinessUnitChange\` | \`(unit: BusinessUnit) => void\` | \`undefined\` | Callback when business unit changes |
|
|
70
|
+
| \`className\` | \`string\` | \`undefined\` | Additional CSS classes |
|
|
71
|
+
| \`logo\` | \`string\` | \`"/headerlogo.png"\` | Logo image URL |
|
|
72
|
+
| \`appName\` | \`string\` | \`"Nuvia"\` | Application name |
|
|
73
|
+
| \`tagline\` | \`string\` | \`"Collaboration Platform"\` | Application tagline |
|
|
74
|
+
|
|
75
|
+
## Types
|
|
76
|
+
|
|
77
|
+
### SidebarItem
|
|
78
|
+
\`\`\`typescript
|
|
79
|
+
interface SidebarItem {
|
|
80
|
+
id: string // Required for favorites functionality
|
|
81
|
+
title: string
|
|
82
|
+
icon: React.ReactNode
|
|
83
|
+
isActive?: boolean
|
|
84
|
+
badge?: string
|
|
85
|
+
url?: string
|
|
86
|
+
maxItems?: number // NEW: Limit subitems shown, enables favorites
|
|
87
|
+
items?: {
|
|
88
|
+
id: string // Required for subitems too
|
|
89
|
+
title: string
|
|
90
|
+
url: string
|
|
91
|
+
badge?: string
|
|
92
|
+
}[]
|
|
93
|
+
}
|
|
94
|
+
\`\`\`
|
|
95
|
+
|
|
96
|
+
## Behavior
|
|
97
|
+
|
|
98
|
+
### Without maxItems on a Section
|
|
99
|
+
- All subitems are displayed normally
|
|
100
|
+
- No favorites functionality for that section
|
|
101
|
+
- Standard collapsible behavior
|
|
102
|
+
|
|
103
|
+
### With maxItems on a Section
|
|
104
|
+
1. **Subitems \u2264 maxItems**: All subitems shown, no management needed
|
|
105
|
+
2. **Subitems > maxItems**:
|
|
106
|
+
- Favorite subitems appear first
|
|
107
|
+
- Non-favorite subitems fill remaining slots
|
|
108
|
+
- Clickable "X more items available - click to manage favorites" text shown when section is expanded
|
|
109
|
+
- Click the text to open favorites management dialog
|
|
110
|
+
|
|
111
|
+
### Per-Section Favorites Management Dialog
|
|
112
|
+
- **Section-Specific**: Each section manages its own favorites independently
|
|
113
|
+
- **Easy Access**: Click "X more items available" text to open management
|
|
114
|
+
- **Checkbox Interface**: Simple checkboxes for subitems in that section
|
|
115
|
+
- **Visual Feedback**: Badges shown for context
|
|
116
|
+
- **Limit Enforcement**: Cannot select more than section's maxItems
|
|
117
|
+
- **Immediate Updates**: Changes reflect immediately in sidebar
|
|
118
|
+
- **Persistent Storage**: Preferences saved per-section to localStorage
|
|
119
|
+
|
|
120
|
+
### Local Storage
|
|
121
|
+
- Key: \`sidebar-favorites\`
|
|
122
|
+
- Value: Object with section IDs as keys, arrays of favorite subitem IDs as values
|
|
123
|
+
- Example: \`{"teams": ["design", "marketing"], "projects": ["active-projects"]}\`
|
|
124
|
+
- Automatically syncs across browser sessions
|
|
125
|
+
- Falls back gracefully if localStorage unavailable
|
|
126
|
+
|
|
127
|
+
## Examples
|
|
128
|
+
|
|
129
|
+
### Example 1: Teams with Limited Display
|
|
130
|
+
\`\`\`tsx
|
|
131
|
+
const teamsWithLimit = {
|
|
132
|
+
id: "teams",
|
|
133
|
+
title: "Teams",
|
|
134
|
+
icon: <Users />,
|
|
135
|
+
maxItems: 2, // Show only 2 teams at a time
|
|
136
|
+
items: [
|
|
137
|
+
{ id: "design", title: "Design", url: "/teams/design" },
|
|
138
|
+
{ id: "marketing", title: "Marketing", url: "/teams/marketing" },
|
|
139
|
+
{ id: "engineering", title: "Engineering", url: "/teams/engineering" },
|
|
140
|
+
{ id: "finance", title: "Finance", url: "/teams/finance" },
|
|
141
|
+
{ id: "sales", title: "Sales", url: "/teams/sales" },
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
\`\`\`
|
|
145
|
+
|
|
146
|
+
### Example 2: Multiple Sections with Different Limits
|
|
147
|
+
\`\`\`tsx
|
|
148
|
+
const sidebarItems = [
|
|
149
|
+
{
|
|
150
|
+
id: "teams",
|
|
151
|
+
title: "Teams",
|
|
152
|
+
icon: <Users />,
|
|
153
|
+
maxItems: 3,
|
|
154
|
+
items: [/* 5 teams */]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "projects",
|
|
158
|
+
title: "Projects",
|
|
159
|
+
icon: <Layers />,
|
|
160
|
+
maxItems: 2,
|
|
161
|
+
items: [/* 4 projects */]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: "tools",
|
|
165
|
+
title: "Tools",
|
|
166
|
+
icon: <Wrench />,
|
|
167
|
+
// No maxItems = show all tools
|
|
168
|
+
items: [/* all tools shown */]
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
\`\`\`
|
|
172
|
+
|
|
173
|
+
## Implementation Details
|
|
174
|
+
|
|
175
|
+
### State Management
|
|
176
|
+
- Uses \`useLocalStorage\` hook with object structure for per-section favorites
|
|
177
|
+
- Internal state for dialog visibility (tracks which section is being managed)
|
|
178
|
+
- Automatic filtering and sorting of subitems per section
|
|
179
|
+
|
|
180
|
+
### Visual Indicators
|
|
181
|
+
- Clickable "X more items available - click to manage favorites" text appears when sections are expanded and have hidden items
|
|
182
|
+
- No visual changes for unlimited sections or sections showing all items
|
|
183
|
+
- Clean section titles without item counts
|
|
184
|
+
|
|
185
|
+
### Performance
|
|
186
|
+
- Efficient per-section filtering algorithms
|
|
187
|
+
- Minimal re-renders when toggling favorites
|
|
188
|
+
- Local storage operations are section-scoped
|
|
189
|
+
|
|
190
|
+
### Accessibility
|
|
191
|
+
- Proper ARIA labels and roles for section-specific dialogs
|
|
192
|
+
- Keyboard navigation support
|
|
193
|
+
- Screen reader friendly section descriptions
|
|
194
|
+
- Focus management in per-section dialogs
|
|
195
|
+
|
|
196
|
+
## Migration Guide
|
|
197
|
+
|
|
198
|
+
### From Previous Version
|
|
199
|
+
1. **Add IDs**: Ensure all \`SidebarItem\` and subitem objects have unique \`id\` fields
|
|
200
|
+
2. **Add maxItems**: Add \`maxItems?: number\` to sections that need limits
|
|
201
|
+
3. **Update Storage**: Old global favorites will be ignored; users will need to reset preferences
|
|
202
|
+
|
|
203
|
+
### Breaking Changes
|
|
204
|
+
- \`SidebarItem.id\` is now required (was optional/missing)
|
|
205
|
+
- Subitem objects now require \`id\` field
|
|
206
|
+
- Global sidebar \`maxItems\` prop removed
|
|
207
|
+
- Favorites storage format changed from array to object
|
|
208
|
+
|
|
209
|
+
### Example Migration
|
|
210
|
+
\`\`\`typescript
|
|
211
|
+
// Before (global limit)
|
|
212
|
+
<Sidebar items={items} maxItems={5} />
|
|
213
|
+
|
|
214
|
+
// After (per-section limits)
|
|
215
|
+
const items = [
|
|
216
|
+
{
|
|
217
|
+
id: "teams",
|
|
218
|
+
title: "Teams",
|
|
219
|
+
maxItems: 3, // Section-specific limit
|
|
220
|
+
items: [
|
|
221
|
+
{ id: "design", title: "Design", url: "#" }, // IDs required
|
|
222
|
+
// ...
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
<Sidebar items={items} />
|
|
227
|
+
\`\`\`
|
|
228
|
+
`;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import"../../chunk-YEKQJ4YC.mjs";var t=`# Sidebar Component with Per-Item Favorites Management
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Sidebar component has been enhanced with per-item favorites management functionality, allowing individual sidebar sections to limit their displayed items and let users choose favorites for each section.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
### Basic Features
|
|
10
|
+
- Responsive sidebar with mobile support
|
|
11
|
+
- Collapsible/expandable sections
|
|
12
|
+
- Badge support for notifications
|
|
13
|
+
- Active state indication
|
|
14
|
+
- Business unit switching
|
|
15
|
+
- Search functionality
|
|
16
|
+
|
|
17
|
+
### New: Per-Item Favorites Management
|
|
18
|
+
- **Per-Section Limits**: Each \`SidebarItem\` can have its own \`maxItems\` limit
|
|
19
|
+
- **Independent Favorites**: Users manage favorites separately for each section
|
|
20
|
+
- **Visual Management**: Each limited section shows item counts and "Manage" button
|
|
21
|
+
- **Persistent Storage**: Favorites stored per-section using \`localStorage\`
|
|
22
|
+
- **Priority Display**: Favorite items always appear first within each section
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Basic Usage
|
|
27
|
+
\`\`\`tsx
|
|
28
|
+
import { Sidebar } from "@/components/DigitalColleagues/sidebar"
|
|
29
|
+
|
|
30
|
+
<Sidebar
|
|
31
|
+
items={sidebarItems}
|
|
32
|
+
isOpen={true}
|
|
33
|
+
/>
|
|
34
|
+
\`\`\`
|
|
35
|
+
|
|
36
|
+
### With Per-Item Limits
|
|
37
|
+
\`\`\`tsx
|
|
38
|
+
const sidebarItems = [
|
|
39
|
+
{
|
|
40
|
+
id: "teams",
|
|
41
|
+
title: "Teams",
|
|
42
|
+
icon: <Users />,
|
|
43
|
+
maxItems: 3, // Only show 3 teams, allow favorites selection
|
|
44
|
+
items: [
|
|
45
|
+
{ id: "design", title: "Design", url: "#" },
|
|
46
|
+
{ id: "marketing", title: "Marketing", url: "#" },
|
|
47
|
+
{ id: "engineering", title: "Engineering", url: "#" },
|
|
48
|
+
{ id: "finance", title: "Finance", url: "#" },
|
|
49
|
+
{ id: "sales", title: "Sales", url: "#" },
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
<Sidebar
|
|
55
|
+
items={sidebarItems}
|
|
56
|
+
isOpen={true}
|
|
57
|
+
/>
|
|
58
|
+
\`\`\`
|
|
59
|
+
|
|
60
|
+
## Props
|
|
61
|
+
|
|
62
|
+
| Prop | Type | Default | Description |
|
|
63
|
+
|------|------|---------|-------------|
|
|
64
|
+
| \`items\` | \`SidebarItem[]\` | Required | Array of sidebar items to display |
|
|
65
|
+
| \`isOpen\` | \`boolean\` | Required | Whether the sidebar is open |
|
|
66
|
+
| \`isMobile\` | \`boolean\` | \`false\` | Whether to use mobile layout |
|
|
67
|
+
| \`onClose\` | \`() => void\` | \`undefined\` | Callback when sidebar is closed (mobile) |
|
|
68
|
+
| \`currentBusinessUnit\` | \`BusinessUnit\` | First unit | Currently selected business unit |
|
|
69
|
+
| \`onBusinessUnitChange\` | \`(unit: BusinessUnit) => void\` | \`undefined\` | Callback when business unit changes |
|
|
70
|
+
| \`className\` | \`string\` | \`undefined\` | Additional CSS classes |
|
|
71
|
+
| \`logo\` | \`string\` | \`"/headerlogo.png"\` | Logo image URL |
|
|
72
|
+
| \`appName\` | \`string\` | \`"Nuvia"\` | Application name |
|
|
73
|
+
| \`tagline\` | \`string\` | \`"Collaboration Platform"\` | Application tagline |
|
|
74
|
+
|
|
75
|
+
## Types
|
|
76
|
+
|
|
77
|
+
### SidebarItem
|
|
78
|
+
\`\`\`typescript
|
|
79
|
+
interface SidebarItem {
|
|
80
|
+
id: string // Required for favorites functionality
|
|
81
|
+
title: string
|
|
82
|
+
icon: React.ReactNode
|
|
83
|
+
isActive?: boolean
|
|
84
|
+
badge?: string
|
|
85
|
+
url?: string
|
|
86
|
+
maxItems?: number // NEW: Limit subitems shown, enables favorites
|
|
87
|
+
items?: {
|
|
88
|
+
id: string // Required for subitems too
|
|
89
|
+
title: string
|
|
90
|
+
url: string
|
|
91
|
+
badge?: string
|
|
92
|
+
}[]
|
|
93
|
+
}
|
|
94
|
+
\`\`\`
|
|
95
|
+
|
|
96
|
+
## Behavior
|
|
97
|
+
|
|
98
|
+
### Without maxItems on a Section
|
|
99
|
+
- All subitems are displayed normally
|
|
100
|
+
- No favorites functionality for that section
|
|
101
|
+
- Standard collapsible behavior
|
|
102
|
+
|
|
103
|
+
### With maxItems on a Section
|
|
104
|
+
1. **Subitems \u2264 maxItems**: All subitems shown, no management needed
|
|
105
|
+
2. **Subitems > maxItems**:
|
|
106
|
+
- Favorite subitems appear first
|
|
107
|
+
- Non-favorite subitems fill remaining slots
|
|
108
|
+
- Clickable "X more items available - click to manage favorites" text shown when section is expanded
|
|
109
|
+
- Click the text to open favorites management dialog
|
|
110
|
+
|
|
111
|
+
### Per-Section Favorites Management Dialog
|
|
112
|
+
- **Section-Specific**: Each section manages its own favorites independently
|
|
113
|
+
- **Easy Access**: Click "X more items available" text to open management
|
|
114
|
+
- **Checkbox Interface**: Simple checkboxes for subitems in that section
|
|
115
|
+
- **Visual Feedback**: Badges shown for context
|
|
116
|
+
- **Limit Enforcement**: Cannot select more than section's maxItems
|
|
117
|
+
- **Immediate Updates**: Changes reflect immediately in sidebar
|
|
118
|
+
- **Persistent Storage**: Preferences saved per-section to localStorage
|
|
119
|
+
|
|
120
|
+
### Local Storage
|
|
121
|
+
- Key: \`sidebar-favorites\`
|
|
122
|
+
- Value: Object with section IDs as keys, arrays of favorite subitem IDs as values
|
|
123
|
+
- Example: \`{"teams": ["design", "marketing"], "projects": ["active-projects"]}\`
|
|
124
|
+
- Automatically syncs across browser sessions
|
|
125
|
+
- Falls back gracefully if localStorage unavailable
|
|
126
|
+
|
|
127
|
+
## Examples
|
|
128
|
+
|
|
129
|
+
### Example 1: Teams with Limited Display
|
|
130
|
+
\`\`\`tsx
|
|
131
|
+
const teamsWithLimit = {
|
|
132
|
+
id: "teams",
|
|
133
|
+
title: "Teams",
|
|
134
|
+
icon: <Users />,
|
|
135
|
+
maxItems: 2, // Show only 2 teams at a time
|
|
136
|
+
items: [
|
|
137
|
+
{ id: "design", title: "Design", url: "/teams/design" },
|
|
138
|
+
{ id: "marketing", title: "Marketing", url: "/teams/marketing" },
|
|
139
|
+
{ id: "engineering", title: "Engineering", url: "/teams/engineering" },
|
|
140
|
+
{ id: "finance", title: "Finance", url: "/teams/finance" },
|
|
141
|
+
{ id: "sales", title: "Sales", url: "/teams/sales" },
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
\`\`\`
|
|
145
|
+
|
|
146
|
+
### Example 2: Multiple Sections with Different Limits
|
|
147
|
+
\`\`\`tsx
|
|
148
|
+
const sidebarItems = [
|
|
149
|
+
{
|
|
150
|
+
id: "teams",
|
|
151
|
+
title: "Teams",
|
|
152
|
+
icon: <Users />,
|
|
153
|
+
maxItems: 3,
|
|
154
|
+
items: [/* 5 teams */]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "projects",
|
|
158
|
+
title: "Projects",
|
|
159
|
+
icon: <Layers />,
|
|
160
|
+
maxItems: 2,
|
|
161
|
+
items: [/* 4 projects */]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: "tools",
|
|
165
|
+
title: "Tools",
|
|
166
|
+
icon: <Wrench />,
|
|
167
|
+
// No maxItems = show all tools
|
|
168
|
+
items: [/* all tools shown */]
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
\`\`\`
|
|
172
|
+
|
|
173
|
+
## Implementation Details
|
|
174
|
+
|
|
175
|
+
### State Management
|
|
176
|
+
- Uses \`useLocalStorage\` hook with object structure for per-section favorites
|
|
177
|
+
- Internal state for dialog visibility (tracks which section is being managed)
|
|
178
|
+
- Automatic filtering and sorting of subitems per section
|
|
179
|
+
|
|
180
|
+
### Visual Indicators
|
|
181
|
+
- Clickable "X more items available - click to manage favorites" text appears when sections are expanded and have hidden items
|
|
182
|
+
- No visual changes for unlimited sections or sections showing all items
|
|
183
|
+
- Clean section titles without item counts
|
|
184
|
+
|
|
185
|
+
### Performance
|
|
186
|
+
- Efficient per-section filtering algorithms
|
|
187
|
+
- Minimal re-renders when toggling favorites
|
|
188
|
+
- Local storage operations are section-scoped
|
|
189
|
+
|
|
190
|
+
### Accessibility
|
|
191
|
+
- Proper ARIA labels and roles for section-specific dialogs
|
|
192
|
+
- Keyboard navigation support
|
|
193
|
+
- Screen reader friendly section descriptions
|
|
194
|
+
- Focus management in per-section dialogs
|
|
195
|
+
|
|
196
|
+
## Migration Guide
|
|
197
|
+
|
|
198
|
+
### From Previous Version
|
|
199
|
+
1. **Add IDs**: Ensure all \`SidebarItem\` and subitem objects have unique \`id\` fields
|
|
200
|
+
2. **Add maxItems**: Add \`maxItems?: number\` to sections that need limits
|
|
201
|
+
3. **Update Storage**: Old global favorites will be ignored; users will need to reset preferences
|
|
202
|
+
|
|
203
|
+
### Breaking Changes
|
|
204
|
+
- \`SidebarItem.id\` is now required (was optional/missing)
|
|
205
|
+
- Subitem objects now require \`id\` field
|
|
206
|
+
- Global sidebar \`maxItems\` prop removed
|
|
207
|
+
- Favorites storage format changed from array to object
|
|
208
|
+
|
|
209
|
+
### Example Migration
|
|
210
|
+
\`\`\`typescript
|
|
211
|
+
// Before (global limit)
|
|
212
|
+
<Sidebar items={items} maxItems={5} />
|
|
213
|
+
|
|
214
|
+
// After (per-section limits)
|
|
215
|
+
const items = [
|
|
216
|
+
{
|
|
217
|
+
id: "teams",
|
|
218
|
+
title: "Teams",
|
|
219
|
+
maxItems: 3, // Section-specific limit
|
|
220
|
+
items: [
|
|
221
|
+
{ id: "design", title: "Design", url: "#" }, // IDs required
|
|
222
|
+
// ...
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
<Sidebar items={items} />
|
|
227
|
+
\`\`\`
|
|
228
|
+
`;export{t as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BusinessUnit, SidebarItem } from "
|
|
1
|
+
import type { BusinessUnit, SidebarItem } from "./types";
|
|
2
2
|
interface SidebarProps {
|
|
3
3
|
items: SidebarItem[];
|
|
4
4
|
isOpen: boolean;
|
|
@@ -10,7 +10,8 @@ interface SidebarProps {
|
|
|
10
10
|
logo?: string;
|
|
11
11
|
appName?: string;
|
|
12
12
|
tagline?: string;
|
|
13
|
+
maxItems?: number;
|
|
13
14
|
}
|
|
14
15
|
export declare function Sidebar({ items, isOpen, isMobile, onClose, currentBusinessUnit, // Default to Design unit
|
|
15
|
-
onBusinessUnitChange, className, logo, appName, tagline, }: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
onBusinessUnitChange, className, logo, appName, tagline, maxItems, }: SidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export {};
|