chore(Range): export RangeColor type

This commit is contained in:
Benjamin Canac
2024-02-15 11:56:40 +01:00
parent c34df13e65
commit b11c773f32
2 changed files with 4 additions and 3 deletions

View File

@@ -26,11 +26,10 @@ import { twMerge, twJoin } from 'tailwind-merge'
import { useUI } from '../../composables/useUI'
import { useFormGroup } from '../../composables/useFormGroup'
import { mergeConfig } from '../../utils'
import type { RangeSize, Strategy } from '../../types'
import type { RangeSize, RangeColor, Strategy } from '../../types'
// @ts-expect-error
import appConfig from '#build/app.config'
import { range } from '#ui/ui.config'
import colors from '#ui-colors'
const config = mergeConfig<typeof range>(appConfig.ui.strategy, appConfig.ui.range, range)
@@ -73,7 +72,7 @@ export default defineComponent({
}
},
color: {
type: String as PropType<typeof colors[number]>,
type: String as PropType<RangeColor>,
default: () => config.default.color,
validator (value: string) {
return appConfig.ui.colors.includes(value)

View File

@@ -1,5 +1,7 @@
import { range } from '../ui.config'
import type { ExtractDeepKey } from '.'
import type { AppConfig } from 'nuxt/schema'
import colors from '#ui-colors'
export type RangeSize = keyof typeof range.size | ExtractDeepKey<AppConfig, ['ui', 'range', 'size']>
export type RangeColor = typeof colors[number]