diff --git a/package.json b/package.json index 1f00214..32cca0d 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,8 @@ { "name": "svelte-headlessui", + "exports": { + ".": "./src/lib/index.ts" + }, "version": "0.0.1", "scripts": { "dev": "svelte-kit dev", diff --git a/src/lib/components/dialog/index.ts b/src/lib/components/dialog/index.ts new file mode 100644 index 0000000..1495359 --- /dev/null +++ b/src/lib/components/dialog/index.ts @@ -0,0 +1,5 @@ +export { default as Dialog } from "./Dialog.svelte"; +export { default as DialogTitle } from "./DialogTitle.svelte"; +export { default as DialogOverlay } from "./DialogOverlay.svelte"; +export { default as DialogDescription } from "./../description/Description.svelte"; + diff --git a/src/lib/components/disclosure/index.ts b/src/lib/components/disclosure/index.ts new file mode 100644 index 0000000..bca59cb --- /dev/null +++ b/src/lib/components/disclosure/index.ts @@ -0,0 +1,3 @@ +export { default as Disclosure } from "./Disclosure.svelte"; +export { default as DisclosureButton } from "./DisclosureButton.svelte"; +export { default as DisclosurePanel } from "./DisclosurePanel.svelte"; diff --git a/src/lib/components/listbox/index.ts b/src/lib/components/listbox/index.ts new file mode 100644 index 0000000..c96136f --- /dev/null +++ b/src/lib/components/listbox/index.ts @@ -0,0 +1,5 @@ +export { default as Listbox } from "./Listbox.svelte"; +export { default as ListboxButton } from "./ListboxButton.svelte"; +export { default as ListboxLabel } from "./ListboxLabel.svelte"; +export { default as ListboxOptions } from "./ListboxOptions.svelte"; +export { default as ListboxOption } from "./ListboxOption.svelte"; diff --git a/src/lib/components/menu/index.ts b/src/lib/components/menu/index.ts new file mode 100644 index 0000000..151c70c --- /dev/null +++ b/src/lib/components/menu/index.ts @@ -0,0 +1,4 @@ +export { default as Menu } from "./Menu.svelte"; +export { default as MenuButton } from "./MenuButton.svelte"; +export { default as MenuItems } from "./MenuItems.svelte"; +export { default as MenuItem } from "./MenuItem.svelte"; diff --git a/src/lib/components/popover/index.ts b/src/lib/components/popover/index.ts new file mode 100644 index 0000000..a1f3237 --- /dev/null +++ b/src/lib/components/popover/index.ts @@ -0,0 +1,5 @@ +export { default as Popover } from "./Popover.svelte"; +export { default as PopoverOverlay } from "./PopoverOverlay.svelte"; +export { default as PopoverButton } from "./PopoverButton.svelte"; +export { default as PopoverPanel } from "./PopoverPanel.svelte"; +export { default as PopoverGroup } from "./PopoverGroup.svelte"; diff --git a/src/lib/components/radio-group/index.ts b/src/lib/components/radio-group/index.ts new file mode 100644 index 0000000..f6ee723 --- /dev/null +++ b/src/lib/components/radio-group/index.ts @@ -0,0 +1,5 @@ +export { default as RadioGroup } from "./RadioGroup.svelte"; +export { default as RadioGroupOption } from "./RadioGroupOption.svelte"; +export { default as RadioGroupLabel } from "../label/Label.svelte"; +export { default as RadioGroupDescription } from "../description/Description.svelte"; + diff --git a/src/lib/components/switch/index.ts b/src/lib/components/switch/index.ts new file mode 100644 index 0000000..19bdb6b --- /dev/null +++ b/src/lib/components/switch/index.ts @@ -0,0 +1,4 @@ +export { default as Switch } from "./Switch.svelte"; +export { default as SwitchGroup } from "./SwitchGroup.svelte"; +export { default as SwitchGroupLabel } from "../label/Label.svelte"; +export { default as SwitchGroupDescription } from "../description/Description.svelte"; diff --git a/src/lib/components/tabs/index.ts b/src/lib/components/tabs/index.ts new file mode 100644 index 0000000..e31913c --- /dev/null +++ b/src/lib/components/tabs/index.ts @@ -0,0 +1,5 @@ +export { default as Tab } from "./Tab.svelte"; +export { default as TabGroup } from "./TabGroup.svelte"; +export { default as TabList } from "./TabList.svelte"; +export { default as TabPanels } from "./TabPanels.svelte"; +export { default as TabPanel } from "./TabPanel.svelte"; diff --git a/src/lib/components/transitions/index.ts b/src/lib/components/transitions/index.ts new file mode 100644 index 0000000..62109dc --- /dev/null +++ b/src/lib/components/transitions/index.ts @@ -0,0 +1,2 @@ +export { default as TransitionChild } from "./TransitionChildWrapper.svelte"; +export { default as Transition } from "./TransitionRoot.svelte"; diff --git a/src/lib/index.ts b/src/lib/index.ts new file mode 100644 index 0000000..9833079 --- /dev/null +++ b/src/lib/index.ts @@ -0,0 +1,9 @@ +export * from "./components/dialog"; +export * from "./components/disclosure"; +export * from "./components/listbox"; +export * from "./components/menu"; +export * from "./components/popover"; +export * from "./components/radio-group"; +export * from "./components/switch"; +export * from "./components/tabs"; +export * from "./components/transitions"; diff --git a/svelte.config.js b/svelte.config.js index 0cafdd5..0fd8bf9 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -13,6 +13,11 @@ const config = { kit: { adapter: adapter(), + package: { + exports: (filepath) => { + return filepath.endsWith("src/lib/index.ts"); + } + }, // hydrate the