@nuxt/ui 2.11.1 → 2.12.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 (63) hide show
  1. package/dist/module.d.mts +100 -28
  2. package/dist/module.d.ts +100 -28
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +2 -2
  5. package/dist/runtime/components/data/Table.vue +26 -18
  6. package/dist/runtime/components/data/Table.vue.d.ts +21 -12
  7. package/dist/runtime/components/elements/Accordion.vue +8 -4
  8. package/dist/runtime/components/elements/Accordion.vue.d.ts +4 -4
  9. package/dist/runtime/components/elements/Alert.vue +8 -2
  10. package/dist/runtime/components/elements/Alert.vue.d.ts +5 -10
  11. package/dist/runtime/components/elements/Button.vue.d.ts +1 -1
  12. package/dist/runtime/components/elements/Chip.vue.d.ts +2 -2
  13. package/dist/runtime/components/elements/Dropdown.vue +64 -15
  14. package/dist/runtime/components/elements/Dropdown.vue.d.ts +30 -2
  15. package/dist/runtime/components/elements/Link.vue +2 -2
  16. package/dist/runtime/components/forms/Form.vue +16 -7
  17. package/dist/runtime/components/forms/Form.vue.d.ts +1 -1
  18. package/dist/runtime/components/forms/Input.vue +1 -1
  19. package/dist/runtime/components/forms/Input.vue.d.ts +1 -1
  20. package/dist/runtime/components/forms/InputMenu.vue +410 -0
  21. package/dist/runtime/components/forms/InputMenu.vue.d.ts +331 -0
  22. package/dist/runtime/components/forms/RadioGroup.vue +1 -1
  23. package/dist/runtime/components/forms/Select.vue +1 -1
  24. package/dist/runtime/components/forms/Select.vue.d.ts +1 -1
  25. package/dist/runtime/components/forms/SelectMenu.vue +52 -19
  26. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +28 -8
  27. package/dist/runtime/components/forms/Toggle.vue +1 -1
  28. package/dist/runtime/components/forms/Toggle.vue.d.ts +2 -1
  29. package/dist/runtime/components/navigation/Breadcrumb.vue +7 -4
  30. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +3 -0
  31. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +1 -1
  32. package/dist/runtime/components/navigation/Pagination.vue +9 -4
  33. package/dist/runtime/components/navigation/Pagination.vue.d.ts +9 -0
  34. package/dist/runtime/components/navigation/VerticalNavigation.vue +54 -37
  35. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +7 -3
  36. package/dist/runtime/components/overlays/Modal.vue.d.ts +1 -1
  37. package/dist/runtime/components/overlays/Popover.vue +49 -13
  38. package/dist/runtime/components/overlays/Popover.vue.d.ts +14 -4
  39. package/dist/runtime/components/overlays/Slideover.vue.d.ts +1 -1
  40. package/dist/runtime/composables/useShortcuts.mjs +3 -1
  41. package/dist/runtime/types/alert.d.ts +5 -0
  42. package/dist/runtime/types/breadcrumb.d.ts +1 -0
  43. package/dist/runtime/types/dropdown.d.ts +2 -0
  44. package/dist/runtime/types/form.d.ts +1 -0
  45. package/dist/runtime/types/vertical-navigation.d.ts +1 -0
  46. package/dist/runtime/ui.config/forms/input.mjs +12 -12
  47. package/dist/runtime/ui.config/forms/inputMenu.d.ts +64 -0
  48. package/dist/runtime/ui.config/forms/inputMenu.mjs +62 -0
  49. package/dist/runtime/ui.config/forms/selectMenu.d.ts +14 -12
  50. package/dist/runtime/ui.config/forms/selectMenu.mjs +7 -41
  51. package/dist/runtime/ui.config/index.d.ts +1 -0
  52. package/dist/runtime/ui.config/index.mjs +1 -0
  53. package/dist/runtime/ui.config/layout/card.mjs +1 -1
  54. package/dist/runtime/ui.config/navigation/breadcrumb.d.ts +1 -0
  55. package/dist/runtime/ui.config/navigation/breadcrumb.mjs +1 -0
  56. package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +5 -0
  57. package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +5 -0
  58. package/dist/runtime/ui.config/popper.mjs +2 -1
  59. package/dist/runtime/utils/index.mjs +11 -3
  60. package/dist/runtime/utils/uid.mjs +2 -1
  61. package/dist/types.d.mts +2 -2
  62. package/dist/types.d.ts +1 -1
  63. package/package.json +27 -24
@@ -0,0 +1,62 @@
1
+ import { arrow } from "../popper.mjs";
2
+ export default {
3
+ container: "z-20 group",
4
+ trigger: "inline-flex w-full",
5
+ width: "w-full",
6
+ height: "max-h-60",
7
+ base: "relative focus:outline-none overflow-y-auto scroll-py-1",
8
+ background: "bg-white dark:bg-gray-800",
9
+ shadow: "shadow-lg",
10
+ rounded: "rounded-md",
11
+ padding: "p-1",
12
+ ring: "ring-1 ring-gray-200 dark:ring-gray-700",
13
+ empty: "text-sm text-gray-400 dark:text-gray-500 px-2 py-1.5",
14
+ option: {
15
+ base: "cursor-default select-none relative flex items-center justify-between gap-1",
16
+ rounded: "rounded-md",
17
+ padding: "px-2 py-1.5",
18
+ size: "text-sm",
19
+ color: "text-gray-900 dark:text-white",
20
+ container: "flex items-center gap-2 min-w-0",
21
+ active: "bg-gray-100 dark:bg-gray-900",
22
+ inactive: "",
23
+ selected: "pe-7",
24
+ disabled: "cursor-not-allowed opacity-50",
25
+ empty: "text-sm text-gray-400 dark:text-gray-500 px-2 py-1.5",
26
+ icon: {
27
+ base: "flex-shrink-0 h-4 w-4",
28
+ active: "text-gray-900 dark:text-white",
29
+ inactive: "text-gray-400 dark:text-gray-500"
30
+ },
31
+ selectedIcon: {
32
+ wrapper: "absolute inset-y-0 end-0 flex items-center",
33
+ padding: "pe-2",
34
+ base: "h-4 w-4 text-gray-900 dark:text-white flex-shrink-0"
35
+ },
36
+ avatar: {
37
+ base: "flex-shrink-0",
38
+ size: "3xs"
39
+ },
40
+ chip: {
41
+ base: "flex-shrink-0 w-2 h-2 mx-1 rounded-full"
42
+ }
43
+ },
44
+ // Syntax for `<Transition>` component https://vuejs.org/guide/built-ins/transition.html#css-based-transitions
45
+ transition: {
46
+ leaveActiveClass: "transition ease-in duration-100",
47
+ leaveFromClass: "opacity-100",
48
+ leaveToClass: "opacity-0"
49
+ },
50
+ popper: {
51
+ placement: "bottom-end"
52
+ },
53
+ default: {
54
+ selectedIcon: "i-heroicons-check-20-solid",
55
+ trailingIcon: "i-heroicons-chevron-down-20-solid"
56
+ },
57
+ arrow: {
58
+ ...arrow,
59
+ ring: "before:ring-1 before:ring-gray-200 dark:before:ring-gray-700",
60
+ background: "before:bg-white dark:before:bg-gray-700"
61
+ }
62
+ };
@@ -1,19 +1,10 @@
1
1
  declare const _default: {
2
- container: string;
3
- trigger: string;
4
2
  select: string;
5
- width: string;
6
- height: string;
7
- base: string;
8
- background: string;
9
- shadow: string;
10
- rounded: string;
11
- padding: string;
12
- ring: string;
13
3
  input: string;
14
4
  required: string;
15
5
  label: string;
16
6
  option: {
7
+ create: string;
17
8
  base: string;
18
9
  rounded: string;
19
10
  padding: string;
@@ -25,7 +16,6 @@ declare const _default: {
25
16
  selected: string;
26
17
  disabled: string;
27
18
  empty: string;
28
- create: string;
29
19
  icon: {
30
20
  base: string;
31
21
  active: string;
@@ -54,7 +44,8 @@ declare const _default: {
54
44
  };
55
45
  default: {
56
46
  selectedIcon: string;
57
- clearOnClose: boolean;
47
+ clearSearchOnClose: boolean;
48
+ showCreateOptionWhen: string;
58
49
  };
59
50
  arrow: {
60
51
  ring: string;
@@ -64,5 +55,16 @@ declare const _default: {
64
55
  shadow: string;
65
56
  placement: string;
66
57
  };
58
+ container: string;
59
+ trigger: string;
60
+ width: string;
61
+ height: string;
62
+ base: string;
63
+ background: string;
64
+ shadow: string;
65
+ rounded: string;
66
+ padding: string;
67
+ ring: string;
68
+ empty: string;
67
69
  };
68
70
  export default _default;
@@ -1,49 +1,14 @@
1
1
  import { arrow } from "../popper.mjs";
2
+ import inputMenu from "./inputMenu.mjs";
2
3
  export default {
3
- container: "z-20 group",
4
- trigger: "inline-flex w-full",
4
+ ...inputMenu,
5
5
  select: "inline-flex items-center text-left cursor-default",
6
- width: "w-full",
7
- height: "max-h-60",
8
- base: "relative focus:outline-none overflow-y-auto scroll-py-1",
9
- background: "bg-white dark:bg-gray-800",
10
- shadow: "shadow-lg",
11
- rounded: "rounded-md",
12
- padding: "p-1",
13
- ring: "ring-1 ring-gray-200 dark:ring-gray-700",
14
- input: "block w-[calc(100%+0.5rem)] focus:ring-transparent text-sm px-3 py-1.5 text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-800 border-0 border-b border-gray-200 dark:border-gray-700 focus:border-inherit sticky -top-1 -mt-1 mb-1 -mx-1 z-10 placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none",
6
+ input: "block w-[calc(100%+0.5rem)] focus:ring-transparent text-sm px-3 py-1.5 text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-800 border-0 border-b border-gray-200 dark:border-gray-700 sticky -top-1 -mt-1 mb-1 -mx-1 z-10 placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none",
15
7
  required: "absolute inset-0 w-px opacity-0 cursor-default",
16
8
  label: "block truncate",
17
9
  option: {
18
- base: "cursor-default select-none relative flex items-center justify-between gap-1",
19
- rounded: "rounded-md",
20
- padding: "px-2 py-1.5",
21
- size: "text-sm",
22
- color: "text-gray-900 dark:text-white",
23
- container: "flex items-center gap-2 min-w-0",
24
- active: "bg-gray-100 dark:bg-gray-900",
25
- inactive: "",
26
- selected: "pe-7",
27
- disabled: "cursor-not-allowed opacity-50",
28
- empty: "text-sm text-gray-400 dark:text-gray-500 px-2 py-1.5",
29
- create: "block truncate",
30
- icon: {
31
- base: "flex-shrink-0 h-4 w-4",
32
- active: "text-gray-900 dark:text-white",
33
- inactive: "text-gray-400 dark:text-gray-500"
34
- },
35
- selectedIcon: {
36
- wrapper: "absolute inset-y-0 end-0 flex items-center",
37
- padding: "pe-2",
38
- base: "h-4 w-4 text-gray-900 dark:text-white flex-shrink-0"
39
- },
40
- avatar: {
41
- base: "flex-shrink-0",
42
- size: "3xs"
43
- },
44
- chip: {
45
- base: "flex-shrink-0 w-2 h-2 mx-1 rounded-full"
46
- }
10
+ ...inputMenu.option,
11
+ create: "block truncate"
47
12
  },
48
13
  // Syntax for `<Transition>` component https://vuejs.org/guide/built-ins/transition.html#css-based-transitions
49
14
  transition: {
@@ -56,7 +21,8 @@ export default {
56
21
  },
57
22
  default: {
58
23
  selectedIcon: "i-heroicons-check-20-solid",
59
- clearOnClose: false
24
+ clearSearchOnClose: false,
25
+ showCreateOptionWhen: "empty"
60
26
  },
61
27
  arrow: {
62
28
  ...arrow,
@@ -13,6 +13,7 @@ export { default as progress } from './elements/progress';
13
13
  export { default as meter } from './elements/meter';
14
14
  export { default as meterGroup } from './elements/meterGroup';
15
15
  export { default as input } from './forms/input';
16
+ export { default as inputMenu } from './forms/inputMenu';
16
17
  export { default as formGroup } from './forms/formGroup';
17
18
  export { default as textarea } from './forms/textarea';
18
19
  export { default as select } from './forms/select';
@@ -13,6 +13,7 @@ export { default as progress } from "./elements/progress.mjs";
13
13
  export { default as meter } from "./elements/meter.mjs";
14
14
  export { default as meterGroup } from "./elements/meterGroup.mjs";
15
15
  export { default as input } from "./forms/input.mjs";
16
+ export { default as inputMenu } from "./forms/inputMenu.mjs";
16
17
  export { default as formGroup } from "./forms/formGroup.mjs";
17
18
  export { default as textarea } from "./forms/textarea.mjs";
18
19
  export { default as select } from "./forms/select.mjs";
@@ -1,5 +1,5 @@
1
1
  export default {
2
- base: "overflow-hidden",
2
+ base: "",
3
3
  background: "bg-white dark:bg-gray-900",
4
4
  divide: "divide-y divide-gray-200 dark:divide-gray-800",
5
5
  ring: "ring-1 ring-gray-200 dark:ring-gray-800",
@@ -3,6 +3,7 @@ declare const _default: {
3
3
  ol: string;
4
4
  li: string;
5
5
  base: string;
6
+ label: string;
6
7
  icon: {
7
8
  base: string;
8
9
  active: string;
@@ -3,6 +3,7 @@ export default {
3
3
  ol: "flex items-center gap-x-1.5",
4
4
  li: "flex items-center gap-x-1.5 text-gray-500 dark:text-gray-400 text-sm",
5
5
  base: "flex items-center gap-x-1.5 group font-semibold",
6
+ label: "",
6
7
  icon: {
7
8
  base: "flex-shrink-0 w-4 h-4",
8
9
  active: "",
@@ -24,5 +24,10 @@ declare const _default: {
24
24
  active: string;
25
25
  inactive: string;
26
26
  };
27
+ divider: {
28
+ wrapper: {
29
+ base: string;
30
+ };
31
+ };
27
32
  };
28
33
  export default _default;
@@ -23,5 +23,10 @@ export default {
23
23
  base: "relative ms-auto inline-block py-0.5 px-2 text-xs rounded-md -me-1 -my-0.5",
24
24
  active: "bg-white dark:bg-gray-900",
25
25
  inactive: "bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white group-hover:bg-white dark:group-hover:bg-gray-900"
26
+ },
27
+ divider: {
28
+ wrapper: {
29
+ base: "p-2"
30
+ }
26
31
  }
27
32
  };
@@ -4,5 +4,6 @@ export const arrow = {
4
4
  rounded: "before:rounded-sm",
5
5
  background: "before:bg-gray-200 dark:before:bg-gray-800",
6
6
  shadow: "before:shadow",
7
- placement: 'group-data-[popper-placement*="right"]:-left-1 group-data-[popper-placement*="left"]:-right-1 group-data-[popper-placement*="top"]:-bottom-1 group-data-[popper-placement*="bottom"]:-top-1'
7
+ // eslint-disable-next-line quotes
8
+ placement: `group-data-[popper-placement*='right']:-left-1 group-data-[popper-placement*='left']:-right-1 group-data-[popper-placement*='top']:-bottom-1 group-data-[popper-placement*='bottom']:-top-1`
8
9
  };
@@ -1,12 +1,20 @@
1
1
  import { defu, createDefu } from "defu";
2
2
  import { extendTailwindMerge } from "tailwind-merge";
3
3
  const customTwMerge = extendTailwindMerge({
4
- classGroups: {
5
- icons: [(classPart) => /^i-/.test(classPart)]
4
+ extend: {
5
+ classGroups: {
6
+ icons: [(classPart) => /^i-/.test(classPart)]
7
+ }
6
8
  }
7
9
  });
8
10
  const defuTwMerge = createDefu((obj, key, value, namespace) => {
9
- if (namespace !== "default" && !namespace.startsWith("default.") && typeof obj[key] === "string" && typeof value === "string" && obj[key] && value) {
11
+ if (namespace === "default" || namespace.startsWith("default.")) {
12
+ return false;
13
+ }
14
+ if (namespace.endsWith("avatar") && key === "size") {
15
+ return false;
16
+ }
17
+ if (typeof obj[key] === "string" && typeof value === "string" && obj[key] && value) {
10
18
  obj[key] = customTwMerge(obj[key], value);
11
19
  return true;
12
20
  }
@@ -1,4 +1,5 @@
1
1
  let _id = 0;
2
2
  export function uid() {
3
- return `nuid-${_id++}`;
3
+ _id = (_id + 1) % Number.MAX_SAFE_INTEGER;
4
+ return `nuid-${_id}`;
4
5
  }
package/dist/types.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import type { ModuleOptions } from './module'
2
+ import type { ModuleOptions } from './module.js'
3
3
 
4
4
 
5
5
  declare module '@nuxt/schema' {
@@ -13,4 +13,4 @@ declare module 'nuxt/schema' {
13
13
  }
14
14
 
15
15
 
16
- export type { accordion, alert, avatar, avatarGroup, badge, breadcrumb, button, buttonGroup, card, checkbox, chip, 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'
16
+ export type { accordion, alert, avatar, avatarGroup, badge, breadcrumb, button, buttonGroup, card, checkbox, chip, commandPalette, container, contextMenu, divider, dropdown, formGroup, input, inputMenu, kbd, meter, meterGroup, modal, notification, notifications, pagination, popover, progress, radio, radioGroup, range, select, selectMenu, skeleton, slideover, table, tabs, textarea, toggle, tooltip, verticalNavigation } from './module.js'
package/dist/types.d.ts CHANGED
@@ -13,4 +13,4 @@ declare module 'nuxt/schema' {
13
13
  }
14
14
 
15
15
 
16
- export type { accordion, alert, avatar, avatarGroup, badge, breadcrumb, button, buttonGroup, card, checkbox, chip, 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'
16
+ export type { accordion, alert, avatar, avatarGroup, badge, breadcrumb, button, buttonGroup, card, checkbox, chip, commandPalette, container, contextMenu, divider, dropdown, formGroup, input, inputMenu, 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.11.1",
3
+ "version": "2.12.0",
4
4
  "repository": "nuxt/ui",
5
5
  "homepage": "https://ui.nuxt.com",
6
6
  "license": "MIT",
@@ -32,51 +32,54 @@
32
32
  "test": "vitest"
33
33
  },
34
34
  "dependencies": {
35
- "@egoist/tailwindcss-icons": "^1.4.0",
35
+ "@egoist/tailwindcss-icons": "^1.7.2",
36
36
  "@headlessui/tailwindcss": "^0.2.0",
37
37
  "@headlessui/vue": "^1.7.16",
38
- "@iconify-json/heroicons": "^1.1.15",
39
- "@nuxt/kit": "^3.8.2",
38
+ "@iconify-json/heroicons": "^1.1.19",
39
+ "@nuxt/kit": "^3.9.1",
40
40
  "@nuxtjs/color-mode": "^3.3.2",
41
- "@nuxtjs/tailwindcss": "^6.10.1",
41
+ "@nuxtjs/tailwindcss": "^6.10.3",
42
42
  "@popperjs/core": "^2.11.8",
43
43
  "@tailwindcss/aspect-ratio": "^0.4.2",
44
44
  "@tailwindcss/container-queries": "^0.1.1",
45
45
  "@tailwindcss/forms": "^0.5.7",
46
46
  "@tailwindcss/typography": "^0.5.10",
47
- "@vueuse/core": "^10.7.0",
48
- "@vueuse/integrations": "^10.7.0",
49
- "@vueuse/math": "^10.7.0",
50
- "defu": "^6.1.3",
47
+ "@vueuse/core": "^10.7.1",
48
+ "@vueuse/integrations": "^10.7.1",
49
+ "@vueuse/math": "^10.7.1",
50
+ "defu": "^6.1.4",
51
51
  "fuse.js": "^6.6.2",
52
- "nuxt-icon": "^0.6.7",
52
+ "nuxt-icon": "^0.6.8",
53
53
  "ohash": "^1.1.3",
54
54
  "pathe": "^1.1.1",
55
55
  "scule": "^1.1.1",
56
- "tailwind-merge": "^1.14.0",
57
- "tailwindcss": "^3.3.6"
56
+ "tailwind-merge": "^2.2.0",
57
+ "tailwindcss": "^3.4.1"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@nuxt/eslint-config": "^0.2.0",
61
- "@nuxt/module-builder": "^0.5.4",
61
+ "@nuxt/module-builder": "^0.5.5",
62
+ "@nuxt/test-utils": "^3.9.0",
62
63
  "@release-it/conventional-changelog": "^8.0.1",
63
- "eslint": "^8.55.0",
64
+ "@vue/test-utils": "^2.4.3",
65
+ "eslint": "^8.56.0",
64
66
  "happy-dom": "^12.10.3",
65
67
  "joi": "^17.11.0",
66
- "nuxt": "^3.8.2",
67
- "nuxt-vitest": "^0.11.5",
68
- "release-it": "^17.0.0",
68
+ "nuxt": "^3.9.1",
69
+ "release-it": "^17.0.1",
69
70
  "typescript": "^5.3.3",
70
71
  "unbuild": "^2.0.0",
71
- "valibot": "^0.21.0",
72
- "vitest": "^0.33.0",
73
- "vue-tsc": "^1.8.25",
74
- "yup": "^1.3.2",
72
+ "valibot": "^0.25.0",
73
+ "vitest": "^1.1.3",
74
+ "vitest-environment-nuxt": "^1.0.0",
75
+ "vue-tsc": "^1.8.27",
76
+ "yup": "^1.3.3",
75
77
  "zod": "^3.22.4"
76
78
  },
77
79
  "resolutions": {
78
- "@nuxt/kit": "3.8.2",
79
- "@nuxt/schema": "3.8.2",
80
- "vue": "3.3.8"
80
+ "@nuxt/kit": "3.9.1",
81
+ "@nuxt/schema": "3.9.1",
82
+ "vue": "3.3.13",
83
+ "tailwindcss": "3.4.1"
81
84
  }
82
85
  }