Skip to content

Commit 6178edb

Browse files
committed
fix: fix command-separator type error
1 parent 3321511 commit 6178edb

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

packages/ui/src/components/command/CommandSeparator.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const CommandSeparator = (props: CommandSeparatorProps) => {
1111
const { separator } = commandVariants({ size });
1212

1313
const mergedClass = cn(separator(), className);
14+
1415
return (
1516
<_CommandSeparator
1617
{...rest}

packages/ui/src/components/command/types.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
import type { Command, CommandEmpty, CommandInput, CommandItem, CommandList, CommandRoot } from 'cmdk';
1+
import type {
2+
Command,
3+
CommandEmpty,
4+
CommandInput,
5+
CommandItem,
6+
CommandList,
7+
CommandRoot,
8+
CommandSeparator
9+
} from 'cmdk';
210
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
311

412
import type { BaseComponentProps, BaseNodeProps, ClassValue, PropsSlot, ThemeSize } from '@/types/other';
@@ -27,7 +35,7 @@ export type CommandListProps = BaseNodeProps<ComponentPropsWithoutRef<typeof Com
2735

2836
export type CommandRootProps = BaseNodeProps<ComponentPropsWithoutRef<typeof CommandRoot>>;
2937

30-
export type CommandSeparatorProps = BaseComponentProps<'div'>;
38+
export type CommandSeparatorProps = BaseNodeProps<ComponentPropsWithoutRef<typeof CommandSeparator>>;
3139

3240
export type CommandShortcutProps = BaseComponentProps<'div'> & {
3341
value?: string | string[];
@@ -61,7 +69,6 @@ export interface CommandProps extends CommandRootProps {
6169
empty?: ReactNode;
6270
inputProps?: CommandInputProps;
6371
items: CommandOptionData[];
64-
searchTerm?: string;
6572
}
6673

6774
export interface CommandDialogProps

playground/src/app/(demo)/command/modules/shared.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const items: CommandProps['items'] = [
4646
],
4747
label: 'Settings'
4848
},
49-
{ type: 'separator' },
49+
{ alwaysRender: true, type: 'separator' },
5050
{
5151
label: 'Help',
5252
leading: <HelpCircle />,

0 commit comments

Comments
 (0)