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
@@ -205,15 +205,20 @@ new class extends Component
@php($job = $this->job)
<div class="mx-auto max-w-5xl space-y-8 p-4 sm:p-6">
<x-page>
<div class="space-y-4">
<div class="flex flex-wrap items-start justify-between gap-4">
<h1 class="text-2xl font-semibold break-words">
<span class="whitespace-nowrap">{{ $job->number }}</span> {{ $job->name }}
</h1>
<div class="min-w-0 flex-1 space-y-1">
<a href="{{ route('jobs.index') }}" wire:navigate class="inline-flex min-h-6 items-center gap-1 rounded-md text-sm font-medium text-primary-700 underline-offset-4 hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:text-primary-300 dark:focus-visible:outline-primary-300">
<x-icon name="arrow-left" class="size-4" aria-hidden="true" />{{ __('jobs.title') }}
</a>
<h1 class="text-2xl font-semibold break-words">
<span class="whitespace-nowrap text-primary-700 dark:text-primary-300">{{ $job->number }}</span> {{ $job->name }}
</h1>
</div>
@can('jobs.manage')
<x-button :href="route('jobs.edit', $job->id)" wire:navigate subtle color="black" icon="pencil" :text="__('jobs.edit')" />
<x-button :href="route('jobs.edit', $job->id)" wire:navigate icon="pencil" :text="__('jobs.edit')" />
@endcan
</div>
@@ -221,14 +226,14 @@ new class extends Component
<x-alert role="status" color="green" light icon="check-circle" :text="session('status')" />
@endif
<dl class="flex flex-wrap gap-x-8 gap-y-2 text-sm">
<div class="flex gap-2"><dt class="font-medium">{{ __('jobs.fields.status') }}:</dt><dd>{{ __('jobs.statuses.'.$job->status->value) }}</dd></div>
<dl class="card flex flex-wrap items-center gap-x-8 gap-y-2 py-3 text-sm sm:py-3">
<div class="flex items-center gap-2"><dt class="font-medium">{{ __('jobs.fields.status') }}:</dt><dd><x-jobs.status :status="$job->status" class="text-sm" /></dd></div>
<div class="flex gap-2"><dt class="font-medium">{{ __('jobs.fields.priority') }}:</dt><dd><x-jobs.priority :priority="$job->priority" /></dd></div>
<div class="flex gap-2"><dt class="font-medium">{{ __('jobs.fields.due_on') }}:</dt><dd><x-jobs.due-date :date="$job->dueOn" :status="$job->status" /></dd></div>
</dl>
</div>
<section aria-labelledby="basics-heading" class="space-y-3">
<section aria-labelledby="basics-heading" class="card space-y-3">
<h2 id="basics-heading" class="text-xl font-semibold">{{ __('jobs.sections.basics') }}</h2>
<dl class="grid gap-x-6 gap-y-2 text-sm sm:grid-cols-[max-content_1fr]">
@@ -291,7 +296,8 @@ new class extends Component
@endif
</section>
<section aria-labelledby="schedule-heading" class="space-y-3">
<div class="grid gap-6 md:grid-cols-2">
<section aria-labelledby="schedule-heading" class="card space-y-3">
<h2 id="schedule-heading" class="text-xl font-semibold">{{ __('jobs.sections.schedule') }}</h2>
<dl class="grid gap-x-6 gap-y-2 text-sm sm:grid-cols-[max-content_1fr]">
@@ -306,7 +312,7 @@ new class extends Component
</dl>
</section>
<section aria-labelledby="members-heading" class="space-y-3">
<section aria-labelledby="members-heading" class="card space-y-3">
<h2 id="members-heading" class="text-xl font-semibold">{{ __('jobs.sections.members') }}</h2>
<dl class="grid gap-x-6 gap-y-2 text-sm sm:grid-cols-[max-content_1fr]">
@@ -325,6 +331,8 @@ new class extends Component
</dl>
</section>
</div>
<section id="tasks" aria-labelledby="tasks-heading" class="space-y-4">
<div class="flex flex-wrap items-center justify-between gap-4">
<h2 id="tasks-heading" tabindex="-1" class="text-xl font-semibold focus:outline-none">{{ __('jobs.tasks.title') }}</h2>
@@ -348,7 +356,7 @@ new class extends Component
<p role="status" aria-live="polite" class="text-sm">{{ $taskStatusMessage }}</p>
@if ($this->tasks === [])
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('jobs.tasks.empty') }}</p>
<x-empty-state icon="clipboard-document-list">{{ __('jobs.tasks.empty') }}</x-empty-state>
@else
@php($canChangeStatus = Gate::allows('jobs.update-task-status', $job->id))
@php($canManageTasks = Gate::allows('jobs.manage-tasks', $job->id))
@@ -395,7 +403,7 @@ new class extends Component
x-on:tasks-expand.window="open = $event.detail"
x-on:focusin="if ($event.target.closest('[data-task-details]')) open = true"
>
<article aria-labelledby="task-{{ $task->id }}-title" class="rounded-lg border border-zinc-200 bg-white text-sm dark:border-zinc-700 dark:bg-zinc-900">
<article aria-labelledby="task-{{ $task->id }}-title" @class(['rounded-xl border border-l-4 border-zinc-200 bg-white text-sm shadow-sm dark:border-zinc-700 dark:bg-zinc-900', match ($task->status->value) { 'in_progress' => 'border-l-primary-500', 'in_review' => 'border-l-amber-500', 'done' => 'border-l-emerald-500', default => 'border-l-zinc-400' }])>
<div class="flex flex-col gap-2 p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-x-6">
<h3 id="task-{{ $task->id }}-title" class="min-w-0 text-base font-medium sm:flex-1">
<button
@@ -405,7 +413,7 @@ new class extends Component
x-bind:aria-expanded="open.toString()"
aria-expanded="false"
aria-controls="task-{{ $task->id }}-details"
class="flex min-h-6 w-full items-start gap-2 rounded-md text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:focus-visible:outline-blue-400"
class="flex min-h-6 w-full items-start gap-2 rounded-md text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300"
>
<x-icon name="chevron-right" class="mt-0.5 size-5 shrink-0 transition-transform" x-bind:class="{ 'rotate-90': open }" aria-hidden="true" />
<span class="min-w-0 break-words">{{ $task->title }}</span>
@@ -423,7 +431,7 @@ new class extends Component
</div>
<div class="flex flex-wrap gap-x-1">
<dt class="font-medium">{{ __('jobs.tasks.fields.status') }}:</dt>
<dd>{{ __('jobs.tasks.statuses.'.$task->status->value) }}</dd>
<dd><x-jobs.task-status :status="$task->status" /></dd>
</div>
@if ($task->commentCount > 0)
<div class="flex flex-wrap gap-x-1">
@@ -570,13 +578,13 @@ new class extends Component
</section>
@can('expenses.record')
<section aria-labelledby="expenses-heading" class="space-y-3">
<section aria-labelledby="expenses-heading" class="card space-y-3">
<h2 id="expenses-heading" class="text-xl font-semibold">{{ __('jobs.sections.expenses') }}</h2>
<x-link :href="route('expenses.job', $job->id)" navigate>{{ __('expenses.job_page.link') }}</x-link>
</section>
@endcan
<section aria-labelledby="links-heading" class="space-y-3">
<section aria-labelledby="links-heading" class="card space-y-3">
<h2 id="links-heading" class="text-xl font-semibold">{{ __('jobs.sections.links') }}</h2>
@if ($job->links === [])
@@ -594,12 +602,12 @@ new class extends Component
@endif
</section>
<section aria-labelledby="instructions-heading" class="space-y-3">
<section aria-labelledby="instructions-heading" class="card space-y-3">
<h2 id="instructions-heading" class="text-xl font-semibold">{{ __('jobs.sections.instructions') }}</h2>
<p class="whitespace-pre-line text-sm">{{ $job->instructions ?? __('jobs.not_set') }}</p>
</section>
<section aria-labelledby="history-heading" class="space-y-3" x-data="{ open: false }">
<section aria-labelledby="history-heading" class="card space-y-3" x-data="{ open: false }">
<h2 id="history-heading" class="text-xl font-semibold">
<button
type="button"
@@ -608,7 +616,7 @@ new class extends Component
x-bind:aria-expanded="open.toString()"
aria-expanded="false"
aria-controls="history-panel"
class="flex min-h-6 items-center gap-2 rounded-md text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:focus-visible:outline-blue-400"
class="flex min-h-6 items-center gap-2 rounded-md text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300"
>
<x-icon name="chevron-right" class="size-5 shrink-0 transition-transform" x-bind:class="{ 'rotate-90': open }" aria-hidden="true" />
{{ __('jobs.sections.history') }}
@@ -644,4 +652,4 @@ new class extends Component
@endif
</div>
</section>
</div>
</x-page>