Skip to content

Commit 294cd38

Browse files
committed
Update styling and color handling in card and column components for improved UI consistency
1 parent 03f2088 commit 294cd38

File tree

3 files changed

+36
-17
lines changed

3 files changed

+36
-17
lines changed

resources/views/livewire/card.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
<div
1212
@class([
13-
'mb-3 bg-white dark:bg-gray-900 rounded-lg shadow-sm border border-gray-200 dark:border-gray-800 overflow-hidden transition-all duration-200 hover:shadow-md',
13+
'mb-3 bg-white dark:bg-gray-900 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden transition-all duration-200 hover:shadow-md',
1414
'cursor-pointer' => $hasActions || $hasCardAction,
15-
'cursor-pointer transition-all duration-100 ease-in-out hover:shadow-lg hover:border-neutral-400 active:shadow-md' => $hasCardAction,
15+
'cursor-pointer transition-all duration-100 ease-in-out hover:shadow-lg hover:border-gray-400 active:shadow-md' => $hasCardAction,
1616
'cursor-grab hover:cursor-grabbing' => $hasPositionIdentifier,
1717
'cursor-default' => !$hasActions && !$hasCardAction && !$hasPositionIdentifier,
1818
])

resources/views/livewire/column.blade.php

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
@props(['columnId', 'column', 'config'])
22

33
@php
4-
use Filament\Support\Colors\Color;
5-
$colors = Color::all();
4+
use Filament\Support\Colors\Color;use Filament\Support\Facades\FilamentColor;
65
7-
if(filled($column['color'])) {
8-
$color = $colors[$column['color']] ?? Color::generateV3Palette($column['color']);
9-
}
10-
else {
11-
$color = $colors['neutral'];
6+
$filamentColors = FilamentColor::getColors();
7+
$nativeColor = null;
8+
9+
if(filled($column['color']) && isset($filamentColors[$column['color']])) {
10+
$nativeColor = $column['color'];
11+
}else{
12+
$color = Color::hex($column['color']);
1213
}
1314
@endphp
1415

@@ -20,13 +21,31 @@ class="w-[300px] min-w-[300px] flex-shrink-0 border border-gray-200 dark:border-
2021
<h3 class="text-sm font-medium text-gray-700 dark:text-gray-200">
2122
{{ $column['label'] }}
2223
</h3>
23-
<div
24-
style="background-color: {{ $color[500] }}; color: {{ $color[50] }};"
25-
@class([
26-
'ms-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium',
27-
])>
28-
{{ $column['total'] ?? (isset($column['items']) ? count($column['items']) : 0) }}
29-
</div>
24+
@if($nativeColor)
25+
<x-filament::badge
26+
tag="div"
27+
:color="$nativeColor"
28+
class="ms-2"
29+
>
30+
{{ $column['total'] ?? (isset($column['items']) ? count($column['items']) : 0) }}
31+
</x-filament::badge>
32+
@else
33+
<div
34+
@style([
35+
"--light-bg-color: $color[50]",
36+
"--light-text-color: $color[700]",
37+
"--dark-bg-color: $color[600]",
38+
"--dark-text-color: $color[300]",
39+
])
40+
@class([
41+
'ms-2 items-center border px-2 py-0.5 rounded-md text-xs font-semibold',
42+
"bg-[var(--light-bg-color)] dark:bg-[var(--dark-bg-color)]/20",
43+
"text-[var(--light-text-color)] dark:text-[var(--dark-text-color)]",
44+
'border-[var(--light-text-color)]/30 dark:border-[var(--dark-text-color)]/30',
45+
])>
46+
{{ $column['total'] ?? (isset($column['items']) ? count($column['items']) : 0) }}
47+
</div>
48+
@endif
3049
</div>
3150

3251

resources/views/livewire/empty-column.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@props(['pluralCardLabel'])
22

3-
<div class="p-3 flex flex-col items-center justify-center h-full min-h-[150px] rounded-lg border-2 border-dashed border-gray-200 dark:border-gray-800">
3+
<div class="p-3 flex flex-col items-center justify-center h-full min-h-[150px] rounded-lg border-2 border-dashed border-gray-200 dark:border-gray-700">
44
<x-filament::icon
55
icon="heroicon-o-archive-box"
66
class="w-10 h-10 text-gray-400 dark:text-gray-600 mb-2"

0 commit comments

Comments
 (0)