Files
Toiminnanohjaus/resources/views/components/checkbox-group.blade.php
T
petriandClaude Opus 5.5 f4b58f6b1d Darken the dark canvas, add customer colours, the ongoing status and the board model
- Dark theme page background is #5a5e60; text on it is lifted to zinc-200 /
  primary-100 and TallStackUI's dark labels, hints and checkbox labels are
  lightened so everything stays at 4.5:1.
- Shared HexColor picks white or black text by the higher WCAG contrast; a
  native-dialog colour picker and a large work dialog component.
- Customers get a header colour (customers.header_color), set on the
  customer page.
- New job status Jatkuvat / Kausi (ongoing): open, never late, billed
  monthly like running jobs.
- Kanban model: board columns and views, urgent threshold, per-user board
  preferences (density, column colours and sort), card positions, tasks of
  continuing jobs pinned to the board, MoveBoardCard and board queries with
  logged hours from TimeTracking.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 06:11:49 +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-200">{{ $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-200">({{ $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>