Skip to content

Commit ae70d35

Browse files
committed
feat: add UIKIT templates view
1 parent 95e1e3e commit ae70d35

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@if ($paginator->hasPages())
2+
@props(['darkMode' => false])
3+
4+
<div class="uk-flex uk-flex-between @if ($darkMode) uk-light @endif">
5+
{{-- Previous Page Link --}}
6+
@if ($paginator->onFirstPage())
7+
<button class="uk-button uk-button-small uk-button-default uk-margin-small-top uk-margin-small-right"
8+
disabled>
9+
{!! __('pagination.previous') !!}
10+
</button>
11+
@else
12+
<a class="uk-button uk-button-small uk-button-default uk-margin-small-top uk-margin-small-right"
13+
href="{{ $paginator->previousPageUrl() }}">
14+
{!! __('pagination.previous') !!}
15+
</a>
16+
@endif
17+
18+
{{-- Next Page Link --}}
19+
@if ($paginator->hasMorePages())
20+
<a class="uk-button uk-button-small uk-button-default uk-margin-small-top uk-margin-small-right"
21+
href="{{ $paginator->nextPageUrl() }}">
22+
{!! __('pagination.next') !!}
23+
</a>
24+
@else
25+
<button class="uk-button uk-button-small uk-button-default uk-margin-small-top uk-margin-small-right"
26+
disabled>
27+
{!! __('pagination.next') !!}
28+
</button>
29+
@endif
30+
</div>
31+
@endif

resources/views/uikit/uikit.blade.php

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
@if ($paginator->hasPages())
2+
@props(['darkMode' => false])
3+
4+
<div class="uk-flex uk-flex-wrap @if ($darkMode) uk-light @endif">
5+
{{-- Previous Page Link --}}
6+
@if ($paginator->onFirstPage())
7+
<button class="uk-button uk-button-small uk-button-default uk-width-auto@s uk-width-1-1 uk-margin-xsmall-right@s uk-margin-small-top uk-margin-xsmall-right"
8+
disabled>
9+
{!! __('pagination.previous') !!}
10+
</button>
11+
@else
12+
<a class="uk-button uk-button-small uk-button-default uk-width-auto@s uk-width-1-1 uk-margin-xsmall-right@s uk-margin-small-top uk-margin-xsmall-right"
13+
href="{{ $paginator->previousPageUrl() }}">
14+
{!! __('pagination.previous') !!}
15+
</a>
16+
@endif
17+
18+
{{-- Pagination Elements --}}
19+
@foreach ($elements as $element)
20+
{{-- "Three Dots" Separator --}}
21+
@if (is_string($element))
22+
<button class="uk-button uk-button-small uk-button-default uk-margin-xsmall-right uk-margin-small-top"
23+
disabled>
24+
{{ $element }}
25+
</button>
26+
@endif
27+
28+
{{-- Array Of Links --}}
29+
@if (is_array($element))
30+
@foreach ($element as $page => $url)
31+
@if ($page == $paginator->currentPage())
32+
<button
33+
class="uk-button uk-button-small uk-button-primary uk-margin-xsmall-right uk-margin-small-top">
34+
{{ $page }}
35+
</button>
36+
@else
37+
<a class="uk-button uk-button-small uk-button-default uk-margin-xsmall-right uk-margin-small-top"
38+
href="{{ $url }}">
39+
{{ $page }}
40+
</a>
41+
@endif
42+
@endforeach
43+
@endif
44+
@endforeach
45+
46+
{{-- Next Page Link --}}
47+
@if ($paginator->hasMorePages())
48+
<a class="uk-button uk-button-small uk-button-default uk-width-auto@s uk-width-1-1 uk-margin-xsmall-right@s uk-margin-small-top"
49+
href="{{ $paginator->nextPageUrl() }}">
50+
{!! __('pagination.next') !!}
51+
</a>
52+
@else
53+
<button class="uk-button uk-button-small uk-button-default uk-width-auto@s uk-width-1-1 uk-margin-xsmall-right@s uk-margin-small-top"
54+
disabled>
55+
{!! __('pagination.next') !!}
56+
</button>
57+
@endif
58+
</div>
59+
@endif

src/PaginationView.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,15 @@ public static function cirrusView(bool $darkMode = false): void
8181
{
8282
self::configureView('cirrus', $darkMode);
8383
}
84+
85+
/**
86+
* Indicates that UIKit styling should be used for generated links.
87+
*
88+
* @param bool $darkMode Whether to enable dark mode
89+
* @return void
90+
*/
91+
public static function uikitView(bool $darkMode = false): void
92+
{
93+
self::configureView('uikit', $darkMode);
94+
}
8495
}

0 commit comments

Comments
 (0)