mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
Merge remote-tracking branch 'origin/v3' into feat/custom-slots
This commit is contained in:
@@ -11,10 +11,10 @@
|
||||
"dependencies": {
|
||||
"@ai-sdk/vue": "^1.2.12",
|
||||
"@iconify-json/logos": "^1.2.4",
|
||||
"@iconify-json/lucide": "^1.2.54",
|
||||
"@iconify-json/simple-icons": "^1.2.41",
|
||||
"@iconify-json/lucide": "^1.2.56",
|
||||
"@iconify-json/simple-icons": "^1.2.42",
|
||||
"@iconify-json/vscode-icons": "^1.2.23",
|
||||
"@nuxt/content": "^3.6.2",
|
||||
"@nuxt/content": "^3.6.3",
|
||||
"@nuxt/image": "^1.10.0",
|
||||
"@nuxt/ui": "workspace:*",
|
||||
"@nuxt/ui-pro": "https://pkg.pr.new/@nuxt/ui-pro@22fdc5e",
|
||||
@@ -29,22 +29,22 @@
|
||||
"capture-website": "^4.2.0",
|
||||
"joi": "^17.13.3",
|
||||
"maska": "^3.2.0",
|
||||
"motion-v": "^1.4.0",
|
||||
"motion-v": "^1.5.0",
|
||||
"nuxt": "^3.17.6",
|
||||
"nuxt-component-meta": "^0.12.1",
|
||||
"nuxt-llms": "^0.1.3",
|
||||
"nuxt-og-image": "^5.1.8",
|
||||
"nuxt-og-image": "^5.1.9",
|
||||
"prettier": "^3.6.2",
|
||||
"shiki-transformer-color-highlight": "^1.0.0",
|
||||
"sortablejs": "^1.15.6",
|
||||
"superstruct": "^2.0.2",
|
||||
"ufo": "^1.6.1",
|
||||
"valibot": "^1.1.0",
|
||||
"workers-ai-provider": "^0.7.0",
|
||||
"workers-ai-provider": "^0.7.1",
|
||||
"yup": "^1.6.1",
|
||||
"zod": "^3.25.67"
|
||||
"zod": "^3.25.75"
|
||||
},
|
||||
"devDependencies": {
|
||||
"wrangler": "^4.22.0"
|
||||
"wrangler": "^4.23.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
"@tailwindcss/postcss": "^4.1.11",
|
||||
"@tailwindcss/vite": "^4.1.11",
|
||||
"@tanstack/vue-table": "^8.21.3",
|
||||
"@unhead/vue": "^2.0.11",
|
||||
"@unhead/vue": "^2.0.12",
|
||||
"@vueuse/core": "^13.5.0",
|
||||
"@vueuse/integrations": "^13.5.0",
|
||||
"colortranslator": "^5.0.0",
|
||||
@@ -152,10 +152,10 @@
|
||||
"unplugin-auto-import": "^19.3.0",
|
||||
"unplugin-vue-components": "^28.8.0",
|
||||
"vaul-vue": "0.4.1",
|
||||
"vue-component-type-helpers": "^3.0.0"
|
||||
"vue-component-type-helpers": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nuxt/eslint-config": "^1.5.0",
|
||||
"@nuxt/eslint-config": "^1.5.2",
|
||||
"@nuxt/module-builder": "^1.0.1",
|
||||
"@nuxt/test-utils": "^3.19.2",
|
||||
"@release-it/conventional-changelog": "^10.0.1",
|
||||
@@ -167,7 +167,7 @@
|
||||
"release-it": "^19.0.3",
|
||||
"vitest": "^3.2.4",
|
||||
"vitest-environment-nuxt": "^1.0.1",
|
||||
"vue-tsc": "^3.0.0"
|
||||
"vue-tsc": "^3.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@inertiajs/vue3": "^2.0.7",
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
"@nuxt/ui": "workspace:*",
|
||||
"vue": "^3.5.17",
|
||||
"vue-router": "^4.5.1",
|
||||
"zod": "^3.25.67"
|
||||
"zod": "^3.25.75"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^5.2.4",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^6.3.5",
|
||||
"vue-tsc": "^3.0.0"
|
||||
"vue-tsc": "^3.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ const groups = computed(() => [{
|
||||
label: 'Set Wallpaper',
|
||||
suffix: 'Choose from beautiful wallpaper collection.',
|
||||
icon: 'i-lucide-image',
|
||||
interface: 'wallpaper',
|
||||
view: 'wallpaper',
|
||||
placeholder: 'Search wallpapers...'
|
||||
}, {
|
||||
label: 'More actions',
|
||||
@@ -279,8 +279,8 @@ defineShortcuts({
|
||||
class="sm:max-h-80"
|
||||
@update:model-value="onSelect"
|
||||
>
|
||||
<template #interface="{ interfaceName }">
|
||||
<div v-if="interfaceName === 'wallpaper'" class="flex flex-col h-full w-full">
|
||||
<template #view="{ viewName }">
|
||||
<div v-if="viewName === 'wallpaper'" class="flex flex-col h-full w-full">
|
||||
<div class="flex-1 overflow-y-auto p-6">
|
||||
<div class="grid grid-cols-4 gap-4">
|
||||
<div
|
||||
|
||||
@@ -9,17 +9,17 @@
|
||||
"typecheck": "nuxt typecheck"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify-json/lucide": "^1.2.54",
|
||||
"@iconify-json/simple-icons": "^1.2.41",
|
||||
"@iconify-json/lucide": "^1.2.56",
|
||||
"@iconify-json/simple-icons": "^1.2.42",
|
||||
"@internationalized/date": "^3.8.2",
|
||||
"@nuxt/ui": "workspace:*",
|
||||
"@nuxthub/core": "^0.9.0",
|
||||
"nuxt": "^3.17.6",
|
||||
"zod": "^3.25.67"
|
||||
"zod": "^3.25.75"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.8.3",
|
||||
"vue-tsc": "^3.0.0"
|
||||
"vue-tsc": "^3.0.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"unimport": "4.1.1"
|
||||
|
||||
728
pnpm-lock.yaml
generated
728
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -32,10 +32,10 @@ export interface CommandPaletteItem extends Omit<LinkProps, 'type' | 'raw' | 'cu
|
||||
placeholder?: string
|
||||
children?: CommandPaletteItem[]
|
||||
/**
|
||||
* Custom interface slot to display instead of children items.
|
||||
* When defined, clicking this item will show the custom interface.
|
||||
* Custom view to display instead of children items.
|
||||
* When defined, clicking this item will show the custom view.
|
||||
*/
|
||||
interface?: string
|
||||
view?: string
|
||||
onSelect?(e?: Event): void
|
||||
class?: any
|
||||
ui?: Pick<CommandPalette['slots'], 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChipSize' | 'itemLeadingChip' | 'itemLabel' | 'itemLabelPrefix' | 'itemLabelBase' | 'itemLabelSuffix' | 'itemTrailing' | 'itemTrailingKbds' | 'itemTrailingKbdsSize' | 'itemTrailingHighlightedIcon' | 'itemTrailingIcon'>
|
||||
@@ -154,7 +154,7 @@ export type CommandPaletteSlots<G extends CommandPaletteGroup<T> = CommandPalett
|
||||
'empty'(props: { searchTerm?: string }): any
|
||||
'back'(props: { ui: { [K in keyof Required<CommandPalette['slots']>]: (props?: Record<string, any>) => string } }): any
|
||||
'close'(props: { ui: { [K in keyof Required<CommandPalette['slots']>]: (props?: Record<string, any>) => string } }): any
|
||||
'interface'(props: { interfaceName?: string, current: any, searchTerm: string, navigateBack: () => void }): any
|
||||
'view'(props: { viewName?: string, current: any, searchTerm: string, navigateBack: () => void }): any
|
||||
'item': SlotProps<T>
|
||||
'item-leading': SlotProps<T>
|
||||
'item-label': SlotProps<T>
|
||||
@@ -214,15 +214,15 @@ const fuse = computed(() => defu({}, props.fuse, {
|
||||
matchAllWhenSearchEmpty: true
|
||||
}))
|
||||
|
||||
const history = ref<(CommandPaletteGroup & { placeholder?: string, interface?: string })[]>([])
|
||||
const history = ref<(CommandPaletteGroup & { placeholder?: string, view?: string })[]>([])
|
||||
|
||||
const placeholder = computed(() => history.value[history.value.length - 1]?.placeholder || props.placeholder || t('commandPalette.placeholder'))
|
||||
|
||||
const groups = computed(() => history.value?.length ? [history.value[history.value.length - 1] as G] : props.groups)
|
||||
|
||||
const _currentInterface = computed(() => {
|
||||
const currentView = computed(() => {
|
||||
const current = history.value[history.value.length - 1]
|
||||
return current?.interface ? current : null
|
||||
return current?.view ? current : null
|
||||
})
|
||||
|
||||
const items = computed(() => groups.value?.filter((group) => {
|
||||
@@ -291,7 +291,7 @@ const filteredGroups = computed(() => {
|
||||
const listboxRootRef = useTemplateRef('listboxRootRef')
|
||||
|
||||
function navigate(item: T) {
|
||||
if (!item.children?.length && !item.interface) {
|
||||
if (!item.children?.length && !item.view) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ function navigate(item: T) {
|
||||
label: item.label,
|
||||
slot: item.slot,
|
||||
placeholder: item.placeholder,
|
||||
interface: item.interface,
|
||||
view: item.view,
|
||||
items: item.children || []
|
||||
} as any)
|
||||
|
||||
@@ -328,7 +328,7 @@ function onBackspace() {
|
||||
}
|
||||
|
||||
function onSelect(e: Event, item: T) {
|
||||
if (item.children?.length || item.interface) {
|
||||
if (item.children?.length || item.view) {
|
||||
e.preventDefault()
|
||||
|
||||
navigate(item)
|
||||
@@ -383,11 +383,11 @@ function onSelect(e: Event, item: T) {
|
||||
</ListboxFilter>
|
||||
|
||||
<ListboxContent :class="ui.content({ class: props.ui?.content })">
|
||||
<div v-if="_currentInterface" :class="ui.viewport({ class: props.ui?.viewport })">
|
||||
<div v-if="currentView" :class="ui.viewport({ class: props.ui?.viewport })">
|
||||
<slot
|
||||
name="interface"
|
||||
:interface-name="_currentInterface.interface"
|
||||
:current="_currentInterface"
|
||||
name="view"
|
||||
:view-name="currentView.view"
|
||||
:current="currentView"
|
||||
:search-term="searchTerm"
|
||||
:navigate-back="navigateBack"
|
||||
/>
|
||||
@@ -437,7 +437,7 @@ function onSelect(e: Event, item: T) {
|
||||
<span :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, item.ui?.itemTrailing] })">
|
||||
<slot :name="((item.slot ? `${item.slot}-trailing` : group.slot ? `${group.slot}-trailing` : `item-trailing`) as keyof CommandPaletteSlots<G, T>)" :item="(item as any)" :index="index">
|
||||
<UIcon
|
||||
v-if="(item.children && item.children.length > 0) || item.interface"
|
||||
v-if="(item.children && item.children.length > 0) || item.view"
|
||||
:name="trailingIcon || appConfig.ui.icons.chevronRight"
|
||||
:class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, item.ui?.itemTrailingIcon] })"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user