Skip to content

Commit d06fd58

Browse files
committed
Mapped the sizes of the drop down
1 parent 0fd1d22 commit d06fd58

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

resources/views/components/dropdown/drop-down.blade.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
- trigger
88
--}}
99

10-
@props(['size' => null, 'dropDownWidth' => null, 'label' => '',])
10+
@props(['size' => 'lg', 'dropDownWidth' => null, 'label' => '',])
11+
12+
@php
13+
$sizes = [
14+
'full' => 'full',
15+
'sm' => 'w-48',
16+
'lg' => 'w-64'
17+
]
18+
@endphp
1119

1220
<div
1321
class="relative"
@@ -26,13 +34,7 @@ class="relative"
2634
</span>
2735

2836
<div
29-
{{ $attributes->class([
30-
'bg-white shadow-lg rounded absolute top-8 right-0 border text-left z-10',
31-
"w-".($dropDownWidth ? $dropDownWidth : ''),
32-
'w-full' => $size === 'full',
33-
'w-64' => !$size,
34-
'w-48' => $size === 'sm',
35-
])}}
37+
class="bg-white shadow-lg rounded absolute top-8 right-0 border text-left z-10 {{ isset($dropDownWidth) ? "w-$dropDownWidth" : '' }} {{ $sizes[$size] }}"
3638
x-show.transition="open"
3739
@click.away="open = false"
3840
x-cloak

0 commit comments

Comments
 (0)