Files
petriandClaude Sonnet 5.5 2de3733a3f Add browser accessibility tests for the reports
Fixes found by axe: the chart axis captions are darker and larger, the
period heading keeps its heading role with the live region inside it,
and scrollable tables are focusable regions named by their table.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 08:56:33 +02:00

31 lines
1.1 KiB
PHP

{{--
A bar chart of one series for a report, drawn by TallStackUI's server
side SVG chart. The chart is one image named by its title and summary;
the same figures are in the report's table, which the caption points to.
No legend or tooltip: their controls would sit inside the image.
--}}
@props(['title', 'summary', 'labels' => [], 'values' => [], 'formatter' => null])
<figure {{ $attributes->class('space-y-2') }}>
<figcaption class="text-base font-semibold">
{{ $title }}
<span class="block text-sm font-normal text-zinc-600 dark:text-zinc-300">{{ __('reports.chart_note') }}</span>
</figcaption>
@if ($values === [] || max(array_map('abs', $values)) == 0)
<p class="text-sm">{{ __('reports.chart_empty') }}</p>
@else
<div role="img" aria-label="{{ $title }}: {{ $summary }}" class="max-w-4xl">
<x-chart
bar
grid
fit="thin"
:labels="$labels"
:series="$values"
:formatter="$formatter"
height="220"
/>
</div>
@endif
</figure>