feat(module): add support for vue using unplugin (#2416)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Daniel Roe
2024-10-25 16:15:26 +01:00
committed by GitHub
parent 50c6bf0092
commit d4a943e631
97 changed files with 18948 additions and 117 deletions

32
src/defaults.ts Normal file
View File

@@ -0,0 +1,32 @@
import icons from './theme/icons'
import { pick } from './runtime/utils'
export const getDefaultUiConfig = (colors?: string[]) => ({
colors: pick({
primary: 'green',
secondary: 'blue',
success: 'green',
info: 'blue',
warning: 'yellow',
error: 'red',
neutral: 'slate'
}, [...(colors || []), 'neutral' as any]),
icons
})
export const defaultOptions = {
prefix: 'U',
fonts: true,
colorMode: true,
theme: {
colors: undefined,
transitions: true
}
}
export const resolveColors = (colors?: string[]) => {
return colors?.length
? [...new Set(['primary', ...colors])]
: ['primary', 'secondary', 'success', 'info', 'warning', 'error']
}