From 2467f9de9af949023f5b38c7ebfce67ce9703736 Mon Sep 17 00:00:00 2001 From: Yurij Finiv Date: Mon, 28 Sep 2026 22:28:57 +0300 Subject: [PATCH 1/6] Expand Dropdown content customization API --- src/Components/Dropdown.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/Components/Dropdown.php b/src/Components/Dropdown.php index c489c45..6b7a43f 100644 --- a/src/Components/Dropdown.php +++ b/src/Components/Dropdown.php @@ -10,6 +10,10 @@ class Dropdown extends DaisyComponent public function __construct( public string $label = 'Menu', + public string $position = '', + public string $width = 'w-52', + public string $contentClass = '', + public bool $contentDefaults = true, public bool $hover = false, public bool $open = false, public bool $close = false, @@ -26,24 +30,31 @@ protected function viewClasses(): array { return [ 'trigger' => 'btn', - 'content' => 'dropdown-content menu bg-base-100 rounded-box z-10 mt-2 w-52 p-2 shadow-sm', + 'content' => $this->classes([ + 'dropdown-content', + 'menu bg-base-100 rounded-box z-10 mt-2 p-2 shadow-sm' => $this->contentDefaults, + $this->width => $this->width !== '', + $this->contentClass => $this->contentClass !== '', + ]), ]; } protected function componentClasses(array $data, ComponentAttributeBag $attributes): array { + $position = $this->position; + return [ 'dropdown', 'dropdown-hover' => $this->hover, 'dropdown-open' => $this->open, 'dropdown-close' => $this->close, - 'dropdown-start' => $this->start, - 'dropdown-center' => $this->center, - 'dropdown-end' => $this->end, - 'dropdown-top' => $this->top, - 'dropdown-bottom' => $this->bottom, - 'dropdown-left' => $this->left, - 'dropdown-right' => $this->right, + 'dropdown-start' => $this->start || $position === 'start', + 'dropdown-center' => $this->center || $position === 'center', + 'dropdown-end' => $this->end || $position === 'end', + 'dropdown-top' => $this->top || $position === 'top', + 'dropdown-bottom' => $this->bottom || $position === 'bottom', + 'dropdown-left' => $this->left || $position === 'left', + 'dropdown-right' => $this->right || $position === 'right', ]; } } From 17e7b0d3d961c1d63693d7e2a01741044f3d0862 Mon Sep 17 00:00:00 2001 From: Yurij Finiv Date: Mon, 28 Sep 2026 22:29:26 +0300 Subject: [PATCH 2/6] Cover expanded Dropdown API --- tests/Components/DaisyUiIntegrationTest.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/Components/DaisyUiIntegrationTest.php b/tests/Components/DaisyUiIntegrationTest.php index d8fc608..75f3fd1 100644 --- a/tests/Components/DaisyUiIntegrationTest.php +++ b/tests/Components/DaisyUiIntegrationTest.php @@ -520,3 +520,24 @@ ->assertSee('id="settings-drawer"', false) ->assertSee('for="settings-drawer"', false); }); + + +it('supports reusable dropdown positioning and content customization', function () { + $this + ->blade('Item') + ->assertSee('dropdown-end') + ->assertSee('w-56') + ->assertSee('max-h-96') + ->assertSee('overflow-y-auto') + ->assertSee('Language') + ->assertSee('Item'); + + $this + ->blade('Panel') + ->assertSee('dropdown-end') + ->assertSee('dropdown-content') + ->assertSee('w-80') + ->assertSee('bg-base-200') + ->assertSee('shadow-2xl') + ->assertDontSee('bg-base-100'); +}); From cd464d283f38d51ee53f7b4a772f5395d96189d2 Mon Sep 17 00:00:00 2001 From: Yurij Finiv Date: Mon, 28 Sep 2026 22:29:43 +0300 Subject: [PATCH 3/6] Add linked and hoverable Card API --- src/Components/Card.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Components/Card.php b/src/Components/Card.php index 3b39b1a..d828833 100644 --- a/src/Components/Card.php +++ b/src/Components/Card.php @@ -8,13 +8,28 @@ class Card extends DaisyComponent { protected const VIEW = 'lazy::card'; + public string $tag; + public function __construct( public string $title = '', public bool $bordered = false, public bool $compact = false, public bool $side = false, public bool $imageFull = false, - ) {} + public ?string $href = null, + public bool $hover = false, + ) { + $this->tag = $this->href === null ? 'div' : 'a'; + } + + protected function prepareAttributes(ComponentAttributeBag $attributes): ComponentAttributeBag + { + if ($this->href !== null) { + $attributes['href'] = $this->href; + } + + return $attributes; + } protected function viewClasses(): array { @@ -33,6 +48,7 @@ protected function componentClasses(array $data, ComponentAttributeBag $attribut 'card-sm' => $this->compact, 'card-side' => $this->side, 'image-full' => $this->imageFull, + 'transition hover:shadow-md' => $this->hover || $this->href !== null, ]; } } From 7badcdb9176025294e30a095d353b8e59539cf5c Mon Sep 17 00:00:00 2001 From: Yurij Finiv Date: Mon, 28 Sep 2026 22:29:48 +0300 Subject: [PATCH 4/6] Render Card as link when href is provided --- resources/views/card.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/card.blade.php b/resources/views/card.blade.php index 47b344e..cb75624 100644 --- a/resources/views/card.blade.php +++ b/resources/views/card.blade.php @@ -1,8 +1,8 @@ -
+<{{ $tag }} {{ $attributes }}> @isset($figure)
{{ $figure }}
@endisset
@if ($title)

{{ $title }}

@endif {{ $slot }} @isset($actions)
{{ $actions }}
@endisset
-
+ From 399db670a821daf8d028523ccb1e8d645695358c Mon Sep 17 00:00:00 2001 From: Yurij Finiv Date: Mon, 28 Sep 2026 22:29:58 +0300 Subject: [PATCH 5/6] Cover linked Card API --- tests/Components/DaisyUiIntegrationTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Components/DaisyUiIntegrationTest.php b/tests/Components/DaisyUiIntegrationTest.php index 75f3fd1..6175147 100644 --- a/tests/Components/DaisyUiIntegrationTest.php +++ b/tests/Components/DaisyUiIntegrationTest.php @@ -541,3 +541,15 @@ ->assertSee('shadow-2xl') ->assertDontSee('bg-base-100'); }); + + +it('supports linked and hoverable cards for admin navigation', function () { + $this + ->blade('42') + ->assertSee('assertSee('href="/admin/users"', false) + ->assertSee('hover:shadow-md', false) + ->assertSee('card-title') + ->assertSee('Users') + ->assertSee('42'); +}); From 9a93991e20e4560bd611fe12f08e96de97130edf Mon Sep 17 00:00:00 2001 From: CrazyBoy49z <3448603+CrazyBoy49z@users.noreply.github.com> Date: Mon, 28 Sep 2026 19:30:22 +0000 Subject: [PATCH 6/6] Fix styling --- tests/Components/DaisyUiIntegrationTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/Components/DaisyUiIntegrationTest.php b/tests/Components/DaisyUiIntegrationTest.php index 6175147..6b90a12 100644 --- a/tests/Components/DaisyUiIntegrationTest.php +++ b/tests/Components/DaisyUiIntegrationTest.php @@ -521,7 +521,6 @@ ->assertSee('for="settings-drawer"', false); }); - it('supports reusable dropdown positioning and content customization', function () { $this ->blade('Item') @@ -542,7 +541,6 @@ ->assertDontSee('bg-base-100'); }); - it('supports linked and hoverable cards for admin navigation', function () { $this ->blade('42')