- 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]>
82 lines
3.2 KiB
PHP
82 lines
3.2 KiB
PHP
{{--
|
|
Customer choice of a job page using the PicksCustomer trait: a search
|
|
field whose results are buttons, the number of matches announced, and
|
|
"Lisää uusi asiakas" for a name not found. Once chosen, the customer is
|
|
shown as text with a "Vaihda asiakas" button.
|
|
--}}
|
|
@props([
|
|
'customerId',
|
|
'customerName',
|
|
'search',
|
|
'results',
|
|
'errorKey' => 'form.customer_id',
|
|
])
|
|
|
|
<div {{ $attributes->class('space-y-2') }}>
|
|
@if ($customerId !== '')
|
|
<p class="text-sm font-semibold text-gray-700 dark:text-dark-300">{{ __('jobs.fields.customer') }}</p>
|
|
<div class="flex flex-wrap items-center gap-3">
|
|
<span class="font-medium break-words">{{ $customerName }}</span>
|
|
<x-button
|
|
id="change-customer"
|
|
wire:click="clearCustomer"
|
|
subtle
|
|
color="black"
|
|
sm
|
|
:text="__('jobs.customer_picker.change')"
|
|
:aria-label="__('jobs.customer_picker.change').': '.$customerName"
|
|
/>
|
|
</div>
|
|
@else
|
|
<x-input
|
|
id="customer-search"
|
|
wire:model.live.debounce.300ms="customerSearch"
|
|
type="search"
|
|
icon="magnifying-glass"
|
|
:label="__('jobs.customer_picker.search')"
|
|
:hint="__('jobs.customer_picker.search_description')"
|
|
autocomplete="off"
|
|
required
|
|
/>
|
|
|
|
@error($errorKey)
|
|
<p class="text-sm text-red-700 dark:text-red-400">{{ $message }}</p>
|
|
@enderror
|
|
|
|
@if (mb_strlen(trim($search)) >= 2)
|
|
<p role="status" aria-live="polite" class="text-sm text-zinc-600 dark:text-zinc-300">
|
|
{{ trans_choice('jobs.customer_picker.results', count($results), ['count' => count($results)]) }}
|
|
</p>
|
|
|
|
<ul class="space-y-1">
|
|
@foreach ($results as $customer)
|
|
<li wire:key="customer-result-{{ $customer->id }}">
|
|
<button
|
|
type="button"
|
|
wire:click="selectCustomer({{ $customer->id }})"
|
|
class="w-full rounded-md px-3 py-2 text-left text-sm 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:hover:bg-zinc-700"
|
|
aria-label="{{ __('jobs.customer_picker.choose', ['name' => $customer->name]) }}"
|
|
>
|
|
<span class="font-medium">{{ $customer->name }}</span>
|
|
@if ($customer->businessId !== null)
|
|
<span class="text-zinc-600 dark:text-zinc-300">{{ $customer->businessId }}</span>
|
|
@endif
|
|
</button>
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
|
|
@can('customers.use')
|
|
<x-button
|
|
wire:click="createCustomer"
|
|
subtle
|
|
color="black"
|
|
sm
|
|
icon="plus"
|
|
:text="__('jobs.customer_picker.create', ['name' => trim($search)])"
|
|
/>
|
|
@endcan
|
|
@endif
|
|
@endif
|
|
</div>
|