diff --git a/src/module.ts b/src/module.ts index 85826ebe4b..421ce38968 100644 --- a/src/module.ts +++ b/src/module.ts @@ -4,7 +4,7 @@ import { iconsPlugin, getIconCollections } from '@egoist/tailwindcss-icons' import { defu } from 'defu' import { name, version } from '../package.json' import { colorsAsRegex, excludeColors } from './runtime/utils/colors' -import { ui as preset } from './preset' +import appConfig from './runtime/app.config' import type { DeepPartial } from './runtime/types' // @ts-ignore @@ -24,7 +24,7 @@ declare module 'nuxt/schema' { primary?: string gray?: string colors?: string[] - } & DeepPartial + } & DeepPartial } } @@ -65,7 +65,11 @@ export default defineNuxtModule({ nuxt.options.css.push(resolve(runtimeDir, 'ui.css')) - nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui, preset) + nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui, appConfig.ui) + + nuxt.hook('app:resolve', (app) => { + app.configs.push(resolve(runtimeDir, 'app.config')) + }) // @ts-ignore nuxt.hook('tailwindcss:config', function (tailwindConfig: TailwindConfig) { diff --git a/src/preset.ts b/src/runtime/app.config.ts similarity index 98% rename from src/preset.ts rename to src/runtime/app.config.ts index fc8168c012..16ed74f34e 100644 --- a/src/preset.ts +++ b/src/runtime/app.config.ts @@ -677,30 +677,32 @@ const notifications = { container: 'px-4 sm:px-6 py-6 space-y-3 overflow-y-auto' } -export const ui = { - avatar, - avatarGroup, - badge, - button, - buttonGroup, - dropdown, - input, - inputGroup, - textarea, - select, - selectMenu, - checkbox, - radio, - toggle, - card, - container, - verticalNavigation, - commandPalette, - modal, - slideover, - popover, - tooltip, - contextMenu, - notification, - notifications +export default { + ui: { + avatar, + avatarGroup, + badge, + button, + buttonGroup, + dropdown, + input, + inputGroup, + textarea, + select, + selectMenu, + checkbox, + radio, + toggle, + card, + container, + verticalNavigation, + commandPalette, + modal, + slideover, + popover, + tooltip, + contextMenu, + notification, + notifications + } }