Skip to content

Commit 429e40f

Browse files
authored
feat(resolver): add headlessUi resolver (#43)
1 parent fc93f66 commit 429e40f

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

src/resolvers/headlessUi.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { ComponentResolver } from '../types'
2+
3+
const components = [
4+
'Dialog',
5+
'DialogDescription',
6+
'DialogOverlay',
7+
'DialogTitle',
8+
'Disclosure',
9+
'DisclosureButton',
10+
'DisclosurePanel',
11+
'FocusTrap',
12+
'Listbox',
13+
'ListboxButton',
14+
'ListboxLabel',
15+
'ListboxOption',
16+
'ListboxOptions',
17+
'Menu',
18+
'MenuButton',
19+
'MenuItem',
20+
'MenuItems',
21+
'Popover',
22+
'PopoverButton',
23+
'PopoverGroup',
24+
'PopoverOverlay',
25+
'PopoverPanel',
26+
'Portal',
27+
'PortalGroup',
28+
'RadioGroup',
29+
'RadioGroupDescription',
30+
'RadioGroupLabel',
31+
'RadioGroupOption',
32+
'Switch',
33+
'SwitchDescription',
34+
'SwitchGroup',
35+
'SwitchLabel',
36+
'TransitionChild',
37+
'TransitionRoot',
38+
]
39+
40+
/**
41+
* Resolver for headlessui
42+
*
43+
* @link https://github.com/tailwindlabs/headlessui
44+
*/
45+
export const HeadlessUiResolver = (): ComponentResolver => (name: string) => {
46+
if (components.includes(name))
47+
return { importName: name, path: '@headlessui/vue' }
48+
}

src/resolvers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './antdv'
22
export * from './element-plus'
3+
export * from './headlessUi'
34
export * from './vant'
45
export * from './vuetify'

0 commit comments

Comments
 (0)