@nuxt/ui 3.0.0-beta.2 → 3.0.0-beta.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.
- package/.nuxt/ui/button.ts +8 -0
- package/.nuxt/ui/pagination.ts +6 -1
- package/.nuxt/ui/table.ts +2 -1
- package/dist/module.cjs +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Accordion.vue +7 -0
- package/dist/runtime/components/Alert.vue +14 -0
- package/dist/runtime/components/Avatar.vue +8 -1
- package/dist/runtime/components/AvatarGroup.vue +3 -0
- package/dist/runtime/components/Badge.vue +9 -0
- package/dist/runtime/components/Breadcrumb.vue +4 -0
- package/dist/runtime/components/Button.vue +56 -18
- package/dist/runtime/components/ButtonGroup.vue +3 -0
- package/dist/runtime/components/Calendar.vue +10 -0
- package/dist/runtime/components/Card.vue +3 -0
- package/dist/runtime/components/Carousel.vue +6 -0
- package/dist/runtime/components/Checkbox.vue +8 -0
- package/dist/runtime/components/Chip.vue +10 -0
- package/dist/runtime/components/ColorPicker.vue +3 -0
- package/dist/runtime/components/CommandPalette.vue +10 -1
- package/dist/runtime/components/ContextMenu.vue +9 -0
- package/dist/runtime/components/ContextMenuContent.vue +9 -0
- package/dist/runtime/components/DropdownMenu.vue +9 -0
- package/dist/runtime/components/DropdownMenuContent.vue +9 -0
- package/dist/runtime/components/FormField.vue +3 -0
- package/dist/runtime/components/Input.vue +9 -0
- package/dist/runtime/components/InputMenu.vue +18 -3
- package/dist/runtime/components/InputNumber.vue +2 -0
- package/dist/runtime/components/Kbd.vue +6 -0
- package/dist/runtime/components/Link.vue +8 -4
- package/dist/runtime/components/Modal.vue +1 -0
- package/dist/runtime/components/NavigationMenu.vue +17 -0
- package/dist/runtime/components/Pagination.vue +15 -9
- package/dist/runtime/components/PinInput.vue +13 -0
- package/dist/runtime/components/Progress.vue +10 -0
- package/dist/runtime/components/RadioGroup.vue +6 -0
- package/dist/runtime/components/Select.vue +14 -0
- package/dist/runtime/components/SelectMenu.vue +16 -1
- package/dist/runtime/components/Separator.vue +13 -1
- package/dist/runtime/components/Slideover.vue +5 -0
- package/dist/runtime/components/Slider.vue +6 -0
- package/dist/runtime/components/Stepper.vue +13 -0
- package/dist/runtime/components/Switch.vue +15 -2
- package/dist/runtime/components/Table.vue +15 -2
- package/dist/runtime/components/Tabs.vue +12 -0
- package/dist/runtime/components/Textarea.vue +9 -0
- package/dist/runtime/components/Toast.vue +11 -0
- package/dist/runtime/components/Toaster.vue +4 -0
- package/dist/runtime/components/Tree.vue +15 -0
- package/dist/runtime/composables/useComponentIcons.d.ts +13 -3
- package/dist/runtime/utils/index.js +1 -1
- package/dist/runtime/vue/components/Link.vue +8 -4
- package/dist/shared/{ui.DfK2RX6G.cjs → ui.DG2iA__L.cjs} +17 -3
- package/dist/shared/{ui.DSPu6Y8j.mjs → ui.S-Be5Oao.mjs} +17 -3
- package/dist/unplugin.cjs +1 -1
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +10 -10
|
@@ -22,9 +22,19 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
|
|
|
22
22
|
as?: any
|
|
23
23
|
title?: StringOrVNode
|
|
24
24
|
description?: StringOrVNode
|
|
25
|
+
/**
|
|
26
|
+
* @IconifyIcon
|
|
27
|
+
*/
|
|
25
28
|
icon?: string
|
|
26
29
|
avatar?: AvatarProps
|
|
30
|
+
/**
|
|
31
|
+
* @defaultValue 'primary'
|
|
32
|
+
*/
|
|
27
33
|
color?: ToastVariants['color']
|
|
34
|
+
/**
|
|
35
|
+
* The orientation between the content and the actions.
|
|
36
|
+
* @defaultValue 'vertical'
|
|
37
|
+
*/
|
|
28
38
|
orientation?: ToastVariants['orientation']
|
|
29
39
|
/**
|
|
30
40
|
* Display a list of actions:
|
|
@@ -42,6 +52,7 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
|
|
|
42
52
|
/**
|
|
43
53
|
* The icon displayed in the close button.
|
|
44
54
|
* @defaultValue appConfig.ui.icons.close
|
|
55
|
+
* @IconifyIcon
|
|
45
56
|
*/
|
|
46
57
|
closeIcon?: string
|
|
47
58
|
class?: any
|
|
@@ -13,6 +13,10 @@ const toaster = tv({ extend: tv(theme), ...(appConfigToaster.ui?.toaster || {})
|
|
|
13
13
|
type ToasterVariants = VariantProps<typeof toaster>
|
|
14
14
|
|
|
15
15
|
export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'> {
|
|
16
|
+
/**
|
|
17
|
+
* The position on the screen to display the toasts.
|
|
18
|
+
* @defaultValue 'bottom-right'
|
|
19
|
+
*/
|
|
16
20
|
position?: ToasterVariants['position']
|
|
17
21
|
/**
|
|
18
22
|
* Expand the toasts to show multiple toasts at once.
|
|
@@ -14,8 +14,14 @@ const tree = tv({ extend: tv(theme), ...(appConfig.ui?.tree || {}) })
|
|
|
14
14
|
type TreeVariants = VariantProps<typeof tree>
|
|
15
15
|
|
|
16
16
|
export type TreeItem = {
|
|
17
|
+
/**
|
|
18
|
+
* @IconifyIcon
|
|
19
|
+
*/
|
|
17
20
|
icon?: string
|
|
18
21
|
label?: string
|
|
22
|
+
/**
|
|
23
|
+
* @IconifyIcon
|
|
24
|
+
*/
|
|
19
25
|
trailingIcon?: string
|
|
20
26
|
defaultExpanded?: boolean
|
|
21
27
|
disabled?: boolean
|
|
@@ -32,7 +38,13 @@ export interface TreeProps<T extends TreeItem, M extends boolean = false, K exte
|
|
|
32
38
|
* @defaultValue 'ul'
|
|
33
39
|
*/
|
|
34
40
|
as?: any
|
|
41
|
+
/**
|
|
42
|
+
* @defaultValue 'primary'
|
|
43
|
+
*/
|
|
35
44
|
color?: TreeVariants['color']
|
|
45
|
+
/**
|
|
46
|
+
* @defaultValue 'md'
|
|
47
|
+
*/
|
|
36
48
|
size?: TreeVariants['size']
|
|
37
49
|
/**
|
|
38
50
|
* The key used to get the value from the item.
|
|
@@ -47,16 +59,19 @@ export interface TreeProps<T extends TreeItem, M extends boolean = false, K exte
|
|
|
47
59
|
/**
|
|
48
60
|
* The icon displayed on the right side of a parent node.
|
|
49
61
|
* @defaultValue appConfig.ui.icons.chevronDown
|
|
62
|
+
* @IconifyIcon
|
|
50
63
|
*/
|
|
51
64
|
trailingIcon?: string
|
|
52
65
|
/**
|
|
53
66
|
* The icon displayed when a parent node is expanded.
|
|
54
67
|
* @defaultValue appConfig.ui.icons.folderOpen
|
|
68
|
+
* @IconifyIcon
|
|
55
69
|
*/
|
|
56
70
|
expandedIcon?: string
|
|
57
71
|
/**
|
|
58
72
|
* The icon displayed when a parent node is collapsed.
|
|
59
73
|
* @defaultValue appConfig.ui.icons.folder
|
|
74
|
+
* @IconifyIcon
|
|
60
75
|
*/
|
|
61
76
|
collapsedIcon?: string
|
|
62
77
|
items?: T[]
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
import { type MaybeRefOrGetter } from 'vue';
|
|
2
2
|
import type { AvatarProps } from '../types';
|
|
3
3
|
export interface UseComponentIconsProps {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Display an icon based on the `leading` and `trailing` props.
|
|
6
|
+
* @IconifyIcon
|
|
7
|
+
*/
|
|
5
8
|
icon?: string;
|
|
6
9
|
/** Display an avatar on the left side. */
|
|
7
10
|
avatar?: AvatarProps;
|
|
8
11
|
/** When `true`, the icon will be displayed on the left side. */
|
|
9
12
|
leading?: boolean;
|
|
10
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Display an icon on the left side.
|
|
15
|
+
* @IconifyIcon
|
|
16
|
+
*/
|
|
11
17
|
leadingIcon?: string;
|
|
12
18
|
/** When `true`, the icon will be displayed on the right side. */
|
|
13
19
|
trailing?: boolean;
|
|
14
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Display an icon on the right side.
|
|
22
|
+
* @IconifyIcon
|
|
23
|
+
*/
|
|
15
24
|
trailingIcon?: string;
|
|
16
25
|
/** When `true`, the loading icon will be displayed. */
|
|
17
26
|
loading?: boolean;
|
|
18
27
|
/**
|
|
19
28
|
* The icon when the `loading` prop is `true`.
|
|
20
29
|
* @defaultValue appConfig.ui.icons.loading
|
|
30
|
+
* @IconifyIcon
|
|
21
31
|
*/
|
|
22
32
|
loadingIcon?: string;
|
|
23
33
|
}
|
|
@@ -91,7 +91,7 @@ export interface LinkSlots {
|
|
|
91
91
|
|
|
92
92
|
<script setup lang="ts">
|
|
93
93
|
import { computed, getCurrentInstance } from 'vue'
|
|
94
|
-
import { isEqual, diff } from 'ohash'
|
|
94
|
+
import { isEqual, diff } from 'ohash/utils'
|
|
95
95
|
import { useForwardProps } from 'reka-ui'
|
|
96
96
|
import { reactiveOmit } from '@vueuse/core'
|
|
97
97
|
import { hasProtocol } from 'ufo'
|
|
@@ -140,11 +140,15 @@ const ui = computed(() => tv({
|
|
|
140
140
|
function isPartiallyEqual(item1: any, item2: any) {
|
|
141
141
|
const diffedKeys = diff(item1, item2).reduce((filtered, q) => {
|
|
142
142
|
if (q.type === 'added') {
|
|
143
|
-
filtered.
|
|
143
|
+
filtered.add(q.key)
|
|
144
144
|
}
|
|
145
145
|
return filtered
|
|
146
|
-
},
|
|
147
|
-
|
|
146
|
+
}, new Set<string>())
|
|
147
|
+
|
|
148
|
+
const item1Filtered = Object.fromEntries(Object.entries(item1).filter(([key]) => !diffedKeys.has(key)))
|
|
149
|
+
const item2Filtered = Object.fromEntries(Object.entries(item2).filter(([key]) => !diffedKeys.has(key)))
|
|
150
|
+
|
|
151
|
+
return isEqual(item1Filtered, item2Filtered)
|
|
148
152
|
}
|
|
149
153
|
|
|
150
154
|
const isExternal = computed(() => {
|
|
@@ -498,6 +498,14 @@ const button = (options) => ({
|
|
|
498
498
|
},
|
|
499
499
|
loading: {
|
|
500
500
|
true: ""
|
|
501
|
+
},
|
|
502
|
+
active: {
|
|
503
|
+
true: {
|
|
504
|
+
base: ""
|
|
505
|
+
},
|
|
506
|
+
false: {
|
|
507
|
+
base: ""
|
|
508
|
+
}
|
|
501
509
|
}
|
|
502
510
|
},
|
|
503
511
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
@@ -1996,7 +2004,12 @@ const pagination = {
|
|
|
1996
2004
|
root: "",
|
|
1997
2005
|
list: "flex items-center gap-1",
|
|
1998
2006
|
ellipsis: "pointer-events-none",
|
|
1999
|
-
label: "min-w-5 text-center"
|
|
2007
|
+
label: "min-w-5 text-center",
|
|
2008
|
+
first: "",
|
|
2009
|
+
prev: "",
|
|
2010
|
+
item: "",
|
|
2011
|
+
next: "",
|
|
2012
|
+
last: ""
|
|
2000
2013
|
}
|
|
2001
2014
|
};
|
|
2002
2015
|
|
|
@@ -2960,7 +2973,8 @@ const table = (options) => ({
|
|
|
2960
2973
|
tr: "data-[selected=true]:bg-(--ui-bg-elevated)/50",
|
|
2961
2974
|
th: "px-4 py-3.5 text-sm text-(--ui-text-highlighted) text-left rtl:text-right font-semibold [&:has([role=checkbox])]:pe-0",
|
|
2962
2975
|
td: "p-4 text-sm text-(--ui-text-muted) whitespace-nowrap [&:has([role=checkbox])]:pe-0",
|
|
2963
|
-
empty: "py-6 text-center text-sm text-(--ui-text-muted)"
|
|
2976
|
+
empty: "py-6 text-center text-sm text-(--ui-text-muted)",
|
|
2977
|
+
loading: "py-6 text-center"
|
|
2964
2978
|
},
|
|
2965
2979
|
variants: {
|
|
2966
2980
|
pinned: {
|
|
@@ -3467,7 +3481,7 @@ function getTemplates(options, uiConfig) {
|
|
|
3467
3481
|
--color-old-neutral-800: ${colors__default.neutral[800]};
|
|
3468
3482
|
--color-old-neutral-900: ${colors__default.neutral[900]};
|
|
3469
3483
|
--color-old-neutral-950: ${colors__default.neutral[950]};
|
|
3470
|
-
${[...options.theme?.colors || [], "neutral"].map((color) => [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].map((shade) => `--color-${color}-${shade}: var(--ui-color-${color}-${shade});`).join("\n ")).join("\n ")}
|
|
3484
|
+
${[...(options.theme?.colors || []).filter((color) => !colors__default[color]), "neutral"].map((color) => [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].map((shade) => `--color-${color}-${shade}: var(--ui-color-${color}-${shade});`).join("\n ")).join("\n ")}
|
|
3471
3485
|
}
|
|
3472
3486
|
`
|
|
3473
3487
|
});
|
|
@@ -492,6 +492,14 @@ const button = (options) => ({
|
|
|
492
492
|
},
|
|
493
493
|
loading: {
|
|
494
494
|
true: ""
|
|
495
|
+
},
|
|
496
|
+
active: {
|
|
497
|
+
true: {
|
|
498
|
+
base: ""
|
|
499
|
+
},
|
|
500
|
+
false: {
|
|
501
|
+
base: ""
|
|
502
|
+
}
|
|
495
503
|
}
|
|
496
504
|
},
|
|
497
505
|
compoundVariants: [...(options.theme.colors || []).map((color) => ({
|
|
@@ -1990,7 +1998,12 @@ const pagination = {
|
|
|
1990
1998
|
root: "",
|
|
1991
1999
|
list: "flex items-center gap-1",
|
|
1992
2000
|
ellipsis: "pointer-events-none",
|
|
1993
|
-
label: "min-w-5 text-center"
|
|
2001
|
+
label: "min-w-5 text-center",
|
|
2002
|
+
first: "",
|
|
2003
|
+
prev: "",
|
|
2004
|
+
item: "",
|
|
2005
|
+
next: "",
|
|
2006
|
+
last: ""
|
|
1994
2007
|
}
|
|
1995
2008
|
};
|
|
1996
2009
|
|
|
@@ -2954,7 +2967,8 @@ const table = (options) => ({
|
|
|
2954
2967
|
tr: "data-[selected=true]:bg-(--ui-bg-elevated)/50",
|
|
2955
2968
|
th: "px-4 py-3.5 text-sm text-(--ui-text-highlighted) text-left rtl:text-right font-semibold [&:has([role=checkbox])]:pe-0",
|
|
2956
2969
|
td: "p-4 text-sm text-(--ui-text-muted) whitespace-nowrap [&:has([role=checkbox])]:pe-0",
|
|
2957
|
-
empty: "py-6 text-center text-sm text-(--ui-text-muted)"
|
|
2970
|
+
empty: "py-6 text-center text-sm text-(--ui-text-muted)",
|
|
2971
|
+
loading: "py-6 text-center"
|
|
2958
2972
|
},
|
|
2959
2973
|
variants: {
|
|
2960
2974
|
pinned: {
|
|
@@ -3461,7 +3475,7 @@ function getTemplates(options, uiConfig) {
|
|
|
3461
3475
|
--color-old-neutral-800: ${colors.neutral[800]};
|
|
3462
3476
|
--color-old-neutral-900: ${colors.neutral[900]};
|
|
3463
3477
|
--color-old-neutral-950: ${colors.neutral[950]};
|
|
3464
|
-
${[...options.theme?.colors || [], "neutral"].map((color) => [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].map((shade) => `--color-${color}-${shade}: var(--ui-color-${color}-${shade});`).join("\n ")).join("\n ")}
|
|
3478
|
+
${[...(options.theme?.colors || []).filter((color) => !colors[color]), "neutral"].map((color) => [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].map((shade) => `--color-${color}-${shade}: var(--ui-color-${color}-${shade});`).join("\n ")).join("\n ")}
|
|
3465
3479
|
}
|
|
3466
3480
|
`
|
|
3467
3481
|
});
|
package/dist/unplugin.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const pathe = require('pathe');
|
|
|
5
5
|
const unplugin = require('unplugin');
|
|
6
6
|
const defu = require('defu');
|
|
7
7
|
const tailwind = require('@tailwindcss/vite');
|
|
8
|
-
const templates = require('./shared/ui.
|
|
8
|
+
const templates = require('./shared/ui.DG2iA__L.cjs');
|
|
9
9
|
const tinyglobby = require('tinyglobby');
|
|
10
10
|
const knitwork = require('knitwork');
|
|
11
11
|
const MagicString = require('magic-string');
|
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.
|
|
6
|
+
import { g as getTemplates, d as defaultOptions, r as resolveColors, a as getDefaultUiConfig } from './shared/ui.S-Be5Oao.mjs';
|
|
7
7
|
import { globSync } from 'tinyglobby';
|
|
8
8
|
import { genSafeVariableName } from 'knitwork';
|
|
9
9
|
import MagicString from 'magic-string';
|
package/dist/vite.cjs
CHANGED
package/dist/vite.mjs
CHANGED
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.0.0-beta.
|
|
5
|
-
"packageManager": "pnpm@10.
|
|
4
|
+
"version": "3.0.0-beta.3",
|
|
5
|
+
"packageManager": "pnpm@10.6.1",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/nuxt/ui.git"
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
"@nuxt/kit": "^3.15.4",
|
|
87
87
|
"@nuxt/schema": "^3.15.4",
|
|
88
88
|
"@nuxtjs/color-mode": "^3.5.2",
|
|
89
|
-
"@tailwindcss/postcss": "^4.0.
|
|
90
|
-
"@tailwindcss/vite": "^4.0.
|
|
89
|
+
"@tailwindcss/postcss": "^4.0.12",
|
|
90
|
+
"@tailwindcss/vite": "^4.0.12",
|
|
91
91
|
"@tanstack/vue-table": "^8.21.2",
|
|
92
92
|
"@unhead/vue": "^1.11.20",
|
|
93
|
-
"@vueuse/core": "^12.
|
|
94
|
-
"@vueuse/integrations": "^12.
|
|
93
|
+
"@vueuse/core": "^12.8.2",
|
|
94
|
+
"@vueuse/integrations": "^12.8.2",
|
|
95
95
|
"colortranslator": "^4.1.0",
|
|
96
96
|
"consola": "^3.4.0",
|
|
97
97
|
"defu": "^6.1.4",
|
|
@@ -106,12 +106,12 @@
|
|
|
106
106
|
"knitwork": "^1.2.0",
|
|
107
107
|
"magic-string": "^0.30.17",
|
|
108
108
|
"mlly": "^1.7.4",
|
|
109
|
-
"ohash": "^
|
|
109
|
+
"ohash": "^2.0.11",
|
|
110
110
|
"pathe": "^2.0.3",
|
|
111
111
|
"reka-ui": "^2.0.2",
|
|
112
112
|
"scule": "^1.3.0",
|
|
113
113
|
"tailwind-variants": "^0.3.1",
|
|
114
|
-
"tailwindcss": "^4.0.
|
|
114
|
+
"tailwindcss": "^4.0.12",
|
|
115
115
|
"tinyglobby": "^0.2.12",
|
|
116
116
|
"unplugin": "^2.2.0",
|
|
117
117
|
"unplugin-auto-import": "^19.1.1",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"devDependencies": {
|
|
122
122
|
"@nuxt/eslint-config": "^1.1.0",
|
|
123
123
|
"@nuxt/module-builder": "^0.8.4",
|
|
124
|
-
"@nuxt/test-utils": "^3.17.
|
|
124
|
+
"@nuxt/test-utils": "^3.17.1",
|
|
125
125
|
"@release-it/conventional-changelog": "^10.0.0",
|
|
126
126
|
"@standard-schema/spec": "^1.0.0",
|
|
127
127
|
"@vue/test-utils": "^2.4.6",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"release-it": "^18.1.2",
|
|
134
134
|
"superstruct": "^2.0.2",
|
|
135
135
|
"valibot": "^0.42.1",
|
|
136
|
-
"vitest": "^3.0.
|
|
136
|
+
"vitest": "^3.0.8",
|
|
137
137
|
"vitest-environment-nuxt": "^1.0.1",
|
|
138
138
|
"vue-tsc": "^2.2.0",
|
|
139
139
|
"yup": "^1.6.1",
|