@nuxt/ui 3.3.1 → 3.3.3

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 (83) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/Accordion.vue.d.ts +1 -1
  4. package/dist/runtime/components/Alert.vue.d.ts +1 -1
  5. package/dist/runtime/components/App.vue +1 -1
  6. package/dist/runtime/components/App.vue.d.ts +1 -1
  7. package/dist/runtime/components/Avatar.vue.d.ts +1 -1
  8. package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
  9. package/dist/runtime/components/Badge.vue.d.ts +1 -1
  10. package/dist/runtime/components/Breadcrumb.vue.d.ts +1 -1
  11. package/dist/runtime/components/Button.vue.d.ts +1 -1
  12. package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
  13. package/dist/runtime/components/Calendar.vue +1 -1
  14. package/dist/runtime/components/Calendar.vue.d.ts +3 -2
  15. package/dist/runtime/components/Card.vue.d.ts +1 -1
  16. package/dist/runtime/components/Carousel.vue +1 -1
  17. package/dist/runtime/components/Carousel.vue.d.ts +1 -1
  18. package/dist/runtime/components/Checkbox.vue.d.ts +4 -4
  19. package/dist/runtime/components/CheckboxGroup.vue.d.ts +4 -4
  20. package/dist/runtime/components/Chip.vue.d.ts +2 -2
  21. package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
  22. package/dist/runtime/components/ColorPicker.vue.d.ts +1 -1
  23. package/dist/runtime/components/CommandPalette.vue.d.ts +1 -1
  24. package/dist/runtime/components/Container.vue.d.ts +1 -1
  25. package/dist/runtime/components/ContextMenu.vue +1 -0
  26. package/dist/runtime/components/ContextMenu.vue.d.ts +1 -1
  27. package/dist/runtime/components/ContextMenuContent.vue.d.ts +1 -1
  28. package/dist/runtime/components/Drawer.vue.d.ts +1 -1
  29. package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -1
  30. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +1 -1
  31. package/dist/runtime/components/FileUpload.vue +1 -1
  32. package/dist/runtime/components/FileUpload.vue.d.ts +5 -6
  33. package/dist/runtime/components/Form.vue +2 -2
  34. package/dist/runtime/components/Form.vue.d.ts +7 -7
  35. package/dist/runtime/components/FormField.vue +2 -2
  36. package/dist/runtime/components/FormField.vue.d.ts +1 -1
  37. package/dist/runtime/components/Icon.vue.d.ts +1 -1
  38. package/dist/runtime/components/Input.vue.d.ts +4 -4
  39. package/dist/runtime/components/InputMenu.vue +1 -1
  40. package/dist/runtime/components/InputMenu.vue.d.ts +9 -9
  41. package/dist/runtime/components/InputNumber.vue.d.ts +6 -6
  42. package/dist/runtime/components/InputTags.vue.d.ts +1 -1
  43. package/dist/runtime/components/Kbd.vue.d.ts +1 -1
  44. package/dist/runtime/components/Link.vue.d.ts +1 -1
  45. package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
  46. package/dist/runtime/components/Modal.vue.d.ts +1 -1
  47. package/dist/runtime/components/NavigationMenu.vue.d.ts +1 -1
  48. package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
  49. package/dist/runtime/components/Pagination.vue.d.ts +1 -1
  50. package/dist/runtime/components/PinInput.vue.d.ts +6 -6
  51. package/dist/runtime/components/Popover.vue.d.ts +1 -1
  52. package/dist/runtime/components/Progress.vue.d.ts +1 -1
  53. package/dist/runtime/components/RadioGroup.vue.d.ts +4 -4
  54. package/dist/runtime/components/Select.vue.d.ts +9 -9
  55. package/dist/runtime/components/SelectMenu.vue.d.ts +9 -9
  56. package/dist/runtime/components/Separator.vue.d.ts +1 -1
  57. package/dist/runtime/components/Skeleton.vue.d.ts +1 -1
  58. package/dist/runtime/components/Slideover.vue.d.ts +1 -1
  59. package/dist/runtime/components/Slider.vue +1 -1
  60. package/dist/runtime/components/Slider.vue.d.ts +6 -7
  61. package/dist/runtime/components/Stepper.vue.d.ts +6 -6
  62. package/dist/runtime/components/Switch.vue.d.ts +4 -4
  63. package/dist/runtime/components/Table.vue +2 -2
  64. package/dist/runtime/components/Table.vue.d.ts +1 -1
  65. package/dist/runtime/components/Tabs.vue.d.ts +1 -1
  66. package/dist/runtime/components/Textarea.vue.d.ts +4 -4
  67. package/dist/runtime/components/Timeline.vue.d.ts +1 -1
  68. package/dist/runtime/components/Toaster.vue.d.ts +1 -1
  69. package/dist/runtime/components/Tooltip.vue.d.ts +1 -1
  70. package/dist/runtime/components/Tree.vue.d.ts +3 -3
  71. package/dist/runtime/composables/useFormField.d.ts +2 -1
  72. package/dist/runtime/composables/useFormField.js +1 -0
  73. package/dist/runtime/inertia/components/Link.vue +3 -0
  74. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  75. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
  76. package/dist/runtime/types/form.d.ts +3 -3
  77. package/dist/runtime/types/utils.d.ts +1 -1
  78. package/dist/runtime/utils/index.d.ts +2 -1
  79. package/dist/runtime/utils/index.js +30 -1
  80. package/dist/runtime/utils/tv.d.ts +1 -1
  81. package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
  82. package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
  83. package/package.json +20 -22
@@ -11,10 +11,10 @@ export interface Form<S extends FormSchema> {
11
11
  nested?: boolean;
12
12
  transform?: T;
13
13
  }): Promise<FormData<S, T> | false>;
14
- clear(path?: string): void;
14
+ clear(path?: keyof FormData<S, false> | RegExp): void;
15
15
  errors: Ref<FormError[]>;
16
- setErrors(errs: FormError[], name?: keyof FormData<S, false>): void;
17
- getErrors(name?: keyof FormData<S, false>): FormError[];
16
+ setErrors(errs: FormError[], name?: keyof FormData<S, false> | RegExp): void;
17
+ getErrors(name?: keyof FormData<S, false> | RegExp): FormError[];
18
18
  submit(): Promise<void>;
19
19
  disabled: ComputedRef<boolean>;
20
20
  dirty: ComputedRef<boolean>;
@@ -32,7 +32,7 @@ export type GetItemValue<I, VK extends GetItemKeys<I> | undefined, T extends Nes
32
32
  export type GetModelValue<T, VK extends GetItemKeys<T> | undefined, M extends boolean> = M extends true ? GetItemValue<T, VK>[] : GetItemValue<T, VK>;
33
33
  export type GetModelValueEmits<T, VK extends GetItemKeys<T> | undefined, M extends boolean> = {
34
34
  /** Event handler called when the value changes. */
35
- 'update:modelValue': [payload: GetModelValue<T, VK, M>];
35
+ 'update:modelValue': [value: GetModelValue<T, VK, M>];
36
36
  };
37
37
  export type StringOrVNode = string | VNode | (() => VNode);
38
38
  export type EmitsToProps<T> = {
@@ -1,10 +1,11 @@
1
- import type { GetItemKeys, NestedItem } from '../types';
1
+ import type { GetItemKeys, NestedItem } from '../types/utils';
2
2
  export declare function pick<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Pick<Data, Keys>;
3
3
  export declare function omit<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Omit<Data, Keys>;
4
4
  export declare function get(object: Record<string, any> | undefined, path: (string | number)[] | string, defaultValue?: any): any;
5
5
  export declare function set(object: Record<string, any>, path: (string | number)[] | string, value: any): void;
6
6
  export declare function looseToNumber(val: any): any;
7
7
  export declare function compare<T>(value?: T, currentValue?: T, comparator?: string | ((a: T, b: T) => boolean)): boolean;
8
+ export declare function isEmpty(value: unknown): boolean;
8
9
  export declare function getDisplayValue<T, V>(items: T[], value: V | undefined | null, options?: {
9
10
  valueKey?: GetItemKeys<T>;
10
11
  labelKey?: keyof NestedItem<T>;
@@ -61,9 +61,38 @@ export function compare(value, currentValue, comparator) {
61
61
  }
62
62
  return isEqual(value, currentValue);
63
63
  }
64
+ export function isEmpty(value) {
65
+ if (value == null) {
66
+ return true;
67
+ }
68
+ if (typeof value === "boolean" || typeof value === "number") {
69
+ return false;
70
+ }
71
+ if (typeof value === "string") {
72
+ return value.trim().length === 0;
73
+ }
74
+ if (Array.isArray(value)) {
75
+ return value.length === 0;
76
+ }
77
+ if (value instanceof Map || value instanceof Set) {
78
+ return value.size === 0;
79
+ }
80
+ if (value instanceof Date || value instanceof RegExp || typeof value === "function") {
81
+ return false;
82
+ }
83
+ if (typeof value === "object") {
84
+ for (const _ in value) {
85
+ if (Object.prototype.hasOwnProperty.call(value, _)) {
86
+ return false;
87
+ }
88
+ }
89
+ return true;
90
+ }
91
+ return false;
92
+ }
64
93
  export function getDisplayValue(items, value, options = {}) {
65
94
  const { valueKey, labelKey } = options;
66
- if (value === null || value === void 0) {
95
+ if (isEmpty(value)) {
67
96
  return void 0;
68
97
  }
69
98
  const foundItem = items.find((item) => {
@@ -1 +1 @@
1
- export declare const tv: import("tailwind-variants").CreateTV;
1
+ export declare const tv: import("tailwind-variants").TV;
@@ -1,5 +1,5 @@
1
1
  export interface IconProps {
2
2
  name: string;
3
3
  }
4
- declare const _default: import("vue").DefineComponent<IconProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ 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>;
5
5
  export default _default;
@@ -77,7 +77,7 @@ export interface LinkSlots {
77
77
  active: boolean;
78
78
  }): any;
79
79
  }
80
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<LinkProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{}>, {
80
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<LinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{}>, {
81
81
  type: "reset" | "submit" | "button";
82
82
  as: any;
83
83
  activeClass: string;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
3
  "description": "A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.",
4
- "version": "3.3.1",
5
- "packageManager": "pnpm@10.14.0",
4
+ "version": "3.3.3",
5
+ "packageManager": "pnpm@10.15.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/nuxt/ui.git"
@@ -112,20 +112,20 @@
112
112
  },
113
113
  "dependencies": {
114
114
  "@iconify/vue": "^5.0.0",
115
- "@internationalized/date": "^3.8.2",
116
- "@internationalized/number": "^3.6.4",
115
+ "@internationalized/date": "^3.9.0",
116
+ "@internationalized/number": "^3.6.5",
117
117
  "@nuxt/fonts": "^0.11.4",
118
118
  "@nuxt/icon": "^1.15.0",
119
119
  "@nuxt/kit": "^4.0.3",
120
120
  "@nuxt/schema": "^4.0.3",
121
121
  "@nuxtjs/color-mode": "^3.5.2",
122
122
  "@standard-schema/spec": "^1.0.0",
123
- "@tailwindcss/postcss": "^4.1.11",
124
- "@tailwindcss/vite": "^4.1.11",
123
+ "@tailwindcss/postcss": "^4.1.12",
124
+ "@tailwindcss/vite": "^4.1.12",
125
125
  "@tanstack/vue-table": "^8.21.3",
126
126
  "@unhead/vue": "^2.0.14",
127
- "@vueuse/core": "^13.6.0",
128
- "@vueuse/integrations": "^13.6.0",
127
+ "@vueuse/core": "^13.8.0",
128
+ "@vueuse/integrations": "^13.8.0",
129
129
  "colortranslator": "^5.0.0",
130
130
  "consola": "^3.4.2",
131
131
  "defu": "^6.1.4",
@@ -135,40 +135,40 @@
135
135
  "embla-carousel-class-names": "^8.6.0",
136
136
  "embla-carousel-fade": "^8.6.0",
137
137
  "embla-carousel-vue": "^8.6.0",
138
- "embla-carousel-wheel-gestures": "^8.0.2",
138
+ "embla-carousel-wheel-gestures": "^8.1.0",
139
139
  "fuse.js": "^7.1.0",
140
140
  "hookable": "^5.5.3",
141
141
  "knitwork": "^1.2.0",
142
- "magic-string": "^0.30.17",
143
- "mlly": "^1.7.4",
142
+ "magic-string": "^0.30.18",
143
+ "mlly": "^1.8.0",
144
144
  "ohash": "^2.0.11",
145
145
  "pathe": "^2.0.3",
146
- "reka-ui": "2.4.1",
146
+ "reka-ui": "2.5.0",
147
147
  "scule": "^1.3.0",
148
148
  "tailwind-merge": "^3.3.1",
149
- "tailwind-variants": "^2.0.1",
150
- "tailwindcss": "^4.1.11",
149
+ "tailwind-variants": "^3.1.0",
150
+ "tailwindcss": "^4.1.12",
151
151
  "tinyglobby": "^0.2.14",
152
- "unplugin": "^2.3.5",
152
+ "unplugin": "^2.3.10",
153
153
  "unplugin-auto-import": "^19.3.0",
154
154
  "unplugin-vue-components": "^28.8.0",
155
155
  "vaul-vue": "0.4.1",
156
- "vue-component-type-helpers": "^3.0.5"
156
+ "vue-component-type-helpers": "^3.0.6"
157
157
  },
158
158
  "devDependencies": {
159
- "@nuxt/eslint-config": "^1.8.0",
159
+ "@nuxt/eslint-config": "^1.9.0",
160
160
  "@nuxt/module-builder": "^1.0.1",
161
161
  "@nuxt/test-utils": "^3.19.2",
162
162
  "@release-it/conventional-changelog": "^10.0.1",
163
163
  "@vue/test-utils": "^2.4.6",
164
164
  "embla-carousel": "^8.6.0",
165
- "eslint": "^9.33.0",
165
+ "eslint": "^9.34.0",
166
166
  "happy-dom": "^18.0.1",
167
167
  "nuxt": "^4.0.3",
168
168
  "release-it": "^19.0.4",
169
169
  "vitest": "^3.2.4",
170
170
  "vitest-environment-nuxt": "^1.0.1",
171
- "vue-tsc": "^3.0.5"
171
+ "vue-tsc": "^3.0.6"
172
172
  },
173
173
  "peerDependencies": {
174
174
  "@inertiajs/vue3": "^2.0.7",
@@ -208,10 +208,8 @@
208
208
  "@nuxt/module-builder": "1.0.1",
209
209
  "chokidar": "3.6.0",
210
210
  "debug": "4.3.7",
211
- "rollup": "4.34.9",
212
211
  "unimport": "4.1.1",
213
- "unplugin": "^2.3.5",
214
- "tailwind-variants": "2.0.1",
212
+ "unplugin": "^2.3.10",
215
213
  "typescript": "5.8.3"
216
214
  },
217
215
  "pnpm": {