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:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use TallStackUi\Facades\TallStackUi;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -19,6 +20,40 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
$this->meetContrastRequirements();
|
||||
}
|
||||
|
||||
/**
|
||||
* TallStackUI uses red-500 for error text, which is 3.8:1 on white and
|
||||
* below the 4.5:1 WCAG 2.2 AA requires. Darker red in light mode, lighter
|
||||
* red in dark mode.
|
||||
*/
|
||||
private function meetContrastRequirements(): void
|
||||
{
|
||||
TallStackUi::customize()
|
||||
->form('error')
|
||||
->block('text')
|
||||
->replace('text-red-500', 'text-red-700 dark:text-red-400');
|
||||
|
||||
TallStackUi::customize()
|
||||
->form('label')
|
||||
->block('error')
|
||||
->replace(['text-red-600' => 'text-red-700', 'dark:text-red-500' => 'dark:text-red-400']);
|
||||
|
||||
TallStackUi::customize()
|
||||
->form('label')
|
||||
->block('asterisk')
|
||||
->replace('text-red-500', 'text-red-700 dark:text-red-400');
|
||||
|
||||
// The typed value of a field in error is red-600: 3.8:1 on the dark input background.
|
||||
TallStackUi::customize()
|
||||
->form('input')
|
||||
->block('error')
|
||||
->replace('text-red-600!', 'text-red-700! dark:!text-red-400');
|
||||
|
||||
TallStackUi::customize()
|
||||
->select('native')
|
||||
->block('error')
|
||||
->replace('text-red-600!', 'text-red-700! dark:!text-red-400');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\TallStackUi\Colors;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
/**
|
||||
* TallStackUI alert colours, published from the package stub. Only the light
|
||||
* variant's text is changed: the defaults (text-*-600 on bg-*-50) are below the
|
||||
* 4.5:1 contrast WCAG 2.2 AA requires. Null keeps the package default.
|
||||
*/
|
||||
class AlertColors
|
||||
{
|
||||
/**
|
||||
* Background colors.
|
||||
*
|
||||
* @return array<string, array<string, string|null>>
|
||||
*/
|
||||
public function backgroundColors(Component $component): array
|
||||
{
|
||||
return [
|
||||
'solid' => [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
'outline' => [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
'light' => [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Text colors.
|
||||
*
|
||||
* @return array<string, array<string, string|null>>
|
||||
*/
|
||||
public function textColors(Component $component): array
|
||||
{
|
||||
return [
|
||||
'solid' => [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
'outline' => [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
'light' => [
|
||||
'black' => null,
|
||||
'primary' => 'text-primary-800',
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => 'text-red-800',
|
||||
'orange' => null,
|
||||
'amber' => 'text-amber-800',
|
||||
'yellow' => 'text-yellow-800',
|
||||
'lime' => null,
|
||||
'green' => 'text-green-800',
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Bordered side colors.
|
||||
*
|
||||
* @return array<string, string|null>
|
||||
*/
|
||||
public function borderedColors(Component $component): array
|
||||
{
|
||||
return [
|
||||
'black' => null,
|
||||
'primary' => null,
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\TallStackUi\Colors;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
/**
|
||||
* TallStackUI link colours, published from the package stub. The default
|
||||
* text-primary-500 has no dark variant and is below 4.5:1 on the dark
|
||||
* background. Null keeps the package default.
|
||||
*/
|
||||
class LinkColors
|
||||
{
|
||||
/**
|
||||
* Text colors.
|
||||
*
|
||||
* @return array<string, string|null>
|
||||
*/
|
||||
public function textColors(Component $component): array
|
||||
{
|
||||
return [
|
||||
'black' => null,
|
||||
'primary' => 'text-primary-600 dark:text-primary-300',
|
||||
'secondary' => null,
|
||||
'slate' => null,
|
||||
'gray' => null,
|
||||
'zinc' => null,
|
||||
'neutral' => null,
|
||||
'stone' => null,
|
||||
'red' => null,
|
||||
'orange' => null,
|
||||
'amber' => null,
|
||||
'yellow' => null,
|
||||
'lime' => null,
|
||||
'green' => null,
|
||||
'emerald' => null,
|
||||
'teal' => null,
|
||||
'cyan' => null,
|
||||
'sky' => null,
|
||||
'blue' => null,
|
||||
'indigo' => null,
|
||||
'violet' => null,
|
||||
'purple' => null,
|
||||
'fuchsia' => null,
|
||||
'pink' => null,
|
||||
'rose' => null,
|
||||
'mauve' => null,
|
||||
'olive' => null,
|
||||
'mist' => null,
|
||||
'taupe' => null,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user