Skip to content

Commit

Permalink
Merge branch '1.x' of github.com:lara-zeus/list-group into 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Feb 14, 2024
2 parents 4cc4a78 + 292c5ff commit 8be8b52
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 71 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to `List Group` will be documented in this file

## 1.0.1 - 2024-02-12

### What's Changed

* fix if no items to list by @atmonshi in https://github.com/lara-zeus/list-group/pull/2

**Full Changelog**: https://github.com/lara-zeus/list-group/compare/1.0.0...1.0.1

## 1.0.0 - 2024-1-11

### What's Changed
Expand Down
146 changes: 75 additions & 71 deletions resources/views/infolists/list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,89 +3,93 @@
$isGrouped = $isGrouped();
$isList = $isList();
$heading = $getHeading();
$getState = $getState();
@endphp

@if(filled($heading))
<h4 class="my-3">{{ $heading }}</h4>
@endif

<ul role="list"
@class([
'max-w-xs flex flex-col text-sm text-gray-600 dark:text-gray-400 ps-5 space-y-2 text-sm',
match (true) {
$isList => 'list-disc',
default => '',
},
])>
@foreach ($getState() as $item)
@if($item instanceof \LaraZeus\ListGroup\Item\ListItem)
<ul
role="list"
@class([
'max-w-xs flex flex-col text-sm text-gray-600 dark:text-gray-400 ps-5 space-y-2 text-sm',
match (true) {
$isList => 'list-disc',
default => '',
},
])
>
@if(filled($getState))
@foreach ($getState as $item)
@if($item instanceof \LaraZeus\ListGroup\Item\ListItem)
@php
$item = $item->toArray();
@endphp
@endif
@php
$item = $item->toArray();
$color = (isset($item['color']) && filled($item['color'])) ? $item['color'] : 'gray';
$iconColor = (isset($item['iconColor']) && filled($item['iconColor'])) ? $item['iconColor'] : 'gray';
@endphp
@endif
@php
$color = (isset($item['color']) && filled($item['color'])) ? $item['color'] : 'gray';
$iconColor = (isset($item['iconColor']) && filled($item['iconColor'])) ? $item['iconColor'] : 'gray';
@endphp
<li
@style([
\Filament\Support\get_color_css_variables(
$color,
shades: [400, 500, 600],
) => $color !== 'gray',
])
@class([
match ($color) {
'gray' => 'text-gray-600',
default => 'text-custom-600',
},
])
>
<a class="flex items-center space-x-2 rtl:space-x-reverse"
target="@if(isset($item['isNewTab']) && $item['isNewTab']) _blank @else _self @endif"

href="{{ $item['url'] }}"
<li
@style([
\Filament\Support\get_color_css_variables(
$color,
shades: [400, 500, 600],
) => $color !== 'gray',
])
@class([
match ($color) {
'gray' => 'text-gray-600',
default => 'text-custom-600',
},
])
>
@if(isset($item['icon']) && filled($item['icon']))
<span
@style([
\Filament\Support\get_color_css_variables(
$iconColor,
shades: [400, 500, 600],
) => $iconColor !== 'gray',
])
@class([
'',
match ($iconColor) {
'gray' => 'text-gray-800 dark:text-gray-500',
default => 'text-custom-800 dark:text-custom-500',
},
])
>
@svg($item['icon'],'flex-shrink-0 h-4 w-4')
</span>
@endif
<a
class="flex items-center space-x-2 rtl:space-x-reverse"
target="@if(isset($item['isNewTab']) && $item['isNewTab']) _blank @else _self @endif"
href="{{ $item['url'] }}"
>
@if(isset($item['icon']) && filled($item['icon']))
<span
@style([
\Filament\Support\get_color_css_variables(
$iconColor,
shades: [400, 500, 600],
) => $iconColor !== 'gray',
])
@class([
match ($iconColor) {
'gray' => 'text-gray-800 dark:text-gray-500',
default => 'text-custom-800 dark:text-custom-500',
},
])
>
@svg($item['icon'],'flex-shrink-0 h-4 w-4')
</span>
@endif

<span>
{{ $item['label'] }}
</span>
</a>
</li>
<span>
{{ $item['label'] }}
</span>
</a>
</li>

{{--todo coming soon ->grouped()--}}
{{--<a href="{{ $item['label'] }}" class="py-3 px-4 text-sm font-medium bg-white border border-gray-200 text-gray-800 -mt-px first:rounded-t-lg first:mt-0 last:rounded-b-lg dark:bg-gray-900 dark:border-gray-700 dark:text-white">
<span class="flex items-center gap-x-2">
@if($item['icon'] !== null)
<span class="h-5 w-5 flex justify-center items-center rounded-full bg-primary-50 text-primary-600 dark:bg-primary-500">
@svg($item['icon'],'flex-shrink-0 h-3 w-3')
{{--todo coming soon ->grouped()--}}
{{--<a href="{{ $item['label'] }}" class="py-3 px-4 text-sm font-medium bg-white border border-gray-200 text-gray-800 -mt-px first:rounded-t-lg first:mt-0 last:rounded-b-lg dark:bg-gray-900 dark:border-gray-700 dark:text-white">
<span class="flex items-center gap-x-2">
@if($item['icon'] !== null)
<span class="h-5 w-5 flex justify-center items-center rounded-full bg-primary-50 text-primary-600 dark:bg-primary-500">
@svg($item['icon'],'flex-shrink-0 h-3 w-3')
</span>
@endif
<span class="flex justify-between w-full">
Profile
<span class="py-0.5 px-1 rounded-full text-xs font-medium bg-primary-500 text-white">New</span>
</span>
@endif
<span class="flex justify-between w-full">
Profile
<span class="py-0.5 px-1 rounded-full text-xs font-medium bg-primary-500 text-white">New</span>
</span>
</span>
</a>--}}
@endforeach
</a>--}}
@endforeach
@endif
</ul>
</div>

0 comments on commit 8be8b52

Please sign in to comment.