Files
Toiminnanohjaus/resources/views/components/status-badge.blade.php
T
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

25 lines
1.6 KiB
PHP

{{--
A status as a tinted label: the text (and optional icon) carries the meaning, the colour only supports it.
Tones: neutral, primary, info, success, warning, danger, violet. Text and background meet 4.5:1 in both themes.
--}}
@props(['tone' => 'neutral', 'icon' => null])
@php
$colours = match ($tone) {
'primary' => 'bg-primary-50 text-primary-800 ring-primary-600/30 dark:bg-primary-400/15 dark:text-primary-200 dark:ring-primary-300/30',
'info' => 'bg-sky-50 text-sky-800 ring-sky-600/30 dark:bg-sky-400/15 dark:text-sky-200 dark:ring-sky-300/30',
'success' => 'bg-emerald-50 text-emerald-800 ring-emerald-600/30 dark:bg-emerald-400/15 dark:text-emerald-200 dark:ring-emerald-300/30',
'warning' => 'bg-amber-50 text-amber-900 ring-amber-600/40 dark:bg-amber-400/15 dark:text-amber-200 dark:ring-amber-300/30',
'danger' => 'bg-red-50 text-red-800 ring-red-600/30 dark:bg-red-400/15 dark:text-red-200 dark:ring-red-300/30',
'violet' => 'bg-violet-50 text-violet-800 ring-violet-600/30 dark:bg-violet-400/15 dark:text-violet-200 dark:ring-violet-300/30',
default => 'bg-zinc-100 text-zinc-800 ring-zinc-500/30 dark:bg-zinc-400/15 dark:text-zinc-200 dark:ring-zinc-300/30',
};
@endphp
<span {{ $attributes->class(['inline-flex max-w-full items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset', $colours]) }}>
@if ($icon !== null)
<x-icon :name="$icon" class="size-3.5 shrink-0" aria-hidden="true" />
@endif
<span class="min-w-0 break-words">{{ $slot }}</span>
</span>