From 2aa4358d328e7c8e1a1dca718acad391a09280fc Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Fri, 23 Aug 2024 18:39:15 +0200 Subject: [PATCH] fix(InputMenu/Select/SelectMenu): use `defuFn` to override base slot --- src/theme/input-menu.ts | 6 +++--- src/theme/select.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/theme/input-menu.ts b/src/theme/input-menu.ts index a614c749..b2e18f97 100644 --- a/src/theme/input-menu.ts +++ b/src/theme/input-menu.ts @@ -1,9 +1,9 @@ -import { defu } from 'defu' +import { defuFn } from 'defu' import type { ModuleOptions } from '../module' import input from './input' export default (options: Required) => { - return defu({ + return defuFn({ slots: { arrow: 'fill-gray-200 dark:fill-gray-800', content: 'max-h-60 w-[--radix-popper-anchor-width] bg-white dark:bg-gray-900 shadow-lg rounded-md ring ring-gray-200 dark:ring-gray-800 overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]', @@ -29,7 +29,7 @@ export default (options: Required) => { } }, { slots: { - base: ['rounded-md', options.transitions && 'transition-colors'], + base: () => ['rounded-md', options.transitions && 'transition-colors'], trailing: 'absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75' }, variants: { diff --git a/src/theme/select.ts b/src/theme/select.ts index a337e7b6..a953a836 100644 --- a/src/theme/select.ts +++ b/src/theme/select.ts @@ -1,10 +1,10 @@ -import { defu } from 'defu' +import { defuFn } from 'defu' import type { ModuleOptions } from '../module' import input from './input' import { buttonGroupVariant } from './button-group' export default (options: Required) => { - return defu({ + return defuFn({ slots: { arrow: 'fill-gray-200 dark:fill-gray-800', content: 'max-h-60 w-[--radix-popper-anchor-width] bg-white dark:bg-gray-900 shadow-lg rounded-md ring ring-gray-200 dark:ring-gray-800 overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]', @@ -74,7 +74,7 @@ export default (options: Required) => { } }, { slots: { - base: ['relative group rounded-md inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75', options.transitions && 'transition-colors'], + base: () => ['relative group rounded-md inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75', options.transitions && 'transition-colors'], value: 'truncate group-data-placeholder:text-current/50' }, variants: {