import type { ReactNode, Ref } from "react" import { useCallback, useState } from "react" import { getIsMoveMeaningful, toSettledIndex, } from "../Board/boardMove.ts" import { useBoardDrag } from "../Board/useBoardDrag.ts" import { toClassName } from "../toClassName.ts" import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.tsx" /** * The attribute the drag's hit test reads on a row. A `data-` * attribute rather than a class, the same contract `BoardCard` and * `DropRail` already write down: a class is a style and a * consumer's tooling may rename it. */ const ITEM_ATTRIBUTE = "data-reorder-item" /** * The single lane this component registers with the board's drag. * A reorder list is a board with one lane and no lane picker, so * the key is a constant and never leaves this file. */ const LANE_KEY = "reorder-list" export type ReorderListItem = { key: string /** * Plain text, and it is not optional. Every accessible name the * component writes is built from it — "Move