From ba534f18b94383c97b2654d892ee4b8b024b3fab Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 8 Apr 2025 15:03:29 +0200 Subject: [PATCH] fix(CommandPalette): prevent hover background on disabled items --- src/theme/command-palette.ts | 4 +- .../CommandPalette-vue.spec.ts.snap | 292 +++++++++--------- .../__snapshots__/CommandPalette.spec.ts.snap | 292 +++++++++--------- 3 files changed, 294 insertions(+), 294 deletions(-) diff --git a/src/theme/command-palette.ts b/src/theme/command-palette.ts index 6b8ce422..c434124a 100644 --- a/src/theme/command-palette.ts +++ b/src/theme/command-palette.ts @@ -33,8 +33,8 @@ export default (options: Required) => ({ itemLeadingIcon: 'text-(--ui-text)' }, false: { - item: ['text-(--ui-text) data-highlighted:text-(--ui-text-highlighted) data-highlighted:before:bg-(--ui-bg-elevated)/50', options.theme.transitions && 'transition-colors before:transition-colors'], - itemLeadingIcon: ['text-(--ui-text-dimmed) group-data-highlighted:text-(--ui-text)', options.theme.transitions && 'transition-colors'] + item: ['text-(--ui-text) data-highlighted:not-data-disabled:text-(--ui-text-highlighted) data-highlighted:not-data-disabled:before:bg-(--ui-bg-elevated)/50', options.theme.transitions && 'transition-colors before:transition-colors'], + itemLeadingIcon: ['text-(--ui-text-dimmed) group-data-highlighted:not-group-data-disabled:text-(--ui-text)', options.theme.transitions && 'transition-colors'] } }, loading: { diff --git a/test/components/__snapshots__/CommandPalette-vue.spec.ts.snap b/test/components/__snapshots__/CommandPalette-vue.spec.ts.snap index 791b3b5d..735f4bc1 100644 --- a/test/components/__snapshots__/CommandPalette-vue.spec.ts.snap +++ b/test/components/__snapshots__/CommandPalette-vue.spec.ts.snap @@ -10,25 +10,25 @@ exports[`CommandPalette > renders with as correctly 1`] = `
-
Labels
@@ -46,25 +46,25 @@ exports[`CommandPalette > renders with class correctly 1`] = `
-
Labels
@@ -80,25 +80,25 @@ exports[`CommandPalette > renders with close correctly 1`] = `
-
Labels
@@ -114,25 +114,25 @@ exports[`CommandPalette > renders with close slot correctly 1`] = `
-
Labels
@@ -148,25 +148,25 @@ exports[`CommandPalette > renders with closeIcon correctly 1`] = `
-
Labels
@@ -184,23 +184,23 @@ exports[`CommandPalette > renders with custom slot correctly 1`] = `
+
-
Labels
@@ -218,25 +218,25 @@ exports[`CommandPalette > renders with defaultValue correctly 1`] = `
-
Labels
@@ -254,25 +254,25 @@ exports[`CommandPalette > renders with disabled correctly 1`] = `
-
Labels
@@ -290,25 +290,25 @@ exports[`CommandPalette > renders with empty slot correctly 1`] = `
-
Labels
@@ -326,25 +326,25 @@ exports[`CommandPalette > renders with groups correctly 1`] = `
-
Labels
@@ -362,25 +362,25 @@ exports[`CommandPalette > renders with icon correctly 1`] = `
-
Labels
@@ -396,15 +396,15 @@ exports[`CommandPalette > renders with item slot correctly 1`] = `
-
-
Labels
+
Labels
-
Users
Item slot +
Users
Item slot
@@ -422,25 +422,25 @@ exports[`CommandPalette > renders with item-label slot correctly 1`] = `
-
Labels
@@ -458,19 +458,19 @@ exports[`CommandPalette > renders with item-leading slot correctly 1`] = `
-
Labels
+
Labels
@@ -486,21 +486,21 @@ exports[`CommandPalette > renders with item-trailing slot correctly 1`] = `
-
-
Labels
@@ -518,28 +518,28 @@ exports[`CommandPalette > renders with labelKey correctly 1`] = `
-
@@ -559,25 +559,25 @@ exports[`CommandPalette > renders with loading correctly 1`] = `
-
Labels
@@ -595,25 +595,25 @@ exports[`CommandPalette > renders with loadingIcon correctly 1`] = `
-
Labels
@@ -631,25 +631,25 @@ exports[`CommandPalette > renders with modelValue correctly 1`] = `
-
Labels
@@ -667,25 +667,25 @@ exports[`CommandPalette > renders with placeholder correctly 1`] = `
-
Labels
@@ -703,25 +703,25 @@ exports[`CommandPalette > renders with selectedIcon correctly 1`] = `
-
Labels
@@ -739,25 +739,25 @@ exports[`CommandPalette > renders with ui correctly 1`] = `
-
Labels
diff --git a/test/components/__snapshots__/CommandPalette.spec.ts.snap b/test/components/__snapshots__/CommandPalette.spec.ts.snap index afbf4183..bf5d91a7 100644 --- a/test/components/__snapshots__/CommandPalette.spec.ts.snap +++ b/test/components/__snapshots__/CommandPalette.spec.ts.snap @@ -10,25 +10,25 @@ exports[`CommandPalette > renders with as correctly 1`] = `
-
Labels
@@ -46,25 +46,25 @@ exports[`CommandPalette > renders with class correctly 1`] = `
-
Labels
@@ -83,25 +83,25 @@ exports[`CommandPalette > renders with close correctly 1`] = `
-
Labels
@@ -117,25 +117,25 @@ exports[`CommandPalette > renders with close slot correctly 1`] = `
-
Labels
@@ -154,25 +154,25 @@ exports[`CommandPalette > renders with closeIcon correctly 1`] = `
-
Labels
@@ -190,23 +190,23 @@ exports[`CommandPalette > renders with custom slot correctly 1`] = `
+
-
Labels
@@ -224,25 +224,25 @@ exports[`CommandPalette > renders with defaultValue correctly 1`] = `
-
Labels
@@ -260,25 +260,25 @@ exports[`CommandPalette > renders with disabled correctly 1`] = `
-
Labels
@@ -296,25 +296,25 @@ exports[`CommandPalette > renders with empty slot correctly 1`] = `
-
Labels
@@ -332,25 +332,25 @@ exports[`CommandPalette > renders with groups correctly 1`] = `
-
Labels
@@ -368,25 +368,25 @@ exports[`CommandPalette > renders with icon correctly 1`] = `
-
Labels
@@ -402,15 +402,15 @@ exports[`CommandPalette > renders with item slot correctly 1`] = `
-
-
Labels
+
Labels
-
Users
Item slot +
Users
Item slot
@@ -428,25 +428,25 @@ exports[`CommandPalette > renders with item-label slot correctly 1`] = `
-
Labels
@@ -464,19 +464,19 @@ exports[`CommandPalette > renders with item-leading slot correctly 1`] = `
-
Labels
+
Labels
@@ -492,21 +492,21 @@ exports[`CommandPalette > renders with item-trailing slot correctly 1`] = `
-
-
Labels
@@ -524,28 +524,28 @@ exports[`CommandPalette > renders with labelKey correctly 1`] = `
-
@@ -565,25 +565,25 @@ exports[`CommandPalette > renders with loading correctly 1`] = `
-
Labels
@@ -601,25 +601,25 @@ exports[`CommandPalette > renders with loadingIcon correctly 1`] = `
-
Labels
@@ -637,25 +637,25 @@ exports[`CommandPalette > renders with modelValue correctly 1`] = `
-
Labels
@@ -673,25 +673,25 @@ exports[`CommandPalette > renders with placeholder correctly 1`] = `
-
Labels
@@ -709,25 +709,25 @@ exports[`CommandPalette > renders with selectedIcon correctly 1`] = `
-
Labels
@@ -745,25 +745,25 @@ exports[`CommandPalette > renders with ui correctly 1`] = `
-
Labels