Skip to content

Commit

Permalink
feat(resolver): add headlessUi resolver (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
YannicEl authored May 12, 2021
1 parent fc93f66 commit 429e40f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/resolvers/headlessUi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { ComponentResolver } from '../types'

const components = [
'Dialog',
'DialogDescription',
'DialogOverlay',
'DialogTitle',
'Disclosure',
'DisclosureButton',
'DisclosurePanel',
'FocusTrap',
'Listbox',
'ListboxButton',
'ListboxLabel',
'ListboxOption',
'ListboxOptions',
'Menu',
'MenuButton',
'MenuItem',
'MenuItems',
'Popover',
'PopoverButton',
'PopoverGroup',
'PopoverOverlay',
'PopoverPanel',
'Portal',
'PortalGroup',
'RadioGroup',
'RadioGroupDescription',
'RadioGroupLabel',
'RadioGroupOption',
'Switch',
'SwitchDescription',
'SwitchGroup',
'SwitchLabel',
'TransitionChild',
'TransitionRoot',
]

/**
* Resolver for headlessui
*
* @link https://github.com/tailwindlabs/headlessui
*/
export const HeadlessUiResolver = (): ComponentResolver => (name: string) => {
if (components.includes(name))
return { importName: name, path: '@headlessui/vue' }
}
1 change: 1 addition & 0 deletions src/resolvers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './antdv'
export * from './element-plus'
export * from './headlessUi'
export * from './vant'
export * from './vuetify'

0 comments on commit 429e40f

Please sign in to comment.