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
@@ -344,7 +344,7 @@ new class extends Component
<div class="mx-auto max-w-7xl space-y-6 p-4 sm:p-6">
<div class="space-y-2">
<h1 class="text-2xl font-semibold break-words">{{ $this->heading() }}</h1>
<x-page-title icon="clock">{{ $this->heading() }}</x-page-title>
@if ($this->isReadOnly())
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('time.other_intro') }}</p>
<x-link :href="route('time.approvals')" navigate class="text-sm">{{ __('time.approval.back_to_list') }}</x-link>
@@ -366,14 +366,14 @@ new class extends Component
<p role="alert" class="text-sm font-medium text-red-700 dark:text-red-400">{{ $errorMessage }}</p>
@if ($sheet->rows === [])
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('time.no_rows') }}</p>
<x-empty-state icon="clock">{{ __('time.no_rows') }}</x-empty-state>
@else
{{-- Desktop: the whole week as an input grid (a form, so a native table rather than <x-table>). --}}
<div class="hidden lg:block">
<div class="card hidden lg:block">
<table class="w-full border-collapse text-sm">
<caption class="sr-only">{{ __('time.table_caption') }}</caption>
<thead>
<tr class="border-b border-zinc-300 dark:border-zinc-600">
<tr class="border-b-2 border-primary-200 text-primary-900 dark:border-primary-800 dark:text-primary-100">
<th scope="col" class="py-2 pr-3 text-left font-semibold">{{ __('time.task') }}</th>
@foreach ($sheet->days as $day)
<th scope="col" class="w-20 px-1 py-2 text-center font-semibold">{{ $this->dayLabel($day) }}</th>
@@ -413,7 +413,7 @@ new class extends Component
wire:change="saveCell({{ $row->task->taskId }}, '{{ $day }}', $event.target.value)"
aria-label="{{ __('time.cell_label', ['task' => $row->task->taskTitle, 'day' => $this->dayLabel($day)]) }}"
@error('cells.'.$row->task->taskId.'.'.$day) aria-invalid="true" aria-describedby="cell-{{ $row->task->taskId }}-{{ $day }}-error" @enderror
class="w-16 rounded-md border border-zinc-400 bg-white px-2 py-1.5 text-center text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 aria-invalid:border-red-700 dark:border-zinc-500 dark:bg-zinc-900 dark:text-zinc-100 dark:aria-invalid:border-red-400"
class="w-16 rounded-md border border-zinc-400 bg-white px-2 py-1.5 text-center text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300 aria-invalid:border-red-700 dark:border-zinc-500 dark:bg-zinc-900 dark:text-zinc-100 dark:aria-invalid:border-red-400"
/>
@error('cells.'.$row->task->taskId.'.'.$day)
<p id="cell-{{ $row->task->taskId }}-{{ $day }}-error" class="mt-1 text-xs text-red-700 dark:text-red-400">{{ $message }}</p>
@@ -447,7 +447,7 @@ new class extends Component
aria-pressed="{{ $day === $selectedDay ? 'true' : 'false' }}"
aria-label="{{ __('time.day_button', ['day' => $this->dayLabel($day), 'hours' => $this->hours($sheet->dayTotals[$day])]) }}"
@class([
'rounded-md border px-2 py-2 text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700',
'rounded-md border px-2 py-2 text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300',
'border-primary-700 bg-primary-700 font-semibold text-white' => $day === $selectedDay,
'border-zinc-300 bg-white text-zinc-900 dark:border-zinc-600 dark:bg-zinc-900 dark:text-zinc-100' => $day !== $selectedDay,
])
@@ -460,7 +460,7 @@ new class extends Component
<ul class="space-y-3">
@foreach ($sheet->rows as $row)
<li wire:key="mrow-{{ $row->task->taskId }}" class="rounded-lg border border-zinc-200 p-3 text-sm dark:border-zinc-700">
<li wire:key="mrow-{{ $row->task->taskId }}" class="rounded-xl border border-zinc-200 bg-white p-3 text-sm shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<x-link :href="route('time.task', $row->task->taskId)" navigate class="font-medium break-words">{{ $row->task->label() }}</x-link>
<span class="block text-zinc-600 dark:text-zinc-300">{{ $row->task->workTypeName }}</span>
@@ -490,7 +490,7 @@ new class extends Component
value="{{ $rejected[$row->task->taskId.'.'.$selectedDay] ?? $cells[$row->task->taskId][$selectedDay] ?? '' }}"
wire:change="saveCell({{ $row->task->taskId }}, '{{ $selectedDay }}', $event.target.value)"
@error('cells.'.$row->task->taskId.'.'.$selectedDay) aria-invalid="true" aria-describedby="mcell-{{ $row->task->taskId }}-{{ $selectedDay }}-error" @enderror
class="mt-1 w-24 rounded-md border border-zinc-400 bg-white px-2 py-2 text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 aria-invalid:border-red-700 dark:border-zinc-500 dark:bg-zinc-900 dark:text-zinc-100 dark:aria-invalid:border-red-400"
class="mt-1 w-24 rounded-md border border-zinc-400 bg-white px-2 py-2 text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300 aria-invalid:border-red-700 dark:border-zinc-500 dark:bg-zinc-900 dark:text-zinc-100 dark:aria-invalid:border-red-400"
/>
@error('cells.'.$row->task->taskId.'.'.$selectedDay)
<p id="mcell-{{ $row->task->taskId }}-{{ $selectedDay }}-error" class="mt-1 text-xs text-red-700 dark:text-red-400">{{ $message }}</p>
@@ -501,10 +501,10 @@ new class extends Component
</ul>
</div>
<p class="text-sm font-semibold">{{ __('time.week_total', ['hours' => $this->hours($sheet->totalQuarters)]) }}</p>
<p class="inline-flex items-center gap-2 rounded-lg bg-primary-50 px-3 py-2 text-sm font-semibold text-primary-900 dark:bg-primary-950 dark:text-primary-100"><x-icon name="clock" class="size-4" aria-hidden="true" />{{ __('time.week_total', ['hours' => $this->hours($sheet->totalQuarters)]) }}</p>
@endif
<section aria-labelledby="approval-heading" class="space-y-3 rounded-lg border border-zinc-200 p-4 dark:border-zinc-700">
<section aria-labelledby="approval-heading" class="card space-y-3">
<h2 id="approval-heading" tabindex="-1" class="text-lg font-semibold focus:outline-none">{{ __('time.approval.title') }}</h2>
@if ($sheet->hasUnapprovedHours())
@@ -548,7 +548,7 @@ new class extends Component
@endcan
@unless ($this->isReadOnly())
<section aria-labelledby="add-task-heading" class="space-y-2">
<section aria-labelledby="add-task-heading" class="card space-y-2">
<h2 id="add-task-heading" class="sr-only">{{ __('time.add.search') }}</h2>
<x-input
id="task-search"
@@ -571,7 +571,7 @@ new class extends Component
type="button"
wire:click="addTask({{ $task->taskId }})"
aria-label="{{ __('time.add.choose', ['task' => $task->label()]) }}"
class="w-full rounded-md px-3 py-2 text-left text-sm hover:bg-zinc-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:hover:bg-zinc-700"
class="w-full rounded-md px-3 py-2 text-left text-sm hover:bg-zinc-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300 dark:hover:bg-zinc-700"
>
<span class="font-medium">{{ $task->label() }}</span>
<span class="text-zinc-600 dark:text-zinc-300">{{ $task->workTypeName }}</span>