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
@@ -36,10 +36,10 @@ new #[Layout('layouts.console')] class extends Component
?>
<div class="mx-auto max-w-3xl space-y-6 p-3 sm:p-6">
<h1 class="text-2xl font-semibold">{{ __('machines.console_picker.title') }}</h1>
<x-page-title icon="cpu-chip">{{ __('machines.console_picker.title') }}</x-page-title>
@if ($this->machines === [])
<p>{{ __('machines.console_picker.empty') }}</p>
<x-empty-state icon="cpu-chip">{{ __('machines.console_picker.empty') }}</x-empty-state>
@else
<p>{{ __('machines.console_picker.intro') }}</p>
@@ -48,7 +48,7 @@ new #[Layout('layouts.console')] class extends Component
<li wire:key="console-machine-{{ $machine->id }}">
<a
href="{{ route('machines.console', $machine->id) }}"
class="flex min-h-14 flex-col justify-center rounded-lg border border-zinc-400 bg-white px-4 py-3 text-xl font-semibold text-zinc-900 hover:bg-zinc-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:border-zinc-500 dark:bg-zinc-900 dark:text-zinc-100 dark:hover:bg-zinc-700 dark:focus-visible:outline-blue-400"
class="flex min-h-14 flex-col justify-center rounded-lg border border-zinc-400 bg-white px-4 py-3 text-xl font-semibold text-zinc-900 hover:bg-zinc-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300 dark:border-zinc-500 dark:bg-zinc-900 dark:text-zinc-100 dark:hover:bg-zinc-700"
>
{{ $machine->name }}
@if ($machine->serviceUnitNames !== [])
@@ -620,7 +620,7 @@ new #[Layout('layouts.console')] class extends Component
?>
@php
$touch = 'inline-flex min-h-11 min-w-11 items-center justify-center gap-2 rounded-lg px-4 py-2 font-medium focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:focus-visible:outline-blue-400';
$touch = 'inline-flex min-h-11 min-w-11 items-center justify-center gap-2 rounded-lg px-4 py-2 font-medium focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300';
$primary = $touch.' bg-primary-600 text-white hover:bg-primary-700';
$secondary = $touch.' border border-zinc-500 bg-white text-zinc-900 hover:bg-zinc-100 dark:border-zinc-400 dark:bg-zinc-900 dark:text-zinc-100 dark:hover:bg-zinc-700';
$machine = $this->machine;
@@ -628,9 +628,9 @@ new #[Layout('layouts.console')] class extends Component
@endphp
<div wire:poll.30s="refreshList" class="mx-auto max-w-6xl space-y-6 p-3 sm:p-4">
<header class="flex flex-wrap items-center justify-between gap-3 rounded-lg bg-zinc-800 p-3 text-zinc-100 dark">
<header class="flex flex-wrap items-center justify-between gap-3 rounded-xl bg-primary-950 p-3 text-zinc-100 shadow-md dark">
<div class="min-w-0">
<h1 class="text-2xl font-semibold break-words">{{ $machine->name }}</h1>
<x-page-title icon="cpu-chip">{{ $machine->name }}</x-page-title>
<p class="text-base">{{ __('machines.console.user', ['name' => auth()->user()?->name]) }}</p>
</div>
<div class="flex flex-wrap gap-2">
@@ -640,7 +640,7 @@ new #[Layout('layouts.console')] class extends Component
</button>
<livewire:users::pin-switch :return-to="route('machines.console', $machine->id)" />
{{-- The normal user interface has a session of its own (Users' UseConsoleSession). --}}
<a href="{{ route('machines.show', $machine->id) }}" class="{{ $touch }} border border-zinc-300 text-zinc-100 hover:bg-zinc-700">
<a href="{{ route('machines.show', $machine->id) }}" class="{{ $touch }} border border-white/60 text-zinc-100 hover:bg-white/10">
<x-icon name="arrow-left" class="size-6" aria-hidden="true" />
{{ __('machines.console.back') }}
</a>
@@ -653,7 +653,7 @@ new #[Layout('layouts.console')] class extends Component
</div>
@if ($lateMaintenance !== [])
<div class="space-y-1 rounded-lg border-2 border-red-700 p-3 dark:border-red-400">
<div class="space-y-1 rounded-xl border-2 border-red-700 bg-red-50 p-3 dark:border-red-400 dark:bg-red-400/10">
@foreach ($lateMaintenance as $late)
<p wire:key="late-{{ $late->id }}" class="flex items-center gap-2 font-semibold text-red-700 dark:text-red-400">
<x-icon name="exclamation-triangle" class="size-6 shrink-0" aria-hidden="true" />
@@ -664,7 +664,7 @@ new #[Layout('layouts.console')] class extends Component
@endif
<div class="grid gap-6 lg:grid-cols-2">
<section aria-labelledby="console-list-heading" class="space-y-3">
<section aria-labelledby="console-list-heading" class="card space-y-3">
<h2 id="console-list-heading" class="text-xl font-semibold">{{ $nextDay ? __('machines.console.next_list', ['date' => $this->dateLabel($this->day())]) : __('machines.console.today_list') }}</h2>
<div class="flex flex-wrap gap-2" role="group" aria-label="{{ __('machines.show.day_navigation') }}">
<button type="button" wire:click="showDay(false)" class="{{ $nextDay ? $secondary : $primary }}" @unless ($nextDay) aria-pressed="true" @else aria-pressed="false" @endunless>{{ __('machines.show.today') }}</button>
@@ -672,7 +672,7 @@ new #[Layout('layouts.console')] class extends Component
</div>
@if ($this->rows === [])
<p>{{ __('machines.show.none') }}</p>
<x-empty-state icon="cpu-chip">{{ __('machines.show.none') }}</x-empty-state>
@else
<ol class="space-y-3">
@foreach ($this->rows as $row)
@@ -827,7 +827,7 @@ new #[Layout('layouts.console')] class extends Component
<button
type="button"
wire:click="selectItem({{ $item->id }})"
class="flex h-full min-h-24 w-full flex-col items-start gap-1 rounded-lg border-2 p-2 text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 {{ $selectedItemId === $item->id ? 'border-primary-600 dark:border-primary-400' : 'border-zinc-300 bg-white hover:bg-zinc-100 dark:border-zinc-600 dark:bg-zinc-900 dark:hover:bg-zinc-700' }}"
class="flex h-full min-h-24 w-full flex-col items-start gap-1 rounded-lg border-2 p-2 text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300 {{ $selectedItemId === $item->id ? 'border-primary-600 dark:border-primary-400' : 'border-zinc-300 bg-white hover:bg-zinc-100 dark:border-zinc-600 dark:bg-zinc-900 dark:hover:bg-zinc-700' }}"
aria-label="{{ __('inventory.task.choose', ['item' => $item->name, 'balance' => $this->quantity($item->balanceMilli, $item->unit)]) }}"
>
@if ($item->hasImage)
@@ -868,7 +868,7 @@ new #[Layout('layouts.console')] class extends Component
</div>
@if ($machine->counters !== [] || $this->maintenance !== [])
<section aria-labelledby="console-maintenance-heading" class="space-y-3">
<section aria-labelledby="console-maintenance-heading" class="card space-y-3">
<h2 id="console-maintenance-heading" class="text-xl font-semibold">{{ __('machines.console.counters_and_maintenance') }}</h2>
<div class="grid gap-3 md:grid-cols-2">
@@ -243,11 +243,11 @@ new class extends Component
?>
<div class="mx-auto max-w-2xl space-y-6 p-4 sm:p-6">
<h1 class="text-2xl font-semibold">{{ $this->heading() }}</h1>
<x-page-title icon="cpu-chip">{{ $this->heading() }}</x-page-title>
<p role="status" aria-live="polite" class="text-sm font-medium">{{ $message }}</p>
<form wire:submit="save" class="space-y-6" novalidate>
<form wire:submit="save" class="card space-y-6" novalidate>
<x-input id="machine-name" wire:model="name" :label="__('machines.form.name')" autocomplete="off" maxlength="150" required />
{{-- TallStackUI's native select does not tie its label to the control, so aria-label names it. --}}
@@ -86,7 +86,7 @@ new class extends Component
<div class="mx-auto max-w-5xl space-y-6 p-4 sm:p-6">
<div class="space-y-2">
<h1 class="text-2xl font-semibold">{{ __('machines.index.title') }}</h1>
<x-page-title icon="cpu-chip">{{ __('machines.index.title') }}</x-page-title>
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('machines.index.intro') }}</p>
@can('machines.manage')
<p><x-button :href="route('machines.create')" wire:navigate icon="plus" :text="__('machines.index.new')" /></p>
@@ -109,7 +109,7 @@ new class extends Component
</div>
@forelse ($this->grouped() as $unitName => $machines)
<section wire:key="unit-{{ md5($unitName) }}" aria-label="{{ $unitName }}" class="space-y-2">
<section wire:key="unit-{{ md5($unitName) }}" aria-label="{{ $unitName }}" class="card space-y-2">
<h2 class="text-lg font-semibold">{{ $unitName }}</h2>
<ul class="divide-y divide-zinc-200 rounded-lg border border-zinc-300 dark:divide-zinc-700 dark:border-zinc-600">
@foreach ($machines as $machine)
@@ -134,6 +134,6 @@ new class extends Component
</ul>
</section>
@empty
<p class="text-sm">{{ __('machines.index.none') }}</p>
<x-empty-state icon="cpu-chip">{{ __('machines.index.none') }}</x-empty-state>
@endforelse
</div>
@@ -183,13 +183,13 @@ new class extends Component
<div class="mx-auto max-w-2xl space-y-6 p-4 sm:p-6">
<div class="space-y-1">
<h1 class="text-2xl font-semibold">{{ $this->heading() }}</h1>
<x-page-title icon="wrench">{{ $this->heading() }}</x-page-title>
<p class="text-sm">{{ $this->machine->name }}</p>
</div>
<p role="status" aria-live="polite" class="text-sm font-medium">{{ $message }}</p>
<form wire:submit="save" class="space-y-6" novalidate>
<form wire:submit="save" class="card space-y-6" novalidate>
<x-input id="item-name" wire:model="name" :label="__('machines.maintenance.name')" :hint="__('machines.maintenance.name_hint')" autocomplete="off" maxlength="150" required />
<fieldset class="space-y-3">
@@ -211,7 +211,7 @@ new class extends Component
<p id="maintenance-status" tabindex="-1" role="status" aria-live="polite" class="text-sm font-medium focus:outline-none">{{ $message }}</p>
@if ($this->machine->counters !== [])
<section aria-labelledby="counters-heading" class="space-y-3">
<section aria-labelledby="counters-heading" class="card space-y-3">
<h2 id="counters-heading" class="text-xl font-semibold">{{ __('machines.maintenance.counters') }}</h2>
<ul class="space-y-3">
@foreach ($this->machine->counters as $counter)
@@ -247,14 +247,14 @@ new class extends Component
@php($hasMaintenance = $this->machine->counters !== [] || $this->items !== [])
@if ($hasMaintenance || auth()->user()?->can('machines.manage'))
<section aria-labelledby="maintenance-heading" class="space-y-3">
<section aria-labelledby="maintenance-heading" class="card space-y-3">
<h2 id="maintenance-heading" class="text-xl font-semibold">{{ __('machines.maintenance.items') }}</h2>
@can('machines.manage')
<p><x-button :href="route('machines.maintenance.create', $machineId)" wire:navigate sm icon="plus" :text="__('machines.maintenance.add')" /></p>
@endcan
@if ($this->items === [])
<p class="text-sm">{{ __('machines.maintenance.none') }}</p>
<x-empty-state icon="cpu-chip">{{ __('machines.maintenance.none') }}</x-empty-state>
@else
<ul class="space-y-3">
@foreach ($this->items as $item)
@@ -308,7 +308,7 @@ new class extends Component
@endif
@if ($hasMaintenance)
<section aria-labelledby="history-heading" class="space-y-3">
<section aria-labelledby="history-heading" class="card space-y-3">
<h2 id="history-heading" class="text-xl font-semibold">{{ __('machines.maintenance.history') }}</h2>
<div class="grid gap-3 sm:grid-cols-3">
{{-- TallStackUI's native select does not tie its label to the control, so aria-label names it. --}}
@@ -209,7 +209,7 @@ new class extends Component
<div>
@if ($this->isAvailable())
<section aria-labelledby="process-heading" class="space-y-4 rounded-lg border border-zinc-300 p-4 dark:border-zinc-600">
<section aria-labelledby="process-heading" class="card space-y-4">
<h2 id="process-heading" class="text-xl font-semibold">{{ __('machines.process.title') }}</h2>
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('machines.process.intro') }}</p>
@@ -243,7 +243,7 @@ new class extends Component
<div class="space-y-2">
<p class="text-sm"><x-link :href="route('machines.index')" navigate>{{ __('machines.show.back') }}</x-link></p>
<h1 class="text-2xl font-semibold break-words">{{ $machine->name }}</h1>
<x-page-title icon="cpu-chip">{{ $machine->name }}</x-page-title>
<p class="text-sm">
{{ __('machines.types.'.$machine->type->value) }}
· {{ __('machines.show.units', ['units' => implode(', ', $machine->serviceUnitNames)]) }}
@@ -268,7 +268,7 @@ new class extends Component
<p id="work-list-status" tabindex="-1" role="status" aria-live="polite" class="text-sm font-medium focus:outline-none">{{ $message }}</p>
<section aria-labelledby="work-list-heading" class="space-y-4">
<section aria-labelledby="work-list-heading" class="card space-y-4">
<h2 id="work-list-heading" class="text-xl font-semibold">{{ __('machines.show.work_list') }}</h2>
<nav aria-label="{{ __('machines.show.day_navigation') }}" class="flex flex-wrap items-end gap-2">
@@ -289,7 +289,7 @@ new class extends Component
<button
type="button"
wire:click="showDate('{{ $dayLoad->day }}')"
class="rounded-md border border-zinc-300 px-2 py-1 hover:bg-zinc-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:border-zinc-600 dark:hover:bg-zinc-700 @if ($dayLoad->day === $day) font-semibold @endif"
class="rounded-md border border-zinc-300 px-2 py-1 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:border-zinc-600 dark:hover:bg-zinc-700 @if ($dayLoad->day === $day) font-semibold @endif"
@if ($dayLoad->day === $day) aria-current="date" @endif
>
{{ __('machines.show.load_row', ['date' => $this->shortDay($dayLoad->day), 'rows' => trans_choice('machines.show.rows', $dayLoad->rows, ['count' => $dayLoad->rows]), 'hours' => $this->quarters($dayLoad->estimatedQuarters)]) }}
@@ -303,7 +303,7 @@ new class extends Component
<p class="text-sm">{{ trans_choice('machines.show.row_count', count($this->rows), ['count' => count($this->rows)]) }}</p>
@if ($this->rows === [])
<p class="text-sm">{{ __('machines.show.none') }}</p>
<x-empty-state icon="cpu-chip">{{ __('machines.show.none') }}</x-empty-state>
@else
<ol class="space-y-3">
@foreach ($this->rows as $row)