import type { Meta, StoryObj } from '@storybook/react-vite' import { Kbd } from './Kbd' import { MenuItem, MenuPanel, MenuSection } from './Menu' import { Tooltip } from './Tooltip' const meta = { title: 'Primitives/Kbd', component: Kbd, args: { children: 'Cmd+K' }, argTypes: { children: { control: 'text' } }, } satisfies Meta export default meta type Story = StoryObj export const Default: Story = {} /** A single trigger character, the way a command menu names its own key. */ export const TriggerCharacter: Story = { args: { children: '/' } } /** A chord. Whoever passes it decides the platform's spelling. */ export const Chord: Story = { args: { children: 'Ctrl+Alt+1' } } /** A named key. */ export const NamedKey: Story = { args: { children: 'Esc' } } /** The four side by side. */ export const Row: Story = { parameters: { controls: { disable: true } }, render: () => (
{['/', 'Cmd+K', 'Ctrl+Alt+1', 'Esc'].map((k) => ( {k} ))}
), } /** Where it appears on its own: a menu row's `shortcut`, and a tooltip's. */ export const InContext: Story = { parameters: { controls: { disable: true } }, render: () => (
), }