Accessibility
LineChart, LineChartCurve from @prepared911/ui/line-chart.
label is required. It names the plot, a focusable region with role="application", and captions a data table that is visually hidden and in the accessibility tree: a column heading per series, a row heading per category, and a cell per value. The table renders on the server and in print and never depends on hover. description is read after the name; use it for how to explore the chart. The painted axes, markers and tooltip are aria-hidden, because the table and the live announcements carry the content.
The plot is in the tab order. Once focused:
onSelect({ datasetIndex, index }).role="list", so the entry count is read). A button is pressed (aria-pressed="true") while its series is shown. A dashed series has a dashed swatch, so a comparison series differs from its main series without color.
Series colors come from Chroma's palette tokens, which clear 3:1 against every surface. Axis text, gridlines and the tooltip use the foreground, border and popup tokens. Under forced-colors: active the chrome uses system colors, series keep their colors because they carry the data, and a dashed series also differs by its dashes.
The entrance reveal, the tooltip glide and the value-scale spring stop under prefers-reduced-motion. The chart is complete without them, and print turns the reveal off.
With sparkline the chart is one image named by label, with no tab stop, tooltip, legend or data table, so it can sit in the aria-hidden MetricCard slot without a focusable element in a hidden subtree. The value, delta and subtitle of the card carry the meaning.