@nuxt/ui 3.3.4 → 3.3.6

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 (149) hide show
  1. package/.nuxt/ui/drawer.ts +23 -0
  2. package/.nuxt/ui/progress.ts +3 -3
  3. package/README.md +10 -10
  4. package/dist/module.d.mts +6 -6
  5. package/dist/module.json +2 -2
  6. package/dist/module.mjs +3 -3
  7. package/dist/runtime/components/Accordion.d.vue.ts +78 -0
  8. package/dist/runtime/components/Accordion.vue.d.ts +6 -5
  9. package/dist/runtime/components/Alert.d.vue.ts +82 -0
  10. package/dist/runtime/components/Alert.vue.d.ts +2 -1
  11. package/dist/runtime/components/App.d.vue.ts +25 -0
  12. package/dist/runtime/components/App.vue +1 -1
  13. package/dist/runtime/components/App.vue.d.ts +5 -4
  14. package/dist/runtime/components/Avatar.d.vue.ts +42 -0
  15. package/dist/runtime/components/Avatar.vue.d.ts +2 -1
  16. package/dist/runtime/components/AvatarGroup.d.vue.ts +32 -0
  17. package/dist/runtime/components/AvatarGroup.vue.d.ts +2 -1
  18. package/dist/runtime/components/Badge.d.vue.ts +44 -0
  19. package/dist/runtime/components/Badge.vue.d.ts +2 -1
  20. package/dist/runtime/components/Breadcrumb.d.vue.ts +67 -0
  21. package/dist/runtime/components/Breadcrumb.vue.d.ts +4 -3
  22. package/dist/runtime/components/Button.d.vue.ts +45 -0
  23. package/dist/runtime/components/Button.vue.d.ts +2 -1
  24. package/dist/runtime/components/ButtonGroup.d.vue.ts +35 -0
  25. package/dist/runtime/components/ButtonGroup.vue.d.ts +2 -1
  26. package/dist/runtime/components/Calendar.d.vue.ts +113 -0
  27. package/dist/runtime/components/Calendar.vue.d.ts +9 -8
  28. package/dist/runtime/components/Card.d.vue.ts +30 -0
  29. package/dist/runtime/components/Card.vue.d.ts +2 -1
  30. package/dist/runtime/components/Carousel.d.vue.ts +128 -0
  31. package/dist/runtime/components/Carousel.vue +32 -12
  32. package/dist/runtime/components/Carousel.vue.d.ts +7 -6
  33. package/dist/runtime/components/Checkbox.d.vue.ts +74 -0
  34. package/dist/runtime/components/Checkbox.vue.d.ts +2 -1
  35. package/dist/runtime/components/CheckboxGroup.d.vue.ts +85 -0
  36. package/dist/runtime/components/CheckboxGroup.vue.d.ts +7 -6
  37. package/dist/runtime/components/Chip.d.vue.ts +58 -0
  38. package/dist/runtime/components/Chip.vue.d.ts +2 -1
  39. package/dist/runtime/components/Collapsible.d.vue.ts +36 -0
  40. package/dist/runtime/components/Collapsible.vue.d.ts +2 -1
  41. package/dist/runtime/components/ColorPicker.d.vue.ts +49 -0
  42. package/dist/runtime/components/ColorPicker.vue.d.ts +2 -1
  43. package/dist/runtime/components/CommandPalette.d.vue.ts +193 -0
  44. package/dist/runtime/components/CommandPalette.vue.d.ts +13 -12
  45. package/dist/runtime/components/Container.d.vue.ts +19 -0
  46. package/dist/runtime/components/Container.vue.d.ts +2 -1
  47. package/dist/runtime/components/ContextMenu.d.vue.ts +110 -0
  48. package/dist/runtime/components/ContextMenu.vue.d.ts +6 -5
  49. package/dist/runtime/components/ContextMenuContent.d.vue.ts +50 -0
  50. package/dist/runtime/components/ContextMenuContent.vue.d.ts +10 -9
  51. package/dist/runtime/components/Drawer.d.vue.ts +87 -0
  52. package/dist/runtime/components/Drawer.vue +19 -5
  53. package/dist/runtime/components/Drawer.vue.d.ts +5 -1
  54. package/dist/runtime/components/DropdownMenu.d.vue.ts +120 -0
  55. package/dist/runtime/components/DropdownMenu.vue.d.ts +6 -5
  56. package/dist/runtime/components/DropdownMenuContent.d.vue.ts +56 -0
  57. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +10 -9
  58. package/dist/runtime/components/FileUpload.d.vue.ts +167 -0
  59. package/dist/runtime/components/FileUpload.vue.d.ts +9 -8
  60. package/dist/runtime/components/Form.d.vue.ts +72 -0
  61. package/dist/runtime/components/Form.vue.d.ts +7 -6
  62. package/dist/runtime/components/FormField.d.vue.ts +62 -0
  63. package/dist/runtime/components/FormField.vue.d.ts +2 -1
  64. package/dist/runtime/components/Icon.d.vue.ts +9 -0
  65. package/dist/runtime/components/Icon.vue.d.ts +2 -1
  66. package/dist/runtime/components/Input.d.vue.ts +78 -0
  67. package/dist/runtime/components/Input.vue.d.ts +9 -8
  68. package/dist/runtime/components/InputMenu.d.vue.ts +330 -0
  69. package/dist/runtime/components/InputMenu.vue +1 -1
  70. package/dist/runtime/components/InputMenu.vue.d.ts +19 -24
  71. package/dist/runtime/components/InputNumber.d.vue.ts +187 -0
  72. package/dist/runtime/components/InputNumber.vue.d.ts +2 -1
  73. package/dist/runtime/components/InputTags.d.vue.ts +186 -0
  74. package/dist/runtime/components/InputTags.vue +2 -2
  75. package/dist/runtime/components/InputTags.vue.d.ts +13 -12
  76. package/dist/runtime/components/Kbd.d.vue.ts +39 -0
  77. package/dist/runtime/components/Kbd.vue.d.ts +2 -1
  78. package/dist/runtime/components/Link.d.vue.ts +92 -0
  79. package/dist/runtime/components/Link.vue.d.ts +2 -1
  80. package/dist/runtime/components/LinkBase.d.vue.ts +26 -0
  81. package/dist/runtime/components/LinkBase.vue.d.ts +2 -1
  82. package/dist/runtime/components/Modal.d.vue.ts +107 -0
  83. package/dist/runtime/components/Modal.vue.d.ts +4 -3
  84. package/dist/runtime/components/NavigationMenu.d.vue.ts +171 -0
  85. package/dist/runtime/components/NavigationMenu.vue.d.ts +6 -5
  86. package/dist/runtime/components/OverlayProvider.d.vue.ts +3 -0
  87. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -1
  88. package/dist/runtime/components/Pagination.d.vue.ts +119 -0
  89. package/dist/runtime/components/Pagination.vue +4 -4
  90. package/dist/runtime/components/Pagination.vue.d.ts +2 -1
  91. package/dist/runtime/components/PinInput.d.vue.ts +61 -0
  92. package/dist/runtime/components/PinInput.vue.d.ts +10 -9
  93. package/dist/runtime/components/Popover.d.vue.ts +71 -0
  94. package/dist/runtime/components/Popover.vue.d.ts +2 -1
  95. package/dist/runtime/components/Progress.d.vue.ts +67 -0
  96. package/dist/runtime/components/Progress.vue +2 -3
  97. package/dist/runtime/components/Progress.vue.d.ts +2 -1
  98. package/dist/runtime/components/RadioGroup.d.vue.ts +95 -0
  99. package/dist/runtime/components/RadioGroup.vue.d.ts +7 -6
  100. package/dist/runtime/components/Select.d.vue.ts +254 -0
  101. package/dist/runtime/components/Select.vue.d.ts +11 -10
  102. package/dist/runtime/components/SelectMenu.d.vue.ts +303 -0
  103. package/dist/runtime/components/SelectMenu.vue.d.ts +16 -15
  104. package/dist/runtime/components/Separator.d.vue.ts +55 -0
  105. package/dist/runtime/components/Separator.vue.d.ts +2 -1
  106. package/dist/runtime/components/Skeleton.d.vue.ts +18 -0
  107. package/dist/runtime/components/Skeleton.vue.d.ts +2 -1
  108. package/dist/runtime/components/Slideover.d.vue.ts +108 -0
  109. package/dist/runtime/components/Slideover.vue.d.ts +4 -3
  110. package/dist/runtime/components/Slider.d.vue.ts +58 -0
  111. package/dist/runtime/components/Slider.vue.d.ts +8 -7
  112. package/dist/runtime/components/Stepper.d.vue.ts +86 -0
  113. package/dist/runtime/components/Stepper.vue.d.ts +10 -9
  114. package/dist/runtime/components/Switch.d.vue.ts +71 -0
  115. package/dist/runtime/components/Switch.vue.d.ts +2 -1
  116. package/dist/runtime/components/Table.d.vue.ts +202 -0
  117. package/dist/runtime/components/Table.vue +19 -1
  118. package/dist/runtime/components/Table.vue.d.ts +20 -19
  119. package/dist/runtime/components/Tabs.d.vue.ts +99 -0
  120. package/dist/runtime/components/Tabs.vue +2 -2
  121. package/dist/runtime/components/Tabs.vue.d.ts +7 -6
  122. package/dist/runtime/components/Textarea.d.vue.ts +80 -0
  123. package/dist/runtime/components/Textarea.vue.d.ts +9 -8
  124. package/dist/runtime/components/Timeline.d.vue.ts +71 -0
  125. package/dist/runtime/components/Timeline.vue.d.ts +7 -6
  126. package/dist/runtime/components/Toast.d.vue.ts +165 -0
  127. package/dist/runtime/components/Toast.vue.d.ts +2 -1
  128. package/dist/runtime/components/Toaster.d.vue.ts +45 -0
  129. package/dist/runtime/components/Toaster.vue.d.ts +2 -1
  130. package/dist/runtime/components/Tooltip.d.vue.ts +57 -0
  131. package/dist/runtime/components/Tooltip.vue.d.ts +2 -1
  132. package/dist/runtime/components/Tree.d.vue.ts +115 -0
  133. package/dist/runtime/components/Tree.vue.d.ts +7 -6
  134. package/dist/runtime/composables/useKbd.js +1 -1
  135. package/dist/runtime/composables/usePortal.d.ts +3 -3
  136. package/dist/runtime/composables/usePortal.js +5 -10
  137. package/dist/runtime/inertia/components/Link.d.vue.ts +64 -0
  138. package/dist/runtime/inertia/components/Link.vue.d.ts +2 -1
  139. package/dist/runtime/inertia/components/LinkBase.d.vue.ts +26 -0
  140. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +2 -1
  141. package/dist/runtime/types/tv.d.ts +9 -2
  142. package/dist/runtime/vue/components/Icon.d.vue.ts +6 -0
  143. package/dist/runtime/vue/components/Icon.vue.d.ts +2 -1
  144. package/dist/runtime/vue/components/Link.d.vue.ts +94 -0
  145. package/dist/runtime/vue/components/Link.vue.d.ts +2 -1
  146. package/dist/shared/{ui.BTUFJHYJ.mjs → ui.DBpKc5X3.mjs} +100 -68
  147. package/dist/unplugin.mjs +1 -1
  148. package/dist/vite.mjs +1 -1
  149. package/package.json +18 -18
@@ -0,0 +1,167 @@
1
+ import type { AppConfig } from '@nuxt/schema';
2
+ import type { UseFileDialogReturn } from '@vueuse/core';
3
+ import theme from '#build/ui/file-upload';
4
+ import type { ButtonProps } from '../types';
5
+ import type { ComponentConfig } from '../types/utils';
6
+ type FileUpload = ComponentConfig<typeof theme, AppConfig, 'fileUpload'>;
7
+ export interface FileUploadProps<M extends boolean = false> {
8
+ /**
9
+ * The element or component this component should render as.
10
+ * @defaultValue 'div'
11
+ */
12
+ as?: any;
13
+ id?: string;
14
+ name?: string;
15
+ /**
16
+ * The icon to display.
17
+ * @defaultValue appConfig.ui.icons.upload
18
+ * @IconifyIcon
19
+ */
20
+ icon?: string;
21
+ label?: string;
22
+ description?: string;
23
+ /**
24
+ * @defaultValue 'primary'
25
+ */
26
+ color?: FileUpload['variants']['color'];
27
+ /**
28
+ * The `button` variant is only available when `multiple` is `false`.
29
+ * @defaultValue 'area'
30
+ */
31
+ variant?: FileUpload['variants']['variant'];
32
+ /**
33
+ * @defaultValue 'md'
34
+ */
35
+ size?: FileUpload['variants']['size'];
36
+ /**
37
+ * The layout of how files are displayed.
38
+ * Only works when `variant` is `area`.
39
+ * @defaultValue 'list'
40
+ */
41
+ layout?: FileUpload['variants']['layout'];
42
+ /**
43
+ * The position of the files.
44
+ * Only works when `variant` is `area` and when `layout` is `list`.
45
+ * @defaultValue 'outside'
46
+ */
47
+ position?: FileUpload['variants']['position'];
48
+ /** Highlight the ring color like a focus state. */
49
+ highlight?: boolean;
50
+ /**
51
+ * Specifies the allowed file types for the input. Provide a comma-separated list of MIME types or file extensions (e.g., "image/png,application/pdf,.jpg").
52
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/accept
53
+ * @defaultValue '*'
54
+ */
55
+ accept?: string;
56
+ multiple?: M & boolean;
57
+ /**
58
+ * Reset the file input when the dialog is opened.
59
+ * @defaultValue false
60
+ */
61
+ reset?: boolean;
62
+ /**
63
+ * Create a zone that allows the user to drop files onto it.
64
+ * @defaultValue true
65
+ */
66
+ dropzone?: boolean;
67
+ /**
68
+ * Make the dropzone interactive when the user is clicking on it.
69
+ * @defaultValue true
70
+ */
71
+ interactive?: boolean;
72
+ required?: boolean;
73
+ disabled?: boolean;
74
+ /**
75
+ * The icon to display for the file.
76
+ * @defaultValue appConfig.ui.icons.file
77
+ * @IconifyIcon
78
+ */
79
+ fileIcon?: string;
80
+ /**
81
+ * Configure the delete button for the file.
82
+ * When `layout` is `grid`, the default is `{ color: 'neutral', variant: 'solid', size: 'xs' }`{lang="ts-type"}
83
+ * When `layout` is `list`, the default is `{ color: 'neutral', variant: 'link' }`{lang="ts-type"}
84
+ */
85
+ fileDelete?: boolean | Partial<ButtonProps>;
86
+ /**
87
+ * The icon displayed to delete a file.
88
+ * @defaultValue appConfig.ui.icons.close
89
+ * @IconifyIcon
90
+ */
91
+ fileDeleteIcon?: string;
92
+ class?: any;
93
+ ui?: FileUpload['slots'];
94
+ }
95
+ export interface FileUploadEmits {
96
+ change: [event: Event];
97
+ }
98
+ type FileUploadFiles<M> = (M extends true ? File[] : File) | null;
99
+ export interface FileUploadSlots<M extends boolean = false> {
100
+ 'default'(props: {
101
+ open: UseFileDialogReturn['open'];
102
+ removeFile: (index?: number) => void;
103
+ }): any;
104
+ 'leading'(props?: {}): any;
105
+ 'label'(props?: {}): any;
106
+ 'description'(props?: {}): any;
107
+ 'actions'(props: {
108
+ files?: FileUploadFiles<M>;
109
+ open: UseFileDialogReturn['open'];
110
+ removeFile: (index?: number) => void;
111
+ }): any;
112
+ 'files'(props: {
113
+ files?: FileUploadFiles<M>;
114
+ }): any;
115
+ 'files-top'(props: {
116
+ files?: FileUploadFiles<M>;
117
+ open: UseFileDialogReturn['open'];
118
+ removeFile: (index?: number) => void;
119
+ }): any;
120
+ 'files-bottom'(props: {
121
+ files?: FileUploadFiles<M>;
122
+ open: UseFileDialogReturn['open'];
123
+ removeFile: (index?: number) => void;
124
+ }): any;
125
+ 'file'(props: {
126
+ file: File;
127
+ index: number;
128
+ }): any;
129
+ 'file-leading'(props: {
130
+ file: File;
131
+ index: number;
132
+ }): any;
133
+ 'file-name'(props: {
134
+ file: File;
135
+ index: number;
136
+ }): any;
137
+ 'file-size'(props: {
138
+ file: File;
139
+ index: number;
140
+ }): any;
141
+ 'file-trailing'(props: {
142
+ file: File;
143
+ index: number;
144
+ }): any;
145
+ }
146
+ declare const __VLS_export: <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<{
147
+ props: __VLS_PrettifyLocal<(FileUploadProps<M> & {
148
+ modelValue?: (M extends true ? File[] : File) | null;
149
+ }) & {
150
+ onChange?: ((event: Event) => any) | undefined;
151
+ "onUpdate:modelValue"?: ((value: (M extends true ? File[] : File) | null | undefined) => any) | undefined;
152
+ }> & import("vue").PublicProps;
153
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
154
+ inputRef: import("vue").Ref<HTMLInputElement | undefined, HTMLInputElement | undefined>;
155
+ dropzoneRef: import("vue").Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
156
+ }>) => void;
157
+ attrs: any;
158
+ slots: FileUploadSlots<M>;
159
+ emit: ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: (M extends true ? File[] : File) | null | undefined) => void);
160
+ }>) => import("vue").VNode & {
161
+ __ctx?: Awaited<typeof __VLS_setup>;
162
+ };
163
+ declare const _default: typeof __VLS_export;
164
+ export default _default;
165
+ type __VLS_PrettifyLocal<T> = {
166
+ [K in keyof T as K]: T[K];
167
+ } & {};
@@ -143,23 +143,24 @@ export interface FileUploadSlots<M extends boolean = false> {
143
143
  index: number;
144
144
  }): any;
145
145
  }
146
- declare const _default: <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<{
147
- props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
148
- readonly onChange?: ((event: Event) => any) | undefined;
149
- readonly "onUpdate:modelValue"?: ((value: (M extends true ? File[] : File) | null | undefined) => any) | undefined;
150
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue"> & (FileUploadProps<M> & {
146
+ declare const __VLS_export: <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<{
147
+ props: __VLS_PrettifyLocal<(FileUploadProps<M> & {
151
148
  modelValue?: (M extends true ? File[] : File) | null;
152
- }) & {}> & import("vue").PublicProps;
153
- expose(exposed: import("vue").ShallowUnwrapRef<{
149
+ }) & {
150
+ onChange?: ((event: Event) => any) | undefined;
151
+ "onUpdate:modelValue"?: ((value: (M extends true ? File[] : File) | null | undefined) => any) | undefined;
152
+ }> & import("vue").PublicProps;
153
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
154
154
  inputRef: import("vue").Ref<HTMLInputElement | undefined, HTMLInputElement | undefined>;
155
155
  dropzoneRef: import("vue").Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
156
- }>): void;
156
+ }>) => void;
157
157
  attrs: any;
158
158
  slots: FileUploadSlots<M>;
159
159
  emit: ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: (M extends true ? File[] : File) | null | undefined) => void);
160
160
  }>) => import("vue").VNode & {
161
161
  __ctx?: Awaited<typeof __VLS_setup>;
162
162
  };
163
+ declare const _default: typeof __VLS_export;
163
164
  export default _default;
164
165
  type __VLS_PrettifyLocal<T> = {
165
166
  [K in keyof T as K]: T[K];
@@ -0,0 +1,72 @@
1
+ import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, Form, InferInput, FormData } from '../types/form';
2
+ export interface FormProps<S extends FormSchema, T extends boolean = true> {
3
+ id?: string | number;
4
+ /** Schema to validate the form state. Supports Standard Schema objects, Yup, Joi, and Superstructs. */
5
+ schema?: S;
6
+ /** An object representing the current state of the form. */
7
+ state: Partial<InferInput<S>>;
8
+ /**
9
+ * Custom validation function to validate the form state.
10
+ * @param state - The current state of the form.
11
+ * @returns A promise that resolves to an array of FormError objects, or an array of FormError objects directly.
12
+ */
13
+ validate?: (state: Partial<InferInput<S>>) => Promise<FormError[]> | FormError[];
14
+ /**
15
+ * The list of input events that trigger the form validation.
16
+ * @remarks The form always validates on submit.
17
+ * @defaultValue `['blur', 'change', 'input']`
18
+ */
19
+ validateOn?: FormInputEvents[];
20
+ /** Disable all inputs inside the form. */
21
+ disabled?: boolean;
22
+ /**
23
+ * Delay in milliseconds before validating the form on input events.
24
+ * @defaultValue `300`
25
+ */
26
+ validateOnInputDelay?: number;
27
+ /**
28
+ * If true, schema transformations will be applied to the state on submit.
29
+ * @defaultValue `true`
30
+ */
31
+ transform?: T;
32
+ /**
33
+ * If true, this form will attach to its parent Form (if any) and validate at the same time.
34
+ * @defaultValue `true`
35
+ */
36
+ attach?: boolean;
37
+ /**
38
+ * When `true`, all form elements will be disabled on `@submit` event.
39
+ * This will cause any focused input elements to lose their focus state.
40
+ * @defaultValue `true`
41
+ */
42
+ loadingAuto?: boolean;
43
+ class?: any;
44
+ onSubmit?: ((event: FormSubmitEvent<FormData<S, T>>) => void | Promise<void>) | (() => void | Promise<void>);
45
+ }
46
+ export interface FormEmits<S extends FormSchema, T extends boolean = true> {
47
+ submit: [event: FormSubmitEvent<FormData<S, T>>];
48
+ error: [event: FormErrorEvent];
49
+ }
50
+ export interface FormSlots {
51
+ default(props: {
52
+ errors: FormError[];
53
+ loading: boolean;
54
+ }): any;
55
+ }
56
+ declare const __VLS_export: <S extends FormSchema, T extends boolean = true>(__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<{
57
+ props: __VLS_PrettifyLocal<FormProps<S, T> & {
58
+ onError?: ((event: FormErrorEvent) => any) | undefined;
59
+ onSubmit?: ((event: FormSubmitEvent<FormData<S, T>>) => any) | undefined;
60
+ }> & import("vue").PublicProps;
61
+ expose: (exposed: import("vue").ShallowUnwrapRef<Form<S>>) => void;
62
+ attrs: any;
63
+ slots: FormSlots;
64
+ emit: ((evt: "error", event: FormErrorEvent) => void) & ((evt: "submit", event: FormSubmitEvent<FormData<S, T>>) => void);
65
+ }>) => import("vue").VNode & {
66
+ __ctx?: Awaited<typeof __VLS_setup>;
67
+ };
68
+ declare const _default: typeof __VLS_export;
69
+ export default _default;
70
+ type __VLS_PrettifyLocal<T> = {
71
+ [K in keyof T as K]: T[K];
72
+ } & {};
@@ -53,18 +53,19 @@ export interface FormSlots {
53
53
  loading: boolean;
54
54
  }): any;
55
55
  }
56
- declare const _default: <S extends FormSchema, T extends boolean = true>(__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<{
57
- props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
58
- readonly onError?: ((event: FormErrorEvent) => any) | undefined;
59
- readonly onSubmit?: ((event: FormSubmitEvent<FormData<S, T>>) => any) | undefined;
60
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onSubmit" | "onError"> & FormProps<S, T> & {}> & import("vue").PublicProps;
61
- expose(exposed: import("vue").ShallowUnwrapRef<Form<S>>): void;
56
+ declare const __VLS_export: <S extends FormSchema, T extends boolean = true>(__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<{
57
+ props: __VLS_PrettifyLocal<FormProps<S, T> & {
58
+ onError?: ((event: FormErrorEvent) => any) | undefined;
59
+ onSubmit?: ((event: FormSubmitEvent<FormData<S, T>>) => any) | undefined;
60
+ }> & import("vue").PublicProps;
61
+ expose: (exposed: import("vue").ShallowUnwrapRef<Form<S>>) => void;
62
62
  attrs: any;
63
63
  slots: FormSlots;
64
64
  emit: ((evt: "error", event: FormErrorEvent) => void) & ((evt: "submit", event: FormSubmitEvent<FormData<S, T>>) => void);
65
65
  }>) => import("vue").VNode & {
66
66
  __ctx?: Awaited<typeof __VLS_setup>;
67
67
  };
68
+ declare const _default: typeof __VLS_export;
68
69
  export default _default;
69
70
  type __VLS_PrettifyLocal<T> = {
70
71
  [K in keyof T as K]: T[K];
@@ -0,0 +1,62 @@
1
+ import type { AppConfig } from '@nuxt/schema';
2
+ import theme from '#build/ui/form-field';
3
+ import type { ComponentConfig } from '../types/utils';
4
+ type FormField = ComponentConfig<typeof theme, AppConfig, 'formField'>;
5
+ export interface FormFieldProps {
6
+ /**
7
+ * The element or component this component should render as.
8
+ * @defaultValue 'div'
9
+ */
10
+ as?: any;
11
+ /** The name of the FormField. Also used to match form errors. */
12
+ name?: string;
13
+ /** A regular expression to match form error names. */
14
+ errorPattern?: RegExp;
15
+ label?: string;
16
+ description?: string;
17
+ help?: string;
18
+ error?: boolean | string;
19
+ hint?: string;
20
+ /**
21
+ * @defaultValue 'md'
22
+ */
23
+ size?: FormField['variants']['size'];
24
+ required?: boolean;
25
+ /** If true, validation on input will be active immediately instead of waiting for a blur event. */
26
+ eagerValidation?: boolean;
27
+ /**
28
+ * Delay in milliseconds before validating the form on input events.
29
+ * @defaultValue `300`
30
+ */
31
+ validateOnInputDelay?: number;
32
+ class?: any;
33
+ ui?: FormField['slots'];
34
+ }
35
+ export interface FormFieldSlots {
36
+ label(props: {
37
+ label?: string;
38
+ }): any;
39
+ hint(props: {
40
+ hint?: string;
41
+ }): any;
42
+ description(props: {
43
+ description?: string;
44
+ }): any;
45
+ help(props: {
46
+ help?: string;
47
+ }): any;
48
+ error(props: {
49
+ error?: boolean | string;
50
+ }): any;
51
+ default(props: {
52
+ error?: boolean | string;
53
+ }): any;
54
+ }
55
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<FormFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, FormFieldSlots>;
56
+ declare const _default: typeof __VLS_export;
57
+ export default _default;
58
+ type __VLS_WithSlots<T, S> = T & {
59
+ new (): {
60
+ $slots: S;
61
+ };
62
+ };
@@ -52,7 +52,8 @@ export interface FormFieldSlots {
52
52
  error?: boolean | string;
53
53
  }): any;
54
54
  }
55
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<FormFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, FormFieldSlots>;
55
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<FormFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, FormFieldSlots>;
56
+ declare const _default: typeof __VLS_export;
56
57
  export default _default;
57
58
  type __VLS_WithSlots<T, S> = T & {
58
59
  new (): {
@@ -0,0 +1,9 @@
1
+ export interface IconProps {
2
+ name: string;
3
+ mode?: 'svg' | 'css';
4
+ size?: string | number;
5
+ customize?: (content: string, name?: string, prefix?: string, provider?: string) => string;
6
+ }
7
+ declare const __VLS_export: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
@@ -4,5 +4,6 @@ export interface IconProps {
4
4
  size?: string | number;
5
5
  customize?: (content: string, name?: string, prefix?: string, provider?: string) => string;
6
6
  }
7
- declare const _default: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const __VLS_export: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ declare const _default: typeof __VLS_export;
8
9
  export default _default;
@@ -0,0 +1,78 @@
1
+ import type { InputHTMLAttributes } from 'vue';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import theme from '#build/ui/input';
4
+ import type { UseComponentIconsProps } from '../composables/useComponentIcons';
5
+ import type { AcceptableValue, ComponentConfig } from '../types/utils';
6
+ type Input = ComponentConfig<typeof theme, AppConfig, 'input'>;
7
+ export interface InputProps<T extends AcceptableValue = AcceptableValue> extends UseComponentIconsProps {
8
+ /**
9
+ * The element or component this component should render as.
10
+ * @defaultValue 'div'
11
+ */
12
+ as?: any;
13
+ id?: string;
14
+ name?: string;
15
+ type?: InputHTMLAttributes['type'];
16
+ /** The placeholder text when the input is empty. */
17
+ placeholder?: string;
18
+ /**
19
+ * @defaultValue 'primary'
20
+ */
21
+ color?: Input['variants']['color'];
22
+ /**
23
+ * @defaultValue 'outline'
24
+ */
25
+ variant?: Input['variants']['variant'];
26
+ /**
27
+ * @defaultValue 'md'
28
+ */
29
+ size?: Input['variants']['size'];
30
+ required?: boolean;
31
+ autocomplete?: InputHTMLAttributes['autocomplete'];
32
+ autofocus?: boolean;
33
+ autofocusDelay?: number;
34
+ disabled?: boolean;
35
+ /** Highlight the ring color like a focus state. */
36
+ highlight?: boolean;
37
+ modelValue?: T;
38
+ defaultValue?: T;
39
+ modelModifiers?: {
40
+ string?: boolean;
41
+ number?: boolean;
42
+ trim?: boolean;
43
+ lazy?: boolean;
44
+ nullify?: boolean;
45
+ };
46
+ class?: any;
47
+ ui?: Input['slots'];
48
+ }
49
+ export interface InputEmits<T extends AcceptableValue = AcceptableValue> {
50
+ 'update:modelValue': [value: T];
51
+ 'blur': [event: FocusEvent];
52
+ 'change': [event: Event];
53
+ }
54
+ export interface InputSlots {
55
+ leading(props?: {}): any;
56
+ default(props?: {}): any;
57
+ trailing(props?: {}): any;
58
+ }
59
+ declare const __VLS_export: <T extends AcceptableValue>(__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<{
60
+ props: __VLS_PrettifyLocal<InputProps<T> & {
61
+ onBlur?: ((event: FocusEvent) => any) | undefined;
62
+ onChange?: ((event: Event) => any) | undefined;
63
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
64
+ }> & import("vue").PublicProps;
65
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
66
+ inputRef: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
67
+ }>) => void;
68
+ attrs: any;
69
+ slots: InputSlots;
70
+ emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: T) => void);
71
+ }>) => import("vue").VNode & {
72
+ __ctx?: Awaited<typeof __VLS_setup>;
73
+ };
74
+ declare const _default: typeof __VLS_export;
75
+ export default _default;
76
+ type __VLS_PrettifyLocal<T> = {
77
+ [K in keyof T as K]: T[K];
78
+ } & {};
@@ -56,21 +56,22 @@ export interface InputSlots {
56
56
  default(props?: {}): any;
57
57
  trailing(props?: {}): any;
58
58
  }
59
- declare const _default: <T extends AcceptableValue>(__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<{
60
- props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
61
- readonly onBlur?: ((event: FocusEvent) => any) | undefined;
62
- readonly onChange?: ((event: Event) => any) | undefined;
63
- readonly "onUpdate:modelValue"?: ((value: T) => any) | undefined;
64
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue"> & InputProps<T> & {}> & import("vue").PublicProps;
65
- expose(exposed: import("vue").ShallowUnwrapRef<{
59
+ declare const __VLS_export: <T extends AcceptableValue>(__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<{
60
+ props: __VLS_PrettifyLocal<InputProps<T> & {
61
+ onBlur?: ((event: FocusEvent) => any) | undefined;
62
+ onChange?: ((event: Event) => any) | undefined;
63
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
64
+ }> & import("vue").PublicProps;
65
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
66
66
  inputRef: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
67
- }>): void;
67
+ }>) => void;
68
68
  attrs: any;
69
69
  slots: InputSlots;
70
70
  emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: T) => void);
71
71
  }>) => import("vue").VNode & {
72
72
  __ctx?: Awaited<typeof __VLS_setup>;
73
73
  };
74
+ declare const _default: typeof __VLS_export;
74
75
  export default _default;
75
76
  type __VLS_PrettifyLocal<T> = {
76
77
  [K in keyof T as K]: T[K];