@nuxt/ui 4.6.0 → 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.
Files changed (174) hide show
  1. package/README.md +8 -5
  2. package/cli/package.json +1 -1
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +4 -2
  5. package/dist/runtime/components/Accordion.d.vue.ts +6 -1
  6. package/dist/runtime/components/Accordion.vue +1 -1
  7. package/dist/runtime/components/Accordion.vue.d.ts +6 -1
  8. package/dist/runtime/components/AuthForm.d.vue.ts +22 -29
  9. package/dist/runtime/components/AuthForm.vue +8 -6
  10. package/dist/runtime/components/AuthForm.vue.d.ts +22 -29
  11. package/dist/runtime/components/Calendar.vue +4 -4
  12. package/dist/runtime/components/Card.d.vue.ts +4 -0
  13. package/dist/runtime/components/Card.vue +16 -2
  14. package/dist/runtime/components/Card.vue.d.ts +4 -0
  15. package/dist/runtime/components/ChatMessage.d.vue.ts +27 -17
  16. package/dist/runtime/components/ChatMessage.vue +11 -17
  17. package/dist/runtime/components/ChatMessage.vue.d.ts +27 -17
  18. package/dist/runtime/components/ChatMessages.d.vue.ts +27 -21
  19. package/dist/runtime/components/ChatMessages.vue +35 -23
  20. package/dist/runtime/components/ChatMessages.vue.d.ts +27 -21
  21. package/dist/runtime/components/ChatPrompt.vue +6 -1
  22. package/dist/runtime/components/ChatPromptSubmit.vue +3 -1
  23. package/dist/runtime/components/Checkbox.vue +5 -3
  24. package/dist/runtime/components/CommandPalette.d.vue.ts +18 -3
  25. package/dist/runtime/components/CommandPalette.vue +11 -7
  26. package/dist/runtime/components/CommandPalette.vue.d.ts +18 -3
  27. package/dist/runtime/components/ContextMenuContent.vue +68 -65
  28. package/dist/runtime/components/DashboardSearch.d.vue.ts +8 -37
  29. package/dist/runtime/components/DashboardSearch.vue +11 -10
  30. package/dist/runtime/components/DashboardSearch.vue.d.ts +8 -37
  31. package/dist/runtime/components/DashboardSidebar.vue +7 -8
  32. package/dist/runtime/components/Drawer.vue +44 -39
  33. package/dist/runtime/components/DropdownMenuContent.vue +90 -87
  34. package/dist/runtime/components/EditorEmojiMenu.d.vue.ts +1 -1
  35. package/dist/runtime/components/EditorEmojiMenu.vue +2 -0
  36. package/dist/runtime/components/EditorEmojiMenu.vue.d.ts +1 -1
  37. package/dist/runtime/components/EditorMentionMenu.d.vue.ts +1 -1
  38. package/dist/runtime/components/EditorMentionMenu.vue +2 -0
  39. package/dist/runtime/components/EditorMentionMenu.vue.d.ts +1 -1
  40. package/dist/runtime/components/EditorSuggestionMenu.d.vue.ts +1 -1
  41. package/dist/runtime/components/EditorSuggestionMenu.vue +2 -0
  42. package/dist/runtime/components/EditorSuggestionMenu.vue.d.ts +1 -1
  43. package/dist/runtime/components/FileUpload.vue +7 -5
  44. package/dist/runtime/components/Header.vue +1 -5
  45. package/dist/runtime/components/Icon.vue +2 -2
  46. package/dist/runtime/components/Input.vue +2 -2
  47. package/dist/runtime/components/InputDate.vue +6 -6
  48. package/dist/runtime/components/InputMenu.d.vue.ts +3 -3
  49. package/dist/runtime/components/InputMenu.vue +40 -38
  50. package/dist/runtime/components/InputMenu.vue.d.ts +3 -3
  51. package/dist/runtime/components/InputNumber.vue +2 -2
  52. package/dist/runtime/components/InputTags.vue +2 -2
  53. package/dist/runtime/components/InputTime.vue +2 -2
  54. package/dist/runtime/components/Link.vue +64 -8
  55. package/dist/runtime/components/Listbox.d.vue.ts +228 -0
  56. package/dist/runtime/components/Listbox.vue +242 -0
  57. package/dist/runtime/components/Listbox.vue.d.ts +228 -0
  58. package/dist/runtime/components/Modal.vue +18 -13
  59. package/dist/runtime/components/Popover.vue +7 -4
  60. package/dist/runtime/components/PricingTable.vue +60 -58
  61. package/dist/runtime/components/RadioGroup.vue +5 -3
  62. package/dist/runtime/components/Select.d.vue.ts +1 -1
  63. package/dist/runtime/components/Select.vue +84 -73
  64. package/dist/runtime/components/Select.vue.d.ts +1 -1
  65. package/dist/runtime/components/SelectMenu.d.vue.ts +3 -3
  66. package/dist/runtime/components/SelectMenu.vue +54 -52
  67. package/dist/runtime/components/SelectMenu.vue.d.ts +3 -3
  68. package/dist/runtime/components/Sidebar.vue +1 -4
  69. package/dist/runtime/components/Slideover.vue +67 -62
  70. package/dist/runtime/components/Table.d.vue.ts +1 -2
  71. package/dist/runtime/components/Table.vue +17 -29
  72. package/dist/runtime/components/Table.vue.d.ts +1 -2
  73. package/dist/runtime/components/Tabs.d.vue.ts +5 -1
  74. package/dist/runtime/components/Tabs.vue +2 -2
  75. package/dist/runtime/components/Tabs.vue.d.ts +5 -1
  76. package/dist/runtime/components/Textarea.d.vue.ts +1 -0
  77. package/dist/runtime/components/Textarea.vue +2 -1
  78. package/dist/runtime/components/Textarea.vue.d.ts +1 -0
  79. package/dist/runtime/components/Tooltip.vue +12 -9
  80. package/dist/runtime/components/content/ContentSearch.d.vue.ts +19 -35
  81. package/dist/runtime/components/content/ContentSearch.vue +10 -9
  82. package/dist/runtime/components/content/ContentSearch.vue.d.ts +19 -35
  83. package/dist/runtime/components/content/ContentToc.vue +19 -9
  84. package/dist/runtime/components/prose/Img.vue +2 -1
  85. package/dist/runtime/components/prose/Pre.vue +8 -3
  86. package/dist/runtime/components/prose/Prompt.d.vue.ts +32 -0
  87. package/dist/runtime/components/prose/Prompt.vue +88 -0
  88. package/dist/runtime/components/prose/Prompt.vue.d.ts +32 -0
  89. package/dist/runtime/composables/index.d.ts +2 -0
  90. package/dist/runtime/composables/index.js +2 -0
  91. package/dist/runtime/composables/useContentSearch.js +19 -5
  92. package/dist/runtime/composables/useEditorMenu.d.ts +5 -0
  93. package/dist/runtime/composables/useEditorMenu.js +3 -1
  94. package/dist/runtime/composables/useFieldGroup.d.ts +3 -0
  95. package/dist/runtime/composables/useFieldGroup.js +11 -1
  96. package/dist/runtime/composables/useIMEGuard.d.ts +10 -0
  97. package/dist/runtime/composables/useIMEGuard.js +22 -0
  98. package/dist/runtime/composables/useResolvedVariants.d.ts +21 -0
  99. package/dist/runtime/composables/useResolvedVariants.js +14 -0
  100. package/dist/runtime/locale/ar.js +9 -0
  101. package/dist/runtime/locale/az.js +9 -0
  102. package/dist/runtime/locale/be.js +9 -0
  103. package/dist/runtime/locale/bg.js +9 -0
  104. package/dist/runtime/locale/bn.js +9 -0
  105. package/dist/runtime/locale/ca.js +9 -0
  106. package/dist/runtime/locale/ckb.js +10 -1
  107. package/dist/runtime/locale/cs.js +9 -0
  108. package/dist/runtime/locale/da.js +9 -0
  109. package/dist/runtime/locale/de.js +9 -0
  110. package/dist/runtime/locale/de_ch.js +9 -0
  111. package/dist/runtime/locale/el.js +9 -0
  112. package/dist/runtime/locale/en.js +10 -1
  113. package/dist/runtime/locale/es.js +9 -0
  114. package/dist/runtime/locale/et.js +9 -0
  115. package/dist/runtime/locale/eu.js +11 -2
  116. package/dist/runtime/locale/fa_ir.js +9 -0
  117. package/dist/runtime/locale/fi.js +9 -0
  118. package/dist/runtime/locale/fr.js +9 -0
  119. package/dist/runtime/locale/gl.js +9 -0
  120. package/dist/runtime/locale/he.js +9 -0
  121. package/dist/runtime/locale/hi.js +9 -0
  122. package/dist/runtime/locale/hr.js +9 -0
  123. package/dist/runtime/locale/hu.js +9 -0
  124. package/dist/runtime/locale/hy.js +9 -0
  125. package/dist/runtime/locale/id.js +9 -0
  126. package/dist/runtime/locale/is.js +9 -0
  127. package/dist/runtime/locale/it.js +9 -0
  128. package/dist/runtime/locale/ja.js +9 -0
  129. package/dist/runtime/locale/ka.js +9 -0
  130. package/dist/runtime/locale/kk.js +9 -0
  131. package/dist/runtime/locale/km.js +9 -0
  132. package/dist/runtime/locale/ko.js +9 -0
  133. package/dist/runtime/locale/ky.js +9 -0
  134. package/dist/runtime/locale/lb.js +11 -2
  135. package/dist/runtime/locale/lo.js +15 -6
  136. package/dist/runtime/locale/lt.js +9 -0
  137. package/dist/runtime/locale/mn.js +9 -0
  138. package/dist/runtime/locale/ms.js +9 -0
  139. package/dist/runtime/locale/nb_no.js +9 -0
  140. package/dist/runtime/locale/nl.js +9 -0
  141. package/dist/runtime/locale/pl.js +9 -0
  142. package/dist/runtime/locale/pt.js +9 -0
  143. package/dist/runtime/locale/pt_br.js +9 -0
  144. package/dist/runtime/locale/ro.js +9 -0
  145. package/dist/runtime/locale/ru.js +9 -0
  146. package/dist/runtime/locale/sk.js +9 -0
  147. package/dist/runtime/locale/sl.js +9 -0
  148. package/dist/runtime/locale/sq.js +9 -0
  149. package/dist/runtime/locale/sv.js +9 -0
  150. package/dist/runtime/locale/th.js +9 -0
  151. package/dist/runtime/locale/tj.js +9 -0
  152. package/dist/runtime/locale/tr.js +9 -0
  153. package/dist/runtime/locale/ug_cn.js +9 -0
  154. package/dist/runtime/locale/uk.js +9 -0
  155. package/dist/runtime/locale/ur.js +9 -0
  156. package/dist/runtime/locale/uz.js +9 -0
  157. package/dist/runtime/locale/vi.js +9 -0
  158. package/dist/runtime/locale/zh_cn.js +9 -0
  159. package/dist/runtime/locale/zh_tw.js +9 -0
  160. package/dist/runtime/plugins/colors.js +1 -1
  161. package/dist/runtime/types/index.d.ts +1 -0
  162. package/dist/runtime/types/index.js +1 -0
  163. package/dist/runtime/types/locale.d.ts +9 -0
  164. package/dist/runtime/types/prose.d.ts +1 -0
  165. package/dist/runtime/types/prose.js +1 -0
  166. package/dist/runtime/utils/ai.d.ts +12 -7
  167. package/dist/runtime/utils/ai.js +6 -3
  168. package/dist/runtime/vue/overrides/inertia/Link.vue +3 -3
  169. package/dist/runtime/vue/overrides/none/Link.vue +3 -2
  170. package/dist/runtime/vue/overrides/vue-router/Link.vue +27 -31
  171. package/dist/shared/{ui.DJUbBpE2.mjs → ui.BIQuJqNV.mjs} +186 -34
  172. package/dist/unplugin.mjs +1 -1
  173. package/dist/vite.mjs +1 -1
  174. package/package.json +51 -42
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
  ```
@@ -126,7 +129,7 @@ Thank you for considering contributing to Nuxt UI. Here are a few ways you can g
126
129
  - Suggestions: Have any thoughts to enhance Nuxt UI? We'd love to hear them! Check out the [contribution guide](https://ui.nuxt.com/docs/getting-started/contribution) to share your suggestions.
127
130
 
128
131
  > [!TIP]
129
- > We provide a [contributing skill](https://github.com/nuxt/ui/tree/v4/.claude/skills/contributing) for AI assistants to help you contribute to Nuxt UI. It will automatically guide you through component structure, theming patterns, testing conventions, and documentation guidelines when working in this repository.
132
+ > We provide contributing guidelines through [`AGENTS.md`](https://github.com/nuxt/ui/blob/v4/AGENTS.md) for AI assistants to help you contribute to Nuxt UI. It is automatically picked up by all AI coding agents and guides through component structure, theming patterns, testing conventions, and documentation guidelines.
130
133
 
131
134
  ## Local Development
132
135
 
package/cli/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  ".": "./index.mjs"
6
6
  },
7
7
  "dependencies": {
8
- "citty": "^0.2.1",
8
+ "citty": "^0.2.2",
9
9
  "consola": "^3.4.2",
10
10
  "pathe": "^2.0.3",
11
11
  "scule": "^1.3.0"
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "docs": "https://ui.nuxt.com/docs/getting-started/installation/nuxt",
5
5
  "configKey": "ui",
6
6
  "compatibility": {
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.DJUbBpE2.mjs';
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.6.0";
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",
@@ -97,6 +98,7 @@ const module$1 = defineNuxtModule({
97
98
  nuxt.options.ui = options;
98
99
  nuxt.options.alias["#ui"] = resolve("./runtime");
99
100
  nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui || {}, getDefaultConfig(options.theme));
101
+ nuxt.options.build.transpile.push("reka-ui");
100
102
  nuxt.options.app.rootAttrs = nuxt.options.app.rootAttrs || {};
101
103
  nuxt.options.app.rootAttrs.class = [nuxt.options.app.rootAttrs.class, `${options.theme?.prefix ? options.theme.prefix + ":" : ""}isolate`].filter(Boolean).join(" ");
102
104
  nuxt.hook("vite:extend", async ({ config }) => {
@@ -18,7 +18,12 @@ export interface AccordionItem {
18
18
  trailingIcon?: IconProps['name'];
19
19
  slot?: string;
20
20
  content?: string;
21
- /** A unique value for the accordion item. Defaults to the index. */
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
- /** A unique value for the accordion item. Defaults to the index. */
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<import("vue").ShallowUnwrapRef<{
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: import("vue").Ref<{
121
+ errors: {
121
122
  id?: string | undefined;
122
123
  name?: string | undefined;
123
124
  message: string;
124
- }[], import("../types").FormErrorWithId[] | {
125
- id?: string | undefined;
126
- name?: string | undefined;
127
- message: string;
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): void;
137
- disabled: import("vue").ComputedRef<boolean>;
138
- loading: import("vue").Ref<boolean, boolean>;
139
- dirty: import("vue").ComputedRef<boolean>;
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
- }> | null, import("vue").ShallowUnwrapRef<{
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: import("vue").Ref<{
155
+ errors: {
159
156
  id?: string | undefined;
160
157
  name?: string | undefined;
161
158
  message: string;
162
- }[], import("../types").FormErrorWithId[] | {
163
- id?: string | undefined;
164
- name?: string | undefined;
165
- message: string;
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): void;
175
- disabled: import("vue").ComputedRef<boolean>;
176
- loading: import("vue").Ref<boolean, boolean>;
177
- dirty: import("vue").ComputedRef<boolean>;
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
- }> | null>>;
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
- <USeparator
120
- v-if="providers?.length && fields?.length"
121
- v-bind="typeof separator === 'object' ? separator : { label: separator }"
122
- data-slot="separator"
123
- :class="ui.separator({ class: uiProp?.separator })"
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<import("vue").ShallowUnwrapRef<{
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: import("vue").Ref<{
121
+ errors: {
121
122
  id?: string | undefined;
122
123
  name?: string | undefined;
123
124
  message: string;
124
- }[], import("../types").FormErrorWithId[] | {
125
- id?: string | undefined;
126
- name?: string | undefined;
127
- message: string;
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): void;
137
- disabled: import("vue").ComputedRef<boolean>;
138
- loading: import("vue").Ref<boolean, boolean>;
139
- dirty: import("vue").ComputedRef<boolean>;
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
- }> | null, import("vue").ShallowUnwrapRef<{
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: import("vue").Ref<{
155
+ errors: {
159
156
  id?: string | undefined;
160
157
  name?: string | undefined;
161
158
  message: string;
162
- }[], import("../types").FormErrorWithId[] | {
163
- id?: string | undefined;
164
- name?: string | undefined;
165
- message: string;
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): void;
175
- disabled: import("vue").ComputedRef<boolean>;
176
- loading: import("vue").Ref<boolean, boolean>;
177
- dirty: import("vue").ComputedRef<boolean>;
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
- }> | null>>;
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: null, required: false },
39
- placeholder: { type: null, required: false },
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: null, required: false },
48
- minValue: { type: null, required: false },
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: ChatMessageProps): VNode[];
60
- actions?(props: {
61
- actions: ChatMessageProps['actions'];
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: __VLS_WithSlots<import("vue").DefineComponent<ChatMessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ChatMessageProps> & Readonly<{}>, {
67
- as: any;
68
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChatMessageSlots>;
69
- type __VLS_WithSlots<T, S> = T & {
70
- new (): {
71
- $slots: S;
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,
@@ -44,41 +46,33 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.chatMessage |
44
46
 
45
47
  <template>
46
48
  <Primitive :as="as" :data-role="role" data-slot="root" :class="ui.root({ class: [uiProp?.root, props.class] })">
47
- <div v-if="!!slots.files" data-slot="files" :class="ui.files({ class: uiProp?.files })">
48
- <slot name="files" :parts="fileParts" />
49
+ <div v-if="!!slots.files && fileParts.length" data-slot="files" :class="ui.files({ class: uiProp?.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" :avatar="avatar" :ui="ui">
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 || parts.length || !!slots.content" data-slot="content" :class="ui.content({ class: uiProp?.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 parts" :key="`${id}-${part.type}-${index}`">
72
- <template v-if="part.type === 'text'">
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" :actions="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, props) : void 0"
83
+ @click="typeof action.onClick === 'function' ? action.onClick($event, messageProps) : void 0"
90
84
  />
91
85
  </UTooltip>
92
86
  </slot>