import "./lane_board.css"; import type * as React from "react"; import { type ReactNode } from "react"; import { useRender } from "@base-ui/react/use-render"; import type { ColorName } from "./colors"; import { type StyleProps } from "./style_props"; /** * LANES DOWN THE SIDE, WORK ALONG A SHARED AXIS, AND WHAT IS STILL OPEN BETWEEN * IT — a despatch board, a bay plan, a machine queue, a crew's day. * * It is not `GanttView`, and the difference is the whole point: a chart gives * every TASK its own row, so a reader scanning down it can see when each job * runs and never what one resource's day looks like. Here a lane is ONE row * carrying everything on it, which is what makes the empty stretches visible — * and the empty stretch is what the operation has left to sell, so it is drawn * and named rather than left as blank track. * * THE LANE CARRIES ITS OWN LOAD, beside its name and against its ceiling: a * board that only placed blocks would let a reader fill a van that is already * two tonnes over, because time and capacity run out independently. The readings * are the CALLER's cells — whichever device the measure's own model says — and * the overflow is named on the LANE, never on a block: no single job is the one * that broke the axle. * * EVERY POSITION IS A SHARE OF THE AXIS, never a pixel. The caller does the * arithmetic against its own clock (`resource_schedule_layout.ts`), so the board * is the same board at a phone's width and at a wallboard's, and nothing here * has to measure itself before it can draw. */ export interface LaneBoardProps extends StyleProps { /** The lanes, in the order the caller arranged them. */ lanes: readonly LaneBoardLane[]; /** The marks across the top — each at its own share of the axis. */ ticks: readonly LaneBoardTick[]; /** Width of the pinned lane block. Default {@link LANE_BOARD_HEAD}. */ laneWidth?: number; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** One mark on the ruler — where it sits, and the moment it names. */ export interface LaneBoardTick { key: string; label: string; /** Its place along the axis, 0–1. */ share: number; } export interface LaneBoardLane { key: string; /** The resource this lane IS. */ label: string; /** How full it is — one reading per ceiling the model states, at most two. */ loads: readonly LaneBoardLoad[]; blocks: readonly LaneBoardBlock[]; /** What is still free on it, in clock order. */ openings: readonly LaneBoardOpening[]; } /** One reading of a lane's load — the caller's own meter, and the overflow past it. */ export interface LaneBoardLoad { key: string; /** The level against its ceiling, drawn by whichever cell the measure takes. */ reading: ReactNode; /** How far past the ceiling this lane is, in words; nothing while it is inside. */ overflow?: string; } export interface LaneBoardBlock { key: string; /** What the block is called, inside the bar where the bar is wide enough to hold it. */ label: string; /** * EVERYTHING A READER WHO CANNOT SEE THE BAR MUST HEAR — what it is, whose * lane it is on and when it runs. A bar's position IS its content here, so a * name that stopped at the label would leave the whole reading in the * geometry. */ name: string; /** Its box on the axis, as shares of it. */ left: number; width: number; /** The family the state colours it in; the kit's neutral where the model states none. */ color?: ColorName; /** * PAST ITS TIME — hatched as well as toned. * * Colour alone is one encoding doing two jobs on a board already coloured by * state: a red block that is CANCELLED and a red block that is LATE would be * one ink. The hatch is a second channel and it survives a monochrome print. */ late?: boolean; /** This block is the one the record surface is standing on. */ selected?: boolean; onOpen?: () => void; } /** A stretch of a lane nothing covers — drawn where it is, and named. */ export interface LaneBoardOpening { key: string; left: number; width: number; /** When it starts and how long it runs, in the reader's own words. */ label: string; } /** The pinned lane block's width — a registration and its two readings under it. */ export declare const LANE_BOARD_HEAD = 168; export declare function LaneBoard(props: LaneBoardProps): React.ReactElement>;