Give the UI an indigo look with cards, status badges and empty states

- Dark indigo header and tinted page background; the mobile main menu gets
  its own row, in the same order as the keyboard reaches it.
- Page titles with an icon chip (x-page-title, x-page, x-page-header) and
  card sections (x-panel, the card utility); x-table styled as a card with
  an indigo header row in AppServiceProvider::styleTables().
- Job and task statuses, late work, unapproved hours and stock states as
  badges with icon and text (x-status-badge, x-jobs.status,
  x-jobs.task-status), never colour alone.
- Empty lists as x-empty-state; dashboard quick link tiles, week hour bars
  and trend arrows; Kanban columns and task cards edged by status; calendar
  today column and bar accents; quick sale, reports and machine console
  restyled; signed-out pages show the app name.
- Focus rings use the primary colour in both themes (white in the header).
- Document the components in CLAUDE.md; test the status badges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-29 10:53:10 +02:00
co-authored by Claude Opus 5.5
parent ef400054b0
commit 51b40b24fe
99 changed files with 702 additions and 388 deletions
@@ -32,7 +32,7 @@ new class extends Component
public function placeholder(): string
{
return '<section class="rounded-lg border border-zinc-300 p-4 dark:border-zinc-600"><p role="status" class="text-sm">'.e(__('dashboard.management.loading')).'</p></section>';
return '<section class="rounded-xl border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-700 dark:bg-zinc-900"><p role="status" class="text-sm">'.e(__('dashboard.management.loading')).'</p></section>';
}
/**
@@ -66,12 +66,13 @@ new class extends Component
<section aria-labelledby="management-heading" class="space-y-6">
@php($overview = $this->overview)
<h2 id="management-heading" class="text-xl font-semibold">{{ __('dashboard.management.title') }}</h2>
<h2 id="management-heading" class="flex items-center gap-2 border-t border-zinc-200 pt-6 text-xl font-semibold dark:border-zinc-700">
<x-icon name="presentation-chart-line" class="size-6 text-primary-700 dark:text-primary-300" aria-hidden="true" />
{{ __('dashboard.management.title') }}
</h2>
<div class="grid gap-6 lg:grid-cols-2">
<section aria-labelledby="todo-heading" class="space-y-3 rounded-lg border border-zinc-300 bg-white p-4 dark:border-zinc-600 dark:bg-zinc-900">
<h3 id="todo-heading" class="text-lg font-semibold">{{ __('dashboard.todo.title') }}</h3>
<x-panel :title="__('dashboard.todo.title')" icon="inbox-stack" :level="3" heading-id="todo-heading">
<ul class="space-y-2 text-sm">
@can('time.approve-others')
<li>
@@ -133,11 +134,10 @@ new class extends Component
</li>
@endcan
</ul>
</section>
</x-panel>
@can('reports.view')
<section aria-labelledby="month-heading" class="space-y-3 rounded-lg border border-zinc-300 bg-white p-4 dark:border-zinc-600 dark:bg-zinc-900">
<h3 id="month-heading" class="text-lg font-semibold">{{ __('dashboard.month.title') }}</h3>
<x-panel :title="__('dashboard.month.title')" icon="chart-bar" :level="3" heading-id="month-heading">
<p class="text-sm text-zinc-600 dark:text-zinc-300">
{{ __('dashboard.month.period', [
'from' => $this->dateLabel($overview->monthFrom), 'to' => $this->dateLabel($overview->monthTo),
@@ -155,25 +155,32 @@ new class extends Component
['label' => 'margin', 'value' => $month->marginCents === null ? __('dashboard.month.no_cost') : $this->money($month->marginCents), 'current' => $month->marginCents, 'previous' => $previous->marginCents, 'route' => 'reports.profitability'],
['label' => 'sales', 'value' => $this->money($month->salesCents), 'current' => $month->salesCents, 'previous' => $previous->salesCents, 'route' => 'reports.sales'],
] as $figure)
<div class="rounded border border-zinc-200 p-3 dark:border-zinc-700">
@php($ratio = $figure['current'] !== null && $figure['previous'] !== null ? (new \App\Modules\Dashboard\Domain\ValueObjects\Change($figure['current'], $figure['previous']))->ratio() : null)
<div class="rounded-lg border border-zinc-200 bg-zinc-50 p-3 dark:border-zinc-700 dark:bg-zinc-800/60">
<dt class="text-sm">
<x-link :href="route($figure['route'])" navigate>{{ __('dashboard.month.'.$figure['label']) }}</x-link>
</dt>
<dd class="text-lg font-semibold">{{ $figure['value'] }}</dd>
<dd class="text-xl font-semibold tabular-nums">{{ $figure['value'] }}</dd>
@if ($figure['current'] !== null && $figure['previous'] !== null)
<dd class="text-sm text-zinc-700 dark:text-zinc-200">{{ $this->change($figure['current'], $figure['previous']) }}</dd>
<dd class="flex items-center gap-1 text-sm text-zinc-700 dark:text-zinc-200">
@if ($ratio !== null && $ratio > 0)
<x-icon name="arrow-trending-up" class="size-4 text-emerald-700 dark:text-emerald-300" aria-hidden="true" />
@elseif ($ratio !== null && $ratio < 0)
<x-icon name="arrow-trending-down" class="size-4 text-red-700 dark:text-red-300" aria-hidden="true" />
@endif
{{ $this->change($figure['current'], $figure['previous']) }}
</dd>
@endif
</div>
@endforeach
</dl>
<p class="text-xs text-zinc-600 dark:text-zinc-300">{{ __('dashboard.month.billing_note') }}</p>
</section>
</x-panel>
@endcan
</div>
<div class="grid gap-6 lg:grid-cols-2">
<section aria-labelledby="jobs-overview-heading" class="space-y-3 rounded-lg border border-zinc-300 bg-white p-4 dark:border-zinc-600 dark:bg-zinc-900">
<h3 id="jobs-overview-heading" class="text-lg font-semibold">{{ __('dashboard.stock.title') }}</h3>
<x-panel :title="__('dashboard.stock.title')" icon="briefcase" :level="3" heading-id="jobs-overview-heading">
<table class="w-full text-sm">
<caption class="sr-only">{{ __('dashboard.stock.caption') }}</caption>
@@ -186,10 +193,12 @@ new class extends Component
<tbody class="divide-y divide-zinc-200 dark:divide-zinc-700">
@foreach ($overview->jobCounts as $status => $count)
<tr wire:key="status-{{ $status }}">
<th scope="row" class="py-1 text-left font-normal">
<x-link :href="route('jobs.index', ['status' => $status, 'mine' => 0])" navigate>{{ __('jobs.statuses.'.$status) }}</x-link>
<th scope="row" class="py-1.5 text-left font-normal">
<a href="{{ route('jobs.index', ['status' => $status, 'mine' => 0]) }}" wire:navigate class="rounded-full focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300">
<x-jobs.status :status="$status" class="underline-offset-2 hover:underline" />
</a>
</th>
<td class="py-1 text-right">{{ $count }}</td>
<td class="py-1.5 text-right font-semibold tabular-nums">{{ $count }}</td>
</tr>
@endforeach
</tbody>
@@ -222,13 +231,11 @@ new class extends Component
@endforeach
</ul>
@endif
</section>
<section aria-labelledby="load-heading" class="space-y-3 rounded-lg border border-zinc-300 bg-white p-4 dark:border-zinc-600 dark:bg-zinc-900">
<h3 id="load-heading" class="text-lg font-semibold">{{ __('dashboard.load.title') }}</h3>
</x-panel>
<x-panel :title="__('dashboard.load.title')" icon="users" :level="3" heading-id="load-heading">
@if ($overview->workloads === [])
<p class="text-sm">{{ __('dashboard.load.none') }}</p>
<x-empty-state icon="users">{{ __('dashboard.load.none') }}</x-empty-state>
@else
<div class="overflow-x-auto rounded focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600" tabindex="0" role="region" aria-label="{{ __('dashboard.load.caption') }}">
<table class="w-full text-sm">
@@ -262,6 +269,6 @@ new class extends Component
<p class="text-sm">{{ __('dashboard.load.note') }}</p>
<p class="text-sm"><x-link :href="route('jobs.calendar')" navigate>{{ __('dashboard.load.to_calendar') }}</x-link></p>
@endif
</section>
</x-panel>
</div>
</section>