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