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
@@ -36,22 +36,22 @@ new class extends Component
?>
<div class="mx-auto max-w-md space-y-6 p-4 sm:p-6 sm:pt-16">
<flux:heading size="xl" level="1">{{ __('auth.forgot_title') }}</flux:heading>
<h1 class="text-2xl font-semibold">{{ __('auth.forgot_title') }}</h1>
<div role="status" aria-live="polite">
@if ($linkRequested)
<flux:callout variant="success" icon="envelope" :heading="__('auth.forgot_sent')" />
<x-alert color="green" light icon="envelope" :text="__('auth.forgot_sent')" />
@endif
</div>
<flux:text>{{ __('auth.forgot_intro') }}</flux:text>
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('auth.forgot_intro') }}</p>
<form wire:submit="sendLink" class="space-y-6" novalidate>
<flux:input wire:model="email" type="email" :label="__('auth.email')" autocomplete="username" required />
<x-input wire:model="email" type="email" :label="__('auth.email')" autocomplete="username" required />
<div class="flex flex-wrap items-center justify-between gap-4">
<flux:button type="submit" variant="primary">{{ __('auth.forgot_submit') }}</flux:button>
<flux:link :href="route('login')" wire:navigate>{{ __('auth.back_to_login') }}</flux:link>
<x-button submit :text="__('auth.forgot_submit')" />
<x-link :href="route('login')" navigate :text="__('auth.back_to_login')" />
</div>
</form>
</div>
@@ -103,60 +103,63 @@ 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">
{{ __($userId === null ? 'users.create_title' : 'users.edit_title') }}
</flux:heading>
</h1>
<form wire:submit="save" class="space-y-6" novalidate>
<flux:input wire:model="form.name" :label="__('users.fields.name')" autocomplete="off" required />
<x-input wire:model="form.name" :label="__('users.fields.name')" autocomplete="off" required />
<flux:input wire:model="form.email" type="email" :label="__('users.fields.email')" autocomplete="off" required />
<x-input wire:model="form.email" type="email" :label="__('users.fields.email')" autocomplete="off" required />
<flux:select wire:model.live="form.role" :label="__('users.fields.role')">
@foreach (Role::cases() as $role)
<flux:select.option wire:key="role-{{ $role->value }}" :value="$role->value">
{{ __('users.roles.'.$role->value) }}
</flux:select.option>
@endforeach
</flux:select>
{{-- TallStackUI's native select does not tie its label to the control, so aria-label names it. --}}
<x-select.native
wire:model.live="form.role"
:label="__('users.fields.role')"
:aria-label="__('users.fields.role')"
:options="collect(Role::cases())->map(fn (Role $role) => ['label' => __('users.roles.'.$role->value), 'value' => $role->value])->all()"
/>
@if ($form->isIntern())
<flux:input
<x-input
wire:model="form.employment_ends_on"
type="date"
:label="__('users.fields.employment_ends_on')"
:description="__('users.fields.employment_ends_on_description')"
:hint="__('users.fields.employment_ends_on_description')"
required
/>
<flux:select wire:model="form.supervisor_id" :label="__('users.fields.supervisor')" :placeholder="__('users.fields.supervisor_placeholder')">
<x-select.native
wire:model="form.supervisor_id"
:label="__('users.fields.supervisor')"
:aria-label="__('users.fields.supervisor')"
required
>
<option value="">{{ __('users.fields.supervisor_placeholder') }}</option>
@foreach ($this->supervisorOptions as $option)
<flux:select.option wire:key="supervisor-{{ $option->id }}" :value="(string) $option->id">
{{ $option->name }}
</flux:select.option>
<option wire:key="supervisor-{{ $option->id }}" value="{{ $option->id }}">{{ $option->name }}</option>
@endforeach
</flux:select>
</x-select.native>
@endif
<flux:checkbox
wire:model="form.active"
:label="__('users.fields.active')"
:description="__('users.fields.active_description')"
/>
<div>
<x-checkbox wire:model="form.active" :label="__('users.fields.active')" aria-describedby="active-description" />
<p id="active-description" class="mt-1 text-sm text-zinc-600 dark:text-zinc-300">{{ __('users.fields.active_description') }}</p>
</div>
<div class="flex flex-wrap gap-3">
<flux:button type="submit" variant="primary">{{ __('users.save') }}</flux:button>
<flux:button :href="route('users.index')" wire:navigate variant="ghost">{{ __('users.cancel') }}</flux:button>
<x-button submit :text="__('users.save')" />
<x-button :href="route('users.index')" wire:navigate subtle color="black" :text="__('users.cancel')" />
</div>
</form>
@if ($userId !== null)
<div class="space-y-3 border-t border-zinc-200 pt-6 dark:border-zinc-700">
<flux:button wire:click="sendPasswordLink" icon="envelope">{{ __('users.send_link') }}</flux:button>
<x-button wire:click="sendPasswordLink" subtle color="black" icon="envelope" :text="__('users.send_link')" />
<div role="status" aria-live="polite">
@if ($linkStatus !== '')
<flux:text>{{ $linkStatus }}</flux:text>
<p class="text-sm">{{ $linkStatus }}</p>
@endif
</div>
</div>
@@ -60,6 +60,20 @@ new class extends Component
]);
}
/**
* @return list<array{index: string, label: string, sortable: bool, align?: string}>
*/
public function headers(): array
{
return [
['index' => 'name', 'label' => __('users.fields.name'), 'sortable' => false],
['index' => 'email', 'label' => __('users.fields.email'), 'sortable' => false],
['index' => 'role', 'label' => __('users.fields.role'), 'sortable' => false],
['index' => 'status', 'label' => __('users.fields.status'), 'sortable' => false],
['index' => 'action', 'label' => __('users.actions'), 'sortable' => false, 'align' => 'right'],
];
}
public function render(): mixed
{
return $this->view()->title(__('users.title'));
@@ -69,63 +83,53 @@ 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">{{ __('users.title') }}</flux:heading>
<h1 class="text-2xl font-semibold">{{ __('users.title') }}</h1>
<flux:button :href="route('users.create')" wire:navigate variant="primary" icon="plus">
{{ __('users.new') }}
</flux:button>
<x-button :href="route('users.create')" wire:navigate icon="plus" :text="__('users.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="__('users.search')"
:description="__('users.search_description')"
:hint="__('users.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('users.result_count', $this->users->total(), ['count' => $this->users->total()]) }}
</flux:text>
</p>
@if ($this->users->total() === 0)
<flux:text>{{ __('users.empty') }}</flux:text>
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('users.empty') }}</p>
@else
<flux:table :paginate="$this->users">
<flux:table.columns>
<flux:table.column>{{ __('users.fields.name') }}</flux:table.column>
<flux:table.column>{{ __('users.fields.email') }}</flux:table.column>
<flux:table.column>{{ __('users.fields.role') }}</flux:table.column>
<flux:table.column>{{ __('users.fields.status') }}</flux:table.column>
<flux:table.column><span class="sr-only">{{ __('users.edit') }}</span></flux:table.column>
</flux:table.columns>
<x-table :headers="$this->headers()" :rows="$this->users" paginate>
@interact('column_name', $user)
<span class="font-medium">{{ $user->name }}</span>
@endinteract
<flux:table.rows>
@foreach ($this->users as $user)
<flux:table.row wire:key="user-{{ $user->id }}">
<flux:table.cell variant="strong">{{ $user->name }}</flux:table.cell>
<flux:table.cell>{{ $user->email }}</flux:table.cell>
<flux:table.cell>
{{ __('users.roles.'.$user->role->value) }}
@if ($user->supervisorName)
<span class="block text-xs text-zinc-600 dark:text-zinc-300">
{{ __('users.fields.supervisor') }}: {{ $user->supervisorName }}
</span>
@endif
</flux:table.cell>
<flux:table.cell>{{ $this->statusOf($user) }}</flux:table.cell>
<flux:table.cell align="end">
<flux:link :href="route('users.edit', $user->id)" wire:navigate>
{{ __('users.edit') }}<span class="sr-only">: {{ $user->name }}</span>
</flux:link>
</flux:table.cell>
</flux:table.row>
@endforeach
</flux:table.rows>
</flux:table>
@interact('column_role', $user)
{{ __('users.roles.'.$user->role->value) }}
@if ($user->supervisorName)
<span class="block text-xs text-zinc-600 dark:text-zinc-300">
{{ __('users.fields.supervisor') }}: {{ $user->supervisorName }}
</span>
@endif
@endinteract
@interact('column_status', $user)
{{ $this->statusOf($user) }}
@endinteract
@interact('column_action', $user)
<x-link :href="route('users.edit', $user->id)" navigate>
{{ __('users.edit') }}<span class="sr-only">: {{ $user->name }}</span>
</x-link>
@endinteract
</x-table>
@endif
</div>
@@ -80,17 +80,16 @@ new class extends Component
?>
<div class="mx-auto max-w-md space-y-6 p-4 sm:p-6 sm:pt-16">
<flux:heading size="xl" level="1">{{ __('auth.login_title') }}</flux:heading>
<h1 class="text-2xl font-semibold">{{ __('auth.login_title') }}</h1>
@if ($accessEnded)
{{-- Not variant="warning": its yellow heading is only 2.8:1 on the light background. --}}
<flux:callout icon="exclamation-triangle" role="status" :heading="__('auth.account_disabled')" />
<x-alert role="status" color="yellow" light icon="exclamation-triangle" :text="__('auth.account_disabled')" />
@elseif (session('status'))
<flux:callout variant="success" icon="information-circle" role="status" :heading="session('status')" />
<x-alert role="status" color="green" light icon="information-circle" :text="session('status')" />
@endif
<form wire:submit="login" class="space-y-6" novalidate>
<flux:input
<x-input
wire:model="email"
type="email"
:label="__('auth.email')"
@@ -98,20 +97,18 @@ new class extends Component
required
/>
<flux:input
<x-password-field
wire:model="password"
type="password"
:label="__('auth.password_label')"
autocomplete="current-password"
viewable
required
/>
<flux:checkbox wire:model="remember" :label="__('auth.remember')" />
<x-checkbox wire:model="remember" :label="__('auth.remember')" />
<div class="flex flex-wrap items-center justify-between gap-4">
<flux:button type="submit" variant="primary">{{ __('auth.login') }}</flux:button>
<flux:link :href="route('password.request')" wire:navigate>{{ __('auth.forgot_password') }}</flux:link>
<x-button submit :text="__('auth.login')" />
<x-link :href="route('password.request')" navigate :text="__('auth.forgot_password')" />
</div>
</form>
</div>
@@ -74,32 +74,28 @@ new class extends Component
?>
<div class="mx-auto max-w-md space-y-6 p-4 sm:p-6 sm:pt-16">
<flux:heading size="xl" level="1">{{ __('auth.reset_title') }}</flux:heading>
<h1 class="text-2xl font-semibold">{{ __('auth.reset_title') }}</h1>
<flux:text>{{ __('auth.reset_intro') }}</flux:text>
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('auth.reset_intro') }}</p>
<form wire:submit="resetPassword" class="space-y-6" novalidate>
<flux:input wire:model="email" type="email" :label="__('auth.email')" autocomplete="username" required />
<x-input wire:model="email" type="email" :label="__('auth.email')" autocomplete="username" required />
<flux:input
<x-password-field
wire:model="password"
type="password"
:label="__('auth.new_password')"
:description="__('auth.password_rules')"
:hint="__('auth.password_rules')"
autocomplete="new-password"
viewable
required
/>
<flux:input
<x-password-field
wire:model="password_confirmation"
type="password"
:label="__('auth.confirm_password')"
autocomplete="new-password"
viewable
required
/>
<flux:button type="submit" variant="primary">{{ __('auth.reset_submit') }}</flux:button>
<x-button submit :text="__('auth.reset_submit')" />
</form>
</div>