Skip to content

Commit

Permalink
fix(types): take user app config into account
Browse files Browse the repository at this point in the history
Fixes #858
  • Loading branch information
benjamincanac committed Oct 25, 2023
1 parent 7be2af7 commit ace8fc1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/runtime/types/avatar.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { avatar } from '../ui.config'
import colors from '#ui-colors'
import type { AppConfig } from 'nuxt/schema'

export type AvatarSize = keyof typeof avatar.size
export type AvatarSize = keyof typeof avatar.size | keyof AppConfig['ui']['avatar']['size']
export type AvatarChipColor = 'gray' | typeof colors[number]
export type AvatarChipPosition = keyof typeof avatar.chip.position

Expand Down
7 changes: 4 additions & 3 deletions src/runtime/types/badge.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { badge } from '../ui.config'
import type { NestedKeyOf } from '.'
import colors from '#ui-colors'
import type { AppConfig } from 'nuxt/schema'

export type BadgeSize = keyof typeof badge.size
export type BadgeColor = keyof typeof badge.color | typeof colors[number]
export type BadgeVariant = keyof typeof badge.variant | NestedKeyOf<typeof badge.color>
export type BadgeSize = keyof typeof badge.size | keyof AppConfig['ui']['badge']['size']
export type BadgeColor = keyof typeof badge.color | keyof AppConfig['ui']['badge']['color'] | typeof colors[number]
export type BadgeVariant = keyof typeof badge.variant | keyof AppConfig['ui']['badge']['variant'] | NestedKeyOf<typeof badge.color> | NestedKeyOf<AppConfig['ui']['badge']['color']>

export interface Badge {
label?: string
Expand Down
7 changes: 4 additions & 3 deletions src/runtime/types/button.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import type { Link } from './link'
import { button } from '../ui.config'
import type { NestedKeyOf } from '.'
import colors from '#ui-colors'
import type { AppConfig } from 'nuxt/schema'

export type ButtonSize = keyof typeof button.size
export type ButtonColor = keyof typeof button.color | typeof colors[number]
export type ButtonVariant = keyof typeof button.variant | NestedKeyOf<typeof button.color>
export type ButtonSize = keyof typeof button.size | keyof AppConfig['ui']['button']['size']
export type ButtonColor = keyof typeof button.color | keyof AppConfig['ui']['button']['color'] | typeof colors[number]
export type ButtonVariant = keyof typeof button.variant | keyof AppConfig['ui']['button']['variant'] | NestedKeyOf<typeof button.color> | NestedKeyOf<AppConfig['ui']['button']['color']>

export interface Button extends Link {
type?: string
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/types/form.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Ref } from 'vue'
import type { Ref } from 'vue'

export interface FormError<T extends string = string> {
path: T
Expand Down

1 comment on commit ace8fc1

@vercel
Copy link

@vercel vercel bot commented on ace8fc1 Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./

ui.nuxt.com
ui-nuxt-js.vercel.app
ui-git-dev-nuxt-js.vercel.app

Please sign in to comment.