Darken the dark canvas, add customer colours, the ongoing status and the board model
- Dark theme page background is #5a5e60; text on it is lifted to zinc-200 / primary-100 and TallStackUI's dark labels, hints and checkbox labels are lightened so everything stays at 4.5:1. - Shared HexColor picks white or black text by the higher WCAG contrast; a native-dialog colour picker and a large work dialog component. - Customers get a header colour (customers.header_color), set on the customer page. - New job status Jatkuvat / Kausi (ongoing): open, never late, billed monthly like running jobs. - Kanban model: board columns and views, urgent threshold, per-user board preferences (density, column colours and sort), card positions, tasks of continuing jobs pinned to the board, MoveBoardCard and board queries with logged hours from TimeTracking. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
])
|
||||
|
||||
@if ($workTypes === [])
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('catalog.no_work_types') }}</p>
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-100">{{ __('catalog.no_work_types') }}</p>
|
||||
@else
|
||||
<ul class="divide-y divide-zinc-200 dark:divide-zinc-700">
|
||||
@foreach ($workTypes as $workType)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<legend class="text-sm font-semibold text-gray-700 dark:text-dark-300">{{ $legend }}</legend>
|
||||
|
||||
@if ($hint !== null)
|
||||
<p id="{{ $id }}-hint" class="text-sm text-zinc-600 dark:text-zinc-300">{{ $hint }}</p>
|
||||
<p id="{{ $id }}-hint" class="text-sm text-zinc-600 dark:text-zinc-200">{{ $hint }}</p>
|
||||
@endif
|
||||
|
||||
<div @class(['grid gap-2', 'sm:grid-cols-2 lg:grid-cols-3' => $columns])>
|
||||
@@ -40,7 +40,7 @@
|
||||
<span>
|
||||
{{ $option['label'] }}
|
||||
@if (($option['note'] ?? null) !== null)
|
||||
<span class="text-zinc-600 dark:text-zinc-300">({{ $option['note'] }})</span>
|
||||
<span class="text-zinc-600 dark:text-zinc-200">({{ $option['note'] }})</span>
|
||||
@endif
|
||||
</span>
|
||||
</label>
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
{{--
|
||||
One colour picker dialog per page (native <dialog> + showModal(), like
|
||||
<x-confirm-dialog>): quick colours, the browser's colour input and R/G/B
|
||||
fields 0–255 kept in step. Any button opens it with
|
||||
|
||||
x-on:click="$dispatch('color-picker:open', { id: 'colour-picker', title: '…', color: '#1d4ed8', method: 'setColumnColor', args: ['order'] })"
|
||||
|
||||
"Use colour" calls the Livewire method with the args and the chosen
|
||||
#rrggbb; "Restore default colour" (when `resettable` is true in the
|
||||
event) calls it with null. Closing returns focus to the opening button.
|
||||
--}}
|
||||
@props([
|
||||
'id' => 'colour-picker',
|
||||
'presets' => ['#1d4ed8', '#23476a', '#0f5c63', '#14532d', '#047857', '#3b2d5e', '#7c2d2d', '#b91c1c', '#9a3412', '#78350f', '#b45309', '#374151'],
|
||||
])
|
||||
|
||||
<dialog
|
||||
id="{{ $id }}"
|
||||
aria-labelledby="{{ $id }}-title"
|
||||
wire:ignore
|
||||
x-data="{
|
||||
title: '',
|
||||
hex: '#1d4ed8',
|
||||
r: 29, g: 78, b: 216,
|
||||
method: null,
|
||||
args: [],
|
||||
resettable: false,
|
||||
open(detail) {
|
||||
if (detail.id !== '{{ $id }}') { return; }
|
||||
this.title = detail.title ?? '';
|
||||
this.method = detail.method;
|
||||
this.args = detail.args ?? [];
|
||||
this.resettable = detail.resettable ?? false;
|
||||
this.setHex(detail.color ?? '#1d4ed8');
|
||||
this.$el.showModal();
|
||||
},
|
||||
setHex(value) {
|
||||
if (! /^#[0-9a-fA-F]{6}$/.test(value)) { return; }
|
||||
this.hex = value.toLowerCase();
|
||||
const n = parseInt(this.hex.slice(1), 16);
|
||||
this.r = (n >> 16) & 255; this.g = (n >> 8) & 255; this.b = n & 255;
|
||||
},
|
||||
fromRgb() {
|
||||
const c = (v) => Math.max(0, Math.min(255, Math.round(Number(v) || 0))).toString(16).padStart(2, '0');
|
||||
this.hex = '#' + c(this.r) + c(this.g) + c(this.b);
|
||||
},
|
||||
apply(color) {
|
||||
if (this.method) { $wire.call(this.method, ...this.args, color); }
|
||||
this.$el.close();
|
||||
},
|
||||
}"
|
||||
x-on:color-picker:open.window="open($event.detail)"
|
||||
class="m-auto w-[calc(100%-2rem)] max-w-xs rounded-xl border border-neutral-300 bg-white p-4 text-neutral-900 shadow-2xl backdrop:bg-black/60 dark:border-[#3e4249] dark:bg-[#282a2e] dark:text-neutral-100"
|
||||
>
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<h2 id="{{ $id }}-title" class="text-sm font-bold" x-text="title"></h2>
|
||||
<button
|
||||
type="button"
|
||||
x-on:click="$el.closest('dialog').close()"
|
||||
aria-label="{{ __('layout.close') }}"
|
||||
class="inline-flex size-7 items-center justify-center rounded-md text-neutral-600 hover:bg-neutral-100 focus-visible:outline-2 focus-visible:outline-primary-600 dark:text-neutral-200 dark:hover:bg-white/10 dark:focus-visible:outline-primary-300"
|
||||
>
|
||||
<x-icon name="x-mark" class="size-4" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<fieldset class="mt-3">
|
||||
<legend class="mb-1.5 text-xs font-medium text-neutral-700 dark:text-neutral-200">{{ __('layout.color_picker.presets') }}</legend>
|
||||
<div class="grid grid-cols-6 gap-1.5">
|
||||
@foreach ($presets as $preset)
|
||||
<button
|
||||
type="button"
|
||||
x-on:click="setHex('{{ $preset }}')"
|
||||
x-bind:aria-pressed="(hex === '{{ $preset }}').toString()"
|
||||
aria-label="{{ __('layout.color_picker.preset', ['color' => $preset]) }}"
|
||||
style="background-color: {{ $preset }}"
|
||||
class="h-7 w-full rounded-md border border-black/40 transition hover:scale-105 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 aria-pressed:ring-2 aria-pressed:ring-neutral-900 aria-pressed:ring-offset-1 dark:border-white/40 dark:focus-visible:outline-primary-300 dark:aria-pressed:ring-white dark:aria-pressed:ring-offset-[#282a2e]"
|
||||
></button>
|
||||
@endforeach
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="mt-3 space-y-2.5 border-t border-neutral-200 pt-3 dark:border-[#36393f]">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<label for="{{ $id }}-native" class="text-xs font-medium text-neutral-700 dark:text-neutral-200">{{ __('layout.color_picker.free') }}</label>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="font-mono text-xs uppercase text-neutral-700 dark:text-neutral-200" x-text="hex"></span>
|
||||
<input
|
||||
type="color"
|
||||
id="{{ $id }}-native"
|
||||
x-bind:value="hex"
|
||||
x-on:input="setHex($event.target.value)"
|
||||
class="h-8 w-9 cursor-pointer rounded border border-neutral-400 bg-transparent p-0 dark:border-[#6b7079]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-3 gap-2">
|
||||
@foreach (['r' => 'red', 'g' => 'green', 'b' => 'blue'] as $channel => $key)
|
||||
<div>
|
||||
<label for="{{ $id }}-{{ $channel }}" class="mb-0.5 block text-[11px] font-bold text-neutral-700 dark:text-neutral-200">{{ __('layout.color_picker.'.$key) }}</label>
|
||||
<input
|
||||
type="number"
|
||||
id="{{ $id }}-{{ $channel }}"
|
||||
min="0"
|
||||
max="255"
|
||||
x-model.number="{{ $channel }}"
|
||||
x-on:input="fromRgb()"
|
||||
class="w-full rounded-md border border-neutral-400 bg-neutral-50 px-2 py-1 font-mono text-xs text-neutral-900 dark:border-[#6b7079] dark:bg-[#18191b] dark:text-white"
|
||||
/>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<p class="flex items-center gap-2 text-xs text-neutral-700 dark:text-neutral-200">
|
||||
<span>{{ __('layout.color_picker.preview') }}:</span>
|
||||
<span class="inline-block h-5 w-12 rounded border border-black/40 dark:border-white/40" x-bind:style="'background-color: ' + hex" aria-hidden="true"></span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 flex flex-wrap justify-end gap-2">
|
||||
<x-button
|
||||
x-show="resettable"
|
||||
x-cloak
|
||||
subtle
|
||||
color="black"
|
||||
sm
|
||||
:text="__('layout.color_picker.reset')"
|
||||
x-on:click="apply(null)"
|
||||
/>
|
||||
<x-button subtle color="black" sm :text="__('layout.cancel')" x-on:click="$el.closest('dialog').close()" />
|
||||
<x-button sm :text="__('layout.color_picker.apply')" x-on:click="apply(hex)" />
|
||||
</div>
|
||||
</dialog>
|
||||
@@ -44,7 +44,7 @@
|
||||
@enderror
|
||||
|
||||
@if (mb_strlen(trim($search)) >= 2)
|
||||
<p role="status" aria-live="polite" class="text-sm text-zinc-600 dark:text-zinc-300">
|
||||
<p role="status" aria-live="polite" class="text-sm text-zinc-600 dark:text-zinc-200">
|
||||
{{ trans_choice('jobs.customer_picker.results', count($results), ['count' => count($results)]) }}
|
||||
</p>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
>
|
||||
<span class="font-medium">{{ $customer->name }}</span>
|
||||
@if ($customer->businessId !== null)
|
||||
<span class="text-zinc-600 dark:text-zinc-300">{{ $customer->businessId }}</span>
|
||||
<span class="text-zinc-600 dark:text-zinc-200">{{ $customer->businessId }}</span>
|
||||
@endif
|
||||
</button>
|
||||
</li>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
@else
|
||||
@php
|
||||
$isLate = \Carbon\CarbonImmutable::parse($date)->endOfDay()->isPast()
|
||||
&& ! in_array($status->value, ['done', 'invoiced', 'billed', 'archived'], true);
|
||||
&& ! in_array($status->value, ['done', 'invoiced', 'billed', 'ongoing', 'archived'], true);
|
||||
@endphp
|
||||
|
||||
<span {{ $attributes->class('inline-flex flex-wrap items-center gap-1') }}>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
'done' => ['success', 'check-circle'],
|
||||
'invoiced' => ['info', 'document-currency-euro'],
|
||||
'billed' => ['success', 'banknotes'],
|
||||
'ongoing' => ['primary', 'arrow-path'],
|
||||
'archived' => ['neutral', 'archive-box'],
|
||||
default => ['neutral', null],
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<a
|
||||
href="{{ $back }}"
|
||||
wire:navigate
|
||||
class="inline-flex min-h-6 items-center gap-1 rounded-md text-sm font-medium text-primary-700 underline-offset-4 hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:text-primary-300 dark:focus-visible:outline-primary-300"
|
||||
class="inline-flex min-h-6 items-center gap-1 rounded-md text-sm font-medium text-primary-700 underline-offset-4 hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:text-primary-100 dark:focus-visible:outline-primary-300"
|
||||
>
|
||||
<x-icon name="arrow-left" class="size-4" aria-hidden="true" />
|
||||
{{ $backLabel }}
|
||||
@@ -34,7 +34,7 @@
|
||||
</h1>
|
||||
|
||||
@if ($description !== null)
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ $description }}</p>
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-100">{{ $description }}</p>
|
||||
@endif
|
||||
|
||||
{{ $slot }}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
x-on:click="shown = ! shown"
|
||||
x-bind:aria-pressed="shown ? 'true' : 'false'"
|
||||
aria-label="{{ __('auth.show_password') }}"
|
||||
class="flex size-8 items-center justify-center rounded-md text-zinc-600 hover:text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300 dark:text-zinc-300 dark:hover:text-white"
|
||||
class="flex size-8 items-center justify-center rounded-md text-zinc-600 hover:text-zinc-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300 dark:text-zinc-200 dark:hover:text-white"
|
||||
>
|
||||
<x-icon name="eye" class="size-5" x-show="! shown" aria-hidden="true" />
|
||||
<x-icon name="eye-slash" class="size-5" x-show="shown" x-cloak aria-hidden="true" />
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<figure {{ $attributes->class('space-y-2') }}>
|
||||
<figcaption class="text-base font-semibold">
|
||||
{{ $title }}
|
||||
<span class="block text-sm font-normal text-zinc-600 dark:text-zinc-300">{{ __('reports.chart_note') }}</span>
|
||||
<span class="block text-sm font-normal text-zinc-600 dark:text-zinc-200">{{ __('reports.chart_note') }}</span>
|
||||
</figcaption>
|
||||
|
||||
@if ($values === [] || max(array_map('abs', $values)) == 0)
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
|
||||
@php
|
||||
$colours = match ($tone) {
|
||||
'primary' => 'bg-primary-50 text-primary-800 ring-primary-600/30 dark:bg-primary-400/15 dark:text-primary-200 dark:ring-primary-300/30',
|
||||
'info' => 'bg-sky-50 text-sky-800 ring-sky-600/30 dark:bg-sky-400/15 dark:text-sky-200 dark:ring-sky-300/30',
|
||||
'success' => 'bg-emerald-50 text-emerald-800 ring-emerald-600/30 dark:bg-emerald-400/15 dark:text-emerald-200 dark:ring-emerald-300/30',
|
||||
'warning' => 'bg-amber-50 text-amber-900 ring-amber-600/40 dark:bg-amber-400/15 dark:text-amber-200 dark:ring-amber-300/30',
|
||||
'danger' => 'bg-red-50 text-red-800 ring-red-600/30 dark:bg-red-400/15 dark:text-red-200 dark:ring-red-300/30',
|
||||
'violet' => 'bg-violet-50 text-violet-800 ring-violet-600/30 dark:bg-violet-400/15 dark:text-violet-200 dark:ring-violet-300/30',
|
||||
default => 'bg-zinc-100 text-zinc-800 ring-zinc-500/30 dark:bg-zinc-400/15 dark:text-zinc-200 dark:ring-zinc-300/30',
|
||||
'primary' => 'bg-primary-50 text-primary-800 ring-primary-600/30 dark:bg-primary-400/15 dark:text-primary-100 dark:ring-primary-300/30',
|
||||
'info' => 'bg-sky-50 text-sky-800 ring-sky-600/30 dark:bg-sky-400/15 dark:text-sky-100 dark:ring-sky-300/30',
|
||||
'success' => 'bg-emerald-50 text-emerald-800 ring-emerald-600/30 dark:bg-emerald-400/15 dark:text-emerald-100 dark:ring-emerald-300/30',
|
||||
'warning' => 'bg-amber-50 text-amber-900 ring-amber-600/40 dark:bg-amber-400/15 dark:text-amber-100 dark:ring-amber-300/30',
|
||||
'danger' => 'bg-red-50 text-red-800 ring-red-600/30 dark:bg-red-400/15 dark:text-red-100 dark:ring-red-300/30',
|
||||
'violet' => 'bg-violet-50 text-violet-800 ring-violet-600/30 dark:bg-violet-400/15 dark:text-violet-100 dark:ring-violet-300/30',
|
||||
default => 'bg-zinc-100 text-zinc-800 ring-zinc-500/30 dark:bg-zinc-400/15 dark:text-zinc-100 dark:ring-zinc-300/30',
|
||||
};
|
||||
@endphp
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
x-on:click="select(@js($key))"
|
||||
x-bind:class="selected === @js($key)
|
||||
? 'border-primary-700 font-semibold text-zinc-900 dark:border-primary-400 dark:text-white'
|
||||
: 'border-transparent text-zinc-700 hover:border-zinc-400 dark:text-zinc-300'"
|
||||
: 'border-transparent text-zinc-700 hover:border-zinc-400 dark:text-zinc-200'"
|
||||
class="-mb-px min-h-6 rounded-t-md border-b-2 px-1 py-2 text-left text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 dark:focus-visible:outline-primary-300"
|
||||
>{{ $title }}</button>
|
||||
@endforeach
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
{{--
|
||||
A large modal work area on the native <dialog> element (see
|
||||
<x-confirm-dialog> for why not <x-modal />): focus moves in, Escape
|
||||
closes it and closing returns focus to the opening button.
|
||||
|
||||
Slots: `header` (replaces the plain title bar, must contain an element
|
||||
with id "<id>-title"), the default slot (scrolling body) and `footer`.
|
||||
Open it with document.getElementById('<id>').showModal(), from Livewire
|
||||
with $this->js(...). `locked` (an Alpine expression) keeps it open while
|
||||
true, e.g. while a timer runs: Escape and the close button do nothing.
|
||||
--}}
|
||||
@props([
|
||||
'id',
|
||||
'title' => null,
|
||||
'width' => 'max-w-5xl',
|
||||
'locked' => 'false',
|
||||
])
|
||||
|
||||
<dialog
|
||||
id="{{ $id }}"
|
||||
aria-labelledby="{{ $id }}-title"
|
||||
wire:ignore.self
|
||||
x-data="{ get isLocked() { return {{ $locked }}; } }"
|
||||
x-on:cancel="if (isLocked) { $event.preventDefault(); }"
|
||||
{{ $attributes->class(['m-auto w-[calc(100%-1rem)] rounded-2xl border border-neutral-300 bg-white p-0 text-neutral-900 shadow-2xl backdrop:bg-black/70 dark:border-[#3e4249] dark:bg-[#222427] dark:text-neutral-100', $width]) }}
|
||||
>
|
||||
<div class="flex max-h-[92vh] flex-col">
|
||||
@isset($header)
|
||||
{{ $header }}
|
||||
@else
|
||||
<div class="flex shrink-0 items-center justify-between gap-3 border-b border-neutral-200 px-5 py-3 dark:border-[#36393f]">
|
||||
<h2 id="{{ $id }}-title" class="text-base font-bold">{{ $title }}</h2>
|
||||
<button
|
||||
type="button"
|
||||
x-on:click="if (! isLocked) { $el.closest('dialog').close(); }"
|
||||
x-bind:disabled="isLocked"
|
||||
aria-label="{{ __('layout.close') }}"
|
||||
class="inline-flex size-8 items-center justify-center rounded-lg text-neutral-600 hover:bg-neutral-100 focus-visible:outline-2 focus-visible:outline-primary-600 disabled:opacity-40 dark:text-neutral-200 dark:hover:bg-white/10 dark:focus-visible:outline-primary-300"
|
||||
>
|
||||
<x-icon name="x-mark" class="size-5" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
@endisset
|
||||
|
||||
<div class="flex-1 overflow-y-auto">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
|
||||
@isset($footer)
|
||||
<div class="flex shrink-0 flex-wrap items-center justify-between gap-2 border-t border-neutral-200 bg-neutral-100 px-5 py-3 dark:border-[#36393f] dark:bg-[#18191b]">
|
||||
{{ $footer }}
|
||||
</div>
|
||||
@endisset
|
||||
</div>
|
||||
</dialog>
|
||||
Reference in New Issue
Block a user