mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-15 04:29:37 +01:00
chore(Progress): define ProgressColor type
This commit is contained in:
@@ -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)
|
||||
|
||||
2
src/runtime/types/progress.d.ts
vendored
2
src/runtime/types/progress.d.ts
vendored
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user