Add shared UI primitives, contexts, and reusable components

Add shadcn components: avatar, breadcrumb, checkbox, collapsible,
command, dialog, dropdown-menu, label, popover, scroll-area, sheet,
skeleton, tabs, textarea, tooltip. Add shared components: BreadcrumbBar,
CommandPalette, CompanySwitcher, CommentThread, EmptyState, EntityRow,
FilterBar, InlineEditor, MetricCard, PageSkeleton, PriorityIcon,
PropertiesPanel, StatusIcon, SidebarNavItem/Section. Add contexts for
breadcrumbs, dialogs, and side panels. Add keyboard shortcut hook and
utility helpers. Update layout, sidebar, and main app shell.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Forgotten
2026-02-17 09:57:00 -06:00
parent 22e7930d0b
commit fad1bd27ce
42 changed files with 2534 additions and 69 deletions

View File

@@ -0,0 +1,35 @@
import { createContext, useCallback, useContext, useState, type ReactNode } from "react";
interface PanelContextValue {
panelContent: ReactNode | null;
openPanel: (content: ReactNode) => void;
closePanel: () => void;
}
const PanelContext = createContext<PanelContextValue | null>(null);
export function PanelProvider({ children }: { children: ReactNode }) {
const [panelContent, setPanelContent] = useState<ReactNode | null>(null);
const openPanel = useCallback((content: ReactNode) => {
setPanelContent(content);
}, []);
const closePanel = useCallback(() => {
setPanelContent(null);
}, []);
return (
<PanelContext.Provider value={{ panelContent, openPanel, closePanel }}>
{children}
</PanelContext.Provider>
);
}
export function usePanel() {
const ctx = useContext(PanelContext);
if (!ctx) {
throw new Error("usePanel must be used within PanelProvider");
}
return ctx;
}