mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
chore: improve types export
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { withoutTrailingSlash } from 'ufo'
|
||||
// import { debounce } from 'perfect-debounce'
|
||||
import type { ContentSearchFile } from '#ui-pro/types'
|
||||
import type { ContentSearchFile } from '@nuxt/ui-pro'
|
||||
|
||||
const route = useRoute()
|
||||
// const colorMode = useColorMode()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { NavItem } from '@nuxt/content'
|
||||
import type { NavigationMenuItem } from '#ui/types'
|
||||
import type { NavigationMenuItem } from '@nuxt/ui'
|
||||
|
||||
const props = defineProps<{
|
||||
links: NavigationMenuItem[]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import type { NuxtError } from '#app'
|
||||
import type { ContentSearchFile } from '#ui-pro/types'
|
||||
import type { ContentSearchFile } from '@nuxt/ui-pro'
|
||||
|
||||
useSeoMeta({
|
||||
title: 'Page not found',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { withoutTrailingSlash } from 'ufo'
|
||||
import { findPageHeadline } from '#ui-pro/utils/content'
|
||||
import { findPageHeadline } from '@nuxt/ui-pro/runtime/utils/content'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/types.d.ts",
|
||||
"types": "./dist/module.d.ts",
|
||||
"import": "./dist/module.mjs",
|
||||
"require": "./dist/module.cjs"
|
||||
}
|
||||
},
|
||||
"./runtime/*": "./dist/runtime/*"
|
||||
},
|
||||
"bin": {
|
||||
"nuxt-ui": "./cli/index.mjs"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { z } from 'zod'
|
||||
import type { FormSubmitEvent, Form } from '#ui/types/form'
|
||||
import type { FormSubmitEvent, Form } from '@nuxt/ui'
|
||||
|
||||
const schema = z.object({
|
||||
input: z.string().min(10),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { z } from 'zod'
|
||||
import type { FormSubmitEvent } from '#ui/types/form'
|
||||
import type { FormSubmitEvent } from '@nuxt/ui'
|
||||
|
||||
const schema = z.object({
|
||||
email: z.string().min(2),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { z } from 'zod'
|
||||
import type { FormSubmitEvent } from '#ui/types/form'
|
||||
import type { FormSubmitEvent } from '@nuxt/ui'
|
||||
|
||||
const schema = z.object({
|
||||
email: z.string().min(2),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { z } from 'zod'
|
||||
import type { FormSubmitEvent } from '#ui/types/form'
|
||||
import type { FormSubmitEvent } from '@nuxt/ui'
|
||||
|
||||
const schema = z.object({
|
||||
email: z.string().email(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import theme from '#build/ui/kbd'
|
||||
import { kbdKeysMap } from '#ui/composables/useKbd'
|
||||
import { kbdKeysMap } from '@nuxt/ui/runtime/composables/useKbd.js'
|
||||
|
||||
const sizes = Object.keys(theme.variants.size)
|
||||
const kbdKeys = Object.keys(kbdKeysMap)
|
||||
|
||||
@@ -4,6 +4,8 @@ import tailwindcss from '@tailwindcss/vite'
|
||||
import { addTemplates } from './templates'
|
||||
import icons from './theme/icons'
|
||||
|
||||
export type * from './runtime/types'
|
||||
|
||||
export interface ModuleOptions {
|
||||
/**
|
||||
* Prefix for components
|
||||
@@ -40,8 +42,7 @@ export default defineNuxtModule<ModuleOptions>({
|
||||
|
||||
options.colors = options.colors?.length ? [...new Set(['primary', ...options.colors])] : ['primary', 'red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchia', 'pink', 'rose']
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
// @ts-expect-error - Add ui options to nuxt
|
||||
nuxt.options.ui = options
|
||||
|
||||
nuxt.options.alias['#ui'] = resolve('./runtime')
|
||||
@@ -54,6 +55,7 @@ export default defineNuxtModule<ModuleOptions>({
|
||||
|
||||
// Isolate root node from portaled components
|
||||
nuxt.options.app.rootAttrs = nuxt.options.app.rootAttrs || {}
|
||||
// TODO: Check if already set
|
||||
nuxt.options.app.rootAttrs.class = 'isolate'
|
||||
|
||||
addVitePlugin(tailwindcss)
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { AccordionRootProps, AccordionRootEmits, AccordionContentProps, Acc
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/accordion'
|
||||
import type { DynamicSlots } from '#ui/types/utils'
|
||||
import type { DynamicSlots } from '../types/utils'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { accordion: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { PrimitiveProps } from 'radix-vue'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/alert'
|
||||
import type { AvatarProps, ButtonProps } from '#ui/types'
|
||||
import type { AvatarProps, ButtonProps } from '../types'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { alert: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { ConfigProviderProps, TooltipProviderProps } from 'radix-vue'
|
||||
import type { ToasterProps } from '#ui/types'
|
||||
import type { ToasterProps } from '../types'
|
||||
|
||||
export interface ProviderProps extends ConfigProviderProps {
|
||||
tooltip?: TooltipProviderProps
|
||||
|
||||
@@ -4,8 +4,8 @@ import type { PrimitiveProps } from 'radix-vue'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/breadcrumb'
|
||||
import type { AvatarProps, LinkProps } from '#ui/types'
|
||||
import type { DynamicSlots } from '#ui/types/utils'
|
||||
import type { AvatarProps, LinkProps } from '../types'
|
||||
import type { DynamicSlots } from '../types/utils'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { breadcrumb: Partial<typeof theme> } }
|
||||
|
||||
@@ -45,7 +45,7 @@ import { computed } from 'vue'
|
||||
import { Primitive } from 'radix-vue'
|
||||
import { useAppConfig } from '#imports'
|
||||
import { ULink, UIcon, UAvatar } from '#components'
|
||||
import { pickLinkProps } from '#ui/utils/link'
|
||||
import { pickLinkProps } from '../utils/link'
|
||||
|
||||
const props = defineProps<BreadcrumbProps<T>>()
|
||||
const slots = defineSlots<BreadcrumbSlots<T>>()
|
||||
|
||||
@@ -3,8 +3,8 @@ import { tv, type VariantProps } from 'tailwind-variants'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/button'
|
||||
import type { LinkProps } from '#ui/components/Link.vue'
|
||||
import type { UseComponentIconsProps } from '#ui/composables/useComponentIcons'
|
||||
import type { LinkProps } from './Link.vue'
|
||||
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { button: Partial<typeof theme> } }
|
||||
|
||||
@@ -37,7 +37,7 @@ import { computed } from 'vue'
|
||||
import { useForwardProps } from 'radix-vue'
|
||||
import { useComponentIcons, useButtonGroup } from '#imports'
|
||||
import { UIcon, ULink } from '#components'
|
||||
import { pickLinkProps } from '#ui/utils/link'
|
||||
import { pickLinkProps } from '../utils/link'
|
||||
|
||||
const props = defineProps<ButtonProps>()
|
||||
const slots = defineSlots<ButtonSlots>()
|
||||
|
||||
@@ -6,9 +6,9 @@ import type { AppConfig } from '@nuxt/schema'
|
||||
import type { UseFuseOptions } from '@vueuse/integrations/useFuse'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/command-palette'
|
||||
import type { UseComponentIconsProps } from '#ui/composables/useComponentIcons'
|
||||
import type { AvatarProps, ButtonProps, ChipProps, KbdProps, InputProps } from '#ui/types'
|
||||
import type { DynamicSlots } from '#ui/types/utils'
|
||||
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
||||
import type { AvatarProps, ButtonProps, ChipProps, KbdProps, InputProps } from '../types'
|
||||
import type { DynamicSlots } from '../types/utils'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { commandPalette: Partial<typeof theme> } }
|
||||
|
||||
@@ -94,8 +94,8 @@ import { reactivePick } from '@vueuse/core'
|
||||
import { useFuse } from '@vueuse/integrations/useFuse'
|
||||
import { UInput, UAvatar, UIcon, UKbd, UChip } from '#components'
|
||||
import { useAppConfig } from '#imports'
|
||||
import { omit } from '#ui/utils'
|
||||
import { highlight } from '#ui/utils/fuse'
|
||||
import { omit } from '../utils'
|
||||
import { highlight } from '../utils/fuse'
|
||||
|
||||
const props = withDefaults(defineProps<CommandPaletteProps<G, T>>(), {
|
||||
modelValue: '',
|
||||
|
||||
@@ -4,8 +4,8 @@ import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProp
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/context-menu'
|
||||
import type { AvatarProps, KbdProps, LinkProps } from '#ui/types'
|
||||
import type { DynamicSlots } from '#ui/types/utils'
|
||||
import type { AvatarProps, KbdProps, LinkProps } from '../types'
|
||||
import type { DynamicSlots } from '../types/utils'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { contextMenu: Partial<typeof theme> } }
|
||||
|
||||
@@ -60,7 +60,7 @@ import { computed, toRef } from 'vue'
|
||||
import { ContextMenuRoot, ContextMenuTrigger, useForwardPropsEmits } from 'radix-vue'
|
||||
import { reactivePick } from '@vueuse/core'
|
||||
import { UContextMenuContent } from '#components'
|
||||
import { omit } from '#ui/utils'
|
||||
import { omit } from '../utils'
|
||||
|
||||
const props = withDefaults(defineProps<ContextMenuProps<T>>(), {
|
||||
portal: true,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { tv } from 'tailwind-variants'
|
||||
import type { ContextMenuContentProps as RadixContextMenuContentProps, ContextMenuContentEmits as RadixContextMenuContentEmits } from 'radix-vue'
|
||||
import theme from '#build/ui/context-menu'
|
||||
import type { ContextMenuItem, ContextMenuSlots } from '#ui/types'
|
||||
import type { ContextMenuItem, ContextMenuSlots } from '../types'
|
||||
|
||||
const contextMenu = tv(theme)()
|
||||
|
||||
@@ -24,8 +24,8 @@ import { useForwardPropsEmits } from 'radix-vue'
|
||||
import { reactiveOmit, createReusableTemplate } from '@vueuse/core'
|
||||
import { useAppConfig } from '#imports'
|
||||
import { ULink } from '#components'
|
||||
import { omit } from '#ui/utils'
|
||||
import { pickLinkProps } from '#ui/utils/link'
|
||||
import { omit } from '../utils'
|
||||
import { pickLinkProps } from '../utils/link'
|
||||
|
||||
const props = defineProps<ContextMenuContentProps<T>>()
|
||||
const emits = defineEmits<ContextMenuContentEmits>()
|
||||
|
||||
@@ -4,8 +4,8 @@ import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentP
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/dropdown-menu'
|
||||
import type { AvatarProps, KbdProps, LinkProps } from '#ui/types'
|
||||
import type { DynamicSlots } from '#ui/types/utils'
|
||||
import type { AvatarProps, KbdProps, LinkProps } from '../types'
|
||||
import type { DynamicSlots } from '../types/utils'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { dropdownMenu: Partial<typeof theme> } }
|
||||
|
||||
@@ -72,7 +72,7 @@ import { defu } from 'defu'
|
||||
import { DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuArrow, useForwardPropsEmits } from 'radix-vue'
|
||||
import { reactivePick } from '@vueuse/core'
|
||||
import { UDropdownMenuContent } from '#components'
|
||||
import { omit } from '#ui/utils'
|
||||
import { omit } from '../utils'
|
||||
|
||||
const props = withDefaults(defineProps<DropdownMenuProps<T>>(), {
|
||||
portal: true,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { tv } from 'tailwind-variants'
|
||||
import type { DropdownMenuContentProps as RadixDropdownMenuContentProps, DropdownMenuContentEmits as RadixDropdownMenuContentEmits } from 'radix-vue'
|
||||
import theme from '#build/ui/dropdown-menu'
|
||||
import type { KbdProps, AvatarProps, DropdownMenuItem, DropdownMenuSlots } from '#ui/types'
|
||||
import type { KbdProps, AvatarProps, DropdownMenuItem, DropdownMenuSlots } from '../types'
|
||||
|
||||
const dropdownMenu = tv(theme)()
|
||||
|
||||
@@ -28,8 +28,8 @@ import { useForwardPropsEmits } from 'radix-vue'
|
||||
import { reactiveOmit, createReusableTemplate } from '@vueuse/core'
|
||||
import { useAppConfig } from '#imports'
|
||||
import { ULink } from '#components'
|
||||
import { omit } from '#ui/utils'
|
||||
import { pickLinkProps } from '#ui/utils/link'
|
||||
import { omit } from '../utils'
|
||||
import { pickLinkProps } from '../utils/link'
|
||||
|
||||
const props = defineProps<DropdownMenuContentProps<T>>()
|
||||
const emits = defineEmits<DropdownMenuContentEmits>()
|
||||
|
||||
@@ -3,8 +3,8 @@ import { tv } from 'tailwind-variants'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/form'
|
||||
import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, FormEvent, Form, FormErrorWithId } from '#ui/types/form'
|
||||
import { FormValidationException } from '#ui/types/form'
|
||||
import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, FormEvent, Form, FormErrorWithId } from '../types/form'
|
||||
import { FormValidationException } from '../types/form'
|
||||
|
||||
import { formOptionsInjectionKey, formInputsInjectionKey, formBusInjectionKey, useId } from '#imports'
|
||||
|
||||
@@ -36,7 +36,7 @@ export interface FormSlots {
|
||||
<script lang="ts" setup generic="T extends object">
|
||||
import { provide, inject, nextTick, ref, onUnmounted, onMounted, computed } from 'vue'
|
||||
import { useEventBus } from '@vueuse/core'
|
||||
import { getYupErrors, isYupSchema, getValibotError, isValibotSchema, getZodErrors, isZodSchema, getJoiErrors, isJoiSchema } from '#ui/utils/form'
|
||||
import { getYupErrors, isYupSchema, getValibotError, isValibotSchema, getZodErrors, isZodSchema, getJoiErrors, isJoiSchema } from '../utils/form'
|
||||
|
||||
const props = withDefaults(defineProps<FormProps<T>>(), {
|
||||
validateOn() {
|
||||
|
||||
@@ -38,8 +38,8 @@ export interface FormFieldSlots {
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, inject, provide, type Ref } from 'vue'
|
||||
import { Label } from 'radix-vue'
|
||||
import type { FormError } from '#ui/types/form'
|
||||
import { useId, formFieldInjectionKey } from '#imports'
|
||||
import type { FormError } from '../types/form'
|
||||
|
||||
const props = defineProps<FormFieldProps>()
|
||||
const slots = defineSlots<FormFieldSlots>()
|
||||
|
||||
@@ -4,7 +4,7 @@ import { tv, type VariantProps } from 'tailwind-variants'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/input'
|
||||
import type { UseComponentIconsProps } from '#ui/composables/useComponentIcons'
|
||||
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { input: Partial<typeof theme> } }
|
||||
|
||||
@@ -45,7 +45,7 @@ export interface InputSlots {
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useComponentIcons, useFormField, useButtonGroup } from '#imports'
|
||||
import { UIcon } from '#components'
|
||||
import { looseToNumber } from '#ui/utils'
|
||||
import { looseToNumber } from '../utils'
|
||||
|
||||
defineOptions({ inheritAttrs: false })
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, Combob
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/input-menu'
|
||||
import type { UseComponentIconsProps } from '#ui/composables/useComponentIcons'
|
||||
import type { AvatarProps, ChipProps, InputProps } from '#ui/types'
|
||||
import type { AcceptableValue, ArrayOrWrapped } from '#ui/types/utils'
|
||||
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
||||
import type { AvatarProps, ChipProps, InputProps } from '../types'
|
||||
import type { AcceptableValue, ArrayOrWrapped } from '../types/utils'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { inputMenu: Partial<typeof theme> } }
|
||||
|
||||
@@ -104,7 +104,7 @@ import { defu } from 'defu'
|
||||
import { reactivePick } from '@vueuse/core'
|
||||
import { useAppConfig, useFormField, useButtonGroup, useComponentIcons } from '#imports'
|
||||
import { UIcon, UChip, UAvatar } from '#components'
|
||||
import { get } from '#ui/utils'
|
||||
import { get } from '../utils'
|
||||
|
||||
defineOptions({ inheritAttrs: false })
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { PrimitiveProps } from 'radix-vue'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/kbd'
|
||||
import type { KbdKey } from '#ui/composables/useKbd'
|
||||
import type { KbdKey } from '../composables/useKbd'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { kbd: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'radix
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/modal'
|
||||
import type { ButtonProps } from '#ui/types'
|
||||
import type { ButtonProps } from '../types'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { modal: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuIt
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/navigation-menu'
|
||||
import type { AvatarProps, BadgeProps, LinkProps } from '#ui/types'
|
||||
import type { DynamicSlots } from '#ui/types/utils'
|
||||
import type { AvatarProps, BadgeProps, LinkProps } from '../types'
|
||||
import type { DynamicSlots } from '../types/utils'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { navigationMenu: Partial<typeof theme> } }
|
||||
|
||||
@@ -76,7 +76,7 @@ import { computed, toRef } from 'vue'
|
||||
import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, useForwardPropsEmits } from 'radix-vue'
|
||||
import { reactivePick } from '@vueuse/core'
|
||||
import { UIcon, UAvatar, UBadge, ULink, ULinkBase } from '#components'
|
||||
import { pickLinkProps } from '#ui/utils/link'
|
||||
import { pickLinkProps } from '../utils/link'
|
||||
|
||||
const props = withDefaults(defineProps<NavigationMenuProps<T>>(), {
|
||||
orientation: 'horizontal',
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { AppConfig } from '@nuxt/schema'
|
||||
import type { RouteLocationRaw } from '#vue-router'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/pagination'
|
||||
import type { ButtonProps } from '#ui/types'
|
||||
import type { ButtonProps } from '../types'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { pagination: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { RadioGroupRootProps, RadioGroupRootEmits, RadioGroupItemProps } fr
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/radio-group'
|
||||
import type { AcceptableValue } from '#ui/types/utils'
|
||||
import type { AcceptableValue } from '../types/utils'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { radioGroup: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import type { SelectRootProps, SelectRootEmits, SelectContentProps, SelectArrowP
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/select'
|
||||
import type { UseComponentIconsProps } from '#ui/composables/useComponentIcons'
|
||||
import type { AvatarProps, ChipProps, InputProps } from '#ui/types'
|
||||
import type { AcceptableValue } from '#ui/types/utils'
|
||||
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
||||
import type { AvatarProps, ChipProps, InputProps } from '../types'
|
||||
import type { AcceptableValue } from '../types/utils'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { select: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, Combob
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/select-menu'
|
||||
import type { UseComponentIconsProps } from '#ui/composables/useComponentIcons'
|
||||
import type { AvatarProps, ChipProps, InputProps } from '#ui/types'
|
||||
import type { AcceptableValue, ArrayOrWrapped } from '#ui/types/utils'
|
||||
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
||||
import type { AvatarProps, ChipProps, InputProps } from '../types'
|
||||
import type { AcceptableValue, ArrayOrWrapped } from '../types/utils'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { selectMenu: Partial<typeof theme> } }
|
||||
|
||||
@@ -95,7 +95,7 @@ import { defu } from 'defu'
|
||||
import { reactivePick } from '@vueuse/core'
|
||||
import { useAppConfig, useFormField, useButtonGroup, useComponentIcons } from '#imports'
|
||||
import { UIcon, UChip, UAvatar } from '#components'
|
||||
import { get } from '#ui/utils'
|
||||
import { get } from '../utils'
|
||||
|
||||
const props = withDefaults(defineProps<SelectMenuProps<T>>(), {
|
||||
portal: true,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { tv, type VariantProps } from 'tailwind-variants'
|
||||
import type { SeparatorProps as _SeparatorProps } from 'radix-vue'
|
||||
import type { AvatarProps } from '#ui/types'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/separator'
|
||||
import type { AvatarProps } from '../types'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { separator: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'radix
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/slideover'
|
||||
import type { ButtonProps } from '#ui/types'
|
||||
import type { ButtonProps } from '../types'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { slideover: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import type { TabsRootProps, TabsRootEmits, TabsContentProps, TabsTriggerProps }
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/tabs'
|
||||
import type { AvatarProps } from '#ui/types'
|
||||
import type { DynamicSlots } from '#ui/types/utils'
|
||||
import type { AvatarProps } from '../types'
|
||||
import type { DynamicSlots } from '../types/utils'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { tabs: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ export interface TextareaSlots {
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, onMounted, nextTick, watch } from 'vue'
|
||||
import { useFormField } from '#imports'
|
||||
import { looseToNumber } from '#ui/utils'
|
||||
import { looseToNumber } from '../utils'
|
||||
|
||||
defineOptions({ inheritAttrs: false })
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { ToastRootProps, ToastRootEmits } from 'radix-vue'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/toast'
|
||||
import type { AvatarProps, ButtonProps, ToasterContext } from '#ui/types'
|
||||
import type { AvatarProps, ButtonProps, ToasterContext } from '../types'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { toast: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import { ToastProvider, ToastViewport, useForwardProps } from 'radix-vue'
|
||||
import { reactivePick } from '@vueuse/core'
|
||||
import { useToast } from '#imports'
|
||||
import { UToast } from '#components'
|
||||
import { omit } from '#ui/utils'
|
||||
import { omit } from '../utils'
|
||||
|
||||
const props = withDefaults(defineProps<ToasterProps>(), {
|
||||
expand: true,
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipAr
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/ui/tooltip'
|
||||
import type { KbdProps } from '#ui/types'
|
||||
import type { KbdProps } from '../types'
|
||||
|
||||
const appConfig = _appConfig as AppConfig & { ui: { tooltip: Partial<typeof theme> } }
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { inject, provide, computed, type ComputedRef, type InjectionKey } from 'vue'
|
||||
import type { AvatarGroupProps } from '#ui/types'
|
||||
import type { AvatarGroupProps } from '../types'
|
||||
|
||||
export const avatarGroupInjectionKey: InjectionKey<ComputedRef<{ size: AvatarGroupProps['size'] }>> = Symbol('nuxt-ui.avatar-group')
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type InjectionKey, type ComputedRef } from 'vue'
|
||||
import { inject, computed } from 'vue'
|
||||
import type { GetObjectField } from '#ui/types/utils'
|
||||
import type { ButtonGroupProps } from '../components/ButtonGroup.vue'
|
||||
import type { GetObjectField } from '../types/utils'
|
||||
|
||||
export const buttonGroupInjectionKey: InjectionKey<ComputedRef<{
|
||||
size: ButtonGroupProps ['size']
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { inject, ref, computed, type InjectionKey, type Ref, type ComputedRef } from 'vue'
|
||||
import { type UseEventBusReturn, useDebounceFn } from '@vueuse/core'
|
||||
import type { FormEvent, FormInputEvents, FormFieldInjectedOptions, FormInjectedOptions } from '#ui/types/form'
|
||||
import type { GetObjectField } from '#ui/types/utils'
|
||||
import type { FormFieldProps } from '#ui/types'
|
||||
import type { FormFieldProps } from '../types'
|
||||
import type { FormEvent, FormInputEvents, FormFieldInjectedOptions, FormInjectedOptions } from '../types/form'
|
||||
import type { GetObjectField } from '../types/utils'
|
||||
|
||||
type Props<T> = {
|
||||
id?: string
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ref, inject } from 'vue'
|
||||
import type { ShallowRef, Component, InjectionKey } from 'vue'
|
||||
import { createSharedComposable } from '@vueuse/core'
|
||||
import type { ModalProps } from '#ui/types'
|
||||
import type { ComponentProps } from '#ui/types/component'
|
||||
import type { ModalProps } from '../types'
|
||||
import type { ComponentProps } from '../types/component'
|
||||
|
||||
export interface ModalState {
|
||||
component: Component | string
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ref, inject } from 'vue'
|
||||
import type { ShallowRef, Component, InjectionKey } from 'vue'
|
||||
import { createSharedComposable } from '@vueuse/core'
|
||||
import type { SlideoverProps } from '#ui/types'
|
||||
import type { ComponentProps } from '#ui/types/component'
|
||||
import type { SlideoverProps } from '../types'
|
||||
import type { ComponentProps } from '../types/component'
|
||||
|
||||
export interface SlideoverState {
|
||||
component: Component | string
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ToastProps } from '#ui/types'
|
||||
import { useState } from '#imports'
|
||||
import type { ToastProps } from '../types'
|
||||
|
||||
export interface Toast extends Omit<ToastProps, 'defaultOpen'> {
|
||||
id: string | number
|
||||
|
||||
@@ -39,3 +39,4 @@ export * from '../components/Textarea.vue'
|
||||
export * from '../components/Toast.vue'
|
||||
export * from '../components/Toaster.vue'
|
||||
export * from '../components/Tooltip.vue'
|
||||
export * from './form'
|
||||
@@ -2,7 +2,7 @@ import type { ZodSchema } from 'zod'
|
||||
import type { ValidationError as JoiError, Schema as JoiSchema } from 'joi'
|
||||
import type { ObjectSchema as YupObjectSchema, ValidationError as YupError } from 'yup'
|
||||
import type { ObjectSchemaAsync as ValibotObjectSchema } from 'valibot'
|
||||
import type { FormError } from '#ui/types/form'
|
||||
import type { FormError } from '../types/form'
|
||||
|
||||
export function isYupSchema(schema: any): schema is YupObjectSchema<any> {
|
||||
return schema.validate && schema.__isYupSchema__
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { reactivePick } from '@vueuse/core'
|
||||
import type { LinkProps } from '#ui/types'
|
||||
import type { LinkProps } from '../types'
|
||||
|
||||
export function pickLinkProps(link: LinkProps) {
|
||||
return reactivePick(link, 'active', 'activeClass', 'ariaCurrentValue', 'as', 'disabled', 'exact', 'exactActiveClass', 'exactHash', 'exactQuery', 'external', 'href', 'inactiveClass', 'noPrefetch', 'noRel', 'prefetch', 'prefetchedClass', 'rel', 'replace', 'target', 'to', 'type')
|
||||
|
||||
Reference in New Issue
Block a user