mirror of
https://github.com/hanzoai/o11y-components.git
synced 2026-10-30 14:54:15 +00:00
48 lines
1.0 KiB
TypeScript
48 lines
1.0 KiB
TypeScript
import {
|
|
Command,
|
|
CommandEmpty,
|
|
CommandGroup,
|
|
CommandInput,
|
|
CommandItem,
|
|
CommandList,
|
|
CommandShortcut,
|
|
} from '@signozhq/ui';
|
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
|
|
import { shortcutArgTypes } from './shared/command-combobox-arg-types.js';
|
|
|
|
const meta: Meta<typeof CommandShortcut> = {
|
|
title: 'Primitive Components/Command/CommandShortcut',
|
|
component: CommandShortcut,
|
|
argTypes: shortcutArgTypes,
|
|
parameters: {
|
|
layout: 'fullscreen',
|
|
},
|
|
tags: ['autodocs'],
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof CommandShortcut>;
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
children: '⌘K',
|
|
},
|
|
render: (args) => (
|
|
<div style={{ width: 520 }}>
|
|
<Command>
|
|
<CommandInput placeholder="Search commands…" />
|
|
<CommandList>
|
|
<CommandGroup heading="Keyboard">
|
|
<CommandItem onSelect={() => {}}>
|
|
Open command palette
|
|
<CommandShortcut {...args} />
|
|
</CommandItem>
|
|
</CommandGroup>
|
|
<CommandEmpty>No results.</CommandEmpty>
|
|
</CommandList>
|
|
</Command>
|
|
</div>
|
|
),
|
|
};
|