@nuxt/ui 3.1.1 → 3.1.2

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 (105) hide show
  1. package/.nuxt/ui/alert.ts +0 -5
  2. package/.nuxt/ui/badge.ts +30 -7
  3. package/.nuxt/ui/button-group.ts +0 -13
  4. package/.nuxt/ui/button.ts +2 -7
  5. package/.nuxt/ui/calendar.ts +1 -1
  6. package/.nuxt/ui/carousel.ts +0 -5
  7. package/.nuxt/ui/checkbox-group.ts +144 -1
  8. package/.nuxt/ui/color-picker.ts +2 -2
  9. package/.nuxt/ui/input-menu.ts +2 -11
  10. package/.nuxt/ui/input-number.ts +10 -0
  11. package/.nuxt/ui/input.ts +2 -11
  12. package/.nuxt/ui/link.ts +12 -5
  13. package/.nuxt/ui/select-menu.ts +2 -11
  14. package/.nuxt/ui/select.ts +2 -11
  15. package/.nuxt/ui/tabs.ts +4 -3
  16. package/.nuxt/ui/textarea.ts +2 -11
  17. package/.nuxt/ui/toast.ts +0 -5
  18. package/cli/templates.mjs +2 -2
  19. package/dist/module.json +1 -1
  20. package/dist/module.mjs +14 -5
  21. package/dist/runtime/components/Accordion.vue +9 -9
  22. package/dist/runtime/components/Accordion.vue.d.ts +2 -0
  23. package/dist/runtime/components/Alert.vue +1 -1
  24. package/dist/runtime/components/Avatar.vue +2 -2
  25. package/dist/runtime/components/AvatarGroup.vue +1 -1
  26. package/dist/runtime/components/Badge.vue +5 -3
  27. package/dist/runtime/components/Badge.vue.d.ts +2 -0
  28. package/dist/runtime/components/Breadcrumb.vue +8 -8
  29. package/dist/runtime/components/Breadcrumb.vue.d.ts +2 -0
  30. package/dist/runtime/components/Button.vue +2 -3
  31. package/dist/runtime/components/Button.vue.d.ts +1 -1
  32. package/dist/runtime/components/Calendar.vue +2 -1
  33. package/dist/runtime/components/Card.vue +1 -1
  34. package/dist/runtime/components/Carousel.vue +5 -2
  35. package/dist/runtime/components/Carousel.vue.d.ts +6 -1
  36. package/dist/runtime/components/Checkbox.vue +2 -2
  37. package/dist/runtime/components/CheckboxGroup.vue +8 -5
  38. package/dist/runtime/components/CheckboxGroup.vue.d.ts +7 -1
  39. package/dist/runtime/components/Chip.vue +1 -1
  40. package/dist/runtime/components/Collapsible.vue +1 -1
  41. package/dist/runtime/components/ColorPicker.vue +1 -1
  42. package/dist/runtime/components/CommandPalette.vue +17 -17
  43. package/dist/runtime/components/CommandPalette.vue.d.ts +2 -0
  44. package/dist/runtime/components/ContextMenu.vue.d.ts +2 -0
  45. package/dist/runtime/components/ContextMenuContent.vue +15 -15
  46. package/dist/runtime/components/DropdownMenu.vue.d.ts +2 -0
  47. package/dist/runtime/components/DropdownMenuContent.vue +15 -15
  48. package/dist/runtime/components/FormField.vue +5 -5
  49. package/dist/runtime/components/Input.vue +2 -2
  50. package/dist/runtime/components/Input.vue.d.ts +23 -29
  51. package/dist/runtime/components/InputMenu.vue +17 -17
  52. package/dist/runtime/components/InputMenu.vue.d.ts +210 -0
  53. package/dist/runtime/components/InputNumber.vue +13 -7
  54. package/dist/runtime/components/InputNumber.vue.d.ts +78 -0
  55. package/dist/runtime/components/Link.vue +5 -14
  56. package/dist/runtime/components/NavigationMenu.vue +35 -28
  57. package/dist/runtime/components/NavigationMenu.vue.d.ts +20 -2
  58. package/dist/runtime/components/Pagination.vue +1 -1
  59. package/dist/runtime/components/PinInput.vue +1 -1
  60. package/dist/runtime/components/Progress.vue +1 -1
  61. package/dist/runtime/components/RadioGroup.vue +8 -8
  62. package/dist/runtime/components/RadioGroup.vue.d.ts +2 -0
  63. package/dist/runtime/components/Select.vue +12 -12
  64. package/dist/runtime/components/Select.vue.d.ts +3 -1
  65. package/dist/runtime/components/SelectMenu.vue +13 -13
  66. package/dist/runtime/components/SelectMenu.vue.d.ts +2 -0
  67. package/dist/runtime/components/Separator.vue +1 -1
  68. package/dist/runtime/components/Slider.vue +16 -4
  69. package/dist/runtime/components/Slider.vue.d.ts +26 -20
  70. package/dist/runtime/components/Stepper.vue +10 -10
  71. package/dist/runtime/components/Stepper.vue.d.ts +2 -0
  72. package/dist/runtime/components/Switch.vue +1 -1
  73. package/dist/runtime/components/Table.vue +2 -2
  74. package/dist/runtime/components/Tabs.vue +6 -6
  75. package/dist/runtime/components/Tabs.vue.d.ts +2 -0
  76. package/dist/runtime/components/Textarea.vue +3 -3
  77. package/dist/runtime/components/Textarea.vue.d.ts +23 -30
  78. package/dist/runtime/components/Toast.vue +3 -2
  79. package/dist/runtime/components/Toast.vue.d.ts +6 -0
  80. package/dist/runtime/components/Toaster.vue +4 -4
  81. package/dist/runtime/components/Toaster.vue.d.ts +6 -0
  82. package/dist/runtime/components/Tree.vue +10 -10
  83. package/dist/runtime/components/Tree.vue.d.ts +2 -0
  84. package/dist/runtime/composables/useFormField.d.ts +1 -1
  85. package/dist/runtime/composables/useFormField.js +2 -1
  86. package/dist/runtime/inertia/components/Link.vue +46 -60
  87. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  88. package/dist/runtime/inertia/components/LinkBase.vue +68 -0
  89. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
  90. package/dist/runtime/inertia/stubs.d.ts +1 -1
  91. package/dist/runtime/inertia/stubs.js +1 -1
  92. package/dist/runtime/locale/index.d.ts +1 -0
  93. package/dist/runtime/locale/index.js +1 -0
  94. package/dist/runtime/locale/sl.d.ts +3 -0
  95. package/dist/runtime/locale/sl.js +54 -0
  96. package/dist/runtime/utils/link.d.ts +1 -0
  97. package/dist/runtime/utils/link.js +12 -0
  98. package/dist/runtime/vue/components/Link.vue +27 -40
  99. package/dist/runtime/vue/composables/useAppConfig.js +3 -1
  100. package/dist/runtime/vue/stubs.d.ts +1 -1
  101. package/dist/runtime/vue/stubs.js +1 -1
  102. package/dist/shared/{ui.CbtTMMzt.mjs → ui.BvUP-pSb.mjs} +103 -16
  103. package/dist/unplugin.mjs +1 -1
  104. package/dist/vite.mjs +1 -1
  105. package/package.json +21 -21
@@ -4,6 +4,7 @@ import appConfig from "#build/app.config";
4
4
  import { useColorMode as useColorModeVueUse } from "@vueuse/core";
5
5
  export { useHead } from "@unhead/vue";
6
6
  export { useRoute, useRouter } from "vue-router";
7
+ export { useAppConfig } from "./composables/useAppConfig.js";
7
8
  export { defineShortcuts } from "../composables/defineShortcuts.js";
8
9
  export { defineLocale } from "../composables/defineLocale.js";
9
10
  export { useLocale } from "../composables/useLocale.js";
@@ -27,7 +28,6 @@ export const useColorMode = () => {
27
28
  forced: false
28
29
  };
29
30
  };
30
- export const useAppConfig = () => appConfig;
31
31
  export const useCookie = (_name, _options = {}) => {
32
32
  const value = ref(null);
33
33
  return {
@@ -253,18 +253,18 @@ const avatarGroup = {
253
253
 
254
254
  const buttonGroupVariant = {
255
255
  buttonGroup: {
256
- horizontal: "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none",
257
- vertical: "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
256
+ horizontal: "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",
257
+ vertical: "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"
258
258
  }
259
259
  };
260
260
  const buttonGroupVariantWithRoot = {
261
261
  buttonGroup: {
262
262
  horizontal: {
263
- root: "group",
263
+ root: "group has-focus-visible:z-[1]",
264
264
  base: "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"
265
265
  },
266
266
  vertical: {
267
- root: "group",
267
+ root: "group has-focus-visible:z-[1]",
268
268
  base: "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
269
269
  }
270
270
  }
@@ -338,6 +338,9 @@ const badge = (options) => ({
338
338
  leadingAvatarSize: "2xs",
339
339
  trailingIcon: "size-6"
340
340
  }
341
+ },
342
+ square: {
343
+ true: ""
341
344
  }
342
345
  },
343
346
  compoundVariants: [...(options.theme.colors || []).map((color) => ({
@@ -372,6 +375,26 @@ const badge = (options) => ({
372
375
  color: "neutral",
373
376
  variant: "subtle",
374
377
  class: "ring ring-inset ring-accented text-default bg-elevated"
378
+ }, {
379
+ size: "xs",
380
+ square: true,
381
+ class: "p-0.5"
382
+ }, {
383
+ size: "sm",
384
+ square: true,
385
+ class: "p-1"
386
+ }, {
387
+ size: "md",
388
+ square: true,
389
+ class: "p-1"
390
+ }, {
391
+ size: "lg",
392
+ square: true,
393
+ class: "p-1"
394
+ }, {
395
+ size: "xl",
396
+ square: true,
397
+ class: "p-1"
375
398
  }],
376
399
  defaultVariants: {
377
400
  color: "primary",
@@ -614,7 +637,7 @@ const calendar = (options) => ({
614
637
  }])),
615
638
  neutral: {
616
639
  headCell: "text-highlighted",
617
- cellTrigger: "focus-visible:ring-inverted data-[selected]:bg-inverted data-today:not-data-[selected]:text-inverted data-[highlighted]:bg-inverted/20 hover:not-data-[selected]:bg-inverted/10"
640
+ cellTrigger: "focus-visible:ring-inverted data-[selected]:bg-inverted data-today:not-data-[selected]:text-highlighted data-[highlighted]:bg-inverted/20 hover:not-data-[selected]:bg-inverted/10"
618
641
  }
619
642
  },
620
643
  size: {
@@ -842,7 +865,7 @@ const checkbox = (options) => ({
842
865
  }
843
866
  });
844
867
 
845
- const checkboxGroup = {
868
+ const checkboxGroup = (options) => ({
846
869
  slots: {
847
870
  root: "relative",
848
871
  fieldset: "flex gap-x-2",
@@ -858,6 +881,17 @@ const checkboxGroup = {
858
881
  fieldset: "flex-col"
859
882
  }
860
883
  },
884
+ color: {
885
+ ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {}])),
886
+ neutral: {}
887
+ },
888
+ variant: {
889
+ list: {},
890
+ card: {},
891
+ table: {
892
+ item: "border border-muted"
893
+ }
894
+ },
861
895
  size: {
862
896
  xs: {
863
897
  fieldset: "gap-y-0.5",
@@ -886,10 +920,56 @@ const checkboxGroup = {
886
920
  }
887
921
  }
888
922
  },
923
+ compoundVariants: [
924
+ { size: "xs", variant: "table", class: { item: "p-2.5" } },
925
+ { size: "sm", variant: "table", class: { item: "p-3" } },
926
+ { size: "md", variant: "table", class: { item: "p-3.5" } },
927
+ { size: "lg", variant: "table", class: { item: "p-4" } },
928
+ { size: "xl", variant: "table", class: { item: "p-4.5" } },
929
+ {
930
+ orientation: "horizontal",
931
+ variant: "table",
932
+ class: {
933
+ item: "first-of-type:rounded-l-lg last-of-type:rounded-r-lg",
934
+ fieldset: "gap-0 -space-x-px"
935
+ }
936
+ },
937
+ {
938
+ orientation: "vertical",
939
+ variant: "table",
940
+ class: {
941
+ item: "first-of-type:rounded-t-lg last-of-type:rounded-b-lg",
942
+ fieldset: "gap-0 -space-y-px"
943
+ }
944
+ },
945
+ ...(options.theme.colors || []).map((color) => ({
946
+ color,
947
+ variant: "table",
948
+ class: {
949
+ item: `has-data-[state=checked]:bg-${color}/10 has-data-[state=checked]:border-${color}/50 has-data-[state=checked]:z-[1]`
950
+ }
951
+ })),
952
+ {
953
+ color: "neutral",
954
+ variant: "table",
955
+ class: {
956
+ item: "has-data-[state=checked]:bg-elevated has-data-[state=checked]:border-inverted/50 has-data-[state=checked]:z-[1]"
957
+ }
958
+ },
959
+ {
960
+ variant: "table",
961
+ disabled: true,
962
+ class: {
963
+ item: "cursor-not-allowed opacity-75"
964
+ }
965
+ }
966
+ ],
889
967
  defaultVariants: {
890
- size: "md"
968
+ size: "md",
969
+ variant: "list",
970
+ color: "primary"
891
971
  }
892
- };
972
+ });
893
973
 
894
974
  const chip = (options) => ({
895
975
  slots: {
@@ -960,10 +1040,10 @@ const colorPicker = {
960
1040
  slots: {
961
1041
  root: "data-[disabled]:opacity-75",
962
1042
  picker: "flex gap-4",
963
- selector: "rounded-md",
1043
+ selector: "rounded-md touch-none",
964
1044
  selectorBackground: "w-full h-full relative rounded-md",
965
1045
  selectorThumb: "-translate-y-1/2 -translate-x-1/2 absolute size-4 ring-2 ring-(--color-white) rounded-full cursor-pointer data-[disabled]:cursor-not-allowed",
966
- track: "w-[8px] relative rounded-md",
1046
+ track: "w-[8px] relative rounded-md touch-none",
967
1047
  trackThumb: "absolute transform -translate-y-1/2 -translate-x-[4px] rtl:translate-x-[4px] size-4 rounded-full ring-2 ring-(--color-white) cursor-pointer data-[disabled]:cursor-not-allowed"
968
1048
  },
969
1049
  variants: {
@@ -1669,6 +1749,7 @@ const inputNumber = (options) => {
1669
1749
  decrement: "absolute flex items-center"
1670
1750
  },
1671
1751
  variants: {
1752
+ ...buttonGroupVariantWithRoot,
1672
1753
  color: {
1673
1754
  ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1674
1755
  neutral: ""
@@ -1794,12 +1875,17 @@ const link = (options) => ({
1794
1875
  variants: {
1795
1876
  active: {
1796
1877
  true: "text-primary",
1797
- false: ["text-muted hover:text-default", options.theme.transitions && "transition-colors"]
1878
+ false: "text-muted"
1798
1879
  },
1799
1880
  disabled: {
1800
1881
  true: "cursor-not-allowed opacity-75"
1801
1882
  }
1802
- }
1883
+ },
1884
+ compoundVariants: [{
1885
+ active: false,
1886
+ disabled: false,
1887
+ class: ["hover:text-default", options.theme.transitions && "transition-colors"]
1888
+ }]
1803
1889
  });
1804
1890
 
1805
1891
  const modal = {
@@ -3230,7 +3316,7 @@ const tabs = (options) => ({
3230
3316
  root: "flex items-center gap-2",
3231
3317
  list: "relative flex p-1 group",
3232
3318
  indicator: "absolute transition-[translate,width] duration-200",
3233
- trigger: ["group relative inline-flex items-center shrink-0 min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
3319
+ trigger: ["group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
3234
3320
  content: "focus:outline-none w-full",
3235
3321
  leadingIcon: "shrink-0",
3236
3322
  leadingAvatar: "shrink-0",
@@ -3245,12 +3331,13 @@ const tabs = (options) => ({
3245
3331
  variant: {
3246
3332
  pill: {
3247
3333
  list: "bg-elevated rounded-lg",
3248
- trigger: "flex-1 w-full",
3334
+ trigger: "grow",
3249
3335
  indicator: "rounded-md shadow-xs"
3250
3336
  },
3251
3337
  link: {
3252
3338
  list: "border-default",
3253
- indicator: "rounded-full"
3339
+ indicator: "rounded-full",
3340
+ trigger: "focus:outline-none"
3254
3341
  }
3255
3342
  },
3256
3343
  orientation: {
@@ -3665,7 +3752,7 @@ function getTemplates(options, uiConfig) {
3665
3752
  });
3666
3753
  }
3667
3754
  function generateVariantDeclarations(variants2) {
3668
- return variants2.map((variant) => {
3755
+ return variants2.filter((variant) => json.includes(`as typeof ${variant}`)).map((variant) => {
3669
3756
  const keys = Object.keys(result.variants[variant]);
3670
3757
  return `const ${variant} = ${JSON.stringify(keys, null, 2)} as const`;
3671
3758
  });
package/dist/unplugin.mjs CHANGED
@@ -3,7 +3,7 @@ import { join, normalize } from 'pathe';
3
3
  import { createUnplugin } from 'unplugin';
4
4
  import { defu } from 'defu';
5
5
  import tailwind from '@tailwindcss/vite';
6
- import { g as getTemplates, d as defaultOptions, r as resolveColors, a as getDefaultUiConfig } from './shared/ui.CbtTMMzt.mjs';
6
+ import { g as getTemplates, d as defaultOptions, r as resolveColors, a as getDefaultUiConfig } from './shared/ui.BvUP-pSb.mjs';
7
7
  import { globSync } from 'tinyglobby';
8
8
  import { genSafeVariableName } from 'knitwork';
9
9
  import MagicString from 'magic-string';
package/dist/vite.mjs CHANGED
@@ -4,7 +4,7 @@ import 'pathe';
4
4
  import 'unplugin';
5
5
  import 'defu';
6
6
  import '@tailwindcss/vite';
7
- import './shared/ui.CbtTMMzt.mjs';
7
+ import './shared/ui.BvUP-pSb.mjs';
8
8
  import '../dist/runtime/utils/index.js';
9
9
  import 'scule';
10
10
  import '@nuxt/kit';
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.1.1",
5
- "packageManager": "pnpm@10.10.0",
4
+ "version": "3.1.2",
5
+ "packageManager": "pnpm@10.11.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/nuxt/ui.git"
@@ -115,18 +115,18 @@
115
115
  "@iconify/vue": "^4.3.0",
116
116
  "@internationalized/date": "^3.8.0",
117
117
  "@internationalized/number": "^3.6.1",
118
- "@nuxt/fonts": "^0.11.2",
118
+ "@nuxt/fonts": "^0.11.4",
119
119
  "@nuxt/icon": "^1.12.0",
120
- "@nuxt/kit": "^3.17.1",
121
- "@nuxt/schema": "^3.17.1",
120
+ "@nuxt/kit": "^3.17.3",
121
+ "@nuxt/schema": "^3.17.3",
122
122
  "@nuxtjs/color-mode": "^3.5.2",
123
123
  "@standard-schema/spec": "^1.0.0",
124
- "@tailwindcss/postcss": "^4.1.4",
125
- "@tailwindcss/vite": "^4.1.4",
124
+ "@tailwindcss/postcss": "^4.1.6",
125
+ "@tailwindcss/vite": "^4.1.6",
126
126
  "@tanstack/vue-table": "^8.21.3",
127
127
  "@unhead/vue": "^2.0.8",
128
- "@vueuse/core": "^13.1.0",
129
- "@vueuse/integrations": "^13.1.0",
128
+ "@vueuse/core": "^13.2.0",
129
+ "@vueuse/integrations": "^13.2.0",
130
130
  "colortranslator": "^4.1.0",
131
131
  "consola": "^3.4.2",
132
132
  "defu": "^6.1.4",
@@ -144,29 +144,29 @@
144
144
  "mlly": "^1.7.4",
145
145
  "ohash": "^2.0.11",
146
146
  "pathe": "^2.0.3",
147
- "reka-ui": "^2.2.0",
147
+ "reka-ui": "^2.2.1",
148
148
  "scule": "^1.3.0",
149
149
  "tailwind-variants": "^1.0.0",
150
- "tailwindcss": "^4.1.4",
150
+ "tailwindcss": "^4.1.6",
151
151
  "tinyglobby": "^0.2.13",
152
- "unplugin": "^2.3.2",
153
- "unplugin-auto-import": "^19.1.2",
152
+ "unplugin": "^2.3.4",
153
+ "unplugin-auto-import": "^19.2.0",
154
154
  "unplugin-vue-components": "^28.5.0",
155
155
  "vaul-vue": "^0.4.1",
156
156
  "vue-component-type-helpers": "^2.2.10"
157
157
  },
158
158
  "devDependencies": {
159
- "@nuxt/eslint-config": "^1.3.0",
159
+ "@nuxt/eslint-config": "^1.3.1",
160
160
  "@nuxt/module-builder": "^1.0.1",
161
- "@nuxt/test-utils": "^3.17.2",
161
+ "@nuxt/test-utils": "^3.18.0",
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.25.1",
166
- "happy-dom": "^17.4.4",
167
- "nuxt": "^3.17.1",
168
- "release-it": "^19.0.1",
169
- "vitest": "^3.1.2",
165
+ "eslint": "^9.26.0",
166
+ "happy-dom": "^17.4.7",
167
+ "nuxt": "^3.17.3",
168
+ "release-it": "^19.0.2",
169
+ "vitest": "^3.1.3",
170
170
  "vitest-environment-nuxt": "^1.0.1",
171
171
  "vue-tsc": "^2.2.10"
172
172
  },
@@ -209,7 +209,7 @@
209
209
  "debug": "4.3.7",
210
210
  "rollup": "4.34.9",
211
211
  "unimport": "4.1.1",
212
- "unplugin": "^2.3.2"
212
+ "unplugin": "^2.3.4"
213
213
  },
214
214
  "pnpm": {
215
215
  "onlyBuiltDependencies": [