Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(components): prevent multiple appConfig identifier import #3186

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cli/templates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import _appConfig from '#build/app.config'
import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
import { tv } from '${pro ? '#ui/utils/tv' : '../utils/tv'}'

const appConfig = _appConfig as AppConfig & { ${key}: { ${prose ? 'prose: { ' : ''}${camelName}: Partial<typeof theme> } }${prose ? ' }' : ''}
const appConfig${camelName} = _appConfig as AppConfig & { ${key}: { ${prose ? 'prose: { ' : ''}${camelName}: Partial<typeof theme> } }${prose ? ' }' : ''}

const ${camelName} = tv({ extend: tv(theme), ...(appConfig.${key}?.${prose ? 'prose?.' : ''}${camelName} || {}) })
const ${camelName} = tv({ extend: tv(theme), ...(appConfig${camelName}.${key}?.${prose ? 'prose?.' : ''}${camelName} || {}) })

export interface ${upperName}Props {
/**
Expand Down Expand Up @@ -78,9 +78,9 @@ import _appConfig from '#build/app.config'
import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
import { tv } from '${pro ? '#ui/utils/tv' : '../utils/tv'}'

const appConfig = _appConfig as AppConfig & { ${key}: { ${prose ? 'prose: { ' : ''}${camelName}: Partial<typeof theme> } }${prose ? ' }' : ''}
const appConfig${camelName} = _appConfig as AppConfig & { ${key}: { ${prose ? 'prose: { ' : ''}${camelName}: Partial<typeof theme> } }${prose ? ' }' : ''}

const ${camelName} = tv({ extend: tv(theme), ...(appConfig.${key}?.${prose ? 'prose?.' : ''}${camelName} || {}) })
const ${camelName} = tv({ extend: tv(theme), ...(appConfig${camelName}.${key}?.${prose ? 'prose?.' : ''}${camelName} || {}) })

type ${upperName}Variants = VariantProps<typeof ${camelName}>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Accordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'
import type { DynamicSlots } from '../types/utils'

const appConfig = _appConfig as AppConfig & { ui: { accordion: Partial<typeof theme> } }
const appConfigAccordion = _appConfig as AppConfig & { ui: { accordion: Partial<typeof theme> } }

const accordion = tv({ extend: tv(theme), ...(appConfig.ui?.accordion || {}) })
const accordion = tv({ extend: tv(theme), ...(appConfigAccordion.ui?.accordion || {}) })

export interface AccordionItem {
label?: string
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'
import type { AvatarProps, ButtonProps } from '../types'

const appConfig = _appConfig as AppConfig & { ui: { alert: Partial<typeof theme> } }
const appConfigAlert = _appConfig as AppConfig & { ui: { alert: Partial<typeof theme> } }

const alert = tv({ extend: tv(theme), ...(appConfig.ui?.alert || {}) })
const alert = tv({ extend: tv(theme), ...(appConfigAlert.ui?.alert || {}) })

type AlertVariants = VariantProps<typeof alert>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import theme from '#build/ui/avatar'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'

const appConfig = _appConfig as AppConfig & { ui: { avatar: Partial<typeof theme> } }
const appConfigAvatar = _appConfig as AppConfig & { ui: { avatar: Partial<typeof theme> } }

const avatar = tv({ extend: tv(theme), ...(appConfig.ui?.avatar || {}) })
const avatar = tv({ extend: tv(theme), ...(appConfigAvatar.ui?.avatar || {}) })

type AvatarVariants = VariantProps<typeof avatar>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/AvatarGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import theme from '#build/ui/avatar-group'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'

const appConfig = _appConfig as AppConfig & { ui: { avatarGroup: Partial<typeof theme> } }
const appConfigAvatarGroup = _appConfig as AppConfig & { ui: { avatarGroup: Partial<typeof theme> } }

const avatarGroup = tv({ extend: tv(theme), ...(appConfig.ui?.avatarGroup || {}) })
const avatarGroup = tv({ extend: tv(theme), ...(appConfigAvatarGroup.ui?.avatarGroup || {}) })

type AvatarGroupVariants = VariantProps<typeof avatarGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import type { UseComponentIconsProps } from '../composables/useComponentIcons'
import { tv } from '../utils/tv'
import type { AvatarProps } from '../types'

const appConfig = _appConfig as AppConfig & { ui: { badge: Partial<typeof theme> } }
const appConfigBadge = _appConfig as AppConfig & { ui: { badge: Partial<typeof theme> } }

const badge = tv({ extend: tv(theme), ...(appConfig.ui?.badge || {}) })
const badge = tv({ extend: tv(theme), ...(appConfigBadge.ui?.badge || {}) })

type BadgeVariants = VariantProps<typeof badge>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { tv } from '../utils/tv'
import type { AvatarProps, LinkProps } from '../types'
import type { DynamicSlots, PartialString } from '../types/utils'

const appConfig = _appConfig as AppConfig & { ui: { breadcrumb: Partial<typeof theme> } }
const appConfigBreadcrumb = _appConfig as AppConfig & { ui: { breadcrumb: Partial<typeof theme> } }

const breadcrumb = tv({ extend: tv(theme), ...(appConfig.ui?.breadcrumb || {}) })
const breadcrumb = tv({ extend: tv(theme), ...(appConfigBreadcrumb.ui?.breadcrumb || {}) })

export interface BreadcrumbItem extends Omit<LinkProps, 'raw' | 'custom'> {
label?: string
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { tv } from '../utils/tv'
import type { AvatarProps } from '../types'
import type { PartialString } from '../types/utils'

const appConfig = _appConfig as AppConfig & { ui: { button: Partial<typeof theme> } }
const appConfigButton = _appConfig as AppConfig & { ui: { button: Partial<typeof theme> } }

const button = tv({ extend: tv(theme), ...(appConfig.ui?.button || {}) })
const button = tv({ extend: tv(theme), ...(appConfigButton.ui?.button || {}) })

type ButtonVariants = VariantProps<typeof button>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/ButtonGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import theme from '#build/ui/button-group'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'

const appConfig = _appConfig as AppConfig & { ui: { buttonGroup: Partial<typeof theme> } }
const appConfigButtonGroup = _appConfig as AppConfig & { ui: { buttonGroup: Partial<typeof theme> } }

const buttonGroup = tv({ extend: tv(theme), ...(appConfig.ui?.buttonGroup) })
const buttonGroup = tv({ extend: tv(theme), ...(appConfigButtonGroup.ui?.buttonGroup) })

type ButtonGroupVariants = VariantProps<typeof buttonGroup>

Expand Down
6 changes: 4 additions & 2 deletions src/runtime/components/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import _appConfig from '#build/app.config'
import theme from '#build/ui/calendar'
import { tv } from '../utils/tv'

const appConfig = _appConfig as AppConfig & { ui: { calendar: Partial<typeof theme> } }
const appConfigCalendar = _appConfig as AppConfig & { ui: { calendar: Partial<typeof theme> } }

const calendar = tv({ extend: tv(theme), ...(appConfig.ui?.calendar || {}) })
const calendar = tv({ extend: tv(theme), ...(appConfigCalendar.ui?.calendar || {}) })

type CalendarVariants = VariantProps<typeof calendar>

Expand Down Expand Up @@ -77,6 +77,7 @@ import { computed } from 'vue'
import { useForwardPropsEmits } from 'reka-ui'
import { Calendar as SingleCalendar, RangeCalendar } from 'reka-ui/namespaced'
import { reactiveOmit } from '@vueuse/core'
import { useAppConfig } from '#imports'
import { useLocale } from '../composables/useLocale'
import UButton from './Button.vue'

Expand All @@ -88,6 +89,7 @@ const props = withDefaults(defineProps<CalendarProps<R, M>>(), {
const emits = defineEmits<CalendarEmits<R, M>>()
defineSlots<CalendarSlots>()

const appConfig = useAppConfig()
const { code: locale, dir, t } = useLocale()

const rootProps = useForwardPropsEmits(reactiveOmit(props, 'range', 'modelValue', 'defaultValue', 'color', 'size', 'monthControls', 'yearControls', 'class', 'ui'), emits)
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import theme from '#build/ui/card'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'

const appConfig = _appConfig as AppConfig & { ui: { card: Partial<typeof theme> } }
const appConfigCard = _appConfig as AppConfig & { ui: { card: Partial<typeof theme> } }

const card = tv({ extend: tv(theme), ...(appConfig.ui?.card || {}) })
const card = tv({ extend: tv(theme), ...(appConfigCard.ui?.card || {}) })

export interface CardProps {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import { tv } from '../utils/tv'
import type { ButtonProps } from '../types'
import type { PartialString } from '../types/utils'

const appConfig = _appConfig as AppConfig & { ui: { carousel: Partial<typeof theme> } }
const appConfigCarousel = _appConfig as AppConfig & { ui: { carousel: Partial<typeof theme> } }

const carousel = tv({ extend: tv(theme), ...(appConfig.ui?.carousel || {}) })
const carousel = tv({ extend: tv(theme), ...(appConfigCarousel.ui?.carousel || {}) })

type CarouselVariants = VariantProps<typeof carousel>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import theme from '#build/ui/checkbox'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'

const appConfig = _appConfig as AppConfig & { ui: { checkbox: Partial<typeof theme> } }
const appConfigCheckbox = _appConfig as AppConfig & { ui: { checkbox: Partial<typeof theme> } }

const checkbox = tv({ extend: tv(theme), ...(appConfig.ui?.checkbox || {}) })
const checkbox = tv({ extend: tv(theme), ...(appConfigCheckbox.ui?.checkbox || {}) })

type CheckboxVariants = VariantProps<typeof checkbox>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Chip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import theme from '#build/ui/chip'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'

const appConfig = _appConfig as AppConfig & { ui: { chip: Partial<typeof theme> } }
const appConfigChip = _appConfig as AppConfig & { ui: { chip: Partial<typeof theme> } }

const chip = tv({ extend: tv(theme), ...(appConfig.ui?.chip || {}) })
const chip = tv({ extend: tv(theme), ...(appConfigChip.ui?.chip || {}) })

type ChipVariants = VariantProps<typeof chip>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Collapsible.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import theme from '#build/ui/collapsible'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'

const appConfig = _appConfig as AppConfig & { ui: { collapsible: Partial<typeof theme> } }
const appConfigCollapsible = _appConfig as AppConfig & { ui: { collapsible: Partial<typeof theme> } }

const collapsible = tv({ extend: tv(theme), ...(appConfig.ui?.collapsible || {}) })
const collapsible = tv({ extend: tv(theme), ...(appConfigCollapsible.ui?.collapsible || {}) })

export interface CollapsibleProps extends Pick<CollapsibleRootProps, 'defaultOpen' | 'open' | 'disabled' | 'unmountOnHide'> {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/ColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import theme from '#build/ui/color-picker'
import { tv } from '../utils/tv'
import type { HSLObject } from 'colortranslator'

const appConfig = _appConfig as AppConfig & { ui: { colorPicker: Partial<typeof theme> } }
const appConfigColorPicker = _appConfig as AppConfig & { ui: { colorPicker: Partial<typeof theme> } }

const colorPicker = tv({ extend: tv(theme), ...(appConfig.ui?.colorPicker || {}) })
const colorPicker = tv({ extend: tv(theme), ...(appConfigColorPicker.ui?.colorPicker || {}) })

type ColorPickerVariants = VariantProps<typeof colorPicker>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/CommandPalette.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { tv } from '../utils/tv'
import type { AvatarProps, ButtonProps, ChipProps, KbdProps, InputProps } from '../types'
import type { DynamicSlots, PartialString } from '../types/utils'

const appConfig = _appConfig as AppConfig & { ui: { commandPalette: Partial<typeof theme> } }
const appConfigCommandPalette = _appConfig as AppConfig & { ui: { commandPalette: Partial<typeof theme> } }

const commandPalette = tv({ extend: tv(theme), ...(appConfig.ui?.commandPalette || {}) })
const commandPalette = tv({ extend: tv(theme), ...(appConfigCommandPalette.ui?.commandPalette || {}) })

export interface CommandPaletteItem {
prefix?: string
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Container.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import theme from '#build/ui/container'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'

const appConfig = _appConfig as AppConfig & { ui: { container: Partial<typeof theme> } }
const appConfigContainer = _appConfig as AppConfig & { ui: { container: Partial<typeof theme> } }

const container = tv({ extend: tv(theme), ...(appConfig.ui?.container || {}) })
const container = tv({ extend: tv(theme), ...(appConfigContainer.ui?.container || {}) })

export interface ContainerProps {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { tv } from '../utils/tv'
import type { AvatarProps, KbdProps, LinkProps } from '../types'
import type { DynamicSlots, PartialString } from '../types/utils'

const appConfig = _appConfig as AppConfig & { ui: { contextMenu: Partial<typeof theme> } }
const appConfigContextMenu = _appConfig as AppConfig & { ui: { contextMenu: Partial<typeof theme> } }

const contextMenu = tv({ extend: tv(theme), ...(appConfig.ui?.contextMenu || {}) })
const contextMenu = tv({ extend: tv(theme), ...(appConfigContextMenu.ui?.contextMenu || {}) })

type ContextMenuVariants = VariantProps<typeof contextMenu>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import theme from '#build/ui/drawer'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'

const appConfig = _appConfig as AppConfig & { ui: { drawer: Partial<typeof theme> } }
const appConfigDrawer = _appConfig as AppConfig & { ui: { drawer: Partial<typeof theme> } }

const drawer = tv({ extend: tv(theme), ...(appConfig.ui?.drawer || {}) })
const drawer = tv({ extend: tv(theme), ...(appConfigDrawer.ui?.drawer || {}) })

export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | 'closeThreshold' | 'defaultOpen' | 'direction' | 'fadeFromIndex' | 'fixed' | 'modal' | 'nested' | 'direction' | 'open' | 'scrollLockTimeout' | 'shouldScaleBackground' | 'snapPoints'> {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/DropdownMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { tv } from '../utils/tv'
import type { AvatarProps, KbdProps, LinkProps } from '../types'
import type { DynamicSlots, PartialString } from '../types/utils'

const appConfig = _appConfig as AppConfig & { ui: { dropdownMenu: Partial<typeof theme> } }
const appConfigDropdownMenu = _appConfig as AppConfig & { ui: { dropdownMenu: Partial<typeof theme> } }

const dropdownMenu = tv({ extend: tv(theme), ...(appConfig.ui?.dropdownMenu || {}) })
const dropdownMenu = tv({ extend: tv(theme), ...(appConfigDropdownMenu.ui?.dropdownMenu || {}) })

type DropdownMenuVariants = VariantProps<typeof dropdownMenu>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { tv } from '../utils/tv'
import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, FormEvent, Form, FormErrorWithId } from '../types/form'
import type { DeepReadonly } from 'vue'
const appConfig = _appConfig as AppConfig & { ui: { form: Partial<typeof theme> } }
const appConfigForm = _appConfig as AppConfig & { ui: { form: Partial<typeof theme> } }
const form = tv({ extend: tv(theme), ...(appConfig.ui?.form || {}) })
const form = tv({ extend: tv(theme), ...(appConfigForm.ui?.form || {}) })
export interface FormProps<T extends object> {
id?: string | number
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import theme from '#build/ui/form-field'
import { tv } from '../utils/tv'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'

const appConfig = _appConfig as AppConfig & { ui: { formField: Partial<typeof theme> } }
const appConfigFormField = _appConfig as AppConfig & { ui: { formField: Partial<typeof theme> } }

const formField = tv({ extend: tv(theme), ...(appConfig.ui?.formField || {}) })
const formField = tv({ extend: tv(theme), ...(appConfigFormField.ui?.formField || {}) })

type FormFieldVariants = VariantProps<typeof formField>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { tv } from '../utils/tv'
import type { AvatarProps } from '../types'
import type { PartialString } from '../types/utils'

const appConfig = _appConfig as AppConfig & { ui: { input: Partial<typeof theme> } }
const appConfigInput = _appConfig as AppConfig & { ui: { input: Partial<typeof theme> } }

const input = tv({ extend: tv(theme), ...(appConfig.ui?.input || {}) })
const input = tv({ extend: tv(theme), ...(appConfigInput.ui?.input || {}) })

type InputVariants = VariantProps<typeof input>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/InputMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { tv } from '../utils/tv'
import type { AvatarProps, ChipProps, InputProps } from '../types'
import type { PartialString, MaybeArrayOfArray, MaybeArrayOfArrayItem, SelectModelValue, SelectModelValueEmits, SelectItemKey } from '../types/utils'

const appConfig = _appConfig as AppConfig & { ui: { inputMenu: Partial<typeof theme> } }
const appConfigInputMenu = _appConfig as AppConfig & { ui: { inputMenu: Partial<typeof theme> } }

const inputMenu = tv({ extend: tv(theme), ...(appConfig.ui?.inputMenu || {}) })
const inputMenu = tv({ extend: tv(theme), ...(appConfigInputMenu.ui?.inputMenu || {}) })

export interface InputMenuItem {
label?: string
Expand Down
6 changes: 4 additions & 2 deletions src/runtime/components/InputNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import theme from '#build/ui/input-number'
import { tv } from '../utils/tv'
import type { ButtonProps } from '../types'

const appConfig = _appConfig as AppConfig & { ui: { inputNumber: Partial<typeof theme> } }
const appConfigInputNumber = _appConfig as AppConfig & { ui: { inputNumber: Partial<typeof theme> } }

const inputNumber = tv({ extend: tv(theme), ...(appConfig.ui?.inputNumber || {}) })
const inputNumber = tv({ extend: tv(theme), ...(appConfigInputNumber.ui?.inputNumber || {}) })

type InputNumberVariants = VariantProps<typeof inputNumber>

Expand Down Expand Up @@ -78,6 +78,7 @@ export interface InputNumberSlots {
import { onMounted, ref, computed } from 'vue'
import { NumberFieldRoot, NumberFieldInput, NumberFieldDecrement, NumberFieldIncrement, useForwardPropsEmits } from 'reka-ui'
import { reactivePick } from '@vueuse/core'
import { useAppConfig } from '#imports'
import { useFormField } from '../composables/useFormField'
import { useLocale } from '../composables/useLocale'
import UButton from './Button.vue'
Expand All @@ -92,6 +93,7 @@ defineSlots<InputNumberSlots>()

const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'min', 'max', 'step', 'formatOptions'), emits)

const appConfig = useAppConfig()
const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size, name, highlight, disabled, ariaAttrs } = useFormField<InputNumberProps>(props)

const { t, code: codeLocale } = useLocale()
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Kbd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import type { KbdKey } from '../composables/useKbd'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'

const appConfig = _appConfig as AppConfig & { ui: { kbd: Partial<typeof theme> } }
const appConfigKbd = _appConfig as AppConfig & { ui: { kbd: Partial<typeof theme> } }

const kbd = tv({ extend: tv(theme), ...(appConfig.ui?.kbd || {}) })
const kbd = tv({ extend: tv(theme), ...(appConfigKbd.ui?.kbd || {}) })

type KbdVariants = VariantProps<typeof kbd>

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ interface NuxtLinkProps extends Omit<RouterLinkProps, 'to'> {
noPrefetch?: boolean
}

const appConfig = _appConfig as AppConfig & { ui: { link: Partial<typeof theme> } }
const appConfigLink = _appConfig as AppConfig & { ui: { link: Partial<typeof theme> } }

const link = tv({ extend: tv(theme), ...(appConfig.ui?.link || {}) })
const link = tv({ extend: tv(theme), ...(appConfigLink.ui?.link || {}) })

export interface LinkProps extends NuxtLinkProps {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'
import type { ButtonProps } from '../types'

const appConfig = _appConfig as AppConfig & { ui: { modal: Partial<typeof theme> } }
const appConfigModal = _appConfig as AppConfig & { ui: { modal: Partial<typeof theme> } }

const modal = tv({ extend: tv(theme), ...(appConfig.ui?.modal || {}) })
const modal = tv({ extend: tv(theme), ...(appConfigModal.ui?.modal || {}) })

export interface ModalProps extends DialogRootProps {
title?: string
Expand Down
Loading
Loading