@nuxt/ui 4.6.1 → 4.7.0
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 +7 -4
- package/cli/package.json +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -2
- package/dist/runtime/components/Accordion.d.vue.ts +6 -1
- package/dist/runtime/components/Accordion.vue +1 -1
- package/dist/runtime/components/Accordion.vue.d.ts +6 -1
- package/dist/runtime/components/AuthForm.d.vue.ts +22 -29
- package/dist/runtime/components/AuthForm.vue +8 -6
- package/dist/runtime/components/AuthForm.vue.d.ts +22 -29
- package/dist/runtime/components/Calendar.vue +4 -4
- package/dist/runtime/components/Card.d.vue.ts +4 -0
- package/dist/runtime/components/Card.vue +16 -2
- package/dist/runtime/components/Card.vue.d.ts +4 -0
- package/dist/runtime/components/ChatMessage.d.vue.ts +27 -17
- package/dist/runtime/components/ChatMessage.vue +10 -16
- package/dist/runtime/components/ChatMessage.vue.d.ts +27 -17
- package/dist/runtime/components/ChatMessages.d.vue.ts +27 -21
- package/dist/runtime/components/ChatMessages.vue +22 -23
- package/dist/runtime/components/ChatMessages.vue.d.ts +27 -21
- package/dist/runtime/components/ChatPromptSubmit.vue +3 -1
- package/dist/runtime/components/Checkbox.vue +5 -3
- package/dist/runtime/components/CommandPalette.d.vue.ts +18 -3
- package/dist/runtime/components/CommandPalette.vue +11 -7
- package/dist/runtime/components/CommandPalette.vue.d.ts +18 -3
- package/dist/runtime/components/ContextMenuContent.vue +68 -65
- package/dist/runtime/components/DashboardSearch.d.vue.ts +8 -37
- package/dist/runtime/components/DashboardSearch.vue +11 -10
- package/dist/runtime/components/DashboardSearch.vue.d.ts +8 -37
- package/dist/runtime/components/DashboardSidebar.vue +1 -5
- package/dist/runtime/components/Drawer.vue +44 -41
- package/dist/runtime/components/DropdownMenuContent.vue +90 -87
- package/dist/runtime/components/EditorEmojiMenu.d.vue.ts +1 -1
- package/dist/runtime/components/EditorEmojiMenu.vue +2 -0
- package/dist/runtime/components/EditorEmojiMenu.vue.d.ts +1 -1
- package/dist/runtime/components/EditorMentionMenu.d.vue.ts +1 -1
- package/dist/runtime/components/EditorMentionMenu.vue +2 -0
- package/dist/runtime/components/EditorMentionMenu.vue.d.ts +1 -1
- package/dist/runtime/components/EditorSuggestionMenu.d.vue.ts +1 -1
- package/dist/runtime/components/EditorSuggestionMenu.vue +2 -0
- package/dist/runtime/components/EditorSuggestionMenu.vue.d.ts +1 -1
- package/dist/runtime/components/FileUpload.vue +7 -5
- package/dist/runtime/components/Header.vue +1 -5
- package/dist/runtime/components/Input.vue +2 -2
- package/dist/runtime/components/InputDate.vue +6 -6
- package/dist/runtime/components/InputMenu.d.vue.ts +3 -3
- package/dist/runtime/components/InputMenu.vue +40 -38
- package/dist/runtime/components/InputMenu.vue.d.ts +3 -3
- package/dist/runtime/components/InputNumber.vue +2 -2
- package/dist/runtime/components/InputTags.vue +2 -2
- package/dist/runtime/components/InputTime.vue +2 -2
- package/dist/runtime/components/Link.vue +64 -8
- package/dist/runtime/components/Listbox.d.vue.ts +228 -0
- package/dist/runtime/components/Listbox.vue +242 -0
- package/dist/runtime/components/Listbox.vue.d.ts +228 -0
- package/dist/runtime/components/Modal.vue +13 -10
- package/dist/runtime/components/Popover.vue +7 -4
- package/dist/runtime/components/PricingTable.vue +60 -58
- package/dist/runtime/components/RadioGroup.vue +5 -3
- package/dist/runtime/components/Select.d.vue.ts +1 -1
- package/dist/runtime/components/Select.vue +84 -73
- package/dist/runtime/components/Select.vue.d.ts +1 -1
- package/dist/runtime/components/SelectMenu.d.vue.ts +3 -3
- package/dist/runtime/components/SelectMenu.vue +54 -52
- package/dist/runtime/components/SelectMenu.vue.d.ts +3 -3
- package/dist/runtime/components/Sidebar.vue +1 -4
- package/dist/runtime/components/Slideover.vue +67 -64
- package/dist/runtime/components/Table.d.vue.ts +1 -2
- package/dist/runtime/components/Table.vue +17 -29
- package/dist/runtime/components/Table.vue.d.ts +1 -2
- package/dist/runtime/components/Tabs.d.vue.ts +5 -1
- package/dist/runtime/components/Tabs.vue +2 -2
- package/dist/runtime/components/Tabs.vue.d.ts +5 -1
- package/dist/runtime/components/Textarea.d.vue.ts +1 -0
- package/dist/runtime/components/Textarea.vue +2 -1
- package/dist/runtime/components/Textarea.vue.d.ts +1 -0
- package/dist/runtime/components/Tooltip.vue +12 -9
- package/dist/runtime/components/content/ContentSearch.d.vue.ts +19 -35
- package/dist/runtime/components/content/ContentSearch.vue +10 -9
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +19 -35
- package/dist/runtime/components/content/ContentToc.vue +19 -9
- package/dist/runtime/components/prose/Img.vue +2 -1
- package/dist/runtime/components/prose/Pre.vue +8 -3
- package/dist/runtime/components/prose/Prompt.d.vue.ts +32 -0
- package/dist/runtime/components/prose/Prompt.vue +88 -0
- package/dist/runtime/components/prose/Prompt.vue.d.ts +32 -0
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/useContentSearch.js +19 -5
- package/dist/runtime/composables/useEditorMenu.d.ts +5 -0
- package/dist/runtime/composables/useEditorMenu.js +3 -1
- package/dist/runtime/composables/useFieldGroup.d.ts +3 -0
- package/dist/runtime/composables/useFieldGroup.js +11 -1
- package/dist/runtime/composables/useResolvedVariants.d.ts +21 -0
- package/dist/runtime/composables/useResolvedVariants.js +14 -0
- package/dist/runtime/locale/ar.js +9 -0
- package/dist/runtime/locale/az.js +9 -0
- package/dist/runtime/locale/be.js +9 -0
- package/dist/runtime/locale/bg.js +9 -0
- package/dist/runtime/locale/bn.js +9 -0
- package/dist/runtime/locale/ca.js +9 -0
- package/dist/runtime/locale/ckb.js +10 -1
- package/dist/runtime/locale/cs.js +9 -0
- package/dist/runtime/locale/da.js +9 -0
- package/dist/runtime/locale/de.js +9 -0
- package/dist/runtime/locale/de_ch.js +9 -0
- package/dist/runtime/locale/el.js +9 -0
- package/dist/runtime/locale/en.js +10 -1
- package/dist/runtime/locale/es.js +9 -0
- package/dist/runtime/locale/et.js +9 -0
- package/dist/runtime/locale/eu.js +11 -2
- package/dist/runtime/locale/fa_ir.js +9 -0
- package/dist/runtime/locale/fi.js +9 -0
- package/dist/runtime/locale/fr.js +9 -0
- package/dist/runtime/locale/gl.js +9 -0
- package/dist/runtime/locale/he.js +9 -0
- package/dist/runtime/locale/hi.js +9 -0
- package/dist/runtime/locale/hr.js +9 -0
- package/dist/runtime/locale/hu.js +9 -0
- package/dist/runtime/locale/hy.js +9 -0
- package/dist/runtime/locale/id.js +9 -0
- package/dist/runtime/locale/is.js +9 -0
- package/dist/runtime/locale/it.js +9 -0
- package/dist/runtime/locale/ja.js +9 -0
- package/dist/runtime/locale/ka.js +9 -0
- package/dist/runtime/locale/kk.js +9 -0
- package/dist/runtime/locale/km.js +9 -0
- package/dist/runtime/locale/ko.js +9 -0
- package/dist/runtime/locale/ky.js +9 -0
- package/dist/runtime/locale/lb.js +11 -2
- package/dist/runtime/locale/lo.js +15 -6
- package/dist/runtime/locale/lt.js +9 -0
- package/dist/runtime/locale/mn.js +9 -0
- package/dist/runtime/locale/ms.js +9 -0
- package/dist/runtime/locale/nb_no.js +9 -0
- package/dist/runtime/locale/nl.js +9 -0
- package/dist/runtime/locale/pl.js +9 -0
- package/dist/runtime/locale/pt.js +9 -0
- package/dist/runtime/locale/pt_br.js +9 -0
- package/dist/runtime/locale/ro.js +9 -0
- package/dist/runtime/locale/ru.js +9 -0
- package/dist/runtime/locale/sk.js +9 -0
- package/dist/runtime/locale/sl.js +9 -0
- package/dist/runtime/locale/sq.js +9 -0
- package/dist/runtime/locale/sv.js +9 -0
- package/dist/runtime/locale/th.js +9 -0
- package/dist/runtime/locale/tj.js +9 -0
- package/dist/runtime/locale/tr.js +9 -0
- package/dist/runtime/locale/ug_cn.js +9 -0
- package/dist/runtime/locale/uk.js +9 -0
- package/dist/runtime/locale/ur.js +9 -0
- package/dist/runtime/locale/uz.js +9 -0
- package/dist/runtime/locale/vi.js +9 -0
- package/dist/runtime/locale/zh_cn.js +9 -0
- package/dist/runtime/locale/zh_tw.js +9 -0
- package/dist/runtime/plugins/colors.js +1 -1
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/locale.d.ts +9 -0
- package/dist/runtime/types/prose.d.ts +1 -0
- package/dist/runtime/types/prose.js +1 -0
- package/dist/runtime/vue/overrides/inertia/Link.vue +3 -3
- package/dist/runtime/vue/overrides/none/Link.vue +3 -2
- package/dist/runtime/vue/overrides/vue-router/Link.vue +27 -31
- package/dist/shared/{ui.DJUbBpE2.mjs → ui.BIQuJqNV.mjs} +186 -34
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +48 -39
package/README.md
CHANGED
|
@@ -58,13 +58,14 @@ bun add @nuxt/ui tailwindcss
|
|
|
58
58
|
|
|
59
59
|
```ts [nuxt.config.ts]
|
|
60
60
|
export default defineNuxtConfig({
|
|
61
|
-
modules: ['@nuxt/ui']
|
|
61
|
+
modules: ['@nuxt/ui'],
|
|
62
|
+
css: ['~/assets/css/main.css']
|
|
62
63
|
})
|
|
63
64
|
```
|
|
64
65
|
|
|
65
66
|
2. Import Tailwind CSS and Nuxt UI in your CSS:
|
|
66
67
|
|
|
67
|
-
```css [assets/css/main.css]
|
|
68
|
+
```css [app/assets/css/main.css]
|
|
68
69
|
@import "tailwindcss";
|
|
69
70
|
@import "@nuxt/ui";
|
|
70
71
|
```
|
|
@@ -90,7 +91,9 @@ export default defineConfig({
|
|
|
90
91
|
|
|
91
92
|
2. Use the Nuxt UI Vue plugin in your `main.ts`:
|
|
92
93
|
|
|
93
|
-
```ts [main.ts]
|
|
94
|
+
```ts [src/main.ts]
|
|
95
|
+
import './assets/css/main.css'
|
|
96
|
+
|
|
94
97
|
import { createApp } from 'vue'
|
|
95
98
|
import { createRouter, createWebHistory } from 'vue-router'
|
|
96
99
|
import ui from '@nuxt/ui/vue-plugin'
|
|
@@ -111,7 +114,7 @@ app.mount('#app')
|
|
|
111
114
|
|
|
112
115
|
3. Import Tailwind CSS and Nuxt UI in your CSS:
|
|
113
116
|
|
|
114
|
-
```css [assets/main.css]
|
|
117
|
+
```css [src/assets/css/main.css]
|
|
115
118
|
@import "tailwindcss";
|
|
116
119
|
@import "@nuxt/ui";
|
|
117
120
|
```
|
package/cli/package.json
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defu } from 'defu';
|
|
2
2
|
import { defineNuxtModule, createResolver, addPlugin, hasNuxtModule, addComponentsDir, addImportsDir, addImports } from '@nuxt/kit';
|
|
3
|
-
import { d as defaultOptions, r as resolveColors, a as getDefaultConfig, p as publicComposables, b as addTemplates } from './shared/ui.
|
|
3
|
+
import { d as defaultOptions, r as resolveColors, a as getDefaultConfig, p as publicComposables, b as addTemplates } from './shared/ui.BIQuJqNV.mjs';
|
|
4
4
|
import '../dist/runtime/utils/index.js';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'scule';
|
|
@@ -11,7 +11,7 @@ import 'pathe';
|
|
|
11
11
|
import 'tinyglobby';
|
|
12
12
|
|
|
13
13
|
const name = "@nuxt/ui";
|
|
14
|
-
const version = "4.
|
|
14
|
+
const version = "4.7.0";
|
|
15
15
|
|
|
16
16
|
const module$1 = defineNuxtModule({
|
|
17
17
|
meta: {
|
|
@@ -79,6 +79,7 @@ const module$1 = defineNuxtModule({
|
|
|
79
79
|
"icon": "ProseIcon",
|
|
80
80
|
"kbd": "ProseKbd",
|
|
81
81
|
"note": "ProseNote",
|
|
82
|
+
"prompt": "ProsePrompt",
|
|
82
83
|
"steps": "ProseSteps",
|
|
83
84
|
"tabs": "ProseTabs",
|
|
84
85
|
"tabs-item": "ProseTabsItem",
|
|
@@ -18,7 +18,12 @@ export interface AccordionItem {
|
|
|
18
18
|
trailingIcon?: IconProps['name'];
|
|
19
19
|
slot?: string;
|
|
20
20
|
content?: string;
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* A unique value for the accordion item. Defaults to the index.
|
|
23
|
+
* Also used as the Vue `key` for this item, so providing a stable value prevents
|
|
24
|
+
* accordion content (and its local state) from remounting when items are added, removed,
|
|
25
|
+
* or reordered.
|
|
26
|
+
*/
|
|
22
27
|
value?: string;
|
|
23
28
|
disabled?: boolean;
|
|
24
29
|
class?: any;
|
|
@@ -41,7 +41,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.accordion ||
|
|
|
41
41
|
<AccordionItem
|
|
42
42
|
v-for="(item, index) in props.items"
|
|
43
43
|
v-slot="{ open }"
|
|
44
|
-
:key="index"
|
|
44
|
+
:key="get(item, props.valueKey) ?? index"
|
|
45
45
|
:value="get(item, props.valueKey) ?? String(index)"
|
|
46
46
|
:disabled="item.disabled"
|
|
47
47
|
data-slot="item"
|
|
@@ -18,7 +18,12 @@ export interface AccordionItem {
|
|
|
18
18
|
trailingIcon?: IconProps['name'];
|
|
19
19
|
slot?: string;
|
|
20
20
|
content?: string;
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* A unique value for the accordion item. Defaults to the index.
|
|
23
|
+
* Also used as the Vue `key` for this item, so providing a stable value prevents
|
|
24
|
+
* accordion content (and its local state) from remounting when items are added, removed,
|
|
25
|
+
* or reordered.
|
|
26
|
+
*/
|
|
22
27
|
value?: string;
|
|
23
28
|
disabled?: boolean;
|
|
24
29
|
class?: any;
|
|
@@ -87,6 +87,7 @@ export type AuthFormSlots<T extends object = object, F extends AuthFormField = A
|
|
|
87
87
|
title?(props?: {}): VNode[];
|
|
88
88
|
description?(props?: {}): VNode[];
|
|
89
89
|
providers?(props?: {}): VNode[];
|
|
90
|
+
separator?(props?: {}): VNode[];
|
|
90
91
|
validation?(props?: {}): VNode[];
|
|
91
92
|
submit?(props: {
|
|
92
93
|
loading: boolean;
|
|
@@ -102,7 +103,7 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
102
103
|
__VLS_PROPS_FALLBACK: infer P;
|
|
103
104
|
} ? P : {});
|
|
104
105
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
105
|
-
formRef: Readonly<import("vue").ShallowRef<
|
|
106
|
+
formRef: Readonly<import("vue").ShallowRef<{
|
|
106
107
|
validate: {
|
|
107
108
|
<T_1 extends boolean>(opts: {
|
|
108
109
|
name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
|
|
@@ -117,30 +118,26 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
117
118
|
transform?: T_1 | undefined;
|
|
118
119
|
}): Promise<false | import("../types").FormData<T, T_1>>;
|
|
119
120
|
};
|
|
120
|
-
errors:
|
|
121
|
+
errors: {
|
|
121
122
|
id?: string | undefined;
|
|
122
123
|
name?: string | undefined;
|
|
123
124
|
message: string;
|
|
124
|
-
}[]
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}[]>;
|
|
129
|
-
setErrors(errs: import("../types").FormError[], name?: string | RegExp | keyof InferInput<T> | undefined): void;
|
|
130
|
-
submit(): Promise<void>;
|
|
131
|
-
getErrors(name?: string | RegExp | keyof InferInput<T> | undefined): {
|
|
125
|
+
}[];
|
|
126
|
+
setErrors: (errs: import("../types").FormError[], name?: string | RegExp | keyof InferInput<T> | undefined) => void;
|
|
127
|
+
submit: () => Promise<void>;
|
|
128
|
+
getErrors: (name?: string | RegExp | keyof InferInput<T> | undefined) => {
|
|
132
129
|
id?: string | undefined;
|
|
133
130
|
name?: string | undefined;
|
|
134
131
|
message: string;
|
|
135
132
|
}[];
|
|
136
|
-
clear(name?: string | RegExp | keyof InferInput<T> | undefined)
|
|
137
|
-
disabled:
|
|
138
|
-
loading:
|
|
139
|
-
dirty:
|
|
133
|
+
clear: (name?: string | RegExp | keyof InferInput<T> | undefined) => void;
|
|
134
|
+
disabled: boolean;
|
|
135
|
+
loading: boolean;
|
|
136
|
+
dirty: boolean;
|
|
140
137
|
dirtyFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
141
138
|
blurredFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
142
139
|
touchedFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
143
|
-
}
|
|
140
|
+
} | null, {
|
|
144
141
|
validate: {
|
|
145
142
|
<T_1 extends boolean>(opts: {
|
|
146
143
|
name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
|
|
@@ -155,30 +152,26 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
155
152
|
transform?: T_1 | undefined;
|
|
156
153
|
}): Promise<false | import("../types").FormData<T, T_1>>;
|
|
157
154
|
};
|
|
158
|
-
errors:
|
|
155
|
+
errors: {
|
|
159
156
|
id?: string | undefined;
|
|
160
157
|
name?: string | undefined;
|
|
161
158
|
message: string;
|
|
162
|
-
}[]
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}[]>;
|
|
167
|
-
setErrors(errs: import("../types").FormError[], name?: string | RegExp | keyof InferInput<T> | undefined): void;
|
|
168
|
-
submit(): Promise<void>;
|
|
169
|
-
getErrors(name?: string | RegExp | keyof InferInput<T> | undefined): {
|
|
159
|
+
}[];
|
|
160
|
+
setErrors: (errs: import("../types").FormError[], name?: string | RegExp | keyof InferInput<T> | undefined) => void;
|
|
161
|
+
submit: () => Promise<void>;
|
|
162
|
+
getErrors: (name?: string | RegExp | keyof InferInput<T> | undefined) => {
|
|
170
163
|
id?: string | undefined;
|
|
171
164
|
name?: string | undefined;
|
|
172
165
|
message: string;
|
|
173
166
|
}[];
|
|
174
|
-
clear(name?: string | RegExp | keyof InferInput<T> | undefined)
|
|
175
|
-
disabled:
|
|
176
|
-
loading:
|
|
177
|
-
dirty:
|
|
167
|
+
clear: (name?: string | RegExp | keyof InferInput<T> | undefined) => void;
|
|
168
|
+
disabled: boolean;
|
|
169
|
+
loading: boolean;
|
|
170
|
+
dirty: boolean;
|
|
178
171
|
dirtyFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
179
172
|
blurredFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
180
173
|
touchedFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
181
|
-
}
|
|
174
|
+
} | null>>;
|
|
182
175
|
state: import("vue").Reactive<InferInput<T>>;
|
|
183
176
|
}>) => void;
|
|
184
177
|
attrs: any;
|
|
@@ -116,12 +116,14 @@ defineExpose({
|
|
|
116
116
|
</slot>
|
|
117
117
|
</div>
|
|
118
118
|
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
<slot name="separator">
|
|
120
|
+
<USeparator
|
|
121
|
+
v-if="providers?.length && fields?.length"
|
|
122
|
+
v-bind="typeof separator === 'object' ? separator : { label: separator }"
|
|
123
|
+
data-slot="separator"
|
|
124
|
+
:class="ui.separator({ class: uiProp?.separator })"
|
|
125
|
+
/>
|
|
126
|
+
</slot>
|
|
125
127
|
|
|
126
128
|
<UForm
|
|
127
129
|
v-if="fields?.length"
|
|
@@ -87,6 +87,7 @@ export type AuthFormSlots<T extends object = object, F extends AuthFormField = A
|
|
|
87
87
|
title?(props?: {}): VNode[];
|
|
88
88
|
description?(props?: {}): VNode[];
|
|
89
89
|
providers?(props?: {}): VNode[];
|
|
90
|
+
separator?(props?: {}): VNode[];
|
|
90
91
|
validation?(props?: {}): VNode[];
|
|
91
92
|
submit?(props: {
|
|
92
93
|
loading: boolean;
|
|
@@ -102,7 +103,7 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
102
103
|
__VLS_PROPS_FALLBACK: infer P;
|
|
103
104
|
} ? P : {});
|
|
104
105
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
105
|
-
formRef: Readonly<import("vue").ShallowRef<
|
|
106
|
+
formRef: Readonly<import("vue").ShallowRef<{
|
|
106
107
|
validate: {
|
|
107
108
|
<T_1 extends boolean>(opts: {
|
|
108
109
|
name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
|
|
@@ -117,30 +118,26 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
117
118
|
transform?: T_1 | undefined;
|
|
118
119
|
}): Promise<false | import("../types").FormData<T, T_1>>;
|
|
119
120
|
};
|
|
120
|
-
errors:
|
|
121
|
+
errors: {
|
|
121
122
|
id?: string | undefined;
|
|
122
123
|
name?: string | undefined;
|
|
123
124
|
message: string;
|
|
124
|
-
}[]
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}[]>;
|
|
129
|
-
setErrors(errs: import("../types").FormError[], name?: string | RegExp | keyof InferInput<T> | undefined): void;
|
|
130
|
-
submit(): Promise<void>;
|
|
131
|
-
getErrors(name?: string | RegExp | keyof InferInput<T> | undefined): {
|
|
125
|
+
}[];
|
|
126
|
+
setErrors: (errs: import("../types").FormError[], name?: string | RegExp | keyof InferInput<T> | undefined) => void;
|
|
127
|
+
submit: () => Promise<void>;
|
|
128
|
+
getErrors: (name?: string | RegExp | keyof InferInput<T> | undefined) => {
|
|
132
129
|
id?: string | undefined;
|
|
133
130
|
name?: string | undefined;
|
|
134
131
|
message: string;
|
|
135
132
|
}[];
|
|
136
|
-
clear(name?: string | RegExp | keyof InferInput<T> | undefined)
|
|
137
|
-
disabled:
|
|
138
|
-
loading:
|
|
139
|
-
dirty:
|
|
133
|
+
clear: (name?: string | RegExp | keyof InferInput<T> | undefined) => void;
|
|
134
|
+
disabled: boolean;
|
|
135
|
+
loading: boolean;
|
|
136
|
+
dirty: boolean;
|
|
140
137
|
dirtyFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
141
138
|
blurredFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
142
139
|
touchedFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
143
|
-
}
|
|
140
|
+
} | null, {
|
|
144
141
|
validate: {
|
|
145
142
|
<T_1 extends boolean>(opts: {
|
|
146
143
|
name?: keyof InferInput<T> | (keyof InferInput<T>)[] | undefined;
|
|
@@ -155,30 +152,26 @@ declare const __VLS_export: <T extends FormSchema, F extends AuthFormField>(__VL
|
|
|
155
152
|
transform?: T_1 | undefined;
|
|
156
153
|
}): Promise<false | import("../types").FormData<T, T_1>>;
|
|
157
154
|
};
|
|
158
|
-
errors:
|
|
155
|
+
errors: {
|
|
159
156
|
id?: string | undefined;
|
|
160
157
|
name?: string | undefined;
|
|
161
158
|
message: string;
|
|
162
|
-
}[]
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}[]>;
|
|
167
|
-
setErrors(errs: import("../types").FormError[], name?: string | RegExp | keyof InferInput<T> | undefined): void;
|
|
168
|
-
submit(): Promise<void>;
|
|
169
|
-
getErrors(name?: string | RegExp | keyof InferInput<T> | undefined): {
|
|
159
|
+
}[];
|
|
160
|
+
setErrors: (errs: import("../types").FormError[], name?: string | RegExp | keyof InferInput<T> | undefined) => void;
|
|
161
|
+
submit: () => Promise<void>;
|
|
162
|
+
getErrors: (name?: string | RegExp | keyof InferInput<T> | undefined) => {
|
|
170
163
|
id?: string | undefined;
|
|
171
164
|
name?: string | undefined;
|
|
172
165
|
message: string;
|
|
173
166
|
}[];
|
|
174
|
-
clear(name?: string | RegExp | keyof InferInput<T> | undefined)
|
|
175
|
-
disabled:
|
|
176
|
-
loading:
|
|
177
|
-
dirty:
|
|
167
|
+
clear: (name?: string | RegExp | keyof InferInput<T> | undefined) => void;
|
|
168
|
+
disabled: boolean;
|
|
169
|
+
loading: boolean;
|
|
170
|
+
dirty: boolean;
|
|
178
171
|
dirtyFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
179
172
|
blurredFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
180
173
|
touchedFields: ReadonlySet<import("vue").DeepReadonly<import("@vue/reactivity").UnwrapRefSimple<keyof InferInput<T>>>>;
|
|
181
|
-
}
|
|
174
|
+
} | null>>;
|
|
182
175
|
state: import("vue").Reactive<InferInput<T>>;
|
|
183
176
|
}>) => void;
|
|
184
177
|
attrs: any;
|
|
@@ -35,8 +35,8 @@ const props = defineProps({
|
|
|
35
35
|
weekNumbers: { type: Boolean, required: false },
|
|
36
36
|
class: { type: null, required: false },
|
|
37
37
|
ui: { type: Object, required: false },
|
|
38
|
-
defaultPlaceholder: { type:
|
|
39
|
-
placeholder: { type:
|
|
38
|
+
defaultPlaceholder: { type: Object, required: false },
|
|
39
|
+
placeholder: { type: Object, required: false },
|
|
40
40
|
allowNonContiguousRanges: { type: Boolean, required: false },
|
|
41
41
|
pagedNavigation: { type: Boolean, required: false },
|
|
42
42
|
preventDeselect: { type: Boolean, required: false },
|
|
@@ -44,8 +44,8 @@ const props = defineProps({
|
|
|
44
44
|
weekStartsOn: { type: Number, required: false },
|
|
45
45
|
weekdayFormat: { type: String, required: false },
|
|
46
46
|
fixedWeeks: { type: Boolean, required: false, default: true },
|
|
47
|
-
maxValue: { type:
|
|
48
|
-
minValue: { type:
|
|
47
|
+
maxValue: { type: Object, required: false },
|
|
48
|
+
minValue: { type: Object, required: false },
|
|
49
49
|
numberOfMonths: { type: Number, required: false },
|
|
50
50
|
disabled: { type: Boolean, required: false },
|
|
51
51
|
readonly: { type: Boolean, required: false },
|
|
@@ -9,6 +9,8 @@ export interface CardProps {
|
|
|
9
9
|
* @defaultValue 'div'
|
|
10
10
|
*/
|
|
11
11
|
as?: any;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
12
14
|
/**
|
|
13
15
|
* @defaultValue 'outline'
|
|
14
16
|
*/
|
|
@@ -18,6 +20,8 @@ export interface CardProps {
|
|
|
18
20
|
}
|
|
19
21
|
export interface CardSlots {
|
|
20
22
|
header?(props?: {}): VNode[];
|
|
23
|
+
title?(props?: {}): VNode[];
|
|
24
|
+
description?(props?: {}): VNode[];
|
|
21
25
|
default?(props?: {}): VNode[];
|
|
22
26
|
footer?(props?: {}): VNode[];
|
|
23
27
|
}
|
|
@@ -10,6 +10,8 @@ import { useComponentUI } from "../composables/useComponentUI";
|
|
|
10
10
|
import { tv } from "../utils/tv";
|
|
11
11
|
const props = defineProps({
|
|
12
12
|
as: { type: null, required: false },
|
|
13
|
+
title: { type: String, required: false },
|
|
14
|
+
description: { type: String, required: false },
|
|
13
15
|
variant: { type: null, required: false },
|
|
14
16
|
class: { type: null, required: false },
|
|
15
17
|
ui: { type: Object, required: false }
|
|
@@ -24,8 +26,20 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.card || {} })
|
|
|
24
26
|
|
|
25
27
|
<template>
|
|
26
28
|
<Primitive :as="as" data-slot="root" :class="ui.root({ class: [uiProp?.root, props.class] })">
|
|
27
|
-
<div v-if="!!slots.header" data-slot="header" :class="ui.header({ class: uiProp?.header })">
|
|
28
|
-
<slot name="header"
|
|
29
|
+
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description)" data-slot="header" :class="ui.header({ class: uiProp?.header })">
|
|
30
|
+
<slot name="header">
|
|
31
|
+
<div v-if="title || !!slots.title" data-slot="title" :class="ui.title({ class: uiProp?.title })">
|
|
32
|
+
<slot name="title">
|
|
33
|
+
{{ title }}
|
|
34
|
+
</slot>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div v-if="description || !!slots.description" data-slot="description" :class="ui.description({ class: uiProp?.description })">
|
|
38
|
+
<slot name="description">
|
|
39
|
+
{{ description }}
|
|
40
|
+
</slot>
|
|
41
|
+
</div>
|
|
42
|
+
</slot>
|
|
29
43
|
</div>
|
|
30
44
|
|
|
31
45
|
<div v-if="!!slots.default" data-slot="body" :class="ui.body({ class: uiProp?.body })">
|
|
@@ -9,6 +9,8 @@ export interface CardProps {
|
|
|
9
9
|
* @defaultValue 'div'
|
|
10
10
|
*/
|
|
11
11
|
as?: any;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
12
14
|
/**
|
|
13
15
|
* @defaultValue 'outline'
|
|
14
16
|
*/
|
|
@@ -18,6 +20,8 @@ export interface CardProps {
|
|
|
18
20
|
}
|
|
19
21
|
export interface CardSlots {
|
|
20
22
|
header?(props?: {}): VNode[];
|
|
23
|
+
title?(props?: {}): VNode[];
|
|
24
|
+
description?(props?: {}): VNode[];
|
|
21
25
|
default?(props?: {}): VNode[];
|
|
22
26
|
footer?(props?: {}): VNode[];
|
|
23
27
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
-
import type { UIMessage, FileUIPart } from 'ai';
|
|
3
|
+
import type { UIDataTypes, UIMessage, UITools, FileUIPart } from 'ai';
|
|
4
4
|
import theme from '#build/ui/chat-message';
|
|
5
5
|
import type { AvatarProps, ButtonProps, IconProps } from '../types';
|
|
6
6
|
import type { ComponentConfig } from '../types/tv';
|
|
7
7
|
type ChatMessage = ComponentConfig<typeof theme, AppConfig, 'chatMessage'>;
|
|
8
|
-
export interface ChatMessageProps extends UIMessage {
|
|
8
|
+
export interface ChatMessageProps<TMetadata = unknown, TDataParts extends UIDataTypes = UIDataTypes, TTools extends UITools = UITools> extends UIMessage<TMetadata, TDataParts, TTools> {
|
|
9
9
|
/**
|
|
10
10
|
* The element or component this component should render as.
|
|
11
11
|
* @defaultValue 'article'
|
|
@@ -32,7 +32,7 @@ export interface ChatMessageProps extends UIMessage {
|
|
|
32
32
|
* `{ size: 'xs', color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
|
|
33
33
|
*/
|
|
34
34
|
actions?: (Omit<ButtonProps, 'onClick'> & {
|
|
35
|
-
onClick?: (e: MouseEvent, message: UIMessage) => void;
|
|
35
|
+
onClick?: (e: MouseEvent, message: UIMessage<TMetadata, TDataParts, TTools>) => void;
|
|
36
36
|
})[];
|
|
37
37
|
/**
|
|
38
38
|
* Render the message in a compact style.
|
|
@@ -48,26 +48,36 @@ export interface ChatMessageProps extends UIMessage {
|
|
|
48
48
|
class?: any;
|
|
49
49
|
ui?: ChatMessage['slots'];
|
|
50
50
|
}
|
|
51
|
-
export interface ChatMessageSlots {
|
|
52
|
-
leading?(props: {
|
|
53
|
-
avatar: ChatMessageProps['avatar'];
|
|
51
|
+
export interface ChatMessageSlots<TMetadata = unknown, TDataParts extends UIDataTypes = UIDataTypes, TTools extends UITools = UITools> {
|
|
52
|
+
leading?(props: UIMessage<TMetadata, TDataParts, TTools> & {
|
|
53
|
+
avatar: ChatMessageProps<TMetadata, TDataParts, TTools>['avatar'];
|
|
54
54
|
ui: ChatMessage['ui'];
|
|
55
55
|
}): VNode[];
|
|
56
|
-
files?(props: {
|
|
56
|
+
files?(props: Omit<UIMessage<TMetadata, TDataParts, TTools>, 'parts'> & {
|
|
57
57
|
parts: FileUIPart[];
|
|
58
58
|
}): VNode[];
|
|
59
|
-
content?(props:
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
content?(props: UIMessage<TMetadata, TDataParts, TTools> & {
|
|
60
|
+
content?: string;
|
|
61
|
+
}): VNode[];
|
|
62
|
+
actions?(props: UIMessage<TMetadata, TDataParts, TTools> & {
|
|
63
|
+
actions: ChatMessageProps<TMetadata, TDataParts, TTools>['actions'];
|
|
62
64
|
}): VNode[];
|
|
63
65
|
}
|
|
64
66
|
declare const _default: typeof __VLS_export;
|
|
65
67
|
export default _default;
|
|
66
|
-
declare const __VLS_export:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
declare const __VLS_export: <TMetadata, TDataParts extends UIDataTypes, TTools extends UITools>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
69
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<ChatMessageProps<TMetadata, TDataParts, TTools>> & (typeof globalThis extends {
|
|
70
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
71
|
+
} ? P : {});
|
|
72
|
+
expose: (exposed: {}) => void;
|
|
73
|
+
attrs: any;
|
|
74
|
+
slots: ChatMessageSlots<TMetadata, TDataParts, TTools>;
|
|
75
|
+
emit: {};
|
|
76
|
+
}>) => import("vue").VNode & {
|
|
77
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
73
78
|
};
|
|
79
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
80
|
+
[K in keyof T]: T[K];
|
|
81
|
+
} : {
|
|
82
|
+
[K in keyof T as K]: T[K];
|
|
83
|
+
}) & {};
|
|
@@ -33,6 +33,8 @@ const slots = defineSlots();
|
|
|
33
33
|
const appConfig = useAppConfig();
|
|
34
34
|
const uiProp = useComponentUI("chatMessage", props);
|
|
35
35
|
const fileParts = computed(() => props.parts?.filter((part) => part.type === "file") ?? []);
|
|
36
|
+
const textParts = computed(() => props.parts?.filter((part) => part.type === "text") ?? []);
|
|
37
|
+
const messageProps = computed(() => omit(props, ["as", "icon", "avatar", "variant", "side", "actions", "compact", "class", "ui", "content"]));
|
|
36
38
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.chatMessage || {} })({
|
|
37
39
|
variant: props.variant,
|
|
38
40
|
side: props.side,
|
|
@@ -45,40 +47,32 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.chatMessage |
|
|
|
45
47
|
<template>
|
|
46
48
|
<Primitive :as="as" :data-role="role" data-slot="root" :class="ui.root({ class: [uiProp?.root, props.class] })">
|
|
47
49
|
<div v-if="!!slots.files && fileParts.length" data-slot="files" :class="ui.files({ class: uiProp?.files })">
|
|
48
|
-
<slot name="files"
|
|
50
|
+
<slot name="files" v-bind="{ ...messageProps, parts: fileParts }" />
|
|
49
51
|
</div>
|
|
50
52
|
|
|
51
53
|
<div data-slot="container" :class="ui.container({ class: uiProp?.container })">
|
|
52
54
|
<div v-if="icon || avatar || !!slots.leading" data-slot="leading" :class="ui.leading({ class: uiProp?.leading })">
|
|
53
|
-
<slot name="leading"
|
|
55
|
+
<slot name="leading" v-bind="{ ...messageProps, avatar, ui }">
|
|
54
56
|
<UIcon v-if="icon" :name="icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class: uiProp?.leadingIcon })" />
|
|
55
57
|
<UAvatar v-else-if="avatar" :size="uiProp?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="avatar" data-slot="leadingAvatar" :class="ui.leadingAvatar({ class: uiProp?.leadingAvatar })" />
|
|
56
58
|
</slot>
|
|
57
59
|
</div>
|
|
58
60
|
|
|
59
|
-
<div v-if="content ||
|
|
60
|
-
<slot
|
|
61
|
-
:id="id"
|
|
62
|
-
name="content"
|
|
63
|
-
:role="role"
|
|
64
|
-
:content="content"
|
|
65
|
-
:parts="parts"
|
|
66
|
-
>
|
|
61
|
+
<div v-if="content || textParts.length || !!slots.content" data-slot="content" :class="ui.content({ class: uiProp?.content })">
|
|
62
|
+
<slot name="content" v-bind="{ ...messageProps, content }">
|
|
67
63
|
<template v-if="content">
|
|
68
64
|
{{ content }}
|
|
69
65
|
</template>
|
|
70
66
|
<template v-else>
|
|
71
|
-
<template v-for="(part, index) in
|
|
72
|
-
|
|
73
|
-
{{ part.text }}
|
|
74
|
-
</template>
|
|
67
|
+
<template v-for="(part, index) in textParts" :key="`${id}-${part.type}-${index}`">
|
|
68
|
+
{{ part.text }}
|
|
75
69
|
</template>
|
|
76
70
|
</template>
|
|
77
71
|
</slot>
|
|
78
72
|
</div>
|
|
79
73
|
|
|
80
74
|
<div v-if="actions || !!slots.actions" data-slot="actions" :class="ui.actions({ class: uiProp?.actions })">
|
|
81
|
-
<slot name="actions"
|
|
75
|
+
<slot name="actions" v-bind="{ ...messageProps, actions }">
|
|
82
76
|
<UTooltip v-for="(action, index) in actions" :key="index" :text="action.label">
|
|
83
77
|
<UButton
|
|
84
78
|
size="sm"
|
|
@@ -86,7 +80,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.chatMessage |
|
|
|
86
80
|
variant="ghost"
|
|
87
81
|
v-bind="omit(action, ['onClick'])"
|
|
88
82
|
:label="undefined"
|
|
89
|
-
@click="typeof action.onClick === 'function' ? action.onClick($event,
|
|
83
|
+
@click="typeof action.onClick === 'function' ? action.onClick($event, messageProps) : void 0"
|
|
90
84
|
/>
|
|
91
85
|
</UTooltip>
|
|
92
86
|
</slot>
|