@nuxt/ui 3.0.0-alpha.2 → 3.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -51
- package/cli/commands/init.mjs +1 -1
- package/cli/templates.mjs +1 -1
- package/dist/module.d.mts +5 -5
- package/dist/module.d.ts +5 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +117 -89
- package/dist/runtime/components/Accordion.vue +2 -0
- package/dist/runtime/components/Alert.vue +2 -2
- package/dist/runtime/components/Breadcrumb.vue +2 -0
- package/dist/runtime/components/CommandPalette.vue +12 -2
- package/dist/runtime/components/ContextMenu.vue +2 -0
- package/dist/runtime/components/Drawer.vue +15 -7
- package/dist/runtime/components/DropdownMenu.vue +2 -0
- package/dist/runtime/components/InputMenu.vue +3 -1
- package/dist/runtime/components/NavigationMenu.vue +2 -0
- package/dist/runtime/components/Pagination.vue +10 -5
- package/dist/runtime/components/Progress.vue +2 -0
- package/dist/runtime/components/SelectMenu.vue +14 -7
- package/dist/runtime/components/Tabs.vue +2 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
- package/dist/runtime/composables/useFormField.d.ts +3 -3
- package/dist/runtime/composables/useModal.d.ts +2 -2
- package/dist/runtime/composables/useSlideover.d.ts +2 -2
- package/dist/runtime/composables/useToast.d.ts +1 -1
- package/dist/runtime/types/form.d.ts +1 -1
- package/dist/runtime/types/index.d.ts +42 -42
- package/dist/runtime/utils/form.d.ts +1 -1
- package/dist/runtime/utils/link.d.ts +3 -1
- package/dist/runtime/utils/link.js +1 -1
- package/package.json +7 -7
|
@@ -46,7 +46,7 @@ export interface AlertProps {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export interface AlertEmits {
|
|
49
|
-
(e: '
|
|
49
|
+
(e: 'update:open', value: boolean): void
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export interface AlertSlots {
|
|
@@ -122,7 +122,7 @@ const ui = computed(() => alert({
|
|
|
122
122
|
aria-label="Close"
|
|
123
123
|
v-bind="typeof close === 'object' ? close : undefined"
|
|
124
124
|
:class="ui.close({ class: props.ui?.close })"
|
|
125
|
-
@click="emits('
|
|
125
|
+
@click="emits('update:open', false)"
|
|
126
126
|
/>
|
|
127
127
|
</slot>
|
|
128
128
|
</div>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import { tv } from 'tailwind-variants'
|
|
3
4
|
import type { AppConfig } from '@nuxt/schema'
|
|
@@ -42,6 +43,7 @@ export type BreadcrumbSlots<T extends { slot?: string }> = {
|
|
|
42
43
|
'item-trailing': SlotProps<T>
|
|
43
44
|
'separator'(props?: {}): any
|
|
44
45
|
} & DynamicSlots<T, SlotProps<T>>
|
|
46
|
+
|
|
45
47
|
</script>
|
|
46
48
|
|
|
47
49
|
<script setup lang="ts" generic="T extends BreadcrumbItem">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import { tv } from 'tailwind-variants'
|
|
3
4
|
import type { ComboboxRootProps, ComboboxRootEmits, ComboboxItemProps } from 'radix-vue'
|
|
@@ -65,7 +66,7 @@ export interface CommandPaletteProps<G, T> extends Pick<ComboboxRootProps, 'mult
|
|
|
65
66
|
*/
|
|
66
67
|
placeholder?: InputProps['placeholder']
|
|
67
68
|
/**
|
|
68
|
-
* Display a close button in the input (useful when inside a
|
|
69
|
+
* Display a close button in the input (useful when inside a Modal for example).
|
|
69
70
|
* `{ size: 'md', color: 'gray', variant: 'ghost' }`{lang="ts-type"}
|
|
70
71
|
* @defaultValue false
|
|
71
72
|
*/
|
|
@@ -78,7 +79,15 @@ export interface CommandPaletteProps<G, T> extends Pick<ComboboxRootProps, 'mult
|
|
|
78
79
|
groups?: G[]
|
|
79
80
|
/**
|
|
80
81
|
* Options for [useFuse](https://vueuse.org/integrations/useFuse).
|
|
81
|
-
* @defaultValue {
|
|
82
|
+
* @defaultValue {
|
|
83
|
+
fuseOptions: {
|
|
84
|
+
ignoreLocation: true,
|
|
85
|
+
threshold: 0.1,
|
|
86
|
+
keys: ['label', 'suffix']
|
|
87
|
+
},
|
|
88
|
+
resultLimit: 12,
|
|
89
|
+
matchAllWhenSearchEmpty: true
|
|
90
|
+
}
|
|
82
91
|
*/
|
|
83
92
|
fuse?: UseFuseOptions<T>
|
|
84
93
|
class?: any
|
|
@@ -97,6 +106,7 @@ export type CommandPaletteSlots<G extends { slot?: string }, T extends { slot?:
|
|
|
97
106
|
'item-label': SlotProps<T>
|
|
98
107
|
'item-trailing': SlotProps<T>
|
|
99
108
|
} & DynamicSlots<G, SlotProps<T>> & DynamicSlots<T, SlotProps<T>>
|
|
109
|
+
|
|
100
110
|
</script>
|
|
101
111
|
|
|
102
112
|
<script setup lang="ts" generic="G extends CommandPaletteGroup<T>, T extends CommandPaletteItem">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
4
|
import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProps, ContextMenuTriggerProps, ContextMenuItemProps } from 'radix-vue'
|
|
@@ -56,6 +57,7 @@ export type ContextMenuSlots<T extends { slot?: string }> = {
|
|
|
56
57
|
'item-label': SlotProps<T>
|
|
57
58
|
'item-trailing': SlotProps<T>
|
|
58
59
|
} & DynamicSlots<T, SlotProps<T>>
|
|
60
|
+
|
|
59
61
|
</script>
|
|
60
62
|
|
|
61
63
|
<script setup lang="ts" generic="T extends ContextMenuItem">
|
|
@@ -10,7 +10,7 @@ const appConfig = _appConfig as AppConfig & { ui: { drawer: Partial<typeof theme
|
|
|
10
10
|
|
|
11
11
|
const drawer = tv({ extend: tv(theme), ...(appConfig.ui?.drawer || {}) })
|
|
12
12
|
|
|
13
|
-
export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | 'closeThreshold' | 'defaultOpen' | 'direction' | 'dismissible' | 'fadeFromIndex' | 'fixed' | 'modal' | 'nested' | 'open' | 'scrollLockTimeout' | 'shouldScaleBackground' | 'snapPoints'> {
|
|
13
|
+
export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | 'closeThreshold' | 'defaultOpen' | 'direction' | 'dismissible' | 'fadeFromIndex' | 'fixed' | 'modal' | 'nested' | 'direction' | 'open' | 'scrollLockTimeout' | 'shouldScaleBackground' | 'snapPoints'> {
|
|
14
14
|
/**
|
|
15
15
|
* The element or component this component should render as.
|
|
16
16
|
* @defaultValue 'div'
|
|
@@ -25,6 +25,11 @@ export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | '
|
|
|
25
25
|
* @defaultValue true
|
|
26
26
|
*/
|
|
27
27
|
overlay?: boolean
|
|
28
|
+
/**
|
|
29
|
+
* Render a handle on the drawer.
|
|
30
|
+
* @defaultValue true
|
|
31
|
+
*/
|
|
32
|
+
handle?: boolean
|
|
28
33
|
/**
|
|
29
34
|
* Render the drawer in a portal.
|
|
30
35
|
* @defaultValue true
|
|
@@ -49,23 +54,26 @@ export interface DrawerSlots {
|
|
|
49
54
|
</script>
|
|
50
55
|
|
|
51
56
|
<script setup lang="ts">
|
|
52
|
-
import { toRef } from 'vue'
|
|
57
|
+
import { computed, toRef } from 'vue'
|
|
53
58
|
import { useForwardPropsEmits } from 'radix-vue'
|
|
54
59
|
import { DrawerRoot, DrawerTrigger, DrawerPortal, DrawerOverlay, DrawerContent, DrawerTitle, DrawerDescription } from 'vaul-vue'
|
|
55
60
|
import { reactivePick } from '@vueuse/core'
|
|
56
61
|
|
|
57
62
|
const props = withDefaults(defineProps<DrawerProps>(), {
|
|
63
|
+
direction: 'bottom',
|
|
58
64
|
portal: true,
|
|
59
|
-
overlay: true
|
|
65
|
+
overlay: true,
|
|
66
|
+
handle: true
|
|
60
67
|
})
|
|
61
68
|
const emits = defineEmits<DrawerEmits>()
|
|
62
69
|
const slots = defineSlots<DrawerSlots>()
|
|
63
70
|
|
|
64
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, 'activeSnapPoint', 'closeThreshold', 'defaultOpen', 'dismissible', 'fadeFromIndex', 'fixed', 'modal', 'nested', 'open', 'scrollLockTimeout', 'shouldScaleBackground', 'snapPoints'), emits)
|
|
71
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'activeSnapPoint', 'closeThreshold', 'defaultOpen', 'dismissible', 'fadeFromIndex', 'fixed', 'modal', 'nested', 'direction', 'open', 'scrollLockTimeout', 'shouldScaleBackground', 'snapPoints'), emits)
|
|
65
72
|
const contentProps = toRef(() => props.content)
|
|
66
73
|
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
const ui = computed(() => drawer({
|
|
75
|
+
direction: props.direction
|
|
76
|
+
}))
|
|
69
77
|
</script>
|
|
70
78
|
|
|
71
79
|
<template>
|
|
@@ -79,7 +87,7 @@ const ui = drawer()
|
|
|
79
87
|
|
|
80
88
|
<DrawerContent :class="ui.content({ class: [props.class, props.ui?.content] })" v-bind="contentProps">
|
|
81
89
|
<slot name="handle">
|
|
82
|
-
<div :class="ui.handle({ class: props.ui?.handle })" />
|
|
90
|
+
<div v-if="handle" :class="ui.handle({ class: props.ui?.handle })" />
|
|
83
91
|
</slot>
|
|
84
92
|
|
|
85
93
|
<slot name="content">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
4
|
import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuArrowProps, DropdownMenuTriggerProps, DropdownMenuItemProps } from 'radix-vue'
|
|
@@ -64,6 +65,7 @@ export type DropdownMenuSlots<T extends { slot?: string }> = {
|
|
|
64
65
|
'item-label': SlotProps<T>
|
|
65
66
|
'item-trailing': SlotProps<T>
|
|
66
67
|
} & DynamicSlots<T, SlotProps<T>>
|
|
68
|
+
|
|
67
69
|
</script>
|
|
68
70
|
|
|
69
71
|
<script setup lang="ts" generic="T extends DropdownMenuItem">
|
|
@@ -23,6 +23,7 @@ export interface InputMenuItem extends Pick<ComboboxItemProps, 'disabled'> {
|
|
|
23
23
|
* @defaultValue 'item'
|
|
24
24
|
*/
|
|
25
25
|
type?: 'label' | 'separator' | 'item'
|
|
26
|
+
select?(e?: Event): void
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
type InputMenuVariants = VariantProps<typeof inputMenu>
|
|
@@ -100,7 +101,7 @@ export type InputMenuEmits<T> = ComboboxRootEmits<T> & {
|
|
|
100
101
|
|
|
101
102
|
type SlotProps<T> = (props: { item: T, index: number }) => any
|
|
102
103
|
|
|
103
|
-
export
|
|
104
|
+
export interface InputMenuSlots<T> {
|
|
104
105
|
'leading'(props: { modelValue: T, open: boolean, ui: any }): any
|
|
105
106
|
'trailing'(props: { modelValue: T, open: boolean, ui: any }): any
|
|
106
107
|
'empty'(props: { searchTerm?: string }): any
|
|
@@ -332,6 +333,7 @@ defineExpose({
|
|
|
332
333
|
:class="ui.item({ class: props.ui?.item })"
|
|
333
334
|
:disabled="item.disabled"
|
|
334
335
|
:value="valueKey && typeof item === 'object' ? (item[valueKey as keyof InputMenuItem]) as AcceptableValue : item"
|
|
336
|
+
@select="item.select"
|
|
335
337
|
>
|
|
336
338
|
<slot name="item" :item="(item as T)" :index="index">
|
|
337
339
|
<slot name="item-leading" :item="(item as T)" :index="index">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
4
|
import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuItemProps, NavigationMenuContentProps } from 'radix-vue'
|
|
@@ -74,6 +75,7 @@ export type NavigationMenuSlots<T extends { slot?: string }> = {
|
|
|
74
75
|
'item-label': SlotProps<T>
|
|
75
76
|
'item-trailing': SlotProps<T>
|
|
76
77
|
} & DynamicSlots<T, SlotProps<T>>
|
|
78
|
+
|
|
77
79
|
</script>
|
|
78
80
|
|
|
79
81
|
<script setup lang="ts" generic="T extends NavigationMenuItem">
|
|
@@ -44,17 +44,17 @@ export interface PaginationProps extends Pick<PaginationRootProps, 'defaultPage'
|
|
|
44
44
|
ellipsisIcon?: string
|
|
45
45
|
/**
|
|
46
46
|
* The color of the pagination controls.
|
|
47
|
-
* @defaultValue '
|
|
47
|
+
* @defaultValue 'gray'
|
|
48
48
|
*/
|
|
49
49
|
color?: ButtonProps['color']
|
|
50
50
|
/**
|
|
51
51
|
* The variant of the pagination controls.
|
|
52
|
-
* @defaultValue '
|
|
52
|
+
* @defaultValue 'outline'
|
|
53
53
|
*/
|
|
54
54
|
variant?: ButtonProps['variant']
|
|
55
55
|
/**
|
|
56
56
|
* The color of the active pagination control.
|
|
57
|
-
* @defaultValue '
|
|
57
|
+
* @defaultValue 'primary'
|
|
58
58
|
*/
|
|
59
59
|
activeColor?: ButtonProps['color']
|
|
60
60
|
/**
|
|
@@ -105,11 +105,16 @@ import { reactivePick } from '@vueuse/core'
|
|
|
105
105
|
import { useAppConfig } from '#imports'
|
|
106
106
|
|
|
107
107
|
const props = withDefaults(defineProps<PaginationProps>(), {
|
|
108
|
+
size: 'md',
|
|
108
109
|
color: 'gray',
|
|
109
|
-
activeColor: 'primary',
|
|
110
110
|
variant: 'outline',
|
|
111
|
+
activeColor: 'primary',
|
|
111
112
|
activeVariant: 'solid',
|
|
112
|
-
showControls: true
|
|
113
|
+
showControls: true,
|
|
114
|
+
showEdges: false,
|
|
115
|
+
itemsPerPage: 10,
|
|
116
|
+
siblingCount: 2,
|
|
117
|
+
total: 0
|
|
113
118
|
})
|
|
114
119
|
const emits = defineEmits<PaginationEmits>()
|
|
115
120
|
const slots = defineSlots<PaginationSlots>()
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
4
|
import type { ProgressRootProps, ProgressRootEmits } from 'radix-vue'
|
|
@@ -42,6 +43,7 @@ export type ProgressSlots = {
|
|
|
42
43
|
} & {
|
|
43
44
|
[key: string]: (props: { step: number }) => any
|
|
44
45
|
}
|
|
46
|
+
|
|
45
47
|
</script>
|
|
46
48
|
|
|
47
49
|
<script setup lang="ts">
|
|
@@ -22,6 +22,7 @@ export interface SelectMenuItem extends Pick<ComboboxItemProps, 'disabled'> {
|
|
|
22
22
|
* @defaultValue 'item'
|
|
23
23
|
*/
|
|
24
24
|
type?: 'label' | 'separator' | 'item'
|
|
25
|
+
select?(e?: Event): void
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
type SelectMenuVariants = VariantProps<typeof selectMenu>
|
|
@@ -32,11 +33,10 @@ export interface SelectMenuProps<T> extends Pick<ComboboxRootProps<T>, 'modelVal
|
|
|
32
33
|
placeholder?: string
|
|
33
34
|
/**
|
|
34
35
|
* Wether to display the search input or not.
|
|
35
|
-
*
|
|
36
|
+
* Can be an object to pass additional props to the input.
|
|
37
|
+
* @defaultValue { placeholder: 'Search...' }
|
|
36
38
|
*/
|
|
37
|
-
|
|
38
|
-
/** The placeholder text when the search input is empty. */
|
|
39
|
-
searchPlaceholder?: string
|
|
39
|
+
searchInput?: boolean | { placeholder?: string }
|
|
40
40
|
color?: SelectMenuVariants['color']
|
|
41
41
|
variant?: SelectMenuVariants['variant']
|
|
42
42
|
size?: SelectMenuVariants['size']
|
|
@@ -92,7 +92,7 @@ export type SelectMenuEmits<T> = ComboboxRootEmits<T> & {
|
|
|
92
92
|
|
|
93
93
|
type SlotProps<T> = (props: { item: T, index: number }) => any
|
|
94
94
|
|
|
95
|
-
export
|
|
95
|
+
export interface SelectMenuSlots<T> {
|
|
96
96
|
'leading'(props: { modelValue: T, open: boolean, ui: any }): any
|
|
97
97
|
'default'(props: { modelValue: T, open: boolean }): any
|
|
98
98
|
'trailing'(props: { modelValue: T, open: boolean, ui: any }): any
|
|
@@ -122,7 +122,7 @@ const props = withDefaults(defineProps<SelectMenuProps<T>>(), {
|
|
|
122
122
|
search: true,
|
|
123
123
|
portal: true,
|
|
124
124
|
autofocusDelay: 0,
|
|
125
|
-
|
|
125
|
+
searchInput: () => ({ placeholder: 'Search...' }),
|
|
126
126
|
filter: () => ['label']
|
|
127
127
|
})
|
|
128
128
|
const emits = defineEmits<SelectMenuEmits<T>>()
|
|
@@ -245,7 +245,13 @@ function onUpdateOpen(value: boolean) {
|
|
|
245
245
|
|
|
246
246
|
<ComboboxPortal :disabled="!portal">
|
|
247
247
|
<ComboboxContent :class="ui.content({ class: props.ui?.content })" v-bind="contentProps">
|
|
248
|
-
<ComboboxInput
|
|
248
|
+
<ComboboxInput
|
|
249
|
+
v-if="!!searchInput"
|
|
250
|
+
autofocus
|
|
251
|
+
autocomplete="off"
|
|
252
|
+
v-bind="typeof searchInput === 'object' ? searchInput : {}"
|
|
253
|
+
:class="ui.input({ class: props.ui?.input })"
|
|
254
|
+
/>
|
|
249
255
|
|
|
250
256
|
<ComboboxEmpty :class="ui.empty({ class: props.ui?.empty })">
|
|
251
257
|
<slot name="empty" :search-term="searchTerm">
|
|
@@ -267,6 +273,7 @@ function onUpdateOpen(value: boolean) {
|
|
|
267
273
|
:class="ui.item({ class: props.ui?.item })"
|
|
268
274
|
:disabled="item.disabled"
|
|
269
275
|
:value="valueKey && typeof item === 'object' ? (item[valueKey as keyof SelectMenuItem]) as AcceptableValue : item"
|
|
276
|
+
@select="item.select"
|
|
270
277
|
>
|
|
271
278
|
<slot name="item" :item="(item as T)" :index="index">
|
|
272
279
|
<slot name="item-leading" :item="(item as T)" :index="index">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
1
2
|
<script lang="ts">
|
|
2
3
|
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
4
|
import type { TabsRootProps, TabsRootEmits, TabsContentProps, TabsTriggerProps } from 'radix-vue'
|
|
@@ -57,6 +58,7 @@ export type TabsSlots<T extends { slot?: string }> = {
|
|
|
57
58
|
trailing: SlotProps<T>
|
|
58
59
|
content: SlotProps<T>
|
|
59
60
|
} & DynamicSlots<T, SlotProps<T>>
|
|
61
|
+
|
|
60
62
|
</script>
|
|
61
63
|
|
|
62
64
|
<script setup lang="ts" generic="T extends TabsItem">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComputedRef, type InjectionKey } from 'vue';
|
|
2
|
-
import type { AvatarGroupProps } from '../types
|
|
2
|
+
import type { AvatarGroupProps } from '../types';
|
|
3
3
|
export declare const avatarGroupInjectionKey: InjectionKey<ComputedRef<{
|
|
4
4
|
size: AvatarGroupProps['size'];
|
|
5
5
|
}>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InjectionKey, ComputedRef } from 'vue';
|
|
2
|
-
import type { ButtonGroupProps } from '../components/ButtonGroup.vue
|
|
3
|
-
import type { GetObjectField } from '../types/utils
|
|
2
|
+
import type { ButtonGroupProps } from '../components/ButtonGroup.vue';
|
|
3
|
+
import type { GetObjectField } from '../types/utils';
|
|
4
4
|
export declare const buttonGroupInjectionKey: InjectionKey<ComputedRef<{
|
|
5
5
|
size: ButtonGroupProps['size'];
|
|
6
6
|
orientation: ButtonGroupProps['orientation'];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type InjectionKey, type Ref, type ComputedRef } from 'vue';
|
|
2
2
|
import { type UseEventBusReturn } from '@vueuse/core';
|
|
3
|
-
import type { FormFieldProps } from '../types
|
|
4
|
-
import type { FormEvent, FormFieldInjectedOptions, FormInjectedOptions } from '../types/form
|
|
5
|
-
import type { GetObjectField } from '../types/utils
|
|
3
|
+
import type { FormFieldProps } from '../types';
|
|
4
|
+
import type { FormEvent, FormFieldInjectedOptions, FormInjectedOptions } from '../types/form';
|
|
5
|
+
import type { GetObjectField } from '../types/utils';
|
|
6
6
|
type Props<T> = {
|
|
7
7
|
id?: string;
|
|
8
8
|
name?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ShallowRef, Component, InjectionKey } from 'vue';
|
|
2
|
-
import type { ModalProps } from '../types
|
|
3
|
-
import type { ComponentProps } from '../types/component
|
|
2
|
+
import type { ModalProps } from '../types';
|
|
3
|
+
import type { ComponentProps } from '../types/component';
|
|
4
4
|
export interface ModalState {
|
|
5
5
|
component: Component | string;
|
|
6
6
|
props: ModalProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ShallowRef, Component, InjectionKey } from 'vue';
|
|
2
|
-
import type { SlideoverProps } from '../types
|
|
3
|
-
import type { ComponentProps } from '../types/component
|
|
2
|
+
import type { SlideoverProps } from '../types';
|
|
3
|
+
import type { ComponentProps } from '../types/component';
|
|
4
4
|
export interface SlideoverState {
|
|
5
5
|
component: Component | string;
|
|
6
6
|
props: SlideoverProps;
|
|
@@ -3,7 +3,7 @@ import type { ZodSchema } from 'zod';
|
|
|
3
3
|
import type { Schema as JoiSchema } from 'joi';
|
|
4
4
|
import type { ObjectSchema as YupObjectSchema } from 'yup';
|
|
5
5
|
import type { GenericSchema as ValibotSchema, GenericSchemaAsync as ValibotSchemaAsync, SafeParser as ValibotSafeParser, SafeParserAsync as ValibotSafeParserAsync } from 'valibot';
|
|
6
|
-
import type { GetObjectField } from './utils
|
|
6
|
+
import type { GetObjectField } from './utils';
|
|
7
7
|
export interface Form<T> {
|
|
8
8
|
validate(opts?: {
|
|
9
9
|
name: string | string[];
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
export * from '../components/Accordion.vue
|
|
2
|
-
export * from '../components/Alert.vue
|
|
3
|
-
export * from '../components/App.vue
|
|
4
|
-
export * from '../components/Avatar.vue
|
|
5
|
-
export * from '../components/AvatarGroup.vue
|
|
6
|
-
export * from '../components/Badge.vue
|
|
7
|
-
export * from '../components/Breadcrumb.vue
|
|
8
|
-
export * from '../components/Button.vue
|
|
9
|
-
export * from '../components/Card.vue
|
|
10
|
-
export * from '../components/Checkbox.vue
|
|
11
|
-
export * from '../components/Chip.vue
|
|
12
|
-
export * from '../components/Collapsible.vue
|
|
13
|
-
export * from '../components/CommandPalette.vue
|
|
14
|
-
export * from '../components/Container.vue
|
|
15
|
-
export * from '../components/ContextMenu.vue
|
|
16
|
-
export * from '../components/Drawer.vue
|
|
17
|
-
export * from '../components/DropdownMenu.vue
|
|
18
|
-
export * from '../components/Form.vue
|
|
19
|
-
export * from '../components/FormField.vue
|
|
20
|
-
export * from '../components/Input.vue
|
|
21
|
-
export * from '../components/InputMenu.vue
|
|
22
|
-
export * from '../components/Kbd.vue
|
|
23
|
-
export * from '../components/Link.vue
|
|
24
|
-
export * from '../components/Modal.vue
|
|
25
|
-
export * from '../components/NavigationMenu.vue
|
|
26
|
-
export * from '../components/Pagination.vue
|
|
27
|
-
export * from '../components/Popover.vue
|
|
28
|
-
export * from '../components/Progress.vue
|
|
29
|
-
export * from '../components/RadioGroup.vue
|
|
30
|
-
export * from '../components/Select.vue
|
|
31
|
-
export * from '../components/SelectMenu.vue
|
|
32
|
-
export * from '../components/Separator.vue
|
|
33
|
-
export * from '../components/Skeleton.vue
|
|
34
|
-
export * from '../components/Slideover.vue
|
|
35
|
-
export * from '../components/Slider.vue
|
|
36
|
-
export * from '../components/Switch.vue
|
|
37
|
-
export * from '../components/Tabs.vue
|
|
38
|
-
export * from '../components/Textarea.vue
|
|
39
|
-
export * from '../components/Toast.vue
|
|
40
|
-
export * from '../components/Toaster.vue
|
|
41
|
-
export * from '../components/Tooltip.vue
|
|
42
|
-
export * from './form
|
|
1
|
+
export * from '../components/Accordion.vue';
|
|
2
|
+
export * from '../components/Alert.vue';
|
|
3
|
+
export * from '../components/App.vue';
|
|
4
|
+
export * from '../components/Avatar.vue';
|
|
5
|
+
export * from '../components/AvatarGroup.vue';
|
|
6
|
+
export * from '../components/Badge.vue';
|
|
7
|
+
export * from '../components/Breadcrumb.vue';
|
|
8
|
+
export * from '../components/Button.vue';
|
|
9
|
+
export * from '../components/Card.vue';
|
|
10
|
+
export * from '../components/Checkbox.vue';
|
|
11
|
+
export * from '../components/Chip.vue';
|
|
12
|
+
export * from '../components/Collapsible.vue';
|
|
13
|
+
export * from '../components/CommandPalette.vue';
|
|
14
|
+
export * from '../components/Container.vue';
|
|
15
|
+
export * from '../components/ContextMenu.vue';
|
|
16
|
+
export * from '../components/Drawer.vue';
|
|
17
|
+
export * from '../components/DropdownMenu.vue';
|
|
18
|
+
export * from '../components/Form.vue';
|
|
19
|
+
export * from '../components/FormField.vue';
|
|
20
|
+
export * from '../components/Input.vue';
|
|
21
|
+
export * from '../components/InputMenu.vue';
|
|
22
|
+
export * from '../components/Kbd.vue';
|
|
23
|
+
export * from '../components/Link.vue';
|
|
24
|
+
export * from '../components/Modal.vue';
|
|
25
|
+
export * from '../components/NavigationMenu.vue';
|
|
26
|
+
export * from '../components/Pagination.vue';
|
|
27
|
+
export * from '../components/Popover.vue';
|
|
28
|
+
export * from '../components/Progress.vue';
|
|
29
|
+
export * from '../components/RadioGroup.vue';
|
|
30
|
+
export * from '../components/Select.vue';
|
|
31
|
+
export * from '../components/SelectMenu.vue';
|
|
32
|
+
export * from '../components/Separator.vue';
|
|
33
|
+
export * from '../components/Skeleton.vue';
|
|
34
|
+
export * from '../components/Slideover.vue';
|
|
35
|
+
export * from '../components/Slider.vue';
|
|
36
|
+
export * from '../components/Switch.vue';
|
|
37
|
+
export * from '../components/Tabs.vue';
|
|
38
|
+
export * from '../components/Textarea.vue';
|
|
39
|
+
export * from '../components/Toast.vue';
|
|
40
|
+
export * from '../components/Toaster.vue';
|
|
41
|
+
export * from '../components/Tooltip.vue';
|
|
42
|
+
export * from './form';
|
|
@@ -2,7 +2,7 @@ import type { ZodSchema } from 'zod';
|
|
|
2
2
|
import type { ValidationError as JoiError, Schema as JoiSchema } from 'joi';
|
|
3
3
|
import type { ObjectSchema as YupObjectSchema, ValidationError as YupError } from 'yup';
|
|
4
4
|
import type { GenericSchema as ValibotSchema, GenericSchemaAsync as ValibotSchemaAsync, SafeParser as ValibotSafeParser, SafeParserAsync as ValibotSafeParserAsync } from 'valibot';
|
|
5
|
-
import type { FormError } from '../types/form
|
|
5
|
+
import type { FormError } from '../types/form';
|
|
6
6
|
export declare function isYupSchema(schema: any): schema is YupObjectSchema<any>;
|
|
7
7
|
export declare function isYupError(error: any): error is YupError;
|
|
8
8
|
export declare function getYupErrors(state: any, schema: YupObjectSchema<any>): Promise<FormError[]>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { LinkProps } from '../types
|
|
1
|
+
import type { LinkProps } from '../types';
|
|
2
2
|
export declare function pickLinkProps(link: LinkProps & {
|
|
3
3
|
ariaLabel?: string;
|
|
4
|
+
title?: string;
|
|
4
5
|
}): {
|
|
5
6
|
type: any;
|
|
7
|
+
title: any;
|
|
6
8
|
active: any;
|
|
7
9
|
activeClass: any;
|
|
8
10
|
ariaCurrentValue: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { reactivePick } from "@vueuse/core";
|
|
2
2
|
export function pickLinkProps(link) {
|
|
3
|
-
return reactivePick(link, "active", "activeClass", "ariaCurrentValue", "ariaLabel", "as", "disabled", "exact", "exactActiveClass", "exactHash", "exactQuery", "external", "href", "inactiveClass", "noPrefetch", "noRel", "prefetch", "prefetchedClass", "rel", "replace", "target", "to", "type");
|
|
3
|
+
return reactivePick(link, "active", "activeClass", "ariaCurrentValue", "ariaLabel", "as", "disabled", "exact", "exactActiveClass", "exactHash", "exactQuery", "external", "href", "inactiveClass", "noPrefetch", "noRel", "prefetch", "prefetchedClass", "rel", "replace", "target", "to", "type", "title");
|
|
4
4
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/ui",
|
|
3
3
|
"description": "A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.",
|
|
4
|
-
"version": "3.0.0-alpha.
|
|
5
|
-
"packageManager": "pnpm@9.
|
|
4
|
+
"version": "3.0.0-alpha.4",
|
|
5
|
+
"packageManager": "pnpm@9.11.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/nuxt/ui.git"
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"release": "release-it --preRelease=alpha --npm.tag=next"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@nuxt/fonts": "^0.
|
|
49
|
-
"@nuxt/icon": "^1.5.
|
|
48
|
+
"@nuxt/fonts": "^0.9.2",
|
|
49
|
+
"@nuxt/icon": "^1.5.2",
|
|
50
50
|
"@nuxt/kit": "^3.13.2",
|
|
51
51
|
"@nuxt/schema": "^3.13.2",
|
|
52
52
|
"@nuxtjs/color-mode": "^3.5.1",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"defu": "^6.1.4",
|
|
58
58
|
"fuse.js": "^7.0.0",
|
|
59
59
|
"ohash": "^1.1.4",
|
|
60
|
-
"radix-vue": "^1.9.
|
|
60
|
+
"radix-vue": "^1.9.6",
|
|
61
61
|
"scule": "^1.3.0",
|
|
62
62
|
"tailwind-variants": "^0.2.1",
|
|
63
63
|
"tailwindcss": "4.0.0-alpha.24",
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
"@nuxt/test-utils": "^3.14.2",
|
|
70
70
|
"@release-it/conventional-changelog": "^8.0.2",
|
|
71
71
|
"@vue/test-utils": "^2.4.6",
|
|
72
|
-
"eslint": "^9.
|
|
72
|
+
"eslint": "^9.11.1",
|
|
73
73
|
"happy-dom": "^15.7.4",
|
|
74
74
|
"joi": "^17.13.3",
|
|
75
75
|
"nuxt": "^3.13.2",
|
|
76
76
|
"release-it": "^17.6.0",
|
|
77
|
-
"valibot": "^0.42.
|
|
77
|
+
"valibot": "^0.42.1",
|
|
78
78
|
"vitest": "^2.1.1",
|
|
79
79
|
"vitest-environment-nuxt": "^1.0.1",
|
|
80
80
|
"vue-tsc": "^2.1.6",
|