mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-21 07:21:46 +01:00
feat(useKbd): new composable (#73)
This commit is contained in:
@@ -11,11 +11,11 @@ describe('DropdownMenu', () => {
|
||||
}, {
|
||||
label: 'Edit',
|
||||
icon: 'i-heroicons-pencil-square-20-solid',
|
||||
shortcuts: ['E']
|
||||
kbds: ['E']
|
||||
}, {
|
||||
label: 'Duplicate',
|
||||
icon: 'i-heroicons-document-duplicate-20-solid',
|
||||
shortcuts: ['D'],
|
||||
kbds: ['D'],
|
||||
disabled: true,
|
||||
slot: 'custom'
|
||||
}]
|
||||
|
||||
@@ -18,9 +18,9 @@ describe('Tooltip', () => {
|
||||
// Props
|
||||
['with text', { props: { text: 'Tooltip', open: true, portal: false } }],
|
||||
['with arrow', { props: { text: 'Tooltip', arrow: true, open: true, portal: false } }],
|
||||
['with shortcuts', { props: { text: 'Tooltip', shortcuts: ['⌘', 'K'], open: true, portal: false } }],
|
||||
['with kbds', { props: { text: 'Tooltip', kbds: ['meta', 'K'], open: true, portal: false } }],
|
||||
// Slots
|
||||
['with default slot', { props: { text: 'Tooltip', shortcuts: ['⌘', 'K'], open: true, portal: false }, slots: { default: () => 'Default slot' } }],
|
||||
['with default slot', { props: { text: 'Tooltip', kbds: ['meta', 'K'], open: true, portal: false }, slots: { default: () => 'Default slot' } }],
|
||||
['with content slot', { props: { open: true, portal: false }, slots: { content: () => 'Content slot' } }]
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props?: TooltipProps, slots?: Partial<TooltipSlots> }) => {
|
||||
const html = await ComponentRender(nameOrHtml, options, TooltipWrapper)
|
||||
|
||||
Reference in New Issue
Block a user