drizzle-cube
Version:
Drizzle ORM-first semantic layer with Cube.js compatibility. Type-safe analytics and dashboards with SQL injection protection.
23 lines (22 loc) • 863 B
TypeScript
/**
* Custom hook for responsive dashboard layout management
* Implements a three-tier responsive strategy:
* - Desktop (1200px+): Normal grid layout with full editing
* - Scaled (768-1199px): CSS transform scaling, read-only
* - Mobile (<768px): Single-column stacked layout, read-only
*/
export type DashboardDisplayMode = 'desktop' | 'scaled' | 'mobile';
export interface UseResponsiveDashboardResult {
containerRef: React.RefCallback<HTMLDivElement>;
containerWidth: number;
displayMode: DashboardDisplayMode;
scaleFactor: number;
isEditable: boolean;
designWidth: number;
}
/**
* Hook for managing responsive dashboard layouts
* Uses ResizeObserver for accurate width detection and calculates
* the appropriate display mode and scale factor
*/
export declare function useResponsiveDashboard(): UseResponsiveDashboardResult;