@nuxt/ui 4.8.1 → 4.9.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 (101) hide show
  1. package/dist/module.d.mts +7 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +2 -2
  4. package/dist/runtime/components/Avatar.vue +1 -1
  5. package/dist/runtime/components/Banner.vue +0 -1
  6. package/dist/runtime/components/BlogPost.vue +8 -10
  7. package/dist/runtime/components/Calendar.d.vue.ts +42 -6
  8. package/dist/runtime/components/Calendar.vue +180 -61
  9. package/dist/runtime/components/Calendar.vue.d.ts +42 -6
  10. package/dist/runtime/components/ChatMessages.d.vue.ts +7 -3
  11. package/dist/runtime/components/ChatMessages.vue +4 -1
  12. package/dist/runtime/components/ChatMessages.vue.d.ts +7 -3
  13. package/dist/runtime/components/ChatPrompt.vue +8 -2
  14. package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +2 -2
  15. package/dist/runtime/components/ChatPromptSubmit.vue +2 -2
  16. package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +2 -2
  17. package/dist/runtime/components/CommandPalette.d.vue.ts +2 -2
  18. package/dist/runtime/components/CommandPalette.vue +10 -4
  19. package/dist/runtime/components/CommandPalette.vue.d.ts +2 -2
  20. package/dist/runtime/components/DashboardSearch.d.vue.ts +7 -1
  21. package/dist/runtime/components/DashboardSearch.vue +9 -2
  22. package/dist/runtime/components/DashboardSearch.vue.d.ts +7 -1
  23. package/dist/runtime/components/DashboardSearchButton.d.vue.ts +2 -2
  24. package/dist/runtime/components/DashboardSearchButton.vue +2 -2
  25. package/dist/runtime/components/DashboardSearchButton.vue.d.ts +2 -2
  26. package/dist/runtime/components/FileUpload.d.vue.ts +5 -2
  27. package/dist/runtime/components/FileUpload.vue +8 -6
  28. package/dist/runtime/components/FileUpload.vue.d.ts +5 -2
  29. package/dist/runtime/components/Form.d.vue.ts +3 -3
  30. package/dist/runtime/components/Form.vue +2 -1
  31. package/dist/runtime/components/Form.vue.d.ts +3 -3
  32. package/dist/runtime/components/InputDate.d.vue.ts +2 -2
  33. package/dist/runtime/components/InputDate.vue +1 -0
  34. package/dist/runtime/components/InputDate.vue.d.ts +2 -2
  35. package/dist/runtime/components/InputMenu.vue +12 -1
  36. package/dist/runtime/components/InputNumber.d.vue.ts +1 -1
  37. package/dist/runtime/components/InputNumber.vue +3 -2
  38. package/dist/runtime/components/InputNumber.vue.d.ts +1 -1
  39. package/dist/runtime/components/InputTime.d.vue.ts +2 -2
  40. package/dist/runtime/components/InputTime.vue +1 -0
  41. package/dist/runtime/components/InputTime.vue.d.ts +2 -2
  42. package/dist/runtime/components/Link.d.vue.ts +1 -0
  43. package/dist/runtime/components/Link.vue +1 -1
  44. package/dist/runtime/components/Link.vue.d.ts +1 -0
  45. package/dist/runtime/components/LinkBase.d.vue.ts +1 -1
  46. package/dist/runtime/components/LinkBase.vue +1 -1
  47. package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
  48. package/dist/runtime/components/Modal.d.vue.ts +6 -0
  49. package/dist/runtime/components/Modal.vue +3 -1
  50. package/dist/runtime/components/Modal.vue.d.ts +6 -0
  51. package/dist/runtime/components/PinInput.d.vue.ts +14 -2
  52. package/dist/runtime/components/PinInput.vue +36 -11
  53. package/dist/runtime/components/PinInput.vue.d.ts +14 -2
  54. package/dist/runtime/components/Popover.d.vue.ts +2 -0
  55. package/dist/runtime/components/Popover.vue +2 -2
  56. package/dist/runtime/components/Popover.vue.d.ts +2 -0
  57. package/dist/runtime/components/ScrollArea.d.vue.ts +8 -0
  58. package/dist/runtime/components/ScrollArea.vue +10 -0
  59. package/dist/runtime/components/ScrollArea.vue.d.ts +8 -0
  60. package/dist/runtime/components/Select.vue +8 -1
  61. package/dist/runtime/components/SelectMenu.vue +23 -5
  62. package/dist/runtime/components/Sidebar.d.vue.ts +5 -0
  63. package/dist/runtime/components/Sidebar.vue +3 -1
  64. package/dist/runtime/components/Sidebar.vue.d.ts +5 -0
  65. package/dist/runtime/components/Slideover.d.vue.ts +6 -0
  66. package/dist/runtime/components/Slideover.vue +3 -1
  67. package/dist/runtime/components/Slideover.vue.d.ts +6 -0
  68. package/dist/runtime/components/Toast.d.vue.ts +8 -1
  69. package/dist/runtime/components/Toast.vue +5 -5
  70. package/dist/runtime/components/Toast.vue.d.ts +8 -1
  71. package/dist/runtime/components/content/ContentSearch.d.vue.ts +7 -1
  72. package/dist/runtime/components/content/ContentSearch.vue +9 -2
  73. package/dist/runtime/components/content/ContentSearch.vue.d.ts +7 -1
  74. package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +2 -2
  75. package/dist/runtime/components/content/ContentSearchButton.vue +2 -2
  76. package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +2 -2
  77. package/dist/runtime/components/prose/Kbd.d.vue.ts +2 -1
  78. package/dist/runtime/components/prose/Kbd.vue.d.ts +2 -1
  79. package/dist/runtime/components/prose/Pre.vue +0 -1
  80. package/dist/runtime/composables/index.d.ts +1 -0
  81. package/dist/runtime/composables/index.js +1 -0
  82. package/dist/runtime/composables/useComponentProps.d.ts +3 -3
  83. package/dist/runtime/composables/useTour.d.ts +80 -0
  84. package/dist/runtime/composables/useTour.js +102 -0
  85. package/dist/runtime/index.css +1 -1
  86. package/dist/runtime/keyframes.css +1 -1
  87. package/dist/runtime/locale/index.d.ts +1 -0
  88. package/dist/runtime/locale/index.js +1 -0
  89. package/dist/runtime/locale/lv.d.ts +3 -0
  90. package/dist/runtime/locale/lv.js +152 -0
  91. package/dist/runtime/plugins/colors.js +5 -4
  92. package/dist/runtime/types/tv.d.ts +15 -3
  93. package/dist/runtime/utils/tv.d.ts +41 -1
  94. package/dist/runtime/utils/tv.js +91 -2
  95. package/dist/runtime/vue/stubs/base.d.ts +1 -1
  96. package/dist/runtime/vue/stubs/base.js +1 -1
  97. package/dist/shared/{ui.BzjkAvk7.mjs → ui.BfHSFiIO.mjs} +377 -234
  98. package/dist/unplugin.d.mts +8 -0
  99. package/dist/unplugin.mjs +2 -2
  100. package/dist/vite.mjs +1 -1
  101. package/package.json +61 -44
@@ -1,4 +1,4 @@
1
- import type { VNode } from 'vue';
1
+ import type { ComponentPublicInstance, VNode } from 'vue';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import type { UIDataTypes, UIMessage, UITools, ChatStatus } from 'ai';
4
4
  import theme from '#build/ui/chat-messages';
@@ -57,7 +57,9 @@ export interface ChatMessagesProps<T extends UIMessage[] = UIMessage[]> {
57
57
  ui?: ChatMessages['slots'];
58
58
  }
59
59
  export type ChatMessagesSlots<T extends UIMessage[] = UIMessage[]> = {
60
- default?(props?: {}): VNode[];
60
+ default?(props: {
61
+ registerMessageRef: (id: string, element: ComponentPublicInstance | null) => void;
62
+ }): VNode[];
61
63
  indicator?(props: {
62
64
  ui: ChatMessages['ui'];
63
65
  }): VNode[];
@@ -76,7 +78,9 @@ declare const __VLS_export: <T extends UIMessage[] = UIMessage[]>(__VLS_props: N
76
78
  props: import("vue").PublicProps & __VLS_PrettifyLocal<ChatMessagesProps<T>> & (typeof globalThis extends {
77
79
  __VLS_PROPS_FALLBACK: infer P;
78
80
  } ? P : {});
79
- expose: (exposed: {}) => void;
81
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
82
+ registerMessageRef: (id: string, element: ComponentPublicInstance | null) => void;
83
+ }>) => void;
80
84
  attrs: any;
81
85
  slots: ChatMessagesSlots<T>;
82
86
  emit: {};
@@ -183,6 +183,9 @@ onMounted(() => {
183
183
  }, { childList: true, subtree: true });
184
184
  }
185
185
  });
186
+ defineExpose({
187
+ registerMessageRef
188
+ });
186
189
  </script>
187
190
 
188
191
  <template>
@@ -193,7 +196,7 @@ onMounted(() => {
193
196
  :class="ui.root({ class: [props.ui?.root, props.class] })"
194
197
  :style="{ '--last-message-height': `${lastMessageHeight}px` }"
195
198
  >
196
- <slot>
199
+ <slot :register-message-ref="registerMessageRef">
197
200
  <template v-for="message in props.messages" :key="message.id">
198
201
  <UChatMessage
199
202
  v-if="message.parts?.length"
@@ -1,4 +1,4 @@
1
- import type { VNode } from 'vue';
1
+ import type { ComponentPublicInstance, VNode } from 'vue';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import type { UIDataTypes, UIMessage, UITools, ChatStatus } from 'ai';
4
4
  import theme from '#build/ui/chat-messages';
@@ -57,7 +57,9 @@ export interface ChatMessagesProps<T extends UIMessage[] = UIMessage[]> {
57
57
  ui?: ChatMessages['slots'];
58
58
  }
59
59
  export type ChatMessagesSlots<T extends UIMessage[] = UIMessage[]> = {
60
- default?(props?: {}): VNode[];
60
+ default?(props: {
61
+ registerMessageRef: (id: string, element: ComponentPublicInstance | null) => void;
62
+ }): VNode[];
61
63
  indicator?(props: {
62
64
  ui: ChatMessages['ui'];
63
65
  }): VNode[];
@@ -76,7 +78,9 @@ declare const __VLS_export: <T extends UIMessage[] = UIMessage[]>(__VLS_props: N
76
78
  props: import("vue").PublicProps & __VLS_PrettifyLocal<ChatMessagesProps<T>> & (typeof globalThis extends {
77
79
  __VLS_PROPS_FALLBACK: infer P;
78
80
  } ? P : {});
79
- expose: (exposed: {}) => void;
81
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
82
+ registerMessageRef: (id: string, element: ComponentPublicInstance | null) => void;
83
+ }>) => void;
80
84
  attrs: any;
81
85
  slots: ChatMessagesSlots<T>;
82
86
  emit: {};
@@ -68,6 +68,13 @@ function handleEnter(event) {
68
68
  }
69
69
  onEnter(event);
70
70
  }
71
+ function onKeydown(event) {
72
+ if (event.key === "Enter") {
73
+ handleEnter(event);
74
+ } else if (event.key === "Escape") {
75
+ blur(event);
76
+ }
77
+ }
71
78
  defineExpose({
72
79
  textareaRef: toRef(() => textareaRef.value?.textareaRef)
73
80
  });
@@ -90,9 +97,8 @@ defineExpose({
90
97
  :ui="transformUI(omit(ui, ['root', 'body', 'header', 'footer']), props.ui)"
91
98
  data-slot="body"
92
99
  :class="ui.body({ class: props.ui?.body })"
93
- @keydown.enter="handleEnter"
100
+ @keydown="onKeydown"
94
101
  @compositionend="onCompositionEnd"
95
- @keydown.esc="blur"
96
102
  >
97
103
  <template v-for="(_, name) in getProxySlots()" #[name]="slotData">
98
104
  <slot :name="name" v-bind="slotData" />
@@ -7,11 +7,11 @@ type ChatPromptSubmit = ComponentConfig<typeof theme, AppConfig, 'chatPromptSubm
7
7
  export interface ChatPromptSubmitProps extends Omit<ButtonProps, LinkPropsKeys | 'icon' | 'color' | 'variant'> {
8
8
  status?: ChatStatus;
9
9
  /**
10
- * The icon displayed in the button when the status is `ready`.
10
+ * The icon displayed in the button when the status is `ready`. Set to `false` to hide the icon.
11
11
  * @defaultValue appConfig.ui.icons.arrowUp
12
12
  * @IconifyIcon
13
13
  */
14
- icon?: IconProps['name'];
14
+ icon?: IconProps['name'] | false;
15
15
  /**
16
16
  * The color of the button when the status is `ready`.
17
17
  * @defaultValue 'primary'
@@ -15,7 +15,7 @@ import UButton from "./Button.vue";
15
15
  defineOptions({ inheritAttrs: false });
16
16
  const _props = defineProps({
17
17
  status: { type: String, required: false, default: "ready" },
18
- icon: { type: null, required: false },
18
+ icon: { type: [String, Boolean], required: false, skipCheck: true },
19
19
  color: { type: null, required: false },
20
20
  variant: { type: null, required: false },
21
21
  streamingIcon: { type: null, required: false },
@@ -59,7 +59,7 @@ const buttonProps = useForwardProps(reactiveOmit(props, "icon", "color", "varian
59
59
  const disabled = computed(() => props.status === "ready" ? props.disabled : false);
60
60
  const statusButtonProps = computed(() => ({
61
61
  ready: {
62
- icon: props.icon || appConfig.ui.icons.arrowUp,
62
+ icon: props.icon === false ? void 0 : props.icon ?? appConfig.ui.icons.arrowUp,
63
63
  color: props.color,
64
64
  variant: props.variant,
65
65
  type: "submit"
@@ -7,11 +7,11 @@ type ChatPromptSubmit = ComponentConfig<typeof theme, AppConfig, 'chatPromptSubm
7
7
  export interface ChatPromptSubmitProps extends Omit<ButtonProps, LinkPropsKeys | 'icon' | 'color' | 'variant'> {
8
8
  status?: ChatStatus;
9
9
  /**
10
- * The icon displayed in the button when the status is `ready`.
10
+ * The icon displayed in the button when the status is `ready`. Set to `false` to hide the icon.
11
11
  * @defaultValue appConfig.ui.icons.arrowUp
12
12
  * @IconifyIcon
13
13
  */
14
- icon?: IconProps['name'];
14
+ icon?: IconProps['name'] | false;
15
15
  /**
16
16
  * The color of the button when the status is `ready`.
17
17
  * @defaultValue 'primary'
@@ -64,11 +64,11 @@ export interface CommandPaletteProps<G extends CommandPaletteGroup<T> = CommandP
64
64
  */
65
65
  size?: CommandPalette['variants']['size'];
66
66
  /**
67
- * The icon displayed in the input.
67
+ * The icon displayed in the input. Set to `false` to hide the icon.
68
68
  * @defaultValue appConfig.ui.icons.search
69
69
  * @IconifyIcon
70
70
  */
71
- icon?: IconProps['name'];
71
+ icon?: IconProps['name'] | false;
72
72
  /**
73
73
  * The icon displayed on the right side of the input.
74
74
  * @defaultValue appConfig.ui.icons.search
@@ -29,7 +29,7 @@ defineOptions({ inheritAttrs: false });
29
29
  const _props = defineProps({
30
30
  as: { type: null, required: false },
31
31
  size: { type: null, required: false },
32
- icon: { type: null, required: false },
32
+ icon: { type: [String, Boolean], required: false, skipCheck: true },
33
33
  trailingIcon: { type: null, required: false },
34
34
  selectedIcon: { type: null, required: false },
35
35
  childrenIcon: { type: null, required: false },
@@ -199,7 +199,13 @@ const filteredItems = computed(() => filteredGroups.value.flatMap((group) => gro
199
199
  const rootRef = useTemplateRef("rootRef");
200
200
  watch(filteredGroups, () => {
201
201
  nextTick(() => {
202
- rootRef.value?.highlightFirstItem();
202
+ const root = rootRef.value;
203
+ const rootEl = root?.$el;
204
+ if (rootEl?.contains(document.activeElement)) {
205
+ root?.highlightFirstItem();
206
+ } else {
207
+ root?.highlightSelected(void 0, false);
208
+ }
203
209
  });
204
210
  });
205
211
  function navigate(item) {
@@ -317,13 +323,13 @@ function onSelect(e, item) {
317
323
  <UInput
318
324
  variant="none"
319
325
  :size="props.size"
320
- v-bind="typeof props.input === 'object' ? props.input : {}"
321
326
  :placeholder="placeholder"
322
327
  :autofocus="props.autofocus"
323
328
  :loading="props.loading"
324
329
  :loading-icon="props.loadingIcon"
325
330
  :trailing-icon="props.trailingIcon"
326
- :icon="props.icon || appConfig.ui.icons.search"
331
+ :icon="props.icon === false ? void 0 : props.icon ?? appConfig.ui.icons.search"
332
+ v-bind="typeof props.input === 'object' ? props.input : {}"
327
333
  data-slot="input"
328
334
  :class="ui.input({ class: props.ui?.input })"
329
335
  @keydown.backspace="onBackspace"
@@ -64,11 +64,11 @@ export interface CommandPaletteProps<G extends CommandPaletteGroup<T> = CommandP
64
64
  */
65
65
  size?: CommandPalette['variants']['size'];
66
66
  /**
67
- * The icon displayed in the input.
67
+ * The icon displayed in the input. Set to `false` to hide the icon.
68
68
  * @defaultValue appConfig.ui.icons.search
69
69
  * @IconifyIcon
70
70
  */
71
- icon?: IconProps['name'];
71
+ icon?: IconProps['name'] | false;
72
72
  /**
73
73
  * The icon displayed on the right side of the input.
74
74
  * @defaultValue appConfig.ui.icons.search
@@ -2,7 +2,7 @@ import type { VNode } from 'vue';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/ui/dashboard-search';
4
4
  import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
5
- import type { ButtonProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, LinkPropsKeys } from '../types';
5
+ import type { ButtonProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, LinkPropsKeys, InputProps } from '../types';
6
6
  import type { ComponentConfig } from '../types/tv';
7
7
  type DashboardSearch = ComponentConfig<typeof theme, AppConfig, 'dashboardSearch'>;
8
8
  export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPaletteItem> extends Pick<ModalProps, 'title' | 'description' | 'overlay' | 'transition' | 'content' | 'dismissible' | 'fullscreen' | 'modal' | 'portal'>, Pick<CommandPaletteProps<CommandPaletteGroup<T>, T>, 'icon' | 'trailingIcon' | 'selectedIcon' | 'childrenIcon' | 'placeholder' | 'autofocus' | 'loading' | 'loadingIcon' | 'closeIcon' | 'back' | 'backIcon' | 'disabled' | 'highlightOnHover' | 'labelKey' | 'descriptionKey' | 'preserveGroupOrder' | 'virtualize' | 'groups'> {
@@ -17,6 +17,12 @@ export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPale
17
17
  * @defaultValue true
18
18
  */
19
19
  close?: boolean | Omit<ButtonProps, LinkPropsKeys>;
20
+ /**
21
+ * Configure the input or hide it with `false`.
22
+ * `{ fixed: true }`{lang="ts-type"}
23
+ * @defaultValue true
24
+ */
25
+ input?: boolean | Omit<InputProps, 'modelValue' | 'defaultValue'>;
20
26
  /**
21
27
  * Keyboard shortcut to open the search (used by [`defineShortcuts`](https://ui.nuxt.com/docs/composables/define-shortcuts))
22
28
  * @defaultValue 'meta_k'
@@ -17,6 +17,7 @@ import UModal from "./Modal.vue";
17
17
  const _props = defineProps({
18
18
  size: { type: null, required: false },
19
19
  close: { type: [Boolean, Object], required: false, default: true },
20
+ input: { type: [Boolean, Object], required: false },
20
21
  shortcut: { type: String, required: false, default: "meta_k" },
21
22
  fuse: { type: Object, required: false },
22
23
  searchDelay: { type: Number, required: false, default: 100 },
@@ -32,7 +33,7 @@ const _props = defineProps({
32
33
  fullscreen: { type: Boolean, required: false, default: false },
33
34
  modal: { type: Boolean, required: false },
34
35
  portal: { type: [Boolean, String], required: false, skipCheck: true },
35
- icon: { type: null, required: false },
36
+ icon: { type: [String, Boolean], required: false, skipCheck: true },
36
37
  trailingIcon: { type: null, required: false },
37
38
  selectedIcon: { type: null, required: false },
38
39
  childrenIcon: { type: null, required: false },
@@ -63,6 +64,12 @@ const colorMode = useColorMode();
63
64
  const appConfig = useAppConfig();
64
65
  const commandPaletteProps = useForwardProps(reactivePick(props, "size", "icon", "trailingIcon", "selectedIcon", "childrenIcon", "placeholder", "autofocus", "loading", "loadingIcon", "close", "closeIcon", "back", "backIcon", "disabled", "highlightOnHover", "labelKey", "descriptionKey", "preserveGroupOrder", "virtualize", "searchDelay"));
65
66
  const modalProps = useForwardProps(reactivePick(props, "overlay", "transition", "content", "dismissible", "fullscreen", "modal", "portal"));
67
+ const inputProps = computed(() => {
68
+ if (props.input === false) {
69
+ return false;
70
+ }
71
+ return defu(typeof props.input === "object" ? props.input : {}, { fixed: true });
72
+ });
66
73
  const getProxySlots = () => omit(slots, ["content"]);
67
74
  const fuse = computed(() => defu({}, props.fuse, {
68
75
  fuseOptions: {
@@ -142,7 +149,7 @@ defineExpose({
142
149
  v-bind="commandPaletteProps"
143
150
  :groups="groups"
144
151
  :fuse="fuse"
145
- :input="{ fixed: true }"
152
+ :input="inputProps"
146
153
  :ui="transformUI(omit(ui, ['modal']), props.ui)"
147
154
  @update:model-value="onSelect"
148
155
  @update:open="open = $event"
@@ -2,7 +2,7 @@ import type { VNode } from 'vue';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/ui/dashboard-search';
4
4
  import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
5
- import type { ButtonProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, LinkPropsKeys } from '../types';
5
+ import type { ButtonProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, LinkPropsKeys, InputProps } from '../types';
6
6
  import type { ComponentConfig } from '../types/tv';
7
7
  type DashboardSearch = ComponentConfig<typeof theme, AppConfig, 'dashboardSearch'>;
8
8
  export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPaletteItem> extends Pick<ModalProps, 'title' | 'description' | 'overlay' | 'transition' | 'content' | 'dismissible' | 'fullscreen' | 'modal' | 'portal'>, Pick<CommandPaletteProps<CommandPaletteGroup<T>, T>, 'icon' | 'trailingIcon' | 'selectedIcon' | 'childrenIcon' | 'placeholder' | 'autofocus' | 'loading' | 'loadingIcon' | 'closeIcon' | 'back' | 'backIcon' | 'disabled' | 'highlightOnHover' | 'labelKey' | 'descriptionKey' | 'preserveGroupOrder' | 'virtualize' | 'groups'> {
@@ -17,6 +17,12 @@ export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPale
17
17
  * @defaultValue true
18
18
  */
19
19
  close?: boolean | Omit<ButtonProps, LinkPropsKeys>;
20
+ /**
21
+ * Configure the input or hide it with `false`.
22
+ * `{ fixed: true }`{lang="ts-type"}
23
+ * @defaultValue true
24
+ */
25
+ input?: boolean | Omit<InputProps, 'modelValue' | 'defaultValue'>;
20
26
  /**
21
27
  * Keyboard shortcut to open the search (used by [`defineShortcuts`](https://ui.nuxt.com/docs/composables/define-shortcuts))
22
28
  * @defaultValue 'meta_k'
@@ -5,11 +5,11 @@ import type { ComponentConfig } from '../types/tv';
5
5
  type DashboardSearchButton = ComponentConfig<typeof theme, AppConfig, 'dashboardSearchButton'>;
6
6
  export interface DashboardSearchButtonProps extends Omit<ButtonProps, LinkPropsKeys | 'icon' | 'label' | 'color' | 'variant'> {
7
7
  /**
8
- * The icon displayed in the button.
8
+ * The icon displayed in the button. Set to `false` to hide the icon.
9
9
  * @defaultValue appConfig.ui.icons.search
10
10
  * @IconifyIcon
11
11
  */
12
- icon?: IconProps['name'];
12
+ icon?: IconProps['name'] | false;
13
13
  /**
14
14
  * The label displayed in the button.
15
15
  * @defaultValue t('dashboardSearchButton.label')
@@ -18,7 +18,7 @@ import UKbd from "./Kbd.vue";
18
18
  import UTooltip from "./Tooltip.vue";
19
19
  defineOptions({ inheritAttrs: false });
20
20
  const _props = defineProps({
21
- icon: { type: null, required: false },
21
+ icon: { type: [String, Boolean], required: false, skipCheck: true },
22
22
  label: { type: String, required: false },
23
23
  color: { type: null, required: false, default: "neutral" },
24
24
  variant: { type: null, required: false },
@@ -65,7 +65,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSear
65
65
  <template>
66
66
  <DefineButtonTemplate>
67
67
  <UButton
68
- :icon="props.icon || appConfig.ui.icons.search"
68
+ :icon="props.icon === false ? void 0 : props.icon ?? appConfig.ui.icons.search"
69
69
  :label="props.label || t('dashboardSearchButton.label')"
70
70
  :variant="props.variant || (props.collapsed ? 'ghost' : 'outline')"
71
71
  v-bind="{
@@ -5,11 +5,11 @@ import type { ComponentConfig } from '../types/tv';
5
5
  type DashboardSearchButton = ComponentConfig<typeof theme, AppConfig, 'dashboardSearchButton'>;
6
6
  export interface DashboardSearchButtonProps extends Omit<ButtonProps, LinkPropsKeys | 'icon' | 'label' | 'color' | 'variant'> {
7
7
  /**
8
- * The icon displayed in the button.
8
+ * The icon displayed in the button. Set to `false` to hide the icon.
9
9
  * @defaultValue appConfig.ui.icons.search
10
10
  * @IconifyIcon
11
11
  */
12
- icon?: IconProps['name'];
12
+ icon?: IconProps['name'] | false;
13
13
  /**
14
14
  * The label displayed in the button.
15
15
  * @defaultValue t('dashboardSearchButton.label')
@@ -15,11 +15,11 @@ export interface FileUploadProps<M extends boolean = false> extends /** @vue-ign
15
15
  id?: string;
16
16
  name?: string;
17
17
  /**
18
- * The icon to display.
18
+ * The icon to display. Set to `false` to hide the icon.
19
19
  * @defaultValue appConfig.ui.icons.upload
20
20
  * @IconifyIcon
21
21
  */
22
- icon?: IconProps['name'];
22
+ icon?: IconProps['name'] | false;
23
23
  label?: string;
24
24
  description?: string;
25
25
  /**
@@ -127,6 +127,7 @@ export interface FileUploadSlots<M extends boolean = false> {
127
127
  }): VNode[];
128
128
  'files'?(props: {
129
129
  files: FileUploadFiles<M>;
130
+ removeFile: (index?: number) => void;
130
131
  }): VNode[];
131
132
  'files-top'?(props: {
132
133
  files: FileUploadFiles<M>;
@@ -141,6 +142,7 @@ export interface FileUploadSlots<M extends boolean = false> {
141
142
  'file'?(props: {
142
143
  file: File;
143
144
  index: number;
145
+ removeFile: (index?: number) => void;
144
146
  }): VNode[];
145
147
  'file-leading'?(props: {
146
148
  file: File;
@@ -159,6 +161,7 @@ export interface FileUploadSlots<M extends boolean = false> {
159
161
  file: File;
160
162
  index: number;
161
163
  ui: FileUpload['ui'];
164
+ removeFile: (index?: number) => void;
162
165
  }): VNode[];
163
166
  }
164
167
  declare const _default: typeof __VLS_export;
@@ -20,7 +20,7 @@ const _props = defineProps({
20
20
  as: { type: null, required: false },
21
21
  id: { type: String, required: false },
22
22
  name: { type: String, required: false },
23
- icon: { type: null, required: false },
23
+ icon: { type: [String, Boolean], required: false, skipCheck: true },
24
24
  label: { type: String, required: false },
25
25
  description: { type: String, required: false },
26
26
  color: { type: null, required: false },
@@ -146,9 +146,9 @@ defineExpose({
146
146
  <slot name="files-top" :files="modelValue" :open="open" :remove-file="removeFile" />
147
147
 
148
148
  <div data-slot="files" :class="ui.files({ class: props.ui?.files })">
149
- <slot name="files" :files="modelValue">
149
+ <slot name="files" :files="modelValue" :remove-file="removeFile">
150
150
  <div v-for="(file, index) in Array.isArray(modelValue) ? modelValue : [modelValue]" :key="file.name" data-slot="file" :class="ui.file({ class: props.ui?.file })">
151
- <slot name="file" :file="file" :index="index">
151
+ <slot name="file" :file="file" :index="index" :remove-file="removeFile">
152
152
  <slot name="file-leading" :file="file" :index="index" :ui="ui">
153
153
  <UAvatar
154
154
  :as="{ img: 'img' }"
@@ -174,7 +174,7 @@ defineExpose({
174
174
  </span>
175
175
  </div>
176
176
 
177
- <slot name="file-trailing" :file="file" :index="index" :ui="ui">
177
+ <slot name="file-trailing" :file="file" :index="index" :ui="ui" :remove-file="removeFile">
178
178
  <UButton
179
179
  v-if="props.fileDelete"
180
180
  color="neutral"
@@ -224,8 +224,10 @@ defineExpose({
224
224
 
225
225
  <div v-if="position === 'inside' ? !props.preview || (multiple ? !modelValue?.length : !modelValue) : true" data-slot="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
226
226
  <slot name="leading" :ui="ui">
227
- <UIcon v-if="variant === 'button'" :name="props.icon || appConfig.ui.icons.upload" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
228
- <UAvatar v-else :icon="props.icon || appConfig.ui.icons.upload" :size="props.size" data-slot="avatar" :class="ui.avatar({ class: props.ui?.avatar })" />
227
+ <template v-if="props.icon !== false">
228
+ <UIcon v-if="variant === 'button'" :name="props.icon ?? appConfig.ui.icons.upload" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
229
+ <UAvatar v-else :icon="props.icon ?? appConfig.ui.icons.upload" :size="props.size" data-slot="avatar" :class="ui.avatar({ class: props.ui?.avatar })" />
230
+ </template>
229
231
  </slot>
230
232
 
231
233
  <template v-if="variant !== 'button'">
@@ -15,11 +15,11 @@ export interface FileUploadProps<M extends boolean = false> extends /** @vue-ign
15
15
  id?: string;
16
16
  name?: string;
17
17
  /**
18
- * The icon to display.
18
+ * The icon to display. Set to `false` to hide the icon.
19
19
  * @defaultValue appConfig.ui.icons.upload
20
20
  * @IconifyIcon
21
21
  */
22
- icon?: IconProps['name'];
22
+ icon?: IconProps['name'] | false;
23
23
  label?: string;
24
24
  description?: string;
25
25
  /**
@@ -127,6 +127,7 @@ export interface FileUploadSlots<M extends boolean = false> {
127
127
  }): VNode[];
128
128
  'files'?(props: {
129
129
  files: FileUploadFiles<M>;
130
+ removeFile: (index?: number) => void;
130
131
  }): VNode[];
131
132
  'files-top'?(props: {
132
133
  files: FileUploadFiles<M>;
@@ -141,6 +142,7 @@ export interface FileUploadSlots<M extends boolean = false> {
141
142
  'file'?(props: {
142
143
  file: File;
143
144
  index: number;
145
+ removeFile: (index?: number) => void;
144
146
  }): VNode[];
145
147
  'file-leading'?(props: {
146
148
  file: File;
@@ -159,6 +161,7 @@ export interface FileUploadSlots<M extends boolean = false> {
159
161
  file: File;
160
162
  index: number;
161
163
  ui: FileUpload['ui'];
164
+ removeFile: (index?: number) => void;
162
165
  }): VNode[];
163
166
  }
164
167
  declare const _default: typeof __VLS_export;
@@ -22,10 +22,10 @@ export type FormProps<S extends FormSchema, T extends boolean = true, N extends
22
22
  /** Disable all inputs inside the form. */
23
23
  disabled?: boolean;
24
24
  /**
25
- * Path of the form's state within it's parent form.
26
- * Used for nesting forms. Only available if `nested` is true.
25
+ * The `name` attribute of the form element.
26
+ * For nested forms (`nested` is true), this is also used as the path of the form's state within its parent form.
27
27
  */
28
- name?: N extends true ? string : never;
28
+ name?: string;
29
29
  /**
30
30
  * Delay in milliseconds before validating the form on input events.
31
31
  * @defaultValue `300`
@@ -20,7 +20,7 @@ const _props = defineProps({
20
20
  return ["input", "blur", "change"];
21
21
  } },
22
22
  disabled: { type: Boolean, required: false },
23
- name: { type: null, required: false },
23
+ name: { type: String, required: false },
24
24
  validateOnInputDelay: { type: Number, required: false, default: 300 },
25
25
  transform: { type: null, required: false, default: () => true },
26
26
  nested: { type: Boolean, required: false },
@@ -293,6 +293,7 @@ defineExpose(api);
293
293
  :is="parentBus ? 'div' : 'form'"
294
294
  :id="formId"
295
295
  ref="formRef"
296
+ :name="parentBus ? void 0 : props.name"
296
297
  method="post"
297
298
  :class="ui({ class: [props.ui?.base, props.class] })"
298
299
  @submit.prevent="onSubmitWrapper"
@@ -22,10 +22,10 @@ export type FormProps<S extends FormSchema, T extends boolean = true, N extends
22
22
  /** Disable all inputs inside the form. */
23
23
  disabled?: boolean;
24
24
  /**
25
- * Path of the form's state within it's parent form.
26
- * Used for nesting forms. Only available if `nested` is true.
25
+ * The `name` attribute of the form element.
26
+ * For nested forms (`nested` is true), this is also used as the path of the form's state within its parent form.
27
27
  */
28
- name?: N extends true ? string : never;
28
+ name?: string;
29
29
  /**
30
30
  * Delay in milliseconds before validating the form on input events.
31
31
  * @defaultValue `300`
@@ -6,8 +6,8 @@ import type { IconProps } from '../types';
6
6
  import type { ComponentConfig } from '../types/tv';
7
7
  import theme from '#build/ui/input-date';
8
8
  type InputDate = ComponentConfig<typeof theme, AppConfig, 'inputDate'>;
9
- type _DateFieldRootProps = Omit<DateFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'locale'>;
10
- type _RangeDateFieldRootProps = Omit<DateRangeFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'locale'>;
9
+ type _DateFieldRootProps = Omit<DateFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir'>;
10
+ type _RangeDateFieldRootProps = Omit<DateRangeFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir'>;
11
11
  type InputDateDefaultValue<R extends boolean = false> = R extends true ? DateRangeFieldRootProps['defaultValue'] : DateFieldRootProps['defaultValue'];
12
12
  type InputDateModelValue<R extends boolean = false> = (R extends true ? DateRangeFieldRootProps['modelValue'] : DateFieldRootProps['modelValue']) | undefined;
13
13
  export interface InputDateProps<R extends boolean = false> extends UseComponentIconsProps, _DateFieldRootProps, _RangeDateFieldRootProps {
@@ -48,6 +48,7 @@ const _props = defineProps({
48
48
  hideTimeZone: { type: Boolean, required: false },
49
49
  maxValue: { type: Object, required: false },
50
50
  minValue: { type: Object, required: false },
51
+ locale: { type: String, required: false },
51
52
  disabled: { type: Boolean, required: false },
52
53
  readonly: { type: Boolean, required: false },
53
54
  isDateUnavailable: { type: Function, required: false },
@@ -6,8 +6,8 @@ import type { IconProps } from '../types';
6
6
  import type { ComponentConfig } from '../types/tv';
7
7
  import theme from '#build/ui/input-date';
8
8
  type InputDate = ComponentConfig<typeof theme, AppConfig, 'inputDate'>;
9
- type _DateFieldRootProps = Omit<DateFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'locale'>;
10
- type _RangeDateFieldRootProps = Omit<DateRangeFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'locale'>;
9
+ type _DateFieldRootProps = Omit<DateFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir'>;
10
+ type _RangeDateFieldRootProps = Omit<DateRangeFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir'>;
11
11
  type InputDateDefaultValue<R extends boolean = false> = R extends true ? DateRangeFieldRootProps['defaultValue'] : DateFieldRootProps['defaultValue'];
12
12
  type InputDateModelValue<R extends boolean = false> = (R extends true ? DateRangeFieldRootProps['modelValue'] : DateFieldRootProps['modelValue']) | undefined;
13
13
  export interface InputDateProps<R extends boolean = false> extends UseComponentIconsProps, _DateFieldRootProps, _RangeDateFieldRootProps {
@@ -3,7 +3,7 @@ import theme from "#build/ui/input-menu";
3
3
  </script>
4
4
 
5
5
  <script setup>
6
- import { computed, useTemplateRef, toRef, onMounted, toRaw, nextTick, watch } from "vue";
6
+ import { computed, ref, useTemplateRef, toRef, onMounted, toRaw, nextTick, watch } from "vue";
7
7
  import { TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput } from "reka-ui";
8
8
  import { useForwardProps } from "../composables/useForwardProps";
9
9
  import { Combobox, Autocomplete } from "reka-ui/namespaced";
@@ -228,7 +228,9 @@ function onFocus(event) {
228
228
  emits("focus", event);
229
229
  emitFormFocus();
230
230
  }
231
+ const isOpen = ref(false);
231
232
  function onUpdateOpen(value) {
233
+ isOpen.value = value;
232
234
  let timeoutId;
233
235
  if (!value) {
234
236
  const event = new FocusEvent("blur");
@@ -283,6 +285,14 @@ function onClear() {
283
285
  emits("clear");
284
286
  }
285
287
  const viewportRef = useTemplateRef("viewportRef");
288
+ const comboboxRootRef = useTemplateRef("comboboxRootRef");
289
+ watch(() => props.items, async () => {
290
+ if (!isOpen.value) {
291
+ return;
292
+ }
293
+ await nextTick();
294
+ comboboxRootRef.value?.highlightFirstItem?.();
295
+ }, { flush: "post" });
286
296
  defineExpose({
287
297
  inputRef: toRef(() => inputRef.value?.$el),
288
298
  viewportRef: toRef(() => viewportRef.value)
@@ -361,6 +371,7 @@ defineExpose({
361
371
  </DefineItemTemplate>
362
372
 
363
373
  <Component.Root
374
+ ref="comboboxRootRef"
364
375
  v-slot="{ modelValue, open }"
365
376
  v-bind="rootProps"
366
377
  :name="name"
@@ -11,7 +11,7 @@ type InputNumberValue = number | null;
11
11
  type ApplyModifiers<T extends InputNumberValue, Mod extends Pick<ModelModifiers, 'optional'>> = T | (Mod extends {
12
12
  optional: true;
13
13
  } ? undefined : never);
14
- export interface InputNumberProps<T extends InputNumberValue = InputNumberValue, Mod extends Pick<ModelModifiers, 'optional'> = Pick<ModelModifiers, 'optional'>> extends Pick<NumberFieldRootProps, 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange' | 'readonly' | 'focusOnChange'>, /** @vue-ignore */ Omit<InputHTMLAttributes, 'disabled' | 'min' | 'max' | 'readonly' | 'required' | 'step' | 'name' | 'placeholder' | 'type' | 'autofocus' | 'maxlength' | 'minlength' | 'pattern' | 'size'> {
14
+ export interface InputNumberProps<T extends InputNumberValue = InputNumberValue, Mod extends Pick<ModelModifiers, 'optional'> = Pick<ModelModifiers, 'optional'>> extends Pick<NumberFieldRootProps, 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange' | 'readonly' | 'focusOnChange' | 'locale'>, /** @vue-ignore */ Omit<InputHTMLAttributes, 'disabled' | 'min' | 'max' | 'readonly' | 'required' | 'step' | 'name' | 'placeholder' | 'type' | 'autofocus' | 'maxlength' | 'minlength' | 'pattern' | 'size'> {
15
15
  /**
16
16
  * The element or component this component should render as.
17
17
  * @defaultValue 'div'
@@ -49,7 +49,8 @@ const _props = defineProps({
49
49
  disableWheelChange: { type: Boolean, required: false },
50
50
  invertWheelChange: { type: Boolean, required: false },
51
51
  readonly: { type: Boolean, required: false },
52
- focusOnChange: { type: Boolean, required: false }
52
+ focusOnChange: { type: Boolean, required: false },
53
+ locale: { type: String, required: false }
53
54
  });
54
55
  const emits = defineEmits(["update:modelValue", "blur", "change"]);
55
56
  defineSlots();
@@ -57,7 +58,7 @@ const props = useComponentProps("inputNumber", _props);
57
58
  const modelValue = useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue });
58
59
  const { t } = useLocale();
59
60
  const appConfig = useAppConfig();
60
- const rootProps = useForwardProps(reactivePick(props, "as", "stepSnapping", "formatOptions", "disableWheelChange", "invertWheelChange", "required", "readonly", "focusOnChange"), emits);
61
+ const rootProps = useForwardProps(reactivePick(props, "as", "stepSnapping", "formatOptions", "disableWheelChange", "invertWheelChange", "required", "readonly", "focusOnChange", "locale"), emits);
61
62
  const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size: formFieldSize, name, highlight, disabled, ariaAttrs } = useFormField(_props);
62
63
  const { orientation, size: fieldGroupSize } = useFieldGroup(_props);
63
64
  const inputSize = computed(() => fieldGroupSize.value || formFieldSize.value);