/** * dsh-widgets — the `calendar` rich block (the 日历 card's month grid). * * WHAT IT DRAWS. The owner's reference card, in the product's own type ladder: the * month caption, the seven weekday headers, then the weeks — weekend/holiday days * in the brand blue, today as a filled blue badge, the neighbouring months' days * dimmed and only when the card asked for them. The GRID is the widget's (see * `CalendarRich`); this file only lays it out, so the calendar's "which day is it" * logic is one pure function away from a test and the offline render snapshot can * verify the grid rather than a drawing of it. * * THE 2×4 VARIANT (the same block, twice as wide). A month grid is square by nature * — stretching seven columns across a 2×4 would give each day a ~36px cell for an * 11px digit, which reads as a table, not a calendar. So the wide card keeps the * SQUARE grid on the left at the block's own height and spends the extra width on * the AGENDA column (the DSH scheduled tasks the widget folded into `agenda`). The * switch is WIDTH-driven, not size-driven: the renderer is handed the card's real * pixel width by `CardBody`, so a magnified 2×2 (a wider box) cannot be mistaken for * a 2×4 and the block needs no second code path to keep in step with the rail. * * WHY EVERY ROW IS AN EXPLICIT PX HEIGHT. The 2×2 tile is a FIXED box and a card * that overflows it is a defect the rail makes visible with a red outline * (`CardBody`'s tile-fits guard). A `1fr` grid would size its rows from whatever * height the flex column happened to hand it, so a month with SIX weeks would * either squeeze the text or push the card past the tile. Computing the row height * here — from the same box height the card's own budget is derived from — makes * the layout exact at every scale and every week count: * * 12(pad) + [120] + 12(pad) = 144 ≤ 150 at scale 1, * and the identical identity at any other scale, because the pad and this box * scale together. The card carries NO TITLE (docs/design/CARD-TITLE-STANDARD.md, * T1) — its month caption lives inside this block — which is exactly what buys * the extra 24px: a 6-week month used to get 11px rows, and now gets 15px. */ import * as React from 'react'; import type { CalendarRich } from '../../lib/contract/types'; /** * The month grid. * * @param calendar - the widget's payload (see `CalendarRich`). * @param scale - `unit / BASE_SIDE`, the card's own scale factor. * @param width - the card's body width in px (a 2×4 is ~2× a 2×2); absent = the * block's own square box, i.e. the single-column layout. */ export declare function MonthGrid({ calendar, scale, width }: { calendar: CalendarRich; scale: number; width?: number; }): React.ReactElement;