chore(Dropdown): improve preset

This commit is contained in:
Benjamin Canac
2023-05-09 17:58:07 +02:00
parent 939efba47c
commit 530d8a8c27
2 changed files with 5 additions and 2 deletions

View File

@@ -167,7 +167,10 @@ const dropdown = {
divide: 'divide-y divide-gray-200 dark:divide-gray-700',
spacing: 'p-1',
item: {
base: 'group flex items-center gap-2 px-2 py-1.5 text-sm w-full rounded-md',
base: 'group flex items-center gap-2 w-full',
rounded: 'rounded-md',
spacing: 'px-2 py-1.5',
size: 'text-sm',
active: 'bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-white',
inactive: 'text-gray-700 dark:text-gray-200',
disabled: 'cursor-not-allowed opacity-50',

View File

@@ -23,7 +23,7 @@
<Component
v-bind="omit(item, ['click'])"
:is="(item.to && NuxtLink) || (item.click && 'button') || 'div'"
:class="[ui.item.base, active ? ui.item.active : ui.item.inactive, itemDisabled && ui.item.disabled]"
:class="[ui.item.base, ui.item.spacing, ui.item.size, ui.item.rounded, active ? ui.item.active : ui.item.inactive, itemDisabled && ui.item.disabled]"
@click="item.click"
>
<slot :name="item.slot || 'item'" :item="item">