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

This commit is contained in:
Benjamin Canac
2025-01-27 13:26:21 +01:00
committed by GitHub
parent d27be06164
commit cd16b95c98
51 changed files with 110 additions and 104 deletions

View File

@@ -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

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>
@@ -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'
@@ -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)

View File

@@ -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 {
/**

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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'> {
/**

View File

@@ -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>

View File

@@ -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

View File

@@ -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 {
/**

View File

@@ -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>

View File

@@ -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'> {
/**

View File

@@ -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>

View File

@@ -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

View File

@@ -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>

View File

@@ -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>

View File

@@ -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

View File

@@ -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>
@@ -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'
@@ -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()

View File

@@ -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>

View File

@@ -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 {
/**

View File

@@ -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

View File

@@ -9,9 +9,9 @@ import { tv } from '../utils/tv'
import type { AvatarProps, BadgeProps, LinkProps } from '../types'
import type { DynamicSlots, MaybeArrayOfArray, MaybeArrayOfArrayItem, PartialString } from '../types/utils'
const appConfig = _appConfig as AppConfig & { ui: { navigationMenu: Partial<typeof theme> } }
const appConfigNavigationMenu = _appConfig as AppConfig & { ui: { navigationMenu: Partial<typeof theme> } }
const navigationMenu = tv({ extend: tv(theme), ...(appConfig.ui?.navigationMenu || {}) })
const navigationMenu = tv({ extend: tv(theme), ...(appConfigNavigationMenu.ui?.navigationMenu || {}) })
export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'children' | 'type'> {
/** Description is only used when `orientation` is `horizontal`. */
@@ -148,6 +148,7 @@ extendDevtoolsMeta({
import { computed, toRef } from 'vue'
import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, useForwardPropsEmits } from 'reka-ui'
import { createReusableTemplate } from '@vueuse/core'
import { useAppConfig } from '#imports'
import { get } from '../utils'
import { pickLinkProps } from '../utils/link'
import ULinkBase from './LinkBase.vue'
@@ -182,6 +183,7 @@ const rootProps = useForwardPropsEmits(computed(() => ({
const contentProps = toRef(() => props.content)
const appConfig = useAppConfig()
const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate<{ item: NavigationMenuItem, index: number, active?: boolean }>()
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<{ item: NavigationMenuItem, index: number }>()

View File

@@ -8,9 +8,9 @@ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'
import type { ButtonProps } from '../types'
const appConfig = _appConfig as AppConfig & { ui: { pagination: Partial<typeof theme> } }
const appConfigPagination = _appConfig as AppConfig & { ui: { pagination: Partial<typeof theme> } }
const pagination = tv({ extend: tv(theme), ...(appConfig.ui?.pagination || {}) })
const pagination = tv({ extend: tv(theme), ...(appConfigPagination.ui?.pagination || {}) })
export interface PaginationProps extends Partial<Pick<PaginationRootProps, 'defaultPage' | 'disabled' | 'itemsPerPage' | 'page' | 'showEdges' | 'siblingCount' | 'total'>> {
/**

View File

@@ -7,9 +7,9 @@ import theme from '#build/ui/pin-input'
import { tv } from '../utils/tv'
import type { PartialString } from '../types/utils'
const appConfig = _appConfig as AppConfig & { ui: { pinInput: Partial<typeof theme> } }
const appConfigPinInput = _appConfig as AppConfig & { ui: { pinInput: Partial<typeof theme> } }
const pinInput = tv({ extend: tv(theme), ...(appConfig.ui?.pinInput || {}) })
const pinInput = tv({ extend: tv(theme), ...(appConfigPinInput.ui?.pinInput || {}) })
type PinInputVariants = VariantProps<typeof pinInput>

View File

@@ -6,9 +6,9 @@ import theme from '#build/ui/popover'
import { tv } from '../utils/tv'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
const appConfig = _appConfig as AppConfig & { ui: { popover: Partial<typeof theme> } }
const appConfigPopover = _appConfig as AppConfig & { ui: { popover: Partial<typeof theme> } }
const popover = tv({ extend: tv(theme), ...(appConfig.ui?.popover || {}) })
const popover = tv({ extend: tv(theme), ...(appConfigPopover.ui?.popover || {}) })
export interface PopoverProps extends PopoverRootProps, Pick<HoverCardRootProps, 'openDelay' | 'closeDelay'> {
/**

View File

@@ -7,9 +7,9 @@ import _appConfig from '#build/app.config'
import theme from '#build/ui/progress'
import { tv } from '../utils/tv'
const appConfig = _appConfig as AppConfig & { ui: { progress: Partial<typeof theme> } }
const appConfigProgress = _appConfig as AppConfig & { ui: { progress: Partial<typeof theme> } }
const progress = tv({ extend: tv(theme), ...(appConfig.ui?.progress || {}) })
const progress = tv({ extend: tv(theme), ...(appConfigProgress.ui?.progress || {}) })
type ProgressVariants = VariantProps<typeof progress>

View File

@@ -7,9 +7,9 @@ import theme from '#build/ui/radio-group'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'
const appConfig = _appConfig as AppConfig & { ui: { radioGroup: Partial<typeof theme> } }
const appConfigRadioGroup = _appConfig as AppConfig & { ui: { radioGroup: Partial<typeof theme> } }
const radioGroup = tv({ extend: tv(theme), ...(appConfig.ui?.radioGroup || {}) })
const radioGroup = tv({ extend: tv(theme), ...(appConfigRadioGroup.ui?.radioGroup || {}) })
type RadioGroupVariants = VariantProps<typeof radioGroup>

View File

@@ -10,9 +10,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: { select: Partial<typeof theme> } }
const appConfigSelect = _appConfig as AppConfig & { ui: { select: Partial<typeof theme> } }
const select = tv({ extend: tv(theme), ...(appConfig.ui?.select || {}) })
const select = tv({ extend: tv(theme), ...(appConfigSelect.ui?.select || {}) })
export interface SelectItem {
label?: string

View File

@@ -10,9 +10,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: { selectMenu: Partial<typeof theme> } }
const appConfigSelectMenu = _appConfig as AppConfig & { ui: { selectMenu: Partial<typeof theme> } }
const selectMenu = tv({ extend: tv(theme), ...(appConfig.ui?.selectMenu || {}) })
const selectMenu = tv({ extend: tv(theme), ...(appConfigSelectMenu.ui?.selectMenu || {}) })
export interface SelectMenuItem {
label?: string

View File

@@ -7,9 +7,9 @@ import theme from '#build/ui/separator'
import { tv } from '../utils/tv'
import type { AvatarProps } from '../types'
const appConfig = _appConfig as AppConfig & { ui: { separator: Partial<typeof theme> } }
const appConfigSeparator = _appConfig as AppConfig & { ui: { separator: Partial<typeof theme> } }
const separator = tv({ extend: tv(theme), ...(appConfig.ui?.separator || {}) })
const separator = tv({ extend: tv(theme), ...(appConfigSeparator.ui?.separator || {}) })
type SeparatorVariants = VariantProps<typeof separator>

View File

@@ -5,9 +5,9 @@ import theme from '#build/ui/skeleton'
import { tv } from '../utils/tv'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
const appConfig = _appConfig as AppConfig & { ui: { skeleton: Partial<typeof theme> } }
const appConfigSkeleton = _appConfig as AppConfig & { ui: { skeleton: Partial<typeof theme> } }
const skeleton = tv({ extend: tv(theme), ...(appConfig.ui?.skeleton || {}) })
const skeleton = tv({ extend: tv(theme), ...(appConfigSkeleton.ui?.skeleton || {}) })
export interface SkeletonProps {
/**

View File

@@ -8,9 +8,9 @@ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'
import type { ButtonProps } from '../types'
const appConfig = _appConfig as AppConfig & { ui: { slideover: Partial<typeof theme> } }
const appConfigSlideover = _appConfig as AppConfig & { ui: { slideover: Partial<typeof theme> } }
const slideover = tv({ extend: tv(theme), ...(appConfig.ui?.slideover || {}) })
const slideover = tv({ extend: tv(theme), ...(appConfigSlideover.ui?.slideover || {}) })
type SlideoverVariants = VariantProps<typeof slideover>

View File

@@ -6,9 +6,9 @@ import _appConfig from '#build/app.config'
import theme from '#build/ui/slider'
import { tv } from '../utils/tv'
const appConfig = _appConfig as AppConfig & { ui: { slider: Partial<typeof theme> } }
const appConfigSlider = _appConfig as AppConfig & { ui: { slider: Partial<typeof theme> } }
const slider = tv({ extend: tv(theme), ...(appConfig.ui?.slider || {}) })
const slider = tv({ extend: tv(theme), ...(appConfigSlider.ui?.slider || {}) })
type SliderVariants = VariantProps<typeof slider>

View File

@@ -8,9 +8,9 @@ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'
import type { DynamicSlots } from '../types/utils'
const appConfig = _appConfig as AppConfig & { ui: { stepper: Partial<typeof theme> } }
const appConfigStepper = _appConfig as AppConfig & { ui: { stepper: Partial<typeof theme> } }
const stepper = tv({ extend: tv(theme), ...(appConfig.ui?.stepper || {}) })
const stepper = tv({ extend: tv(theme), ...(appConfigStepper.ui?.stepper || {}) })
type StepperVariants = VariantProps<typeof stepper>

View File

@@ -8,9 +8,9 @@ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'
import type { PartialString } from '../types/utils'
const appConfig = _appConfig as AppConfig & { ui: { switch: Partial<typeof theme> } }
const appConfigSwitch = _appConfig as AppConfig & { ui: { switch: Partial<typeof theme> } }
const switchTv = tv({ extend: tv(theme), ...(appConfig.ui?.switch || {}) })
const switchTv = tv({ extend: tv(theme), ...(appConfigSwitch.ui?.switch || {}) })
type SwitchVariants = VariantProps<typeof switchTv>

View File

@@ -38,9 +38,9 @@ declare module '@tanstack/table-core' {
}
}
const appConfig = _appConfig as AppConfig & { ui: { table: Partial<typeof theme> } }
const appConfigTable = _appConfig as AppConfig & { ui: { table: Partial<typeof theme> } }
const table = tv({ extend: tv(theme), ...(appConfig.ui?.table || {}) })
const table = tv({ extend: tv(theme), ...(appConfigTable.ui?.table || {}) })
type TableVariants = VariantProps<typeof table>

View File

@@ -9,9 +9,9 @@ import { tv } from '../utils/tv'
import type { AvatarProps } from '../types'
import type { DynamicSlots, PartialString } from '../types/utils'
const appConfig = _appConfig as AppConfig & { ui: { tabs: Partial<typeof theme> } }
const appConfigTabs = _appConfig as AppConfig & { ui: { tabs: Partial<typeof theme> } }
const tabs = tv({ extend: tv(theme), ...(appConfig.ui?.tabs || {}) })
const tabs = tv({ extend: tv(theme), ...(appConfigTabs.ui?.tabs || {}) })
export interface TabsItem {
label?: string

View File

@@ -5,9 +5,9 @@ import _appConfig from '#build/app.config'
import theme from '#build/ui/textarea'
import { tv } from '../utils/tv'
const appConfig = _appConfig as AppConfig & { ui: { textarea: Partial<typeof theme> } }
const appConfigTextarea = _appConfig as AppConfig & { ui: { textarea: Partial<typeof theme> } }
const textarea = tv({ extend: tv(theme), ...(appConfig.ui?.textarea || {}) })
const textarea = tv({ extend: tv(theme), ...(appConfigTextarea.ui?.textarea || {}) })
type TextareaVariants = VariantProps<typeof textarea>

View File

@@ -8,9 +8,9 @@ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'
import type { AvatarProps, ButtonProps } from '../types'
const appConfig = _appConfig as AppConfig & { ui: { toast: Partial<typeof theme> } }
const appConfigToast = _appConfig as AppConfig & { ui: { toast: Partial<typeof theme> } }
const toast = tv({ extend: tv(theme), ...(appConfig.ui?.toast || {}) })
const toast = tv({ extend: tv(theme), ...(appConfigToast.ui?.toast || {}) })
type ToastVariants = VariantProps<typeof toast>

View File

@@ -7,9 +7,9 @@ import theme from '#build/ui/toaster'
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'
const appConfig = _appConfig as AppConfig & { ui: { toaster: Partial<typeof theme> } }
const appConfigToaster = _appConfig as AppConfig & { ui: { toaster: Partial<typeof theme> } }
const toaster = tv({ extend: tv(theme), ...(appConfig.ui?.toaster || {}) })
const toaster = tv({ extend: tv(theme), ...(appConfigToaster.ui?.toaster || {}) })
type ToasterVariants = VariantProps<typeof toaster>

View File

@@ -7,9 +7,9 @@ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
import { tv } from '../utils/tv'
import type { KbdProps } from '../types'
const appConfig = _appConfig as AppConfig & { ui: { tooltip: Partial<typeof theme> } }
const appConfigTooltip = _appConfig as AppConfig & { ui: { tooltip: Partial<typeof theme> } }
const tooltip = tv({ extend: tv(theme), ...(appConfig.ui?.tooltip || {}) })
const tooltip = tv({ extend: tv(theme), ...(appConfigTooltip.ui?.tooltip || {}) })
export interface TooltipProps extends TooltipRootProps {
/** The text content of the tooltip. */

View File

@@ -2,6 +2,6 @@ import { createTV, type defaultConfig } from 'tailwind-variants'
import type { AppConfig } from '@nuxt/schema'
import _appConfig from '#build/app.config'
const appConfig = _appConfig as AppConfig & { ui: { tv: typeof defaultConfig } }
const appConfigTv = _appConfig as AppConfig & { ui: { tv: typeof defaultConfig } }
export const tv = createTV(appConfig.ui?.tv)
export const tv = createTV(appConfigTv.ui?.tv)

View File

@@ -52,9 +52,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 {
/**