diff --git a/lib/providers/theme/theme.ts b/lib/component/theme/index.ts similarity index 98% rename from lib/providers/theme/theme.ts rename to lib/component/theme/index.ts index d45edaf..c00eecf 100644 --- a/lib/providers/theme/theme.ts +++ b/lib/component/theme/index.ts @@ -1,2 +1 @@ export { default as ThemeProvider, useTheme } from "$/providers/theme/ThemeProvider"; - diff --git a/lib/index.ts b/lib/index.ts index 9c16d5b..322bf1e 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -6,6 +6,6 @@ export * from "$/component/modal"; export * from "$/component/nav"; export * from "$/component/progress"; export * from "$/component/tab"; +export * from "$/component/theme"; export * from "$/component/toaster"; -export * from "$/providers/theme/theme"; diff --git a/package.json b/package.json index 300a74a..4623dde 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,6 @@ "type": "git", "url": "git+https://git.mattrixwv.com/BaseLibraries/MattrixwvReactComponents.git" }, - "main": "./dist/mattrixwv-components.cjs", "module": "./dist/mattrixwv-components.js", "types": "./dist/mattrixwv-components.d.ts", "exports": { @@ -109,6 +108,10 @@ "types": "./dist/tab.d.ts", "import": "./dist/tab.js" }, + "./theme": { + "types": "./dist/theme.d.ts", + "import": "./dist/theme.js" + }, "./toaster": { "types": "./dist/toaster.d.ts", "import": "./dist/toaster.js" diff --git a/vite.config.ts b/vite.config.ts index e7eaf23..6ace18b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -10,7 +10,7 @@ import { viteStaticCopy } from "vite-plugin-static-copy"; import { peerDependencies } from "./package.json"; -const modules = [ "button", "input", "loading", "message", "modal", "nav", "progress", "tab", "toaster" ]; +const modules = [ "button", "input", "loading", "message", "modal", "nav", "progress", "tab", "theme", "toaster" ]; // https://vite.dev/config/ @@ -51,7 +51,7 @@ export default defineConfig({ build: { lib: { entry: { - index: resolve(__dirname, "lib/index.ts"), + "mattrixwv-components": resolve(__dirname, "lib/index.ts"), ...Object.fromEntries(modules.map(mod => [mod, resolve(__dirname, `lib/component/${mod}/index.ts`)])) }, formats: [ "es" ],