Replace Flux UI with TallStackUI 4

Rewrite the layout and all Customers and Users pages with TallStackUI
components and remove livewire/flux and its Boost skill.

Fix the TallStackUI accessibility gaps found by the axe tests:
- password reveal and theme switch have no accessible name: add
  <x-password-field> and keep the own theme toggle button
- select.native label is not tied to the control: add aria-label
- contrast: darker primary palette, soft-customized error colours and
  published alert/link colour classes; neutral buttons use subtle black
- follow the system theme by default (localStorage key dark-theme)

Load TallStackUI assets from the app URL so they work in the XAMPP
subfolder, add Finnish TallStackUI strings, and drop inputmode=numeric
from the business ID field so iOS keyboards show the hyphen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-22 12:22:03 +02:00
co-authored by Claude Opus 5.5
parent 7b6a909677
commit 90d6f5bd66
35 changed files with 1054 additions and 448 deletions
@@ -69,43 +69,37 @@ new class extends Component
?>
<div class="mx-auto max-w-2xl space-y-6 p-4 sm:p-6">
<flux:heading size="xl" level="1">
<h1 class="text-2xl font-semibold">
{{ __($customerId === null ? 'customers.create_title' : 'customers.edit_title') }}
</flux:heading>
</h1>
<form wire:submit="save" class="space-y-6" novalidate>
<flux:input
<x-input
wire:model="form.name"
:label="__('customers.fields.name')"
autocomplete="organization"
required
/>
<flux:radio.group wire:model.live="form.type" :label="__('customers.fields.type')">
@foreach (CustomerType::cases() as $customerType)
<flux:radio
wire:key="type-{{ $customerType->value }}"
:value="$customerType->value"
:label="__('customers.types.'.$customerType->value)"
/>
@endforeach
</flux:radio.group>
<x-radio.group
wire:model.live="form.type"
:label="__('customers.fields.type')"
:options="collect(CustomerType::cases())->map(fn (CustomerType $type) => ['label' => __('customers.types.'.$type->value), 'value' => $type->value])->all()"
/>
@if ($form->type === CustomerType::Company->value)
<flux:input
{{-- No inputmode="numeric": the iOS number pad has no hyphen for 1234567-8. --}}
<x-input
wire:model="form.business_id"
:label="__('customers.fields.business_id')"
:description="__('customers.fields.business_id_description')"
inputmode="numeric"
:hint="__('customers.fields.business_id_description')"
autocomplete="off"
/>
@endif
<div class="flex flex-wrap gap-3">
<flux:button type="submit" variant="primary">{{ __('customers.save') }}</flux:button>
<flux:button :href="route('customers.index')" wire:navigate variant="ghost">
{{ __('customers.cancel') }}
</flux:button>
<x-button submit :text="__('customers.save')" />
<x-button :href="route('customers.index')" wire:navigate subtle color="black" :text="__('customers.cancel')" />
</div>
</form>
</div>
@@ -41,6 +41,19 @@ new class extends Component
return $this->customerQueries->paginate($this->search);
}
/**
* @return list<array{index: string, label: string, sortable: bool, align?: string}>
*/
public function headers(): array
{
return [
['index' => 'name', 'label' => __('customers.fields.name'), 'sortable' => false],
['index' => 'type', 'label' => __('customers.fields.type'), 'sortable' => false],
['index' => 'businessId', 'label' => __('customers.fields.business_id'), 'sortable' => false],
['index' => 'action', 'label' => __('customers.actions'), 'sortable' => false, 'align' => 'right'],
];
}
public function render(): mixed
{
return $this->view()->title(__('customers.title'));
@@ -50,54 +63,48 @@ new class extends Component
<div class="mx-auto max-w-5xl space-y-6 p-4 sm:p-6">
<div class="flex flex-wrap items-center justify-between gap-4">
<flux:heading size="xl" level="1">{{ __('customers.title') }}</flux:heading>
<h1 class="text-2xl font-semibold">{{ __('customers.title') }}</h1>
<flux:button :href="route('customers.create')" wire:navigate variant="primary" icon="plus">
{{ __('customers.new') }}
</flux:button>
<x-button :href="route('customers.create')" wire:navigate icon="plus" :text="__('customers.new')" />
</div>
@if (session('status'))
<flux:callout variant="success" icon="check-circle" role="status" :heading="session('status')" />
<x-alert role="status" color="green" light icon="check-circle" :text="session('status')" />
@endif
<flux:input
<x-input
wire:model.live.debounce.300ms="search"
type="search"
icon="magnifying-glass"
:label="__('customers.search')"
:description="__('customers.search_description')"
:hint="__('customers.search_description')"
/>
<flux:text role="status" aria-live="polite" aria-atomic="true">
<p role="status" aria-live="polite" aria-atomic="true" class="text-sm text-zinc-600 dark:text-zinc-300">
{{ trans_choice('customers.result_count', $this->customers->total(), ['count' => $this->customers->total()]) }}
</flux:text>
</p>
@if ($this->customers->total() === 0)
<flux:text>{{ __('customers.empty') }}</flux:text>
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('customers.empty') }}</p>
@else
<flux:table :paginate="$this->customers">
<flux:table.columns>
<flux:table.column>{{ __('customers.fields.name') }}</flux:table.column>
<flux:table.column>{{ __('customers.fields.type') }}</flux:table.column>
<flux:table.column>{{ __('customers.fields.business_id') }}</flux:table.column>
<flux:table.column><span class="sr-only">{{ __('customers.edit') }}</span></flux:table.column>
</flux:table.columns>
<x-table :headers="$this->headers()" :rows="$this->customers" paginate>
@interact('column_name', $customer)
<span class="font-medium">{{ $customer->name }}</span>
@endinteract
<flux:table.rows>
@foreach ($this->customers as $customer)
<flux:table.row wire:key="customer-{{ $customer->id }}">
<flux:table.cell variant="strong">{{ $customer->name }}</flux:table.cell>
<flux:table.cell>{{ __('customers.types.'.$customer->type->value) }}</flux:table.cell>
<flux:table.cell>{{ $customer->businessId ?? '–' }}</flux:table.cell>
<flux:table.cell align="end">
<flux:link :href="route('customers.edit', $customer->id)" wire:navigate>
{{ __('customers.edit') }}<span class="sr-only">: {{ $customer->name }}</span>
</flux:link>
</flux:table.cell>
</flux:table.row>
@endforeach
</flux:table.rows>
</flux:table>
@interact('column_type', $customer)
{{ __('customers.types.'.$customer->type->value) }}
@endinteract
@interact('column_businessId', $customer)
{{ $customer->businessId ?? '–' }}
@endinteract
@interact('column_action', $customer)
<x-link :href="route('customers.edit', $customer->id)" navigate>
{{ __('customers.edit') }}<span class="sr-only">: {{ $customer->name }}</span>
</x-link>
@endinteract
</x-table>
@endif
</div>