chore(Progress): define ProgressColor type

This commit is contained in:
Benjamin Canac
2024-02-15 11:58:10 +01:00
parent b11c773f32
commit db42d9cab7
2 changed files with 4 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ import type { PropType } from 'vue'
import { twJoin } from 'tailwind-merge'
import { useUI } from '../../composables/useUI'
import { mergeConfig } from '../../utils'
import type { Strategy, ProgressSize, ProgressAnimation } from '../../types'
import type { Strategy, ProgressSize, ProgressAnimation, ProgressColor } from '../../types'
// @ts-expect-error
import appConfig from '#build/app.config'
import { progress } from '#ui/ui.config'
@@ -65,7 +65,7 @@ export default defineComponent({
}
},
color: {
type: String,
type: String as PropType<ProgressColor>,
default: () => config.default.color,
validator (value: string) {
return appConfig.ui.colors.includes(value)

View File

@@ -1,4 +1,6 @@
import { progress } from '../ui.config'
import colors from '#ui-colors'
export type ProgressSize = keyof typeof progress.progress.size
export type ProgressAnimation = keyof typeof progress.animation
export type ProgressColor = typeof colors[number]