@nuxt/ui 2.8.1 → 2.10.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 (120) hide show
  1. package/README.md +1 -0
  2. package/dist/module.d.mts +1411 -1092
  3. package/dist/module.d.ts +1411 -1092
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +55 -11
  6. package/dist/runtime/components/data/Table.vue +47 -32
  7. package/dist/runtime/components/data/Table.vue.d.ts +22 -14
  8. package/dist/runtime/components/elements/Accordion.vue +33 -28
  9. package/dist/runtime/components/elements/Accordion.vue.d.ts +25 -18
  10. package/dist/runtime/components/elements/Alert.vue +22 -18
  11. package/dist/runtime/components/elements/Alert.vue.d.ts +26 -19
  12. package/dist/runtime/components/elements/Avatar.vue +22 -16
  13. package/dist/runtime/components/elements/Avatar.vue.d.ts +28 -19
  14. package/dist/runtime/components/elements/AvatarGroup.d.ts +17 -8
  15. package/dist/runtime/components/elements/AvatarGroup.mjs +18 -13
  16. package/dist/runtime/components/elements/Badge.vue +21 -17
  17. package/dist/runtime/components/elements/Badge.vue.d.ts +28 -19
  18. package/dist/runtime/components/elements/Button.vue +22 -18
  19. package/dist/runtime/components/elements/Button.vue.d.ts +28 -19
  20. package/dist/runtime/components/elements/ButtonGroup.d.ts +17 -8
  21. package/dist/runtime/components/elements/ButtonGroup.mjs +22 -15
  22. package/dist/runtime/components/elements/Dropdown.vue +45 -37
  23. package/dist/runtime/components/elements/Dropdown.vue.d.ts +22 -17
  24. package/dist/runtime/components/elements/Kbd.vue +16 -12
  25. package/dist/runtime/components/elements/Kbd.vue.d.ts +20 -12
  26. package/dist/runtime/components/elements/Link.vue +18 -5
  27. package/dist/runtime/components/elements/Meter.vue +166 -0
  28. package/dist/runtime/components/elements/Meter.vue.d.ts +123 -0
  29. package/dist/runtime/components/elements/MeterGroup.d.ts +78 -0
  30. package/dist/runtime/components/elements/MeterGroup.mjs +172 -0
  31. package/dist/runtime/components/elements/Progress.vue +284 -0
  32. package/dist/runtime/components/elements/Progress.vue.d.ts +2 -0
  33. package/dist/runtime/components/forms/Checkbox.vue +27 -17
  34. package/dist/runtime/components/forms/Checkbox.vue.d.ts +33 -15
  35. package/dist/runtime/components/forms/Form.vue +34 -9
  36. package/dist/runtime/components/forms/Form.vue.d.ts +2 -1
  37. package/dist/runtime/components/forms/FormGroup.vue +51 -27
  38. package/dist/runtime/components/forms/FormGroup.vue.d.ts +23 -15
  39. package/dist/runtime/components/forms/Input.vue +41 -29
  40. package/dist/runtime/components/forms/Input.vue.d.ts +51 -24
  41. package/dist/runtime/components/forms/Radio.vue +32 -21
  42. package/dist/runtime/components/forms/Radio.vue.d.ts +36 -18
  43. package/dist/runtime/components/forms/RadioGroup.vue +136 -0
  44. package/dist/runtime/components/forms/RadioGroup.vue.d.ts +118 -0
  45. package/dist/runtime/components/forms/Range.vue +26 -16
  46. package/dist/runtime/components/forms/Range.vue.d.ts +37 -18
  47. package/dist/runtime/components/forms/Select.vue +34 -26
  48. package/dist/runtime/components/forms/Select.vue.d.ts +42 -24
  49. package/dist/runtime/components/forms/SelectMenu.vue +104 -89
  50. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +53 -33
  51. package/dist/runtime/components/forms/Textarea.vue +43 -31
  52. package/dist/runtime/components/forms/Textarea.vue.d.ts +50 -23
  53. package/dist/runtime/components/forms/Toggle.vue +26 -15
  54. package/dist/runtime/components/forms/Toggle.vue.d.ts +31 -12
  55. package/dist/runtime/components/layout/Card.vue +15 -10
  56. package/dist/runtime/components/layout/Card.vue.d.ts +17 -9
  57. package/dist/runtime/components/layout/Container.vue +15 -10
  58. package/dist/runtime/components/layout/Container.vue.d.ts +17 -9
  59. package/dist/runtime/components/layout/Divider.vue +107 -0
  60. package/dist/runtime/components/layout/Divider.vue.d.ts +82 -0
  61. package/dist/runtime/components/layout/Skeleton.vue +15 -10
  62. package/dist/runtime/components/layout/Skeleton.vue.d.ts +17 -9
  63. package/dist/runtime/components/navigation/CommandPalette.vue +57 -38
  64. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +24 -23
  65. package/dist/runtime/components/navigation/CommandPaletteGroup.vue +1 -1
  66. package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +3 -4
  67. package/dist/runtime/components/navigation/Pagination.vue +129 -64
  68. package/dist/runtime/components/navigation/Pagination.vue.d.ts +70 -25
  69. package/dist/runtime/components/navigation/Tabs.vue +17 -14
  70. package/dist/runtime/components/navigation/Tabs.vue.d.ts +18 -11
  71. package/dist/runtime/components/navigation/VerticalNavigation.vue +15 -13
  72. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +20 -16
  73. package/dist/runtime/components/overlays/ContextMenu.vue +21 -11
  74. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +20 -11
  75. package/dist/runtime/components/overlays/Modal.vue +16 -14
  76. package/dist/runtime/components/overlays/Modal.vue.d.ts +18 -11
  77. package/dist/runtime/components/overlays/Notification.vue +25 -15
  78. package/dist/runtime/components/overlays/Notification.vue.d.ts +25 -19
  79. package/dist/runtime/components/overlays/Notifications.vue +19 -13
  80. package/dist/runtime/components/overlays/Notifications.vue.d.ts +22 -14
  81. package/dist/runtime/components/overlays/Popover.vue +39 -22
  82. package/dist/runtime/components/overlays/Popover.vue.d.ts +32 -11
  83. package/dist/runtime/components/overlays/Slideover.vue +15 -13
  84. package/dist/runtime/components/overlays/Slideover.vue.d.ts +18 -11
  85. package/dist/runtime/components/overlays/Tooltip.vue +31 -23
  86. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +19 -11
  87. package/dist/runtime/composables/useFormGroup.d.ts +12 -2
  88. package/dist/runtime/composables/useFormGroup.mjs +21 -4
  89. package/dist/runtime/composables/usePopper.d.ts +3 -3
  90. package/dist/runtime/composables/usePopper.mjs +47 -31
  91. package/dist/runtime/composables/useToast.d.ts +3 -3
  92. package/dist/runtime/composables/useUI.d.ts +10 -0
  93. package/dist/runtime/composables/useUI.mjs +24 -0
  94. package/dist/runtime/types/avatar.d.ts +10 -4
  95. package/dist/runtime/types/badge.d.ts +14 -0
  96. package/dist/runtime/types/button.d.ts +10 -3
  97. package/dist/runtime/types/command-palette.d.ts +3 -1
  98. package/dist/runtime/types/form.d.ts +18 -4
  99. package/dist/runtime/types/index.d.ts +4 -0
  100. package/dist/runtime/types/link.d.ts +1 -0
  101. package/dist/runtime/types/meter.d.ts +5 -0
  102. package/dist/runtime/types/notification.d.ts +5 -3
  103. package/dist/runtime/types/popper.d.ts +1 -0
  104. package/dist/runtime/types/progress.d.ts +4 -0
  105. package/dist/runtime/types/tabs.d.ts +1 -0
  106. package/dist/runtime/types/utils.d.ts +11 -0
  107. package/dist/runtime/ui.config.d.ts +1470 -0
  108. package/dist/runtime/{app.config.mjs → ui.config.mjs} +313 -97
  109. package/dist/runtime/utils/index.d.ts +5 -11
  110. package/dist/runtime/utils/index.mjs +21 -9
  111. package/dist/runtime/utils/lodash.d.ts +2 -0
  112. package/dist/runtime/utils/lodash.mjs +23 -0
  113. package/dist/runtime/utils/uid.d.ts +1 -0
  114. package/dist/runtime/utils/uid.mjs +4 -0
  115. package/dist/types.d.mts +1 -1
  116. package/dist/types.d.ts +1 -1
  117. package/package.json +27 -29
  118. package/dist/runtime/app.config.d.ts +0 -1203
  119. package/dist/runtime/utils/StateEmitter.d.ts +0 -17
  120. package/dist/runtime/utils/StateEmitter.mjs +0 -21
@@ -1,11 +1,5 @@
1
- export declare const defuTwMerge: <Source extends {
2
- [x: string]: any;
3
- [x: number]: any;
4
- [x: symbol]: any;
5
- }, Defaults extends ({
6
- [x: string]: any;
7
- [x: number]: any;
8
- [x: symbol]: any;
9
- } | (number | boolean | any[] | Record<never, any> | null | undefined))[]>(source: Source, ...defaults: Defaults) => import("defu").Defu<Source, Defaults>;
10
- export declare const hexToRgb: (hex: string) => string | null;
11
- export declare const getSlotsChildren: (slots: any) => any;
1
+ import type { Strategy } from '../types';
2
+ export declare function mergeConfig<T>(strategy: Strategy, ...configs: any[]): T;
3
+ export declare function hexToRgb(hex: string): string | null;
4
+ export declare function getSlotsChildren(slots: any): any;
5
+ export * from './lodash';
@@ -1,20 +1,31 @@
1
- import { createDefu } from "defu";
2
- import { twMerge } from "tailwind-merge";
3
- export const defuTwMerge = createDefu((obj, key, value) => {
4
- if (typeof obj[key] === "string" && typeof value === "string" && obj[key] && value) {
5
- obj[key] = twMerge(obj[key], value);
1
+ import { defu, createDefu } from "defu";
2
+ import { extendTailwindMerge } from "tailwind-merge";
3
+ const customTwMerge = extendTailwindMerge({
4
+ classGroups: {
5
+ icons: [(classPart) => /^i-/.test(classPart)]
6
+ }
7
+ });
8
+ const defuTwMerge = createDefu((obj, key, value, namespace) => {
9
+ if (namespace !== "default" && typeof obj[key] === "string" && typeof value === "string" && obj[key] && value) {
10
+ obj[key] = customTwMerge(obj[key], value);
6
11
  return true;
7
12
  }
8
13
  });
9
- export const hexToRgb = (hex) => {
14
+ export function mergeConfig(strategy, ...configs) {
15
+ if (strategy === "override") {
16
+ return defu({}, ...configs);
17
+ }
18
+ return defuTwMerge({}, ...configs);
19
+ }
20
+ export function hexToRgb(hex) {
10
21
  const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
11
22
  hex = hex.replace(shorthandRegex, function(_, r, g, b) {
12
23
  return r + r + g + g + b + b;
13
24
  });
14
25
  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
15
26
  return result ? `${parseInt(result[1], 16)} ${parseInt(result[2], 16)} ${parseInt(result[3], 16)}` : null;
16
- };
17
- export const getSlotsChildren = (slots) => {
27
+ }
28
+ export function getSlotsChildren(slots) {
18
29
  let children = slots.default?.();
19
30
  if (children.length) {
20
31
  children = children.flatMap((c) => {
@@ -30,4 +41,5 @@ export const getSlotsChildren = (slots) => {
30
41
  }).filter(Boolean);
31
42
  }
32
43
  return children;
33
- };
44
+ }
45
+ export * from "./lodash.mjs";
@@ -0,0 +1,2 @@
1
+ export declare function omit<T extends Record<string, any>, K extends keyof T>(object: T, keysToOmit: K[] | any[]): Pick<T, Exclude<keyof T, K>>;
2
+ export declare function get(object: Record<string, any>, path: (string | number)[] | string, defaultValue?: any): any;
@@ -0,0 +1,23 @@
1
+ export function omit(object, keysToOmit) {
2
+ const result = { ...object };
3
+ for (const key of keysToOmit) {
4
+ delete result[key];
5
+ }
6
+ return result;
7
+ }
8
+ export function get(object, path, defaultValue) {
9
+ if (typeof path === "string") {
10
+ path = path.split(".").map((key) => {
11
+ const numKey = Number(key);
12
+ return isNaN(numKey) ? key : numKey;
13
+ });
14
+ }
15
+ let result = object;
16
+ for (const key of path) {
17
+ if (result === void 0 || result === null) {
18
+ return defaultValue;
19
+ }
20
+ result = result[key];
21
+ }
22
+ return result !== void 0 ? result : defaultValue;
23
+ }
@@ -0,0 +1 @@
1
+ export declare function uid(): string;
@@ -0,0 +1,4 @@
1
+ let _id = 0;
2
+ export function uid() {
3
+ return `nuid-${_id++}`;
4
+ }
package/dist/types.d.mts CHANGED
@@ -12,4 +12,4 @@ declare module 'nuxt/schema' {
12
12
  }
13
13
 
14
14
 
15
- export { ModuleOptions, default } from './module'
15
+ export { accordion, alert, avatar, avatarGroup, badge, button, buttonGroup, card, checkbox, commandPalette, container, contextMenu, divider, dropdown, formGroup, input, kbd, meter, meterGroup, modal, notification, notifications, pagination, popover, progress, radio, radioGroup, range, select, selectMenu, skeleton, slideover, table, tabs, textarea, toggle, tooltip, verticalNavigation } from './module'
package/dist/types.d.ts CHANGED
@@ -12,4 +12,4 @@ declare module 'nuxt/schema' {
12
12
  }
13
13
 
14
14
 
15
- export { ModuleOptions, default } from './module'
15
+ export { accordion, alert, avatar, avatarGroup, badge, button, buttonGroup, card, checkbox, commandPalette, container, contextMenu, divider, dropdown, formGroup, input, kbd, meter, meterGroup, modal, notification, notifications, pagination, popover, progress, radio, radioGroup, range, select, selectMenu, skeleton, slideover, table, tabs, textarea, toggle, tooltip, verticalNavigation } from './module'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "2.8.1",
3
+ "version": "2.10.0",
4
4
  "repository": "https://github.com/nuxt/ui",
5
5
  "license": "MIT",
6
6
  "exports": {
@@ -18,56 +18,54 @@
18
18
  "node": ">=v16.20.2"
19
19
  },
20
20
  "scripts": {
21
- "build": "nuxt-module-build",
21
+ "build": "nuxt-module-build build",
22
22
  "prepack": "pnpm build",
23
23
  "dev": "nuxi dev docs",
24
24
  "play": "nuxi dev playground",
25
25
  "build:docs": "nuxi generate docs",
26
26
  "lint": "eslint .",
27
27
  "lint:fix": "eslint . --fix",
28
- "typecheck": "nuxi typecheck",
29
- "prepare": "nuxi prepare docs",
28
+ "typecheck": "vue-tsc --noEmit && nuxi typecheck docs",
29
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare docs",
30
30
  "release": "release-it"
31
31
  },
32
32
  "dependencies": {
33
- "@egoist/tailwindcss-icons": "^1.1.0",
33
+ "@egoist/tailwindcss-icons": "^1.4.0",
34
+ "@headlessui/tailwindcss": "^0.2.0",
34
35
  "@headlessui/vue": "^1.7.16",
35
- "@iconify-json/heroicons": "^1.1.12",
36
- "@nuxt/kit": "^3.7.1",
36
+ "@iconify-json/heroicons": "^1.1.13",
37
+ "@nuxt/kit": "^3.8.0",
37
38
  "@nuxtjs/color-mode": "^3.3.0",
38
- "@nuxtjs/tailwindcss": "^6.8.0",
39
+ "@nuxtjs/tailwindcss": "^6.8.1",
39
40
  "@popperjs/core": "^2.11.8",
40
41
  "@tailwindcss/aspect-ratio": "^0.4.2",
41
42
  "@tailwindcss/container-queries": "^0.1.1",
42
43
  "@tailwindcss/forms": "^0.5.6",
43
44
  "@tailwindcss/typography": "^0.5.10",
44
- "@vueuse/core": "^10.4.1",
45
- "@vueuse/integrations": "^10.4.1",
46
- "@vueuse/math": "^10.4.1",
47
- "defu": "^6.1.2",
45
+ "@vueuse/core": "^10.5.0",
46
+ "@vueuse/integrations": "^10.5.0",
47
+ "@vueuse/math": "^10.5.0",
48
+ "defu": "^6.1.3",
48
49
  "fuse.js": "^6.6.2",
49
- "lodash-es": "^4.17.21",
50
+ "ohash": "^1.1.3",
51
+ "pathe": "^1.1.1",
52
+ "scule": "^1.0.0",
50
53
  "tailwind-merge": "^1.14.0",
51
- "tailwindcss": "^3.3.3"
54
+ "tailwindcss": "^3.3.5"
52
55
  },
53
56
  "devDependencies": {
54
57
  "@nuxt/eslint-config": "^0.2.0",
55
- "@nuxt/module-builder": "^0.5.1",
56
- "@release-it/conventional-changelog": "^7.0.1",
57
- "eslint": "^8.48.0",
58
- "joi": "^17.10.1",
59
- "nuxt": "^3.7.1",
60
- "release-it": "^16.1.5",
58
+ "@nuxt/module-builder": "^0.5.2",
59
+ "@release-it/conventional-changelog": "^7.0.2",
60
+ "eslint": "^8.52.0",
61
+ "joi": "^17.11.0",
62
+ "nuxt": "^3.8.0",
63
+ "release-it": "^16.2.1",
61
64
  "typescript": "^5.2.2",
62
65
  "unbuild": "^2.0.0",
63
- "vue-tsc": "^1.8.10",
64
- "yup": "^1.2.0",
65
- "zod": "^3.22.2",
66
- "valibot": "^0.13.1"
67
- },
68
- "pnpm": {
69
- "patchedDependencies": {
70
- "nuxt-component-meta@0.5.3": "patches/nuxt-component-meta@0.5.3.patch"
71
- }
66
+ "valibot": "^0.19.0",
67
+ "vue-tsc": "^1.8.21",
68
+ "yup": "^1.3.2",
69
+ "zod": "^3.22.4"
72
70
  }
73
71
  }