@nuxt/ui 2.20.0 → 2.21.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 (39) hide show
  1. package/dist/module.d.mts +2 -0
  2. package/dist/module.d.ts +2 -0
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +16 -11
  5. package/dist/runtime/components/data/Table.vue +23 -14
  6. package/dist/runtime/components/data/Table.vue.d.ts +0 -1
  7. package/dist/runtime/components/elements/Alert.vue +2 -2
  8. package/dist/runtime/components/elements/Avatar.vue +2 -2
  9. package/dist/runtime/components/elements/AvatarGroup.js +2 -2
  10. package/dist/runtime/components/elements/Badge.vue +2 -2
  11. package/dist/runtime/components/elements/Button.vue +2 -2
  12. package/dist/runtime/components/elements/ButtonGroup.js +2 -2
  13. package/dist/runtime/components/elements/Carousel.vue +1 -2
  14. package/dist/runtime/components/elements/Dropdown.vue +2 -2
  15. package/dist/runtime/components/elements/Kbd.vue +2 -2
  16. package/dist/runtime/components/elements/MeterGroup.js +1 -1
  17. package/dist/runtime/components/forms/Checkbox.vue +2 -2
  18. package/dist/runtime/components/forms/Input.vue +2 -2
  19. package/dist/runtime/components/forms/InputMenu.vue +2 -2
  20. package/dist/runtime/components/forms/Radio.vue +2 -2
  21. package/dist/runtime/components/forms/RadioGroup.vue +1 -1
  22. package/dist/runtime/components/forms/Range.vue +2 -2
  23. package/dist/runtime/components/forms/Select.vue +2 -2
  24. package/dist/runtime/components/forms/SelectMenu.vue +2 -2
  25. package/dist/runtime/components/forms/Textarea.vue +2 -2
  26. package/dist/runtime/components/forms/Toggle.vue +2 -2
  27. package/dist/runtime/components/layout/Card.vue +2 -2
  28. package/dist/runtime/components/layout/Container.vue +2 -2
  29. package/dist/runtime/components/layout/Divider.vue +2 -2
  30. package/dist/runtime/components/layout/Skeleton.vue +2 -2
  31. package/dist/runtime/components/navigation/Breadcrumb.vue +2 -2
  32. package/dist/runtime/components/navigation/HorizontalNavigation.vue +2 -2
  33. package/dist/runtime/components/navigation/VerticalNavigation.vue +2 -2
  34. package/dist/runtime/components/overlays/ContextMenu.vue +2 -2
  35. package/dist/runtime/components/overlays/Notification.vue +2 -2
  36. package/dist/runtime/components/overlays/Notifications.vue +2 -2
  37. package/dist/runtime/utils/index.d.ts +1 -0
  38. package/dist/runtime/utils/index.js +4 -3
  39. package/package.json +23 -23
package/dist/module.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
+ import { ConfigExtension, DefaultClassGroupIds, DefaultThemeGroupIds } from 'tailwind-merge';
2
3
  import * as config from '../dist/runtime/ui.config/index.js';
3
4
  import { Strategy, DeepPartial } from '../dist/runtime/types/index.js';
4
5
 
@@ -7,6 +8,7 @@ type UI = {
7
8
  gray?: string;
8
9
  colors?: string[];
9
10
  strategy?: Strategy;
11
+ tailwindMerge?: ConfigExtension<DefaultClassGroupIds, DefaultThemeGroupIds>;
10
12
  [key: string]: any;
11
13
  } & DeepPartial<typeof config, string | number | boolean>;
12
14
  declare module '@nuxt/schema' {
package/dist/module.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
+ import { ConfigExtension, DefaultClassGroupIds, DefaultThemeGroupIds } from 'tailwind-merge';
2
3
  import * as config from '../dist/runtime/ui.config/index.js';
3
4
  import { Strategy, DeepPartial } from '../dist/runtime/types/index.js';
4
5
 
@@ -7,6 +8,7 @@ type UI = {
7
8
  gray?: string;
8
9
  colors?: string[];
9
10
  strategy?: Strategy;
11
+ tailwindMerge?: ConfigExtension<DefaultClassGroupIds, DefaultThemeGroupIds>;
10
12
  [key: string]: any;
11
13
  } & DeepPartial<typeof config, string | number | boolean>;
12
14
  declare module '@nuxt/schema' {
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "2.20.0",
3
+ "version": "2.21.0",
4
4
  "configKey": "ui",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.10.0"
package/dist/module.mjs CHANGED
@@ -14,7 +14,7 @@ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
14
14
  const __dirname = __cjs_path__.dirname(__filename);
15
15
  const require = __cjs_mod__.createRequire(import.meta.url);
16
16
  const name = "@nuxt/ui";
17
- const version = "2.20.0";
17
+ const version = "2.21.0";
18
18
 
19
19
  function createTemplates(nuxt = useNuxt()) {
20
20
  const template = addTemplate({
@@ -48,21 +48,26 @@ function installTailwind(moduleOptions, nuxt = useNuxt(), resolve = createResolv
48
48
  };
49
49
  });
50
50
  const configTemplate = addTemplate({
51
- filename: "nuxtui-tailwind.config.cjs",
51
+ filename: "nuxtui-tailwind.config.mjs",
52
52
  write: true,
53
53
  getContents: ({ nuxt: nuxt2 }) => `
54
- const { defaultExtractor: createDefaultExtractor } = require('tailwindcss/lib/lib/defaultExtractor.js')
55
- const { customSafelistExtractor, generateSafelist } = require(${JSON.stringify(resolve(runtimeDir, "utils", "colors"))})
54
+ import { defaultExtractor as createDefaultExtractor } from "tailwindcss/lib/lib/defaultExtractor.js";
55
+ import { customSafelistExtractor, generateSafelist } from ${JSON.stringify(resolve(runtimeDir, "utils", "colors"))};
56
+ import formsPlugin from "@tailwindcss/forms";
57
+ import aspectRatio from "@tailwindcss/aspect-ratio";
58
+ import typography from "@tailwindcss/typography";
59
+ import containerQueries from "@tailwindcss/container-queries";
60
+ import headlessUi from "@headlessui/tailwindcss";
56
61
 
57
- const defaultExtractor = createDefaultExtractor({ tailwindConfig: { separator: ':' } })
62
+ const defaultExtractor = createDefaultExtractor({ tailwindConfig: { separator: ':' } });
58
63
 
59
- module.exports = {
64
+ export default {
60
65
  plugins: [
61
- require('@tailwindcss/forms')({ strategy: 'class' }),
62
- require('@tailwindcss/aspect-ratio'),
63
- require('@tailwindcss/typography'),
64
- require('@tailwindcss/container-queries'),
65
- require('@headlessui/tailwindcss')
66
+ formsPlugin({ strategy: 'class' }),
67
+ aspectRatio,
68
+ typography,
69
+ containerQueries,
70
+ headlessUi
66
71
  ],
67
72
  content: {
68
73
  files: [
@@ -18,7 +18,7 @@
18
18
  :class="[ui.th.base, ui.th.padding, ui.th.color, ui.th.font, ui.th.size, column.key === 'select' && ui.checkbox.padding, column.class]"
19
19
  :aria-sort="getAriaSort(column)"
20
20
  >
21
- <slot v-if="!singleSelect && modelValue && (column.key === 'select' || shouldRenderColumnInFirstPlace(index, 'select'))" name="select-header" :indeterminate="indeterminate" :checked="isAllRowChecked" :change="onChange">
21
+ <slot v-if="!singleSelect && modelValue && column.key === 'select'" name="select-header" :indeterminate="indeterminate" :checked="isAllRowChecked" :change="onChange">
22
22
  <UCheckbox
23
23
  :model-value="isAllRowChecked"
24
24
  :indeterminate="indeterminate"
@@ -93,13 +93,12 @@
93
93
  />
94
94
  </td>
95
95
  <td v-for="(column, subIndex) in columns" :key="subIndex" :class="[ui.td.base, ui.td.padding, ui.td.color, ui.td.font, ui.td.size, column?.rowClass, row[column.key]?.class, column.key === 'select' && ui.checkbox.padding]">
96
- <slot v-if="modelValue && (column.key === 'select' || shouldRenderColumnInFirstPlace(subIndex, 'select')) " name="select-data" :checked="isSelected(row)" :change="(ev: boolean) => onChangeCheckbox(ev, row)">
96
+ <slot v-if="modelValue && column.key === 'select' " name="select-data" :checked="isSelected(row)" :change="(ev: boolean) => onChangeCheckbox(ev, row)">
97
97
  <UCheckbox
98
98
  :model-value="isSelected(row)"
99
99
  v-bind="ui.default.checkbox"
100
100
  aria-label="Select row"
101
101
  @change="onChangeCheckbox($event, row)"
102
- @click.capture.stop="() => onSelect(row)"
103
102
  />
104
103
  </slot>
105
104
 
@@ -143,7 +142,7 @@ import UButton from "../elements/Button.vue";
143
142
  import UProgress from "../elements/Progress.vue";
144
143
  import UCheckbox from "../forms/Checkbox.vue";
145
144
  import { useUI } from "../../composables/useUI";
146
- import { mergeConfig, get } from "../../utils";
145
+ import { get, mergeConfig } from "../../utils";
147
146
  import appConfig from "#build/app.config";
148
147
  import { table } from "#ui/ui.config";
149
148
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.table, table);
@@ -263,7 +262,25 @@ export default defineComponent({
263
262
  emits: ["update:modelValue", "update:sort", "update:expand", "select:all"],
264
263
  setup(props, { emit, attrs: $attrs }) {
265
264
  const { ui, attrs } = useUI("table", toRef(props, "ui"), config, toRef(props, "class"));
266
- const columns = computed(() => props.columns ?? Object.keys(props.rows[0] ?? {}).map((key) => ({ key, label: upperFirst(key), sortable: false, class: void 0, sort: defaultSort })));
265
+ const columns = computed(() => {
266
+ const defaultColumns = props.columns ?? Object.keys(props.rows[0]).map((key) => ({
267
+ key,
268
+ label: upperFirst(key),
269
+ sortable: false,
270
+ class: void 0,
271
+ sort: defaultSort
272
+ }));
273
+ const hasColumnSelect = defaultColumns.find((v) => v.key === "select");
274
+ if (hasColumnSelect || !props.modelValue) {
275
+ return defaultColumns;
276
+ }
277
+ return [{
278
+ key: "select",
279
+ sortable: false,
280
+ class: void 0,
281
+ sort: defaultSort
282
+ }, ...defaultColumns];
283
+ });
267
284
  const sort = useVModel(props, "sort", emit, { passive: true, defaultValue: defu({}, props.sort, { column: null, direction: "asc" }) });
268
285
  const expand = useVModel(props, "expand", emit, {
269
286
  passive: true,
@@ -375,8 +392,7 @@ export default defineComponent({
375
392
  if (checked) {
376
393
  selected.value = props.singleSelect ? [row] : [...selected.value, row];
377
394
  } else {
378
- const index = selected.value.findIndex((item) => compare(item, row));
379
- selected.value.splice(index, 1);
395
+ selected.value = selected.value.filter((value) => !compare(toRaw(value), toRaw(row)));
380
396
  }
381
397
  }
382
398
  function getRowData(row, rowKey, defaultValue = "") {
@@ -385,12 +401,6 @@ export default defineComponent({
385
401
  function isExpanded(row) {
386
402
  return expand.value?.openedRows ? expand.value.openedRows.some((openedRow) => compare(openedRow, row)) : false;
387
403
  }
388
- function shouldRenderColumnInFirstPlace(index, key) {
389
- if (!props.columns) {
390
- return index === 0;
391
- }
392
- return index === 0 && !props.columns.find((col) => col.key === key);
393
- }
394
404
  function toggleOpened(row) {
395
405
  expand.value = {
396
406
  openedRows: isExpanded(row) ? expand.value.openedRows.filter((v) => !compare(v, row)) : props.multipleExpand ? [...expand.value.openedRows, row] : [row],
@@ -444,7 +454,6 @@ export default defineComponent({
444
454
  toggleOpened,
445
455
  getAriaSort,
446
456
  isExpanded,
447
- shouldRenderColumnInFirstPlace,
448
457
  retriggerSlot
449
458
  };
450
459
  }
@@ -308,7 +308,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
308
308
  toggleOpened: (row: TableRow) => void;
309
309
  getAriaSort: (column: TableColumn) => AriaAttributes["aria-sort"];
310
310
  isExpanded: (row: TableRow) => boolean;
311
- shouldRenderColumnInFirstPlace: (index: number, key: string) => boolean;
312
311
  retriggerSlot: import("vue").Ref<any, any>;
313
312
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:sort" | "update:expand" | "select:all")[], "update:modelValue" | "update:sort" | "update:expand" | "select:all", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
314
313
  modelValue: {
@@ -41,12 +41,12 @@
41
41
 
42
42
  <script>
43
43
  import { computed, toRef, defineComponent } from "vue";
44
- import { twMerge, twJoin } from "tailwind-merge";
44
+ import { twJoin } from "tailwind-merge";
45
45
  import UIcon from "../elements/Icon.vue";
46
46
  import UAvatar from "../elements/Avatar.vue";
47
47
  import UButton from "../elements/Button.vue";
48
48
  import { useUI } from "../../composables/useUI";
49
- import { mergeConfig } from "../../utils";
49
+ import { mergeConfig, twMerge } from "../../utils";
50
50
  import appConfig from "#build/app.config";
51
51
  import { alert } from "#ui/ui.config";
52
52
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.alert, alert);
@@ -22,10 +22,10 @@
22
22
 
23
23
  <script>
24
24
  import { defineComponent, ref, computed, toRef, watch } from "vue";
25
- import { twMerge, twJoin } from "tailwind-merge";
25
+ import { twJoin } from "tailwind-merge";
26
26
  import UIcon from "../elements/Icon.vue";
27
27
  import { useUI } from "../../composables/useUI";
28
- import { mergeConfig } from "../../utils";
28
+ import { mergeConfig, twMerge } from "../../utils";
29
29
  import appConfig from "#build/app.config";
30
30
  import { avatar } from "#ui/ui.config";
31
31
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.avatar, avatar);
@@ -1,7 +1,7 @@
1
1
  import { h, cloneVNode, computed, toRef, defineComponent } from "vue";
2
- import { twMerge, twJoin } from "tailwind-merge";
2
+ import { twJoin } from "tailwind-merge";
3
3
  import { useUI } from "../../composables/useUI.js";
4
- import { mergeConfig, getSlotsChildren } from "../../utils/index.js";
4
+ import { getSlotsChildren, mergeConfig, twMerge } from "../../utils/index.js";
5
5
  import UAvatar from "./Avatar.vue";
6
6
  import appConfig from "#build/app.config";
7
7
  import { avatar, avatarGroup } from "#ui/ui.config";
@@ -18,10 +18,10 @@
18
18
 
19
19
  <script>
20
20
  import { computed, toRef, defineComponent } from "vue";
21
- import { twMerge, twJoin } from "tailwind-merge";
21
+ import { twJoin } from "tailwind-merge";
22
22
  import UIcon from "../elements/Icon.vue";
23
23
  import { useUI } from "../../composables/useUI";
24
- import { mergeConfig } from "../../utils";
24
+ import { mergeConfig, twMerge } from "../../utils";
25
25
  import { useInjectButtonGroup } from "../../composables/useButtonGroup";
26
26
  import appConfig from "#build/app.config";
27
27
  import { badge } from "#ui/ui.config";
@@ -18,11 +18,11 @@
18
18
 
19
19
  <script>
20
20
  import { computed, defineComponent, toRef } from "vue";
21
- import { twMerge, twJoin } from "tailwind-merge";
21
+ import { twJoin } from "tailwind-merge";
22
22
  import UIcon from "../elements/Icon.vue";
23
23
  import ULink from "../elements/Link.vue";
24
24
  import { useUI } from "../../composables/useUI";
25
- import { mergeConfig, nuxtLinkProps, getNuxtLinkProps } from "../../utils";
25
+ import { getNuxtLinkProps, mergeConfig, nuxtLinkProps, twMerge } from "../../utils";
26
26
  import { useInjectButtonGroup } from "../../composables/useButtonGroup";
27
27
  import appConfig from "#build/app.config";
28
28
  import { button } from "#ui/ui.config";
@@ -1,7 +1,7 @@
1
1
  import { h, computed, toRef, defineComponent } from "vue";
2
- import { twMerge, twJoin } from "tailwind-merge";
2
+ import { twJoin } from "tailwind-merge";
3
3
  import { useUI } from "../../composables/useUI.js";
4
- import { mergeConfig, getSlotsChildren } from "../../utils/index.js";
4
+ import { getSlotsChildren, mergeConfig, twMerge } from "../../utils/index.js";
5
5
  import { useProvideButtonGroup } from "../../composables/useButtonGroup.js";
6
6
  import appConfig from "#build/app.config";
7
7
  import { button, buttonGroup } from "#ui/ui.config";
@@ -57,9 +57,8 @@
57
57
 
58
58
  <script>
59
59
  import { ref, toRef, computed, defineComponent } from "vue";
60
- import { twMerge } from "tailwind-merge";
61
60
  import { useScroll, useResizeObserver, useElementSize } from "@vueuse/core";
62
- import { mergeConfig } from "../../utils";
61
+ import { mergeConfig, twMerge } from "../../utils";
63
62
  import UButton from "../elements/Button.vue";
64
63
  import { useUI } from "../../composables/useUI";
65
64
  import { useCarouselScroll } from "../../composables/useCarouselScroll";
@@ -59,13 +59,13 @@
59
59
  import { defineComponent, ref, computed, watch, toRef, onMounted, resolveComponent } from "vue";
60
60
  import { Menu as HMenu, MenuButton as HMenuButton, MenuItems as HMenuItems, MenuItem as HMenuItem, provideUseId } from "@headlessui/vue";
61
61
  import { defu } from "defu";
62
- import { twMerge, twJoin } from "tailwind-merge";
62
+ import { twJoin } from "tailwind-merge";
63
63
  import UIcon from "../elements/Icon.vue";
64
64
  import UAvatar from "../elements/Avatar.vue";
65
65
  import UKbd from "../elements/Kbd.vue";
66
66
  import { useUI } from "../../composables/useUI";
67
67
  import { usePopper } from "../../composables/usePopper";
68
- import { mergeConfig, getNuxtLinkProps } from "../../utils";
68
+ import { getNuxtLinkProps, mergeConfig, twMerge } from "../../utils";
69
69
  import appConfig from "#build/app.config";
70
70
  import { dropdown } from "#ui/ui.config";
71
71
  import { useId } from "#imports";
@@ -6,9 +6,9 @@
6
6
 
7
7
  <script>
8
8
  import { toRef, defineComponent, computed } from "vue";
9
- import { twMerge, twJoin } from "tailwind-merge";
9
+ import { twJoin } from "tailwind-merge";
10
10
  import { useUI } from "../../composables/useUI";
11
- import { mergeConfig } from "../../utils";
11
+ import { mergeConfig, twMerge } from "../../utils";
12
12
  import appConfig from "#build/app.config";
13
13
  import { kbd } from "#ui/ui.config";
14
14
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.kbd, kbd);
@@ -2,7 +2,7 @@ import { h, cloneVNode, computed, toRef, defineComponent } from "vue";
2
2
  import { twJoin } from "tailwind-merge";
3
3
  import UIcon from "../elements/Icon.vue";
4
4
  import { useUI } from "../../composables/useUI.js";
5
- import { mergeConfig, getSlotsChildren } from "../../utils/index.js";
5
+ import { getSlotsChildren, mergeConfig } from "../../utils/index.js";
6
6
  import appConfig from "#build/app.config";
7
7
  import { meter, meterGroup } from "#ui/ui.config";
8
8
  const meterConfig = mergeConfig(appConfig.ui.strategy, appConfig.ui.meter, meter);
@@ -31,10 +31,10 @@
31
31
 
32
32
  <script>
33
33
  import { computed, toRef, defineComponent } from "vue";
34
- import { twMerge, twJoin } from "tailwind-merge";
34
+ import { twJoin } from "tailwind-merge";
35
35
  import { useUI } from "../../composables/useUI";
36
36
  import { useFormGroup } from "../../composables/useFormGroup";
37
- import { mergeConfig } from "../../utils";
37
+ import { mergeConfig, twMerge } from "../../utils";
38
38
  import appConfig from "#build/app.config";
39
39
  import { checkbox } from "#ui/ui.config";
40
40
  import { useId } from "#app";
@@ -32,12 +32,12 @@
32
32
 
33
33
  <script>
34
34
  import { ref, computed, toRef, onMounted, defineComponent } from "vue";
35
- import { twMerge, twJoin } from "tailwind-merge";
35
+ import { twJoin } from "tailwind-merge";
36
36
  import { defu } from "defu";
37
37
  import UIcon from "../elements/Icon.vue";
38
38
  import { useUI } from "../../composables/useUI";
39
39
  import { useFormGroup } from "../../composables/useFormGroup";
40
- import { mergeConfig, looseToNumber } from "../../utils";
40
+ import { looseToNumber, mergeConfig, twMerge } from "../../utils";
41
41
  import { useInjectButtonGroup } from "../../composables/useButtonGroup";
42
42
  import appConfig from "#build/app.config";
43
43
  import { input } from "#ui/ui.config";
@@ -102,14 +102,14 @@ import {
102
102
  } from "@headlessui/vue";
103
103
  import { computedAsync, useDebounceFn } from "@vueuse/core";
104
104
  import { defu } from "defu";
105
- import { twMerge, twJoin } from "tailwind-merge";
105
+ import { twJoin } from "tailwind-merge";
106
106
  import { isEqual } from "ohash";
107
107
  import UIcon from "../elements/Icon.vue";
108
108
  import UAvatar from "../elements/Avatar.vue";
109
109
  import { useUI } from "../../composables/useUI";
110
110
  import { usePopper } from "../../composables/usePopper";
111
111
  import { useFormGroup } from "../../composables/useFormGroup";
112
- import { get, mergeConfig } from "../../utils";
112
+ import { get, mergeConfig, twMerge } from "../../utils";
113
113
  import { useInjectButtonGroup } from "../../composables/useButtonGroup";
114
114
  import appConfig from "#build/app.config";
115
115
  import { input, inputMenu } from "#ui/ui.config";
@@ -30,10 +30,10 @@
30
30
 
31
31
  <script>
32
32
  import { computed, defineComponent, inject, toRef } from "vue";
33
- import { twMerge, twJoin } from "tailwind-merge";
33
+ import { twJoin } from "tailwind-merge";
34
34
  import { useUI } from "../../composables/useUI";
35
35
  import { useFormGroup } from "../../composables/useFormGroup";
36
- import { mergeConfig } from "../../utils";
36
+ import { mergeConfig, twMerge } from "../../utils";
37
37
  import appConfig from "#build/app.config";
38
38
  import { radio } from "#ui/ui.config";
39
39
  import { useId } from "#imports";
@@ -33,7 +33,7 @@
33
33
  import { computed, defineComponent, provide, toRef } from "vue";
34
34
  import { useUI } from "../../composables/useUI";
35
35
  import { useFormGroup } from "../../composables/useFormGroup";
36
- import { mergeConfig, get } from "../../utils";
36
+ import { get, mergeConfig } from "../../utils";
37
37
  import URadio from "./Radio.vue";
38
38
  import appConfig from "#build/app.config";
39
39
  import { radioGroup, radio } from "#ui/ui.config";
@@ -21,10 +21,10 @@
21
21
 
22
22
  <script>
23
23
  import { computed, toRef, defineComponent } from "vue";
24
- import { twMerge, twJoin } from "tailwind-merge";
24
+ import { twJoin } from "tailwind-merge";
25
25
  import { useUI } from "../../composables/useUI";
26
26
  import { useFormGroup } from "../../composables/useFormGroup";
27
- import { mergeConfig } from "../../utils";
27
+ import { mergeConfig, twMerge } from "../../utils";
28
28
  import appConfig from "#build/app.config";
29
29
  import { range } from "#ui/ui.config";
30
30
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.range, range);
@@ -54,11 +54,11 @@
54
54
 
55
55
  <script>
56
56
  import { computed, toRef, defineComponent } from "vue";
57
- import { twMerge, twJoin } from "tailwind-merge";
57
+ import { twJoin } from "tailwind-merge";
58
58
  import UIcon from "../elements/Icon.vue";
59
59
  import { useUI } from "../../composables/useUI";
60
60
  import { useFormGroup } from "../../composables/useFormGroup";
61
- import { mergeConfig, get } from "../../utils";
61
+ import { get, mergeConfig, twMerge } from "../../utils";
62
62
  import { useInjectButtonGroup } from "../../composables/useButtonGroup";
63
63
  import appConfig from "#build/app.config";
64
64
  import { select } from "#ui/ui.config";
@@ -138,14 +138,14 @@ import {
138
138
  } from "@headlessui/vue";
139
139
  import { computedAsync, useDebounceFn } from "@vueuse/core";
140
140
  import { defu } from "defu";
141
- import { twMerge, twJoin } from "tailwind-merge";
141
+ import { twJoin } from "tailwind-merge";
142
142
  import { isEqual } from "ohash";
143
143
  import UIcon from "../elements/Icon.vue";
144
144
  import UAvatar from "../elements/Avatar.vue";
145
145
  import { useUI } from "../../composables/useUI";
146
146
  import { usePopper } from "../../composables/usePopper";
147
147
  import { useFormGroup } from "../../composables/useFormGroup";
148
- import { get, mergeConfig } from "../../utils";
148
+ import { get, mergeConfig, twMerge } from "../../utils";
149
149
  import { useInjectButtonGroup } from "../../composables/useButtonGroup";
150
150
  import appConfig from "#build/app.config";
151
151
  import { select, selectMenu } from "#ui/ui.config";
@@ -22,11 +22,11 @@
22
22
 
23
23
  <script>
24
24
  import { ref, computed, toRef, watch, onMounted, nextTick, defineComponent } from "vue";
25
- import { twMerge, twJoin } from "tailwind-merge";
25
+ import { twJoin } from "tailwind-merge";
26
26
  import { defu } from "defu";
27
27
  import { useUI } from "../../composables/useUI";
28
28
  import { useFormGroup } from "../../composables/useFormGroup";
29
- import { mergeConfig, looseToNumber } from "../../utils";
29
+ import { looseToNumber, mergeConfig, twMerge } from "../../utils";
30
30
  import appConfig from "#build/app.config";
31
31
  import { textarea } from "#ui/ui.config";
32
32
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.textarea, textarea);
@@ -32,11 +32,11 @@
32
32
  <script>
33
33
  import { computed, toRef, defineComponent } from "vue";
34
34
  import { Switch as HSwitch, provideUseId } from "@headlessui/vue";
35
- import { twMerge, twJoin } from "tailwind-merge";
35
+ import { twJoin } from "tailwind-merge";
36
36
  import UIcon from "../elements/Icon.vue";
37
37
  import { useUI } from "../../composables/useUI";
38
38
  import { useFormGroup } from "../../composables/useFormGroup";
39
- import { mergeConfig } from "../../utils";
39
+ import { mergeConfig, twMerge } from "../../utils";
40
40
  import appConfig from "#build/app.config";
41
41
  import { toggle } from "#ui/ui.config";
42
42
  import { useId } from "#imports";
@@ -18,9 +18,9 @@
18
18
 
19
19
  <script>
20
20
  import { computed, toRef, defineComponent } from "vue";
21
- import { twMerge, twJoin } from "tailwind-merge";
21
+ import { twJoin } from "tailwind-merge";
22
22
  import { useUI } from "../../composables/useUI";
23
- import { mergeConfig } from "../../utils";
23
+ import { mergeConfig, twMerge } from "../../utils";
24
24
  import appConfig from "#build/app.config";
25
25
  import { card } from "#ui/ui.config";
26
26
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.card, card);
@@ -6,9 +6,9 @@
6
6
 
7
7
  <script>
8
8
  import { computed, toRef, defineComponent } from "vue";
9
- import { twMerge, twJoin } from "tailwind-merge";
9
+ import { twJoin } from "tailwind-merge";
10
10
  import { useUI } from "../../composables/useUI";
11
- import { mergeConfig } from "../../utils";
11
+ import { mergeConfig, twMerge } from "../../utils";
12
12
  import appConfig from "#build/app.config";
13
13
  import { container } from "#ui/ui.config";
14
14
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.container, container);
@@ -20,11 +20,11 @@
20
20
 
21
21
  <script>
22
22
  import { toRef, computed, defineComponent } from "vue";
23
- import { twMerge, twJoin } from "tailwind-merge";
23
+ import { twJoin } from "tailwind-merge";
24
24
  import UIcon from "../elements/Icon.vue";
25
25
  import UAvatar from "../elements/Avatar.vue";
26
26
  import { useUI } from "../../composables/useUI";
27
- import { mergeConfig } from "../../utils";
27
+ import { mergeConfig, twMerge } from "../../utils";
28
28
  import appConfig from "#build/app.config";
29
29
  import { divider } from "#ui/ui.config";
30
30
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.divider, divider);
@@ -4,9 +4,9 @@
4
4
 
5
5
  <script>
6
6
  import { computed, toRef, defineComponent } from "vue";
7
- import { twMerge, twJoin } from "tailwind-merge";
7
+ import { twJoin } from "tailwind-merge";
8
8
  import { useUI } from "../../composables/useUI";
9
- import { mergeConfig } from "../../utils";
9
+ import { mergeConfig, twMerge } from "../../utils";
10
10
  import appConfig from "#build/app.config";
11
11
  import { skeleton } from "#ui/ui.config";
12
12
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.skeleton, skeleton);
@@ -35,11 +35,11 @@
35
35
 
36
36
  <script>
37
37
  import { defineComponent, toRef } from "vue";
38
- import { twMerge, twJoin } from "tailwind-merge";
38
+ import { twJoin } from "tailwind-merge";
39
39
  import UIcon from "../elements/Icon.vue";
40
40
  import ULink from "../elements/Link.vue";
41
41
  import { useUI } from "../../composables/useUI";
42
- import { mergeConfig, getULinkProps } from "../../utils";
42
+ import { getULinkProps, mergeConfig, twMerge } from "../../utils";
43
43
  import appConfig from "#build/app.config";
44
44
  import { breadcrumb } from "#ui/ui.config";
45
45
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.breadcrumb, breadcrumb);
@@ -53,13 +53,13 @@
53
53
 
54
54
  <script>
55
55
  import { toRef, defineComponent, computed } from "vue";
56
- import { twMerge, twJoin } from "tailwind-merge";
56
+ import { twJoin } from "tailwind-merge";
57
57
  import UIcon from "../elements/Icon.vue";
58
58
  import UAvatar from "../elements/Avatar.vue";
59
59
  import UBadge from "../elements/Badge.vue";
60
60
  import ULink from "../elements/Link.vue";
61
61
  import { useUI } from "../../composables/useUI";
62
- import { mergeConfig, getULinkProps } from "../../utils";
62
+ import { getULinkProps, mergeConfig, twMerge } from "../../utils";
63
63
  import appConfig from "#build/app.config";
64
64
  import { horizontalNavigation } from "#ui/ui.config";
65
65
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.horizontalNavigation, horizontalNavigation);
@@ -54,14 +54,14 @@
54
54
 
55
55
  <script>
56
56
  import { toRef, defineComponent, computed } from "vue";
57
- import { twMerge, twJoin } from "tailwind-merge";
57
+ import { twJoin } from "tailwind-merge";
58
58
  import UIcon from "../elements/Icon.vue";
59
59
  import UAvatar from "../elements/Avatar.vue";
60
60
  import UBadge from "../elements/Badge.vue";
61
61
  import ULink from "../elements/Link.vue";
62
62
  import UDivider from "../layout/Divider.vue";
63
63
  import { useUI } from "../../composables/useUI";
64
- import { mergeConfig, getULinkProps } from "../../utils";
64
+ import { getULinkProps, mergeConfig, twMerge } from "../../utils";
65
65
  import appConfig from "#build/app.config";
66
66
  import { verticalNavigation } from "#ui/ui.config";
67
67
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.verticalNavigation, verticalNavigation);
@@ -16,10 +16,10 @@
16
16
  import { computed, toRef, defineComponent } from "vue";
17
17
  import { defu } from "defu";
18
18
  import { onClickOutside } from "@vueuse/core";
19
- import { twMerge, twJoin } from "tailwind-merge";
19
+ import { twJoin } from "tailwind-merge";
20
20
  import { useUI } from "../../composables/useUI";
21
21
  import { usePopper } from "../../composables/usePopper";
22
- import { mergeConfig } from "../../utils";
22
+ import { mergeConfig, twMerge } from "../../utils";
23
23
  import appConfig from "#build/app.config";
24
24
  import { contextMenu } from "#ui/ui.config";
25
25
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.contextMenu, contextMenu);
@@ -44,13 +44,13 @@
44
44
 
45
45
  <script>
46
46
  import { ref, computed, toRef, onMounted, onUnmounted, watch, watchEffect, defineComponent } from "vue";
47
- import { twMerge, twJoin } from "tailwind-merge";
47
+ import { twJoin } from "tailwind-merge";
48
48
  import UIcon from "../elements/Icon.vue";
49
49
  import UAvatar from "../elements/Avatar.vue";
50
50
  import UButton from "../elements/Button.vue";
51
51
  import { useUI } from "../../composables/useUI";
52
52
  import { useTimer } from "../../composables/useTimer";
53
- import { mergeConfig } from "../../utils";
53
+ import { mergeConfig, twMerge } from "../../utils";
54
54
  import appConfig from "#build/app.config";
55
55
  import { notification } from "#ui/ui.config";
56
56
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.notification, notification);
@@ -21,10 +21,10 @@
21
21
 
22
22
  <script>
23
23
  import { computed, toRef, defineComponent } from "vue";
24
- import { twMerge, twJoin } from "tailwind-merge";
24
+ import { twJoin } from "tailwind-merge";
25
25
  import { useUI } from "../../composables/useUI";
26
26
  import { useToast } from "../../composables/useToast";
27
- import { mergeConfig } from "../../utils";
27
+ import { mergeConfig, twMerge } from "../../utils";
28
28
  import UNotification from "./Notification.vue";
29
29
  import { useState } from "#imports";
30
30
  import appConfig from "#build/app.config";
@@ -1,4 +1,5 @@
1
1
  import type { Strategy } from '../types/index.js';
2
+ export declare const twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
2
3
  export declare function mergeConfig<T>(strategy: Strategy, ...configs: any[]): T;
3
4
  export declare function parseConfigValue(value: string): string;
4
5
  export declare function hexToRgb(hex: string): string;
@@ -1,12 +1,13 @@
1
1
  import { defu, createDefu } from "defu";
2
2
  import { extendTailwindMerge } from "tailwind-merge";
3
- const customTwMerge = extendTailwindMerge({
3
+ import appConfig from "#build/app.config";
4
+ export const twMerge = extendTailwindMerge(defu({
4
5
  extend: {
5
6
  classGroups: {
6
7
  icons: [(classPart) => classPart.startsWith("i-")]
7
8
  }
8
9
  }
9
- });
10
+ }, appConfig.ui?.tailwindMerge));
10
11
  const defuTwMerge = createDefu((obj, key, value, namespace) => {
11
12
  if (namespace === "default" || namespace.startsWith("default.")) {
12
13
  return false;
@@ -24,7 +25,7 @@ const defuTwMerge = createDefu((obj, key, value, namespace) => {
24
25
  return false;
25
26
  }
26
27
  if (typeof obj[key] === "string" && typeof value === "string" && obj[key] && value) {
27
- obj[key] = customTwMerge(obj[key], value);
28
+ obj[key] = twMerge(obj[key], value);
28
29
  return true;
29
30
  }
30
31
  });
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": "2.20.0",
5
- "packageManager": "pnpm@9.15.0",
4
+ "version": "2.21.0",
5
+ "packageManager": "pnpm@9.15.3",
6
6
  "repository": "nuxt/ui",
7
7
  "homepage": "https://ui.nuxt.com",
8
8
  "type": "module",
@@ -34,55 +34,55 @@
34
34
  "dependencies": {
35
35
  "@headlessui/tailwindcss": "^0.2.1",
36
36
  "@headlessui/vue": "^1.7.23",
37
- "@iconify-json/heroicons": "^1.2.1",
38
- "@nuxt/icon": "^1.9.1",
39
- "@nuxt/kit": "^3.14.1592",
37
+ "@iconify-json/heroicons": "^1.2.2",
38
+ "@nuxt/icon": "^1.10.3",
39
+ "@nuxt/kit": "^3.15.1",
40
40
  "@nuxtjs/color-mode": "^3.5.2",
41
- "@nuxtjs/tailwindcss": "^6.12.2",
41
+ "@nuxtjs/tailwindcss": "^6.13.1",
42
42
  "@popperjs/core": "^2.11.8",
43
43
  "@tailwindcss/aspect-ratio": "^0.4.2",
44
44
  "@tailwindcss/container-queries": "^0.1.1",
45
- "@tailwindcss/forms": "^0.5.9",
46
- "@tailwindcss/typography": "^0.5.15",
47
- "@vueuse/core": "^12.0.0",
48
- "@vueuse/integrations": "^12.0.0",
49
- "@vueuse/math": "^12.0.0",
45
+ "@tailwindcss/forms": "^0.5.10",
46
+ "@tailwindcss/typography": "^0.5.16",
47
+ "@vueuse/core": "^12.4.0",
48
+ "@vueuse/integrations": "^12.4.0",
49
+ "@vueuse/math": "^12.4.0",
50
50
  "defu": "^6.1.4",
51
51
  "fuse.js": "^7.0.0",
52
52
  "ohash": "^1.1.4",
53
- "pathe": "^1.1.2",
53
+ "pathe": "^2.0.1",
54
54
  "scule": "^1.3.0",
55
- "tailwind-merge": "^2.5.5",
56
- "tailwindcss": "^3.4.16"
55
+ "tailwind-merge": "^2.6.0",
56
+ "tailwindcss": "^3.4.17"
57
57
  },
58
58
  "devDependencies": {
59
- "@nuxt/eslint-config": "^0.7.2",
59
+ "@nuxt/eslint-config": "^0.7.5",
60
60
  "@nuxt/module-builder": "^0.8.4",
61
- "@nuxt/test-utils": "^3.15.1",
62
- "@release-it/conventional-changelog": "^9.0.3",
61
+ "@nuxt/test-utils": "^3.15.4",
62
+ "@release-it/conventional-changelog": "^10.0.0",
63
63
  "@vue/test-utils": "^2.4.6",
64
- "eslint": "^9.16.0",
64
+ "eslint": "^9.18.0",
65
65
  "happy-dom": "^14.12.3",
66
66
  "joi": "^17.13.3",
67
- "nuxt": "^3.14.1592",
68
- "release-it": "^17.10.0",
67
+ "nuxt": "^3.15.1",
68
+ "release-it": "^18.1.1",
69
69
  "superstruct": "^2.0.2",
70
70
  "typescript": "^5.6.3",
71
- "unbuild": "^2.0.0",
72
71
  "valibot": "^0.42.1",
73
72
  "valibot30": "npm:valibot@0.30.0",
74
73
  "valibot31": "npm:valibot@0.31.0",
75
74
  "vitest": "^2.1.8",
76
75
  "vitest-environment-nuxt": "^1.0.1",
77
76
  "vue-tsc": "^2.1.10",
78
- "yup": "^1.5.0",
79
- "zod": "^3.23.8"
77
+ "yup": "^1.6.1",
78
+ "zod": "^3.24.1"
80
79
  },
81
80
  "resolutions": {
82
81
  "@nuxt/ui": "workspace:*",
83
82
  "@nuxt/content": "2.13.2",
84
83
  "@nuxtjs/mdc": "0.9.0",
85
84
  "chokidar": "3.6.0",
85
+ "vue-tsc": "2.1.10",
86
86
  "typescript": "5.6.3"
87
87
  }
88
88
  }