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
@@ -54,33 +54,42 @@ new class extends Component
};
?>
<div class="mx-auto max-w-7xl space-y-8 p-4 sm:p-6">
<h1 class="text-2xl font-semibold">{{ __('dashboard.greeting', ['name' => auth()->user()->name]) }}</h1>
<x-page width="wide">
<x-page-header :title="__('dashboard.greeting', ['name' => auth()->user()->name])" />
@php($overview = $this->overview)
<nav aria-label="{{ __('dashboard.links.title') }}">
<ul class="flex flex-wrap gap-2">
<ul class="grid grid-cols-1 gap-3 min-[400px]:grid-cols-2 sm:grid-cols-3 lg:grid-cols-5">
@foreach ($this->quickLinks() as $link)
<li><x-button :href="route($link['route'])" wire:navigate :icon="$link['icon']" :text="$link['label']" /></li>
<li>
<a
href="{{ route($link['route']) }}"
wire:navigate
class="group flex h-full min-h-16 items-center gap-3 rounded-xl border border-zinc-200 bg-white p-3 text-sm font-medium shadow-sm transition hover:border-primary-400 hover:shadow-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:border-zinc-700 dark:bg-zinc-900 dark:hover:border-primary-300 dark:focus-visible:outline-primary-300"
>
<span class="flex size-10 shrink-0 items-center justify-center rounded-lg bg-primary-600 text-white group-hover:bg-primary-700 dark:bg-primary-500" aria-hidden="true">
<x-icon :name="$link['icon']" class="size-5" />
</span>
<span class="min-w-0 break-words">{{ $link['label'] }}</span>
</a>
</li>
@endforeach
</ul>
</nav>
<div class="grid gap-6 lg:grid-cols-2">
<section aria-labelledby="tasks-heading" class="space-y-4 rounded-lg border border-zinc-300 bg-white p-4 dark:border-zinc-600 dark:bg-zinc-900">
<h2 id="tasks-heading" class="text-xl font-semibold">{{ __('dashboard.tasks.title') }}</h2>
<x-panel :title="__('dashboard.tasks.title')" icon="clipboard-document-list" heading-id="tasks-heading">
@if (! $overview->hasTasks())
<p class="text-sm">{{ __('dashboard.tasks.none') }}</p>
<x-empty-state icon="check-badge">{{ __('dashboard.tasks.none') }}</x-empty-state>
@endif
@foreach (['overdue' => $overview->overdue, 'soon' => $overview->soon, 'this_week' => $overview->thisWeek] as $group => $tasks)
@if ($tasks !== [])
<div class="space-y-2">
<h3 class="flex items-center gap-2 font-semibold">
<div @class(['space-y-2', 'rounded-lg border border-red-200 bg-red-50 p-3 dark:border-red-400/30 dark:bg-red-400/10' => $group === 'overdue'])>
<h3 @class(['flex items-center gap-2 font-semibold', 'text-red-800 dark:text-red-200' => $group === 'overdue'])>
@if ($group === 'overdue')
<x-icon name="exclamation-triangle" class="size-5 text-red-700 dark:text-red-400" aria-hidden="true" />
<x-icon name="exclamation-triangle" class="size-5" aria-hidden="true" />
@endif
{{ __('dashboard.tasks.groups.'.$group, ['count' => count($tasks)]) }}
</h3>
@@ -89,8 +98,8 @@ new class extends Component
<li wire:key="task-{{ $task->taskId }}" class="py-2 text-sm">
<x-link :href="route('jobs.show', $task->jobId).'#task-'.$task->taskId" navigate class="font-medium">{{ $task->title }}</x-link>
<span class="block text-zinc-600 dark:text-zinc-300">{{ $task->jobNumber }} {{ $task->jobName }}</span>
<span class="flex flex-wrap gap-x-3 text-zinc-700 dark:text-zinc-200">
<span>{{ __('jobs.tasks.statuses.'.$task->status) }}</span>
<span class="mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-zinc-700 dark:text-zinc-200">
<x-jobs.task-status :status="$task->status" />
@if ($task->dueOn !== null)
<span>{{ __('dashboard.tasks.due', ['date' => $this->dateLabel($task->dueOn)]) }}</span>
@endif
@@ -98,9 +107,7 @@ new class extends Component
<span>{{ __('dashboard.tasks.starts', ['date' => $this->dateLabel($task->plannedFrom)]) }}</span>
@endif
@if ($task->isLate)
<span class="inline-flex items-center gap-1 font-medium text-red-700 dark:text-red-400">
<x-icon name="exclamation-triangle" class="size-4" aria-hidden="true" />{{ __('jobs.late') }}
</span>
<x-status-badge tone="danger" icon="exclamation-triangle">{{ __('jobs.late') }}</x-status-badge>
@endif
</span>
</li>
@@ -114,12 +121,12 @@ new class extends Component
<p class="text-sm">{{ trans_choice('dashboard.tasks.later', $overview->laterCount, ['count' => $overview->laterCount]) }}</p>
<p class="text-sm"><x-link :href="route('jobs.calendar')" navigate>{{ __('dashboard.tasks.to_calendar') }}</x-link></p>
@endif
</section>
</x-panel>
<div class="space-y-6">
<section aria-labelledby="week-heading" class="space-y-3 rounded-lg border border-zinc-300 bg-white p-4 dark:border-zinc-600 dark:bg-zinc-900">
<h2 id="week-heading" class="text-xl font-semibold">{{ __('dashboard.week.title') }}</h2>
<x-panel :title="__('dashboard.week.title')" icon="clock" heading-id="week-heading">
{{-- The bars are decoration; the hours are the table's text. A full day (7.5 h) or the week's longest day fills a bar. --}}
@php($dayMax = max(30, ...array_values($overview->week->days)))
<table class="w-full text-sm">
<caption class="sr-only">{{ __('dashboard.week.caption', ['from' => $this->dateLabel($overview->week->monday)]) }}</caption>
<thead>
@@ -135,45 +142,43 @@ new class extends Component
<tbody>
<tr>
@foreach ($overview->week->days as $quarters)
<td class="py-1 text-center">{{ $this->hours($quarters) }}</td>
<td class="px-0.5 pt-2 text-center align-bottom">
<span class="mx-auto flex h-14 w-full max-w-8 items-end overflow-hidden rounded-md bg-zinc-100 dark:bg-zinc-800" aria-hidden="true">
<span class="block w-full bg-primary-500 dark:bg-primary-400" style="height: {{ round(min(1, $quarters / $dayMax) * 100) }}%"></span>
</span>
<span class="mt-1 block tabular-nums">{{ $this->hours($quarters) }}</span>
</td>
@endforeach
</tr>
</tbody>
</table>
<p class="text-sm">
{{ __('dashboard.week.total', ['hours' => $this->hours($overview->week->totalQuarters)]) }}
<p class="flex flex-wrap items-center gap-2 text-sm">
<span class="font-semibold">{{ __('dashboard.week.total', ['hours' => $this->hours($overview->week->totalQuarters)]) }}</span>
@if ($overview->week->unapprovedQuarters > 0)
<span class="inline-flex items-center gap-1">
<x-icon name="exclamation-circle" class="size-4" aria-hidden="true" />
{{ __('dashboard.week.unapproved', ['hours' => $this->hours($overview->week->unapprovedQuarters)]) }}
</span>
<x-status-badge tone="warning" icon="exclamation-circle">{{ __('dashboard.week.unapproved', ['hours' => $this->hours($overview->week->unapprovedQuarters)]) }}</x-status-badge>
@endif
</p>
<p class="text-sm"><x-link :href="route('time.week')" navigate>{{ __('dashboard.week.open') }}</x-link></p>
</section>
<section aria-labelledby="jobs-heading" class="space-y-3 rounded-lg border border-zinc-300 bg-white p-4 dark:border-zinc-600 dark:bg-zinc-900">
<h2 id="jobs-heading" class="text-xl font-semibold">{{ __('dashboard.jobs.title') }}</h2>
</x-panel>
<x-panel :title="__('dashboard.jobs.title')" icon="briefcase" heading-id="jobs-heading">
@if ($overview->jobs === [])
<p class="text-sm">{{ __('dashboard.jobs.none') }}</p>
<x-empty-state icon="briefcase">{{ __('dashboard.jobs.none') }}</x-empty-state>
@else
<ul class="divide-y divide-zinc-200 dark:divide-zinc-700">
@foreach ($overview->jobs as $job)
<li wire:key="job-{{ $job->id }}" class="py-2 text-sm">
<x-link :href="route('jobs.show', $job->id)" navigate class="font-medium">{{ $job->number }} {{ $job->name }}</x-link>
<span class="block text-zinc-600 dark:text-zinc-300">{{ $job->customerName }}</span>
<span class="flex flex-wrap items-center gap-x-3 text-zinc-700 dark:text-zinc-200">
<span>{{ __('jobs.statuses.'.$job->status) }}</span>
<span class="mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-zinc-700 dark:text-zinc-200">
<x-jobs.status :status="$job->status" />
<x-jobs.priority :priority="\App\Modules\Jobs\Domain\Enums\Priority::from($job->priority)" />
@if ($job->dueOn !== null)
<span>{{ __('dashboard.jobs.due', ['date' => $this->dateLabel($job->dueOn)]) }}</span>
@endif
@if ($job->isLate)
<span class="inline-flex items-center gap-1 font-medium text-red-700 dark:text-red-400">
<x-icon name="exclamation-triangle" class="size-4" aria-hidden="true" />{{ __('jobs.late') }}
</span>
<x-status-badge tone="danger" icon="exclamation-triangle">{{ __('jobs.late') }}</x-status-badge>
@endif
</span>
</li>
@@ -184,7 +189,7 @@ new class extends Component
<p class="text-sm">
<x-link :href="route('jobs.index')" navigate>{{ trans_choice('dashboard.jobs.all', $overview->jobCount, ['count' => $overview->jobCount]) }}</x-link>
</p>
</section>
</x-panel>
</div>
</div>
@@ -192,4 +197,4 @@ new class extends Component
{{-- Loaded right after the page, not only when scrolled to. --}}
<livewire:dashboard::management lazy="on-load" />
@endcan
</div>
</x-page>