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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user