Files
petriandClaude Opus 5.5 51b40b24fe 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]>
2026-11-29 10:53:10 +02:00

53 lines
2.2 KiB
PHP

{{--
A card-like section of a page. With a title it is a <section> named by its heading (h2 by default, `level`
changes it), with an optional decorative icon and actions (the `actions` slot) beside the heading.
tone="danger" or "warning" adds a coloured top edge; the heading text must still say what is wrong.
--}}
@props([
'title' => null,
'icon' => null,
'level' => 2,
'tone' => null,
'headingId' => null,
])
@php
$headingId ??= $title !== null ? 'panel-'.\Illuminate\Support\Str::slug($title).'-'.substr(md5($title), 0, 6) : null;
$edge = match ($tone) {
'danger' => 'border-t-4 border-t-red-600 dark:border-t-red-400',
'warning' => 'border-t-4 border-t-amber-500 dark:border-t-amber-400',
'primary' => 'border-t-4 border-t-primary-500 dark:border-t-primary-400',
default => null,
};
$iconColour = match ($tone) {
'danger' => 'bg-red-100 text-red-700 dark:bg-red-400/15 dark:text-red-300',
'warning' => 'bg-amber-100 text-amber-800 dark:bg-amber-400/15 dark:text-amber-200',
default => 'bg-primary-100 text-primary-700 dark:bg-primary-400/15 dark:text-primary-200',
};
$tag = $title !== null ? 'section' : 'div';
@endphp
<{{ $tag }}
@if ($title !== null) aria-labelledby="{{ $headingId }}" @endif
{{ $attributes->class(['space-y-4 rounded-xl border border-zinc-200 bg-white p-4 shadow-sm sm:p-5 dark:border-zinc-700 dark:bg-zinc-900', $edge]) }}
>
@if ($title !== null)
<div class="flex flex-wrap items-center justify-between gap-2">
<h{{ $level }} id="{{ $headingId }}" class="flex items-center gap-2 text-lg font-semibold">
@if ($icon !== null)
<span class="flex size-8 shrink-0 items-center justify-center rounded-lg {{ $iconColour }}" aria-hidden="true">
<x-icon :name="$icon" class="size-5" />
</span>
@endif
<span class="min-w-0 break-words">{{ $title }}</span>
</h{{ $level }}>
@isset($actions)
<div class="flex flex-wrap items-center gap-2">{{ $actions }}</div>
@endisset
</div>
@endif
{{ $slot }}
</{{ $tag }}>