@nuxt/ui 3.0.1 → 3.1.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 (228) hide show
  1. package/.nuxt/ui/accordion.ts +25 -4
  2. package/.nuxt/ui/alert.ts +52 -31
  3. package/.nuxt/ui/avatar-group.ts +24 -3
  4. package/.nuxt/ui/avatar.ts +26 -5
  5. package/.nuxt/ui/badge.ts +56 -35
  6. package/.nuxt/ui/breadcrumb.ts +28 -7
  7. package/.nuxt/ui/button-group.ts +23 -2
  8. package/.nuxt/ui/button.ts +66 -45
  9. package/.nuxt/ui/calendar.ts +39 -18
  10. package/.nuxt/ui/card.ts +28 -7
  11. package/.nuxt/ui/carousel.ts +29 -8
  12. package/.nuxt/ui/checkbox-group.ts +82 -0
  13. package/.nuxt/ui/checkbox.ts +163 -29
  14. package/.nuxt/ui/chip.ts +31 -10
  15. package/.nuxt/ui/collapsible.ts +23 -2
  16. package/.nuxt/ui/color-picker.ts +26 -5
  17. package/.nuxt/ui/command-palette.ts +37 -16
  18. package/.nuxt/ui/container.ts +24 -3
  19. package/.nuxt/ui/context-menu.ts +56 -35
  20. package/.nuxt/ui/drawer.ts +33 -12
  21. package/.nuxt/ui/dropdown-menu.ts +57 -36
  22. package/.nuxt/ui/form-field.ts +29 -8
  23. package/.nuxt/ui/form.ts +23 -2
  24. package/.nuxt/ui/index.ts +1 -0
  25. package/.nuxt/ui/input-menu.ts +65 -44
  26. package/.nuxt/ui/input-number.ts +43 -22
  27. package/.nuxt/ui/input.ts +46 -25
  28. package/.nuxt/ui/kbd.ts +27 -6
  29. package/.nuxt/ui/link.ts +26 -5
  30. package/.nuxt/ui/modal.ts +28 -7
  31. package/.nuxt/ui/navigation-menu.ts +103 -84
  32. package/.nuxt/ui/pagination.ts +23 -2
  33. package/.nuxt/ui/pin-input.ts +43 -22
  34. package/.nuxt/ui/popover.ts +25 -4
  35. package/.nuxt/ui/progress.ts +40 -19
  36. package/.nuxt/ui/radio-group.ts +273 -37
  37. package/.nuxt/ui/select-menu.ts +59 -35
  38. package/.nuxt/ui/select.ts +55 -34
  39. package/.nuxt/ui/separator.ts +31 -10
  40. package/.nuxt/ui/skeleton.ts +24 -3
  41. package/.nuxt/ui/slideover.ts +27 -6
  42. package/.nuxt/ui/slider.ts +39 -18
  43. package/.nuxt/ui/stepper.ts +41 -20
  44. package/.nuxt/ui/switch.ts +44 -23
  45. package/.nuxt/ui/table.ts +38 -17
  46. package/.nuxt/ui/tabs.ts +55 -34
  47. package/.nuxt/ui/textarea.ts +63 -37
  48. package/.nuxt/ui/toast.ts +47 -26
  49. package/.nuxt/ui/toaster.ts +23 -2
  50. package/.nuxt/ui/tooltip.ts +25 -4
  51. package/.nuxt/ui/tree.ts +41 -20
  52. package/.nuxt/ui.css +56 -12
  53. package/README.md +11 -0
  54. package/cli/templates.mjs +18 -17
  55. package/dist/module.d.mts +2 -1
  56. package/dist/module.json +5 -5
  57. package/dist/module.mjs +11 -7
  58. package/dist/runtime/components/Accordion.vue +36 -92
  59. package/dist/runtime/components/Accordion.vue.d.ts +91 -0
  60. package/dist/runtime/components/Alert.vue +37 -100
  61. package/dist/runtime/components/Alert.vue.d.ts +96 -0
  62. package/dist/runtime/components/App.vue +28 -34
  63. package/dist/runtime/components/App.vue.d.ts +24 -0
  64. package/dist/runtime/components/Avatar.vue +47 -78
  65. package/dist/runtime/components/Avatar.vue.d.ts +60 -0
  66. package/dist/runtime/components/AvatarGroup.vue +40 -77
  67. package/dist/runtime/components/AvatarGroup.vue.d.ts +40 -0
  68. package/dist/runtime/components/Badge.vue +33 -62
  69. package/dist/runtime/components/Badge.vue.d.ts +62 -0
  70. package/dist/runtime/components/Breadcrumb.vue +36 -88
  71. package/dist/runtime/components/Breadcrumb.vue.d.ts +82 -0
  72. package/dist/runtime/components/Button.vue +96 -105
  73. package/dist/runtime/components/Button.vue.d.ts +73 -0
  74. package/dist/runtime/components/ButtonGroup.vue +20 -46
  75. package/dist/runtime/components/ButtonGroup.vue.d.ts +55 -0
  76. package/dist/runtime/components/Calendar.vue +73 -127
  77. package/dist/runtime/components/Calendar.vue.d.ts +107 -0
  78. package/dist/runtime/components/Card.vue +18 -40
  79. package/dist/runtime/components/Card.vue.d.ts +38 -0
  80. package/dist/runtime/components/Carousel.vue +112 -230
  81. package/dist/runtime/components/Carousel.vue.d.ts +120 -0
  82. package/dist/runtime/components/Checkbox.vue +52 -93
  83. package/dist/runtime/components/Checkbox.vue.d.ts +76 -0
  84. package/dist/runtime/components/CheckboxGroup.vue +121 -0
  85. package/dist/runtime/components/CheckboxGroup.vue.d.ts +75 -0
  86. package/dist/runtime/components/Chip.vue +26 -69
  87. package/dist/runtime/components/Chip.vue.d.ts +71 -0
  88. package/dist/runtime/components/Collapsible.vue +22 -41
  89. package/dist/runtime/components/Collapsible.vue.d.ts +50 -0
  90. package/dist/runtime/components/ColorPicker.vue +111 -197
  91. package/dist/runtime/components/ColorPicker.vue.d.ts +63 -0
  92. package/dist/runtime/components/CommandPalette.vue +94 -234
  93. package/dist/runtime/components/CommandPalette.vue.d.ts +173 -0
  94. package/dist/runtime/components/Container.vue +15 -28
  95. package/dist/runtime/components/Container.vue.d.ts +27 -0
  96. package/dist/runtime/components/ContextMenu.vue +32 -119
  97. package/dist/runtime/components/ContextMenu.vue.d.ts +127 -0
  98. package/dist/runtime/components/ContextMenuContent.vue +71 -72
  99. package/dist/runtime/components/ContextMenuContent.vue.d.ts +105 -0
  100. package/dist/runtime/components/Drawer.vue +49 -87
  101. package/dist/runtime/components/Drawer.vue.d.ts +88 -0
  102. package/dist/runtime/components/DropdownMenu.vue +37 -129
  103. package/dist/runtime/components/DropdownMenu.vue.d.ts +141 -0
  104. package/dist/runtime/components/DropdownMenuContent.vue +76 -79
  105. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +55 -0
  106. package/dist/runtime/components/Form.vue +135 -219
  107. package/dist/runtime/components/Form.vue.d.ts +66 -0
  108. package/dist/runtime/components/FormField.vue +36 -77
  109. package/dist/runtime/components/FormField.vue.d.ts +70 -0
  110. package/dist/runtime/components/Icon.vue +12 -19
  111. package/dist/runtime/components/Icon.vue.d.ts +17 -0
  112. package/dist/runtime/components/Input.vue +82 -140
  113. package/dist/runtime/components/Input.vue.d.ts +91 -0
  114. package/dist/runtime/components/InputMenu.vue +193 -302
  115. package/dist/runtime/components/InputMenu.vue.d.ts +312 -0
  116. package/dist/runtime/components/InputNumber.vue +71 -133
  117. package/dist/runtime/components/InputNumber.vue.d.ts +193 -0
  118. package/dist/runtime/components/Kbd.vue +20 -46
  119. package/dist/runtime/components/Kbd.vue.d.ts +55 -0
  120. package/dist/runtime/components/Link.vue +98 -173
  121. package/dist/runtime/components/Link.vue.d.ts +124 -0
  122. package/dist/runtime/components/LinkBase.vue +33 -41
  123. package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
  124. package/dist/runtime/components/Modal.vue +53 -116
  125. package/dist/runtime/components/Modal.vue.d.ts +109 -0
  126. package/dist/runtime/components/NavigationMenu.vue +78 -186
  127. package/dist/runtime/components/NavigationMenu.vue.d.ts +159 -0
  128. package/dist/runtime/components/OverlayProvider.vue +14 -18
  129. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  130. package/dist/runtime/components/Pagination.vue +46 -140
  131. package/dist/runtime/components/Pagination.vue.d.ts +143 -0
  132. package/dist/runtime/components/PinInput.vue +61 -78
  133. package/dist/runtime/components/PinInput.vue.d.ts +68 -0
  134. package/dist/runtime/components/Popover.vue +47 -84
  135. package/dist/runtime/components/Popover.vue.d.ts +80 -0
  136. package/dist/runtime/components/Progress.vue +70 -131
  137. package/dist/runtime/components/Progress.vue.d.ts +97 -0
  138. package/dist/runtime/components/RadioGroup.vue +75 -126
  139. package/dist/runtime/components/RadioGroup.vue.d.ts +88 -0
  140. package/dist/runtime/components/Select.vue +115 -202
  141. package/dist/runtime/components/Select.vue.d.ts +139 -0
  142. package/dist/runtime/components/SelectMenu.vue +167 -281
  143. package/dist/runtime/components/SelectMenu.vue.d.ts +184 -0
  144. package/dist/runtime/components/Separator.vue +29 -71
  145. package/dist/runtime/components/Separator.vue.d.ts +75 -0
  146. package/dist/runtime/components/Skeleton.vue +21 -23
  147. package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
  148. package/dist/runtime/components/Slideover.vue +53 -120
  149. package/dist/runtime/components/Slideover.vue.d.ts +111 -0
  150. package/dist/runtime/components/Slider.vue +46 -84
  151. package/dist/runtime/components/Slider.vue.d.ts +71 -0
  152. package/dist/runtime/components/Stepper.vue +44 -113
  153. package/dist/runtime/components/Stepper.vue.d.ts +89 -0
  154. package/dist/runtime/components/Switch.vue +45 -93
  155. package/dist/runtime/components/Switch.vue.d.ts +73 -0
  156. package/dist/runtime/components/Table.vue +165 -264
  157. package/dist/runtime/components/Table.vue.d.ts +183 -0
  158. package/dist/runtime/components/Tabs.vue +40 -105
  159. package/dist/runtime/components/Tabs.vue.d.ts +104 -0
  160. package/dist/runtime/components/Textarea.vue +113 -158
  161. package/dist/runtime/components/Textarea.vue.d.ts +95 -0
  162. package/dist/runtime/components/Toast.vue +49 -110
  163. package/dist/runtime/components/Toast.vue.d.ts +95 -0
  164. package/dist/runtime/components/Toaster.vue +70 -107
  165. package/dist/runtime/components/Toaster.vue.d.ts +63 -0
  166. package/dist/runtime/components/Tooltip.vue +38 -65
  167. package/dist/runtime/components/Tooltip.vue.d.ts +65 -0
  168. package/dist/runtime/components/Tree.vue +57 -150
  169. package/dist/runtime/components/Tree.vue.d.ts +128 -0
  170. package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
  171. package/dist/runtime/composables/defineShortcuts.js +0 -1
  172. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  173. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  174. package/dist/runtime/composables/useFormField.d.ts +2 -2
  175. package/dist/runtime/composables/useFormField.js +1 -1
  176. package/dist/runtime/composables/useOverlay.d.ts +16 -8
  177. package/dist/runtime/composables/useOverlay.js +14 -6
  178. package/dist/runtime/composables/usePortal.d.ts +6 -0
  179. package/dist/runtime/composables/usePortal.js +17 -0
  180. package/dist/runtime/index.css +1 -1
  181. package/dist/runtime/inertia/components/Link.vue +146 -0
  182. package/dist/runtime/inertia/components/Link.vue.d.ts +92 -0
  183. package/dist/runtime/inertia/stubs.d.ts +43 -0
  184. package/dist/runtime/inertia/stubs.js +82 -0
  185. package/dist/runtime/locale/bg.d.ts +3 -0
  186. package/dist/runtime/locale/bg.js +54 -0
  187. package/dist/runtime/locale/hy.d.ts +3 -0
  188. package/dist/runtime/locale/hy.js +54 -0
  189. package/dist/runtime/locale/index.d.ts +6 -1
  190. package/dist/runtime/locale/index.js +6 -1
  191. package/dist/runtime/locale/kk.d.ts +3 -0
  192. package/dist/runtime/locale/kk.js +54 -0
  193. package/dist/runtime/locale/tj.d.ts +3 -0
  194. package/dist/runtime/locale/tj.js +54 -0
  195. package/dist/runtime/locale/ug_cn.d.ts +3 -0
  196. package/dist/runtime/locale/ug_cn.js +55 -0
  197. package/dist/runtime/types/form.d.ts +5 -1
  198. package/dist/runtime/types/index.d.ts +2 -0
  199. package/dist/runtime/types/index.js +2 -0
  200. package/dist/runtime/types/utils.d.ts +70 -10
  201. package/dist/runtime/utils/index.d.ts +1 -0
  202. package/dist/runtime/utils/index.js +3 -0
  203. package/dist/runtime/utils/link.d.ts +4 -27
  204. package/dist/runtime/utils/link.js +32 -1
  205. package/dist/runtime/utils/tv.js +2 -2
  206. package/dist/runtime/vue/components/Icon.vue +7 -8
  207. package/dist/runtime/vue/components/Icon.vue.d.ts +14 -0
  208. package/dist/runtime/vue/components/Link.vue +118 -199
  209. package/dist/runtime/vue/components/Link.vue.d.ts +124 -0
  210. package/dist/runtime/vue/stubs.d.ts +5 -0
  211. package/dist/runtime/vue/stubs.js +11 -2
  212. package/dist/shared/{ui.BCaWD5Ek.mjs → ui.D7lOOabO.mjs} +623 -364
  213. package/dist/types.d.mts +5 -1
  214. package/dist/unplugin.d.mts +6 -1
  215. package/dist/unplugin.mjs +25 -4
  216. package/dist/vite.mjs +1 -1
  217. package/package.json +122 -64
  218. package/dist/module.cjs +0 -62
  219. package/dist/module.d.cts +0 -44
  220. package/dist/module.d.ts +0 -44
  221. package/dist/shared/ui.C6uTSFTI.cjs +0 -3555
  222. package/dist/types.d.ts +0 -1
  223. package/dist/unplugin.cjs +0 -232
  224. package/dist/unplugin.d.cts +0 -61
  225. package/dist/unplugin.d.ts +0 -61
  226. package/dist/vite.cjs +0 -23
  227. package/dist/vite.d.cts +0 -15
  228. package/dist/vite.d.ts +0 -15
@@ -0,0 +1,312 @@
1
+ import type { InputHTMLAttributes } from 'vue';
2
+ import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxContentEmits, ComboboxArrowProps } from 'reka-ui';
3
+ import type { AppConfig } from '@nuxt/schema';
4
+ import theme from '#build/ui/input-menu';
5
+ import type { UseComponentIconsProps } from '../composables/useComponentIcons';
6
+ import type { AvatarProps, ChipProps } from '../types';
7
+ import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
8
+ type InputMenu = ComponentConfig<typeof theme, AppConfig, 'inputMenu'>;
9
+ interface _InputMenuItem {
10
+ label?: string;
11
+ /**
12
+ * @IconifyIcon
13
+ */
14
+ icon?: string;
15
+ avatar?: AvatarProps;
16
+ chip?: ChipProps;
17
+ /**
18
+ * The item type.
19
+ * @defaultValue 'item'
20
+ */
21
+ type?: 'label' | 'separator' | 'item';
22
+ disabled?: boolean;
23
+ onSelect?(e?: Event): void;
24
+ [key: string]: any;
25
+ }
26
+ export type InputMenuItem = _InputMenuItem | AcceptableValue | boolean;
27
+ export interface InputMenuProps<T extends ArrayOrNested<InputMenuItem> = ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false> extends Pick<ComboboxRootProps<T>, 'open' | 'defaultOpen' | 'disabled' | 'name' | 'resetSearchTermOnBlur' | 'resetSearchTermOnSelect' | 'highlightOnHover'>, UseComponentIconsProps {
28
+ /**
29
+ * The element or component this component should render as.
30
+ * @defaultValue 'div'
31
+ */
32
+ as?: any;
33
+ id?: string;
34
+ type?: InputHTMLAttributes['type'];
35
+ /** The placeholder text when the input is empty. */
36
+ placeholder?: string;
37
+ /**
38
+ * @defaultValue 'primary'
39
+ */
40
+ color?: InputMenu['variants']['color'];
41
+ /**
42
+ * @defaultValue 'outline'
43
+ */
44
+ variant?: InputMenu['variants']['variant'];
45
+ /**
46
+ * @defaultValue 'md'
47
+ */
48
+ size?: InputMenu['variants']['size'];
49
+ required?: boolean;
50
+ autofocus?: boolean;
51
+ autofocusDelay?: number;
52
+ /**
53
+ * The icon displayed to open the menu.
54
+ * @defaultValue appConfig.ui.icons.chevronDown
55
+ * @IconifyIcon
56
+ */
57
+ trailingIcon?: string;
58
+ /**
59
+ * The icon displayed when an item is selected.
60
+ * @defaultValue appConfig.ui.icons.check
61
+ * @IconifyIcon
62
+ */
63
+ selectedIcon?: string;
64
+ /**
65
+ * The icon displayed to delete a tag.
66
+ * Works only when `multiple` is `true`.
67
+ * @defaultValue appConfig.ui.icons.close
68
+ * @IconifyIcon
69
+ */
70
+ deleteIcon?: string;
71
+ /**
72
+ * The content of the menu.
73
+ * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }
74
+ */
75
+ content?: Omit<ComboboxContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<ComboboxContentEmits>>;
76
+ /**
77
+ * Display an arrow alongside the menu.
78
+ * @defaultValue false
79
+ */
80
+ arrow?: boolean | Omit<ComboboxArrowProps, 'as' | 'asChild'>;
81
+ /**
82
+ * Render the menu in a portal.
83
+ * @defaultValue true
84
+ */
85
+ portal?: boolean | string | HTMLElement;
86
+ /**
87
+ * When `items` is an array of objects, select the field to use as the value instead of the object itself.
88
+ * @defaultValue undefined
89
+ */
90
+ valueKey?: VK;
91
+ /**
92
+ * When `items` is an array of objects, select the field to use as the label.
93
+ * @defaultValue 'label'
94
+ */
95
+ labelKey?: keyof NestedItem<T>;
96
+ items?: T;
97
+ /** The value of the InputMenu when initially rendered. Use when you do not need to control the state of the InputMenu. */
98
+ defaultValue?: GetModelValue<T, VK, M>;
99
+ /** The controlled value of the InputMenu. Can be binded-with with `v-model`. */
100
+ modelValue?: GetModelValue<T, VK, M>;
101
+ /** Whether multiple options can be selected or not. */
102
+ multiple?: M & boolean;
103
+ /** Highlight the ring color like a focus state. */
104
+ highlight?: boolean;
105
+ /**
106
+ * Determines if custom user input that does not exist in options can be added.
107
+ * @defaultValue false
108
+ */
109
+ createItem?: boolean | 'always' | {
110
+ position?: 'top' | 'bottom';
111
+ when?: 'empty' | 'always';
112
+ };
113
+ /**
114
+ * Fields to filter items by.
115
+ * @defaultValue [labelKey]
116
+ */
117
+ filterFields?: string[];
118
+ /**
119
+ * When `true`, disable the default filters, useful for custom filtering (useAsyncData, useFetch, etc.).
120
+ * @defaultValue false
121
+ */
122
+ ignoreFilter?: boolean;
123
+ class?: any;
124
+ ui?: InputMenu['slots'];
125
+ }
126
+ export type InputMenuEmits<A extends ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<A> | undefined, M extends boolean> = Pick<ComboboxRootEmits, 'update:open'> & {
127
+ change: [payload: Event];
128
+ blur: [payload: FocusEvent];
129
+ focus: [payload: FocusEvent];
130
+ create: [item: string];
131
+ /** Event handler when highlighted element changes. */
132
+ highlight: [
133
+ payload: {
134
+ ref: HTMLElement;
135
+ value: GetModelValue<A, VK, M>;
136
+ } | undefined
137
+ ];
138
+ } & GetModelValueEmits<A, VK, M>;
139
+ type SlotProps<T extends InputMenuItem> = (props: {
140
+ item: T;
141
+ index: number;
142
+ }) => any;
143
+ export interface InputMenuSlots<A extends ArrayOrNested<InputMenuItem> = ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<A> | undefined = undefined, M extends boolean = false, T extends NestedItem<A> = NestedItem<A>> {
144
+ 'leading'(props: {
145
+ modelValue?: GetModelValue<A, VK, M>;
146
+ open: boolean;
147
+ ui: {
148
+ [K in keyof Required<InputMenu['slots']>]: (props?: Record<string, any>) => string;
149
+ };
150
+ }): any;
151
+ 'trailing'(props: {
152
+ modelValue?: GetModelValue<A, VK, M>;
153
+ open: boolean;
154
+ ui: {
155
+ [K in keyof Required<InputMenu['slots']>]: (props?: Record<string, any>) => string;
156
+ };
157
+ }): any;
158
+ 'empty'(props: {
159
+ searchTerm?: string;
160
+ }): any;
161
+ 'item': SlotProps<T>;
162
+ 'item-leading': SlotProps<T>;
163
+ 'item-label': SlotProps<T>;
164
+ 'item-trailing': SlotProps<T>;
165
+ 'tags-item-text': SlotProps<T>;
166
+ 'tags-item-delete': SlotProps<T>;
167
+ 'content-top': (props?: {}) => any;
168
+ 'content-bottom': (props?: {}) => any;
169
+ 'create-item-label'(props: {
170
+ item: string;
171
+ }): any;
172
+ }
173
+ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
174
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & ({
175
+ searchTerm?: string;
176
+ } & InputMenuProps<T, VK, M>) & Partial<{}>> & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps);
177
+ expose(exposed: import("vue").ShallowUnwrapRef<{
178
+ inputRef: import("vue").Ref<({
179
+ $: import("vue").ComponentInternalInstance;
180
+ $data: {};
181
+ $props: {
182
+ readonly displayValue?: ((val: any) => string) | undefined;
183
+ readonly modelValue?: string | undefined;
184
+ readonly autoFocus?: boolean | undefined;
185
+ readonly disabled?: boolean | undefined;
186
+ readonly asChild?: boolean | undefined;
187
+ readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
188
+ readonly "onUpdate:modelValue"?: ((args_0: string) => any) | undefined | undefined;
189
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
190
+ $attrs: {
191
+ [x: string]: unknown;
192
+ };
193
+ $refs: {
194
+ [x: string]: unknown;
195
+ };
196
+ $slots: Readonly<{
197
+ [name: string]: import("vue").Slot<any> | undefined;
198
+ }>;
199
+ $root: import("vue").ComponentPublicInstance | null;
200
+ $parent: import("vue").ComponentPublicInstance | null;
201
+ $host: Element | null;
202
+ $emit: (event: "update:modelValue", args_0: string) => void;
203
+ $el: any;
204
+ $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
205
+ "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
206
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
207
+ "update:modelValue": (args_0: string) => any;
208
+ }, string, {
209
+ as: import("reka-ui").AsTag | import("vue").Component;
210
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
211
+ beforeCreate?: (() => void) | (() => void)[];
212
+ created?: (() => void) | (() => void)[];
213
+ beforeMount?: (() => void) | (() => void)[];
214
+ mounted?: (() => void) | (() => void)[];
215
+ beforeUpdate?: (() => void) | (() => void)[];
216
+ updated?: (() => void) | (() => void)[];
217
+ activated?: (() => void) | (() => void)[];
218
+ deactivated?: (() => void) | (() => void)[];
219
+ beforeDestroy?: (() => void) | (() => void)[];
220
+ beforeUnmount?: (() => void) | (() => void)[];
221
+ destroyed?: (() => void) | (() => void)[];
222
+ unmounted?: (() => void) | (() => void)[];
223
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
224
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
225
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
226
+ };
227
+ $forceUpdate: () => void;
228
+ $nextTick: typeof import("vue").nextTick;
229
+ $watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
230
+ } & Readonly<{
231
+ as: import("reka-ui").AsTag | import("vue").Component;
232
+ }> & Omit<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
233
+ "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
234
+ }>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
235
+ $slots: {
236
+ default?(_: {}): any;
237
+ };
238
+ }) | null, ({
239
+ $: import("vue").ComponentInternalInstance;
240
+ $data: {};
241
+ $props: {
242
+ readonly displayValue?: ((val: any) => string) | undefined;
243
+ readonly modelValue?: string | undefined;
244
+ readonly autoFocus?: boolean | undefined;
245
+ readonly disabled?: boolean | undefined;
246
+ readonly asChild?: boolean | undefined;
247
+ readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
248
+ readonly "onUpdate:modelValue"?: ((args_0: string) => any) | undefined | undefined;
249
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
250
+ $attrs: {
251
+ [x: string]: unknown;
252
+ };
253
+ $refs: {
254
+ [x: string]: unknown;
255
+ };
256
+ $slots: Readonly<{
257
+ [name: string]: import("vue").Slot<any> | undefined;
258
+ }>;
259
+ $root: import("vue").ComponentPublicInstance | null;
260
+ $parent: import("vue").ComponentPublicInstance | null;
261
+ $host: Element | null;
262
+ $emit: (event: "update:modelValue", args_0: string) => void;
263
+ $el: any;
264
+ $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
265
+ "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
266
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
267
+ "update:modelValue": (args_0: string) => any;
268
+ }, string, {
269
+ as: import("reka-ui").AsTag | import("vue").Component;
270
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
271
+ beforeCreate?: (() => void) | (() => void)[];
272
+ created?: (() => void) | (() => void)[];
273
+ beforeMount?: (() => void) | (() => void)[];
274
+ mounted?: (() => void) | (() => void)[];
275
+ beforeUpdate?: (() => void) | (() => void)[];
276
+ updated?: (() => void) | (() => void)[];
277
+ activated?: (() => void) | (() => void)[];
278
+ deactivated?: (() => void) | (() => void)[];
279
+ beforeDestroy?: (() => void) | (() => void)[];
280
+ beforeUnmount?: (() => void) | (() => void)[];
281
+ destroyed?: (() => void) | (() => void)[];
282
+ unmounted?: (() => void) | (() => void)[];
283
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
284
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
285
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
286
+ };
287
+ $forceUpdate: () => void;
288
+ $nextTick: typeof import("vue").nextTick;
289
+ $watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
290
+ } & Readonly<{
291
+ as: import("reka-ui").AsTag | import("vue").Component;
292
+ }> & Omit<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
293
+ "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
294
+ }>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
295
+ $slots: {
296
+ default?(_: {}): any;
297
+ };
298
+ }) | null>;
299
+ }>): void;
300
+ attrs: any;
301
+ slots: Readonly<InputMenuSlots<T, VK, M, NestedItem<T>>> & InputMenuSlots<T, VK, M, NestedItem<T>>;
302
+ emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "highlight", payload: {
303
+ ref: HTMLElement;
304
+ value: GetModelValue<T, VK, M>;
305
+ } | undefined) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void)) & ((evt: "update:searchTerm", value: string) => void);
306
+ }>) => import("vue").VNode & {
307
+ __ctx?: Awaited<typeof __VLS_setup>;
308
+ };
309
+ export default _default;
310
+ type __VLS_PrettifyLocal<T> = {
311
+ [K in keyof T]: T[K];
312
+ } & {};
@@ -1,149 +1,87 @@
1
- <script lang="ts">
2
- import type { VariantProps } from 'tailwind-variants'
3
- import type { NumberFieldRootProps } from 'reka-ui'
4
- import type { AppConfig } from '@nuxt/schema'
5
- import _appConfig from '#build/app.config'
6
- import theme from '#build/ui/input-number'
7
- import { tv } from '../utils/tv'
8
- import type { ButtonProps } from '../types'
9
- import type { PartialString } from '../types/utils'
10
-
11
- const appConfigInputNumber = _appConfig as AppConfig & { ui: { inputNumber: Partial<typeof theme> } }
12
-
13
- const inputNumber = tv({ extend: tv(theme), ...(appConfigInputNumber.ui?.inputNumber || {}) })
14
-
15
- type InputNumberVariants = VariantProps<typeof inputNumber>
16
-
17
- export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions'> {
18
- /**
19
- * The element or component this component should render as.
20
- * @defaultValue 'div'
21
- */
22
- as?: any
23
- /** The placeholder text when the input is empty. */
24
- placeholder?: string
25
- color?: InputNumberVariants['color']
26
- variant?: InputNumberVariants['variant']
27
- size?: InputNumberVariants['size']
28
- /** Highlight the ring color like a focus state. */
29
- highlight?: boolean
30
- /**
31
- * The orientation of the input menu.
32
- * @defaultValue 'horizontal'
33
- */
34
- orientation?: 'vertical' | 'horizontal'
35
- /**
36
- * Configure the increment button. The `color` and `size` are inherited.
37
- * @defaultValue { variant: 'link' }
38
- */
39
- increment?: ButtonProps
40
- /**
41
- * The icon displayed to increment the value.
42
- * @defaultValue appConfig.ui.icons.plus
43
- * @IconifyIcon
44
- */
45
- incrementIcon?: string
46
- /**
47
- * Configure the decrement button. The `color` and `size` are inherited.
48
- * @defaultValue { variant: 'link' }
49
- */
50
- decrement?: ButtonProps
51
- /**
52
- * The icon displayed to decrement the value.
53
- * @defaultValue appConfig.ui.icons.minus
54
- * @IconifyIcon
55
- */
56
- decrementIcon?: string
57
- autofocus?: boolean
58
- autofocusDelay?: number
59
- /**
60
- * The locale to use for formatting and parsing numbers.
61
- * @defaultValue UApp.locale.code
62
- */
63
- locale?: string
64
- class?: any
65
- ui?: PartialString<typeof inputNumber.slots>
66
- }
67
-
68
- export interface InputNumberEmits {
69
- (e: 'update:modelValue', payload: number): void
70
- (e: 'blur', event: FocusEvent): void
71
- (e: 'change', payload: Event): void
72
- }
73
-
74
- export interface InputNumberSlots {
75
- increment(props?: {}): any
76
- decrement(props?: {}): any
77
- }
1
+ <script>
2
+ import theme from "#build/ui/input-number";
78
3
  </script>
79
4
 
80
- <script setup lang="ts">
81
- import { onMounted, ref, computed } from 'vue'
82
- import { NumberFieldRoot, NumberFieldInput, NumberFieldDecrement, NumberFieldIncrement, useForwardPropsEmits } from 'reka-ui'
83
- import { reactivePick } from '@vueuse/core'
84
- import { useAppConfig } from '#imports'
85
- import { useFormField } from '../composables/useFormField'
86
- import { useLocale } from '../composables/useLocale'
87
- import UButton from './Button.vue'
88
-
89
- defineOptions({ inheritAttrs: false })
90
-
91
- const props = withDefaults(defineProps<InputNumberProps>(), {
92
- orientation: 'horizontal'
93
- })
94
- const emits = defineEmits<InputNumberEmits>()
95
- defineSlots<InputNumberSlots>()
96
-
97
- const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'min', 'max', 'step', 'formatOptions'), emits)
98
-
99
- const appConfig = useAppConfig()
100
- const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size, name, highlight, disabled, ariaAttrs } = useFormField<InputNumberProps>(props)
101
-
102
- const { t, code: codeLocale } = useLocale()
103
- const locale = computed(() => props.locale || codeLocale.value)
104
-
105
- const ui = computed(() => inputNumber({
5
+ <script setup>
6
+ import { onMounted, ref, computed } from "vue";
7
+ import { NumberFieldRoot, NumberFieldInput, NumberFieldDecrement, NumberFieldIncrement, useForwardPropsEmits } from "reka-ui";
8
+ import { reactivePick } from "@vueuse/core";
9
+ import { useAppConfig } from "#imports";
10
+ import { useFormField } from "../composables/useFormField";
11
+ import { useLocale } from "../composables/useLocale";
12
+ import { tv } from "../utils/tv";
13
+ import UButton from "./Button.vue";
14
+ defineOptions({ inheritAttrs: false });
15
+ const props = defineProps({
16
+ as: { type: null, required: false },
17
+ placeholder: { type: String, required: false },
18
+ color: { type: null, required: false },
19
+ variant: { type: null, required: false },
20
+ size: { type: null, required: false },
21
+ highlight: { type: Boolean, required: false },
22
+ orientation: { type: String, required: false, default: "horizontal" },
23
+ increment: { type: Object, required: false },
24
+ incrementIcon: { type: String, required: false },
25
+ decrement: { type: Object, required: false },
26
+ decrementIcon: { type: String, required: false },
27
+ autofocus: { type: Boolean, required: false },
28
+ autofocusDelay: { type: Number, required: false },
29
+ locale: { type: String, required: false },
30
+ class: { type: null, required: false },
31
+ ui: { type: null, required: false },
32
+ modelValue: { type: [Number, null], required: false },
33
+ defaultValue: { type: Number, required: false },
34
+ min: { type: Number, required: false },
35
+ max: { type: Number, required: false },
36
+ step: { type: Number, required: false },
37
+ stepSnapping: { type: Boolean, required: false },
38
+ disabled: { type: Boolean, required: false },
39
+ required: { type: Boolean, required: false },
40
+ id: { type: String, required: false },
41
+ name: { type: String, required: false },
42
+ formatOptions: { type: null, required: false },
43
+ disableWheelChange: { type: Boolean, required: false }
44
+ });
45
+ const emits = defineEmits(["update:modelValue", "blur", "change"]);
46
+ defineSlots();
47
+ const appConfig = useAppConfig();
48
+ const rootProps = useForwardPropsEmits(reactivePick(props, "as", "modelValue", "defaultValue", "min", "max", "step", "stepSnapping", "formatOptions", "disableWheelChange"), emits);
49
+ const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size, name, highlight, disabled, ariaAttrs } = useFormField(props);
50
+ const { t, code: codeLocale } = useLocale();
51
+ const locale = computed(() => props.locale || codeLocale.value);
52
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.inputNumber || {} })({
106
53
  color: color.value,
107
54
  variant: props.variant,
108
55
  size: size.value,
109
56
  highlight: highlight.value,
110
57
  orientation: props.orientation
111
- }))
112
-
113
- const incrementIcon = computed(() => props.incrementIcon || (props.orientation === 'horizontal' ? appConfig.ui.icons.plus : appConfig.ui.icons.chevronUp))
114
- const decrementIcon = computed(() => props.decrementIcon || (props.orientation === 'horizontal' ? appConfig.ui.icons.minus : appConfig.ui.icons.chevronDown))
115
-
116
- const inputRef = ref<InstanceType<typeof NumberFieldInput> | null>(null)
117
-
58
+ }));
59
+ const incrementIcon = computed(() => props.incrementIcon || (props.orientation === "horizontal" ? appConfig.ui.icons.plus : appConfig.ui.icons.chevronUp));
60
+ const decrementIcon = computed(() => props.decrementIcon || (props.orientation === "horizontal" ? appConfig.ui.icons.minus : appConfig.ui.icons.chevronDown));
61
+ const inputRef = ref(null);
62
+ function onUpdate(value) {
63
+ const event = new Event("change", { target: { value } });
64
+ emits("change", event);
65
+ emitFormChange();
66
+ emitFormInput();
67
+ }
68
+ function onBlur(event) {
69
+ emitFormBlur();
70
+ emits("blur", event);
71
+ }
118
72
  function autoFocus() {
119
73
  if (props.autofocus) {
120
- inputRef.value?.$el?.focus()
74
+ inputRef.value?.$el?.focus();
121
75
  }
122
76
  }
123
-
124
77
  onMounted(() => {
125
78
  setTimeout(() => {
126
- autoFocus()
127
- }, props.autofocusDelay)
128
- })
129
-
130
- function onUpdate(value: number) {
131
- // @ts-expect-error - 'target' does not exist in type 'EventInit'
132
- const event = new Event('change', { target: { value } })
133
- emits('change', event)
134
-
135
- emitFormChange()
136
- emitFormInput()
137
- }
138
-
139
- function onBlur(event: FocusEvent) {
140
- emitFormBlur()
141
- emits('blur', event)
142
- }
143
-
79
+ autoFocus();
80
+ }, props.autofocusDelay);
81
+ });
144
82
  defineExpose({
145
83
  inputRef
146
- })
84
+ });
147
85
  </script>
148
86
 
149
87
  <template>
@@ -175,7 +113,7 @@ defineExpose({
175
113
  :size="size"
176
114
  variant="link"
177
115
  :aria-label="t('inputNumber.increment')"
178
- v-bind="typeof increment === 'object' ? increment : undefined"
116
+ v-bind="typeof increment === 'object' ? increment : void 0"
179
117
  />
180
118
  </slot>
181
119
  </NumberFieldIncrement>
@@ -190,7 +128,7 @@ defineExpose({
190
128
  :size="size"
191
129
  variant="link"
192
130
  :aria-label="t('inputNumber.decrement')"
193
- v-bind="typeof decrement === 'object' ? decrement : undefined"
131
+ v-bind="typeof decrement === 'object' ? decrement : void 0"
194
132
  />
195
133
  </slot>
196
134
  </NumberFieldDecrement>