Give the UI an indigo look with cards, status badges and empty states
- Dark indigo header and tinted page background; the mobile main menu gets its own row, in the same order as the keyboard reaches it. - Page titles with an icon chip (x-page-title, x-page, x-page-header) and card sections (x-panel, the card utility); x-table styled as a card with an indigo header row in AppServiceProvider::styleTables(). - Job and task statuses, late work, unapproved hours and stock states as badges with icon and text (x-status-badge, x-jobs.status, x-jobs.task-status), never colour alone. - Empty lists as x-empty-state; dashboard quick link tiles, week hour bars and trend arrows; Kanban columns and task cards edged by status; calendar today column and bar accents; quick sale, reports and machine console restyled; signed-out pages show the app name. - Focus rings use the primary colour in both themes (white in the header). - Document the components in CLAUDE.md; test the status badges. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -289,7 +289,7 @@ new class extends Component
|
||||
|
||||
<div class="mx-auto max-w-6xl space-y-6 p-4 sm:p-6">
|
||||
<div class="space-y-2">
|
||||
<h1 class="text-2xl font-semibold">{{ __('sales.index.title') }}</h1>
|
||||
<x-page-title icon="receipt-percent">{{ __('sales.index.title') }}</x-page-title>
|
||||
<p>
|
||||
<x-button :href="route('sales.sell')" wire:navigate icon="plus" :text="__('sales.index.new_sale')" />
|
||||
</p>
|
||||
@@ -304,7 +304,7 @@ new class extends Component
|
||||
<p id="sales-status" tabindex="-1" role="status" aria-live="polite" class="text-sm font-medium focus:outline-none">{{ $statusMessage }}</p>
|
||||
|
||||
@if ($this->unclosedDays !== [])
|
||||
<div class="rounded-lg border border-amber-700 p-4 text-sm dark:border-amber-400">
|
||||
<div class="rounded-lg border border-amber-700 bg-amber-50 p-4 text-sm text-amber-950 dark:border-amber-400 dark:bg-amber-400/10 dark:text-amber-100">
|
||||
<p class="flex items-start gap-2">
|
||||
<x-icon name="exclamation-triangle" class="size-5 shrink-0" aria-hidden="true" />
|
||||
{{ __('sales.index.unclosed') }}
|
||||
@@ -422,7 +422,7 @@ new class extends Component
|
||||
@endcan
|
||||
|
||||
@if ($this->sales === [])
|
||||
<p class="text-sm">{{ __('sales.index.none') }}</p>
|
||||
<x-empty-state icon="shopping-cart">{{ __('sales.index.none') }}</x-empty-state>
|
||||
@else
|
||||
<x-table :headers="$this->headers()" :rows="$this->sales">
|
||||
@interact('column_time', $sale)
|
||||
@@ -463,7 +463,7 @@ new class extends Component
|
||||
href="{{ route('sales.receipt', $sale->id) }}"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="mr-2 inline-flex items-center gap-1 text-sm font-medium underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700"
|
||||
class="mr-2 inline-flex items-center gap-1 text-sm font-medium underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300"
|
||||
aria-label="{{ __('sales.receipt.open_named', ['number' => $sale->id]) }}"
|
||||
>
|
||||
<x-icon name="document-text" class="size-4" aria-hidden="true" />
|
||||
|
||||
@@ -327,7 +327,7 @@ new class extends Component
|
||||
<p>{{ $message }}</p>
|
||||
@if ($paidSaleId !== null)
|
||||
<p>
|
||||
<a href="{{ route('sales.receipt', $paidSaleId) }}" target="_blank" rel="noopener" class="inline-flex items-center gap-1 underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700">
|
||||
<a href="{{ route('sales.receipt', $paidSaleId) }}" target="_blank" rel="noopener" class="inline-flex items-center gap-1 underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300">
|
||||
<x-icon name="document-text" class="size-5" aria-hidden="true" />
|
||||
{{ __('sales.receipt.open', ['number' => $paidSaleId]) }}
|
||||
</a>
|
||||
@@ -336,7 +336,7 @@ new class extends Component
|
||||
</div>
|
||||
|
||||
@if ($this->orders === [])
|
||||
<p class="text-sm">{{ __('sales.orders.none') }}</p>
|
||||
<x-empty-state icon="shopping-cart">{{ __('sales.orders.none') }}</x-empty-state>
|
||||
@else
|
||||
<ul class="space-y-3">
|
||||
@foreach ($this->orders as $order)
|
||||
|
||||
@@ -477,7 +477,7 @@ new class extends Component
|
||||
|
||||
<div class="mx-auto max-w-lg space-y-6 p-4 sm:p-6">
|
||||
<div class="space-y-1">
|
||||
<h1 class="text-2xl font-semibold">{{ __('sales.sell.title') }}</h1>
|
||||
<x-page-title icon="shopping-cart">{{ __('sales.sell.title') }}</x-page-title>
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('sales.sell.intro') }}</p>
|
||||
<p class="text-sm">
|
||||
<x-link :href="route('sales.index')" navigate>{{ __('sales.sell.to_list') }}</x-link>
|
||||
@@ -503,7 +503,7 @@ new class extends Component
|
||||
href="{{ route('sales.receipt', $savedSaleId) }}"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="inline-flex items-center gap-1 font-medium underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700"
|
||||
class="inline-flex items-center gap-1 font-medium underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300"
|
||||
>
|
||||
<x-icon name="document-text" class="size-5" aria-hidden="true" />
|
||||
{{ __('sales.receipt.open', ['number' => $savedSaleId]) }}
|
||||
@@ -522,9 +522,9 @@ new class extends Component
|
||||
@enderror
|
||||
|
||||
@if ($this->products === [])
|
||||
<p class="text-sm">{{ __('sales.sell.no_products') }}</p>
|
||||
<x-empty-state icon="shopping-cart">{{ __('sales.sell.no_products') }}</x-empty-state>
|
||||
@else
|
||||
<section aria-labelledby="products-heading" class="space-y-3">
|
||||
<section aria-labelledby="products-heading" class="card space-y-3">
|
||||
<h2 id="products-heading" class="text-lg font-semibold">{{ __('sales.sell.products') }}</h2>
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('sales.sell.products_help') }}</p>
|
||||
|
||||
@@ -534,11 +534,11 @@ new class extends Component
|
||||
<button
|
||||
type="button"
|
||||
wire:click="addProduct({{ $product->id }})"
|
||||
class="flex h-full min-h-16 w-full flex-col items-start justify-center rounded-lg border border-zinc-400 bg-white px-3 py-2 text-left hover:bg-zinc-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:border-zinc-500 dark:bg-zinc-800 dark:hover:bg-zinc-700"
|
||||
class="flex h-full min-h-16 w-full flex-col items-start justify-center rounded-xl border border-zinc-400 bg-white px-3 py-2 text-left shadow-sm transition hover:border-primary-600 hover:bg-primary-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300 dark:border-zinc-500 dark:bg-zinc-800 dark:hover:border-primary-300 dark:hover:bg-primary-950"
|
||||
aria-label="{{ __('sales.sell.add_named', ['product' => $product->name, 'price' => $this->money($product->grossCents), 'unit' => __('catalog.units.'.$product->unit)]) }}"
|
||||
>
|
||||
<span class="font-medium break-words">{{ $product->name }}</span>
|
||||
<span class="text-sm text-zinc-700 dark:text-zinc-300">{{ $this->money($product->grossCents) }} / {{ __('catalog.units.'.$product->unit) }}</span>
|
||||
<span class="text-sm font-semibold text-primary-800 dark:text-primary-200">{{ $this->money($product->grossCents) }} / {{ __('catalog.units.'.$product->unit) }}</span>
|
||||
@if (in_array($product->id, $this->madeProductIds, true))
|
||||
<span class="inline-flex items-center gap-1 text-xs">
|
||||
<x-icon name="printer" class="size-4" aria-hidden="true" />
|
||||
@@ -551,7 +551,7 @@ new class extends Component
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section aria-labelledby="cart-heading" class="space-y-3">
|
||||
<section aria-labelledby="cart-heading" class="card space-y-3">
|
||||
<h2 id="cart-heading" tabindex="-1" class="text-lg font-semibold focus:outline-none">{{ __('sales.sell.cart') }}</h2>
|
||||
|
||||
<p role="status" aria-live="polite" class="sr-only">{{ $cartMessage }}</p>
|
||||
@@ -590,7 +590,7 @@ new class extends Component
|
||||
wire:change="setQuantity({{ $product->id }}, $event.target.value)"
|
||||
wire:keydown.enter.prevent="setQuantity({{ $product->id }}, $event.target.value)"
|
||||
aria-label="{{ __('sales.sell.quantity_named', ['product' => $product->name]) }}"
|
||||
class="h-9 w-14 rounded-md border border-zinc-500 bg-white px-2 text-center font-medium text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:border-zinc-400 dark:bg-zinc-900 dark:text-zinc-100"
|
||||
class="h-9 w-14 rounded-md border border-zinc-500 bg-white px-2 text-center font-medium text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300 dark:border-zinc-400 dark:bg-zinc-900 dark:text-zinc-100"
|
||||
/>
|
||||
<x-button wire:click="addProduct({{ $product->id }})" subtle color="black" sm icon="plus" :aria-label="__('sales.sell.increase_named', ['product' => $product->name])" />
|
||||
<x-button wire:click="removeProduct({{ $product->id }})" subtle color="black" sm icon="trash" :aria-label="__('sales.sell.remove_named', ['product' => $product->name])" />
|
||||
@@ -600,14 +600,14 @@ new class extends Component
|
||||
</ul>
|
||||
@endif
|
||||
|
||||
<p class="text-lg font-semibold">
|
||||
<p class="flex items-center justify-between gap-2 rounded-lg bg-primary-50 px-3 py-2 text-lg font-semibold text-primary-900 dark:bg-primary-950 dark:text-primary-100">
|
||||
{{ __('sales.sell.total', ['total' => $this->money($this->totalCents)]) }}
|
||||
</p>
|
||||
</section>
|
||||
|
||||
@php($isOrder = $this->isOrder() || $editingOrderId !== null)
|
||||
|
||||
<form wire:submit="save" class="space-y-6" novalidate>
|
||||
<form wire:submit="save" class="card space-y-6" novalidate>
|
||||
@if ($editingOrderId !== null)
|
||||
<div class="flex flex-wrap items-center gap-3 rounded-lg border border-zinc-400 p-3 text-sm dark:border-zinc-500">
|
||||
<x-icon name="pencil" class="size-5 shrink-0" aria-hidden="true" />
|
||||
@@ -669,7 +669,7 @@ new class extends Component
|
||||
<button
|
||||
type="button"
|
||||
wire:click="selectCustomer({{ $customer->id }})"
|
||||
class="w-full rounded-md px-3 py-2 text-left text-sm hover:bg-zinc-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-700 dark:hover:bg-zinc-700"
|
||||
class="w-full rounded-md px-3 py-2 text-left text-sm hover:bg-zinc-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300 dark:hover:bg-zinc-700"
|
||||
aria-label="{{ __('sales.sell.choose_customer', ['name' => $customer->name]) }}"
|
||||
>
|
||||
<span class="font-medium">{{ $customer->name }}</span>
|
||||
|
||||
Reference in New Issue
Block a user