Files
headlessui/packages/@headlessui-react/src/index.test.ts
T
Robin Malfait b86737b698 Add new CloseButton component and useClose hook (#3096)
* add `useClose` hook and `CloseButton` component

* expose `useClose` hook and `CloseButton` components

* use `CloseProvider` in the `Popover` component

* use `CloseProvider` in the `Dialog` component

* use `CloseProvider` in the `Disclosure` component

* update changelog
2024-04-12 15:54:01 +02:00

99 lines
1.5 KiB
TypeScript

import * as HeadlessUI from './index'
/**
* Looks a bit of a silly test, however this ensures that we don't accidentally expose something to
* the outside world that we didn't want!
*/
it('should expose the correct components', () => {
expect(Object.keys(HeadlessUI).sort((a, z) => a.localeCompare(z))).toEqual([
'Button',
'Checkbox',
'CloseButton',
'Combobox',
'ComboboxButton',
'ComboboxInput',
'ComboboxLabel',
'ComboboxOption',
'ComboboxOptions',
'DataInteractive',
'Description',
'Dialog',
'DialogBackdrop',
'DialogDescription',
'DialogOverlay',
'DialogPanel',
'DialogTitle',
'Disclosure',
'DisclosureButton',
'DisclosurePanel',
'Field',
'Fieldset',
'FocusTrap',
'FocusTrapFeatures',
'Input',
'Label',
'Legend',
'Listbox',
'ListboxButton',
'ListboxLabel',
'ListboxOption',
'ListboxOptions',
'ListboxSelectedOption',
'Menu',
'MenuButton',
'MenuHeading',
'MenuItem',
'MenuItems',
'MenuSection',
'MenuSeparator',
'Popover',
'PopoverButton',
'PopoverGroup',
'PopoverOverlay',
'PopoverPanel',
'Portal',
'Radio',
'RadioGroup',
'RadioGroupDescription',
'RadioGroupLabel',
'RadioGroupOption',
'Select',
'Switch',
'SwitchDescription',
'SwitchGroup',
'SwitchLabel',
'Tab',
'TabGroup',
'TabList',
'TabPanel',
'TabPanels',
'Textarea',
'Transition',
'TransitionChild',
'useClose',
])
})