@wordpress/widget-dashboard
Version:
Stateless rendering engine for widget dashboards: the WidgetDashboard compound component and its grid-settings kit.
32 lines • 1.54 kB
TypeScript
/**
* Container width (px) below which the dashboard uses a single column.
* Matches `@container widget-dashboard (max-width: …)` in widgets CSS.
*/
export declare const WIDGET_DASHBOARD_CONTAINER_BREAKPOINT_ONE_COLUMN = 600;
/**
* Container width (px) below which the dashboard drops from the column
* cap to two. Above this threshold the grid uses the cap itself.
*/
export declare const WIDGET_DASHBOARD_CONTAINER_BREAKPOINT_TWO_COLUMNS = 960;
/**
* Resolves the wide-container column count a host asked for. A finite value
* is floored, with a floor of one and no ceiling: how many columns a surface
* can carry is the host's decision, not the package's. An absent or
* non-finite value resolves to {@link WIDGET_DASHBOARD_COLUMN_COUNT}.
*
* @param columns Host-provided `gridSettings.columns`, if any.
* @return Column count for wide containers.
*/
export declare function resolveDashboardColumnCap(columns?: number): number;
/**
* Resolves the dashboard grid column count from the widget surface
* container width. Uses discrete steps (cap → 2 → 1), not viewport
* media queries.
*
* @param containerWidth Measured inline size of the dashboard grid container.
* @param maxColumns Column cap for wide containers; see
* {@link resolveDashboardColumnCap}.
* @return Column count for {@link @wordpress/grid} surfaces.
*/
export declare function resolveDashboardColumnCount(containerWidth: number, maxColumns?: number): number;
//# sourceMappingURL=resolve-dashboard-column-count.d.ts.map