From fe60ae170855037dca665d175218b4ea5f30dce2 Mon Sep 17 00:00:00 2001 From: Not-Jayden Date: Sun, 19 Nov 2023 02:06:58 +0800 Subject: [PATCH] fix: Move `Command` additional props to be declared directly in `CommandProps` type (#31) * fix: include additional CommandProps in types file --- .changeset/bright-kangaroos-explode.md | 5 +++++ src/lib/cmdk/components/Command.svelte | 5 +---- src/lib/cmdk/types.ts | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .changeset/bright-kangaroos-explode.md diff --git a/.changeset/bright-kangaroos-explode.md b/.changeset/bright-kangaroos-explode.md new file mode 100644 index 0000000..0454cb4 --- /dev/null +++ b/.changeset/bright-kangaroos-explode.md @@ -0,0 +1,5 @@ +--- +'cmdk-sv': patch +--- + +fix: move Command additional props to types file diff --git a/src/lib/cmdk/components/Command.svelte b/src/lib/cmdk/components/Command.svelte index 3c9449f..a650367 100644 --- a/src/lib/cmdk/components/Command.svelte +++ b/src/lib/cmdk/components/Command.svelte @@ -8,10 +8,7 @@ import { createCommand } from '../command.js'; import type { CommandProps } from '../types.js'; - type $$Props = CommandProps & { - onKeydown?: (e: KeyboardEvent) => void; - asChild?: boolean; - }; + type $$Props = CommandProps; export let label: $$Props['label'] = undefined; export let shouldFilter: $$Props['shouldFilter'] = true; diff --git a/src/lib/cmdk/types.ts b/src/lib/cmdk/types.ts index ea5225e..f99f920 100644 --- a/src/lib/cmdk/types.ts +++ b/src/lib/cmdk/types.ts @@ -102,7 +102,10 @@ export type CommandProps = Expand< ids?: Partial; } > & - HTMLDivAttributes; + HTMLDivAttributes & { + onKeydown?: (e: KeyboardEvent) => void; + asChild?: boolean; + }; export type ListProps = { /**