Files
Toiminnanohjaus/resources/views/components/checkbox-group.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

54 lines
2.0 KiB
PHP

{{--
A group of checkboxes for one array property, in a fieldset whose
legend names the group. Native inputs with wrapping labels, so every
box has a name; the validation error is announced with the group.
$options: list of ['value' => ..., 'label' => ..., 'note' => ?string].
--}}
@props([
'legend',
'model',
'options',
'hint' => null,
'columns' => true,
])
@php
$errorKey = $model;
$id = 'group-'.str_replace('.', '-', $model);
@endphp
<fieldset
{{ $attributes->class('space-y-2') }}
@if ($hint !== null || $errors->has($errorKey)) aria-describedby="{{ trim(($hint !== null ? $id.'-hint ' : '').($errors->has($errorKey) ? $id.'-error' : '')) }}" @endif
>
<legend class="text-sm font-semibold text-gray-700 dark:text-dark-300">{{ $legend }}</legend>
@if ($hint !== null)
<p id="{{ $id }}-hint" class="text-sm text-zinc-600 dark:text-zinc-300">{{ $hint }}</p>
@endif
<div @class(['grid gap-2', 'sm:grid-cols-2 lg:grid-cols-3' => $columns])>
@foreach ($options as $option)
<label wire:key="{{ $id }}-{{ $option['value'] }}" class="flex min-h-6 cursor-pointer items-start gap-2 text-sm">
<input
type="checkbox"
wire:model="{{ $model }}"
value="{{ $option['value'] }}"
class="mt-0.5 size-4 shrink-0 rounded border-zinc-400 text-primary-600 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-800"
/>
<span>
{{ $option['label'] }}
@if (($option['note'] ?? null) !== null)
<span class="text-zinc-600 dark:text-zinc-300">({{ $option['note'] }})</span>
@endif
</span>
</label>
@endforeach
</div>
@error($errorKey)
<p id="{{ $id }}-error" class="text-sm text-red-700 dark:text-red-400">{{ $message }}</p>
@enderror
</fieldset>