From d227a105d8d409ea0753153afaecf639ddb80fed Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Mon, 7 Apr 2025 18:53:30 +0200 Subject: [PATCH] fix(CommandPalette): increase input font size to avoid zoom --- .../popover/PopoverCommandPaletteExample.vue | 2 +- .../app/pages/components/command-palette.vue | 2 +- src/theme/command-palette.ts | 2 +- .../CommandPalette-vue.spec.ts.snap | 46 +++++++++---------- .../__snapshots__/CommandPalette.spec.ts.snap | 46 +++++++++---------- 5 files changed, 49 insertions(+), 49 deletions(-) diff --git a/docs/app/components/content/examples/popover/PopoverCommandPaletteExample.vue b/docs/app/components/content/examples/popover/PopoverCommandPaletteExample.vue index a9a7ccce..62dc71fc 100644 --- a/docs/app/components/content/examples/popover/PopoverCommandPaletteExample.vue +++ b/docs/app/components/content/examples/popover/PopoverCommandPaletteExample.vue @@ -40,7 +40,7 @@ const label = ref([]) multiple placeholder="Search labels..." :groups="[{ id: 'labels', items }]" - :ui="{ input: '[&>input]:h-8' }" + :ui="{ input: '[&>input]:h-8 [&>input]:text-sm' }" /> diff --git a/playground/app/pages/components/command-palette.vue b/playground/app/pages/components/command-palette.vue index 391d118e..b4d7f9e9 100644 --- a/playground/app/pages/components/command-palette.vue +++ b/playground/app/pages/components/command-palette.vue @@ -146,7 +146,7 @@ defineShortcuts({ diff --git a/src/theme/command-palette.ts b/src/theme/command-palette.ts index 44152e66..6b8ce422 100644 --- a/src/theme/command-palette.ts +++ b/src/theme/command-palette.ts @@ -3,7 +3,7 @@ import type { ModuleOptions } from '../module' export default (options: Required) => ({ slots: { root: 'flex flex-col min-h-0 min-w-0 divide-y divide-(--ui-border)', - input: '[&>input]:h-12', + input: '[&>input]:h-12 [&>input]:text-base/5', close: '', content: 'relative overflow-hidden flex flex-col', viewport: 'relative divide-y divide-(--ui-border) scroll-py-1 overflow-y-auto flex-1 focus:outline-none', diff --git a/test/components/__snapshots__/CommandPalette-vue.spec.ts.snap b/test/components/__snapshots__/CommandPalette-vue.spec.ts.snap index df65e173..791b3b5d 100644 --- a/test/components/__snapshots__/CommandPalette-vue.spec.ts.snap +++ b/test/components/__snapshots__/CommandPalette-vue.spec.ts.snap @@ -2,7 +2,7 @@ exports[`CommandPalette > renders with as correctly 1`] = ` "
-
+
@@ -38,7 +38,7 @@ exports[`CommandPalette > renders with as correctly 1`] = ` exports[`CommandPalette > renders with class correctly 1`] = ` "
-
+
@@ -74,7 +74,7 @@ exports[`CommandPalette > renders with class correctly 1`] = ` exports[`CommandPalette > renders with close correctly 1`] = ` "
-
+
@@ -108,7 +108,7 @@ exports[`CommandPalette > renders with close correctly 1`] = ` exports[`CommandPalette > renders with close slot correctly 1`] = ` "
-
Close slot
+
Close slot
@@ -142,7 +142,7 @@ exports[`CommandPalette > renders with close slot correctly 1`] = ` exports[`CommandPalette > renders with closeIcon correctly 1`] = ` "
-
+
@@ -176,7 +176,7 @@ exports[`CommandPalette > renders with closeIcon correctly 1`] = ` exports[`CommandPalette > renders with custom slot correctly 1`] = ` "
-
+
@@ -210,7 +210,7 @@ exports[`CommandPalette > renders with custom slot correctly 1`] = ` exports[`CommandPalette > renders with defaultValue correctly 1`] = ` "
-
+
@@ -246,7 +246,7 @@ exports[`CommandPalette > renders with defaultValue correctly 1`] = ` exports[`CommandPalette > renders with disabled correctly 1`] = ` "
-
+
@@ -282,7 +282,7 @@ exports[`CommandPalette > renders with disabled correctly 1`] = ` exports[`CommandPalette > renders with empty slot correctly 1`] = ` "
-
+
@@ -318,7 +318,7 @@ exports[`CommandPalette > renders with empty slot correctly 1`] = ` exports[`CommandPalette > renders with groups correctly 1`] = ` "
-
+
@@ -354,7 +354,7 @@ exports[`CommandPalette > renders with groups correctly 1`] = ` exports[`CommandPalette > renders with icon correctly 1`] = ` "
-
+
@@ -390,7 +390,7 @@ exports[`CommandPalette > renders with icon correctly 1`] = ` exports[`CommandPalette > renders with item slot correctly 1`] = ` "
-
+
@@ -414,7 +414,7 @@ exports[`CommandPalette > renders with item slot correctly 1`] = ` exports[`CommandPalette > renders with item-label slot correctly 1`] = ` "
-
+
@@ -450,7 +450,7 @@ exports[`CommandPalette > renders with item-label slot correctly 1`] = ` exports[`CommandPalette > renders with item-leading slot correctly 1`] = ` "
-
+
@@ -480,7 +480,7 @@ exports[`CommandPalette > renders with item-leading slot correctly 1`] = ` exports[`CommandPalette > renders with item-trailing slot correctly 1`] = ` "
-
+
@@ -510,7 +510,7 @@ exports[`CommandPalette > renders with item-trailing slot correctly 1`] = ` exports[`CommandPalette > renders with labelKey correctly 1`] = ` "
-
+
@@ -551,7 +551,7 @@ exports[`CommandPalette > renders with labelKey correctly 1`] = ` exports[`CommandPalette > renders with loading correctly 1`] = ` "
-
+
@@ -587,7 +587,7 @@ exports[`CommandPalette > renders with loading correctly 1`] = ` exports[`CommandPalette > renders with loadingIcon correctly 1`] = ` "
-
+
@@ -623,7 +623,7 @@ exports[`CommandPalette > renders with loadingIcon correctly 1`] = ` exports[`CommandPalette > renders with modelValue correctly 1`] = ` "
-
+
@@ -659,7 +659,7 @@ exports[`CommandPalette > renders with modelValue correctly 1`] = ` exports[`CommandPalette > renders with placeholder correctly 1`] = ` "
-
+
@@ -695,7 +695,7 @@ exports[`CommandPalette > renders with placeholder correctly 1`] = ` exports[`CommandPalette > renders with selectedIcon correctly 1`] = ` "
-
+
@@ -731,7 +731,7 @@ exports[`CommandPalette > renders with selectedIcon correctly 1`] = ` exports[`CommandPalette > renders with ui correctly 1`] = ` "
-
+
@@ -767,7 +767,7 @@ exports[`CommandPalette > renders with ui correctly 1`] = ` exports[`CommandPalette > renders without data correctly 1`] = ` "
-
+
diff --git a/test/components/__snapshots__/CommandPalette.spec.ts.snap b/test/components/__snapshots__/CommandPalette.spec.ts.snap index 35de6264..afbf4183 100644 --- a/test/components/__snapshots__/CommandPalette.spec.ts.snap +++ b/test/components/__snapshots__/CommandPalette.spec.ts.snap @@ -2,7 +2,7 @@ exports[`CommandPalette > renders with as correctly 1`] = ` "
-
+
@@ -38,7 +38,7 @@ exports[`CommandPalette > renders with as correctly 1`] = ` exports[`CommandPalette > renders with class correctly 1`] = ` "
-
+
@@ -74,7 +74,7 @@ exports[`CommandPalette > renders with class correctly 1`] = ` exports[`CommandPalette > renders with close correctly 1`] = ` "
-
@@ -111,7 +111,7 @@ exports[`CommandPalette > renders with close correctly 1`] = ` exports[`CommandPalette > renders with close slot correctly 1`] = ` "
-
Close slot
+
Close slot
@@ -145,7 +145,7 @@ exports[`CommandPalette > renders with close slot correctly 1`] = ` exports[`CommandPalette > renders with closeIcon correctly 1`] = ` "
-
@@ -182,7 +182,7 @@ exports[`CommandPalette > renders with closeIcon correctly 1`] = ` exports[`CommandPalette > renders with custom slot correctly 1`] = ` "
-
+
@@ -216,7 +216,7 @@ exports[`CommandPalette > renders with custom slot correctly 1`] = ` exports[`CommandPalette > renders with defaultValue correctly 1`] = ` "
-
+
@@ -252,7 +252,7 @@ exports[`CommandPalette > renders with defaultValue correctly 1`] = ` exports[`CommandPalette > renders with disabled correctly 1`] = ` "
-
+
@@ -288,7 +288,7 @@ exports[`CommandPalette > renders with disabled correctly 1`] = ` exports[`CommandPalette > renders with empty slot correctly 1`] = ` "
-
+
@@ -324,7 +324,7 @@ exports[`CommandPalette > renders with empty slot correctly 1`] = ` exports[`CommandPalette > renders with groups correctly 1`] = ` "
-
+
@@ -360,7 +360,7 @@ exports[`CommandPalette > renders with groups correctly 1`] = ` exports[`CommandPalette > renders with icon correctly 1`] = ` "
-
+
@@ -396,7 +396,7 @@ exports[`CommandPalette > renders with icon correctly 1`] = ` exports[`CommandPalette > renders with item slot correctly 1`] = ` "
-
+
@@ -420,7 +420,7 @@ exports[`CommandPalette > renders with item slot correctly 1`] = ` exports[`CommandPalette > renders with item-label slot correctly 1`] = ` "
-
+
@@ -456,7 +456,7 @@ exports[`CommandPalette > renders with item-label slot correctly 1`] = ` exports[`CommandPalette > renders with item-leading slot correctly 1`] = ` "
-
+
@@ -486,7 +486,7 @@ exports[`CommandPalette > renders with item-leading slot correctly 1`] = ` exports[`CommandPalette > renders with item-trailing slot correctly 1`] = ` "
-
+
@@ -516,7 +516,7 @@ exports[`CommandPalette > renders with item-trailing slot correctly 1`] = ` exports[`CommandPalette > renders with labelKey correctly 1`] = ` "
-
+
@@ -557,7 +557,7 @@ exports[`CommandPalette > renders with labelKey correctly 1`] = ` exports[`CommandPalette > renders with loading correctly 1`] = ` "
-
+
@@ -593,7 +593,7 @@ exports[`CommandPalette > renders with loading correctly 1`] = ` exports[`CommandPalette > renders with loadingIcon correctly 1`] = ` "
-
+
@@ -629,7 +629,7 @@ exports[`CommandPalette > renders with loadingIcon correctly 1`] = ` exports[`CommandPalette > renders with modelValue correctly 1`] = ` "
-
+
@@ -665,7 +665,7 @@ exports[`CommandPalette > renders with modelValue correctly 1`] = ` exports[`CommandPalette > renders with placeholder correctly 1`] = ` "
-
+
@@ -701,7 +701,7 @@ exports[`CommandPalette > renders with placeholder correctly 1`] = ` exports[`CommandPalette > renders with selectedIcon correctly 1`] = ` "
-
+
@@ -737,7 +737,7 @@ exports[`CommandPalette > renders with selectedIcon correctly 1`] = ` exports[`CommandPalette > renders with ui correctly 1`] = ` "
-
+
@@ -773,7 +773,7 @@ exports[`CommandPalette > renders with ui correctly 1`] = ` exports[`CommandPalette > renders without data correctly 1`] = ` "
-
+