From ef1a89df52d5fd0c8c4a6d4c6b06a46c96bf45f4 Mon Sep 17 00:00:00 2001 From: "Jason M. Hasperhoven" Date: Thu, 31 Oct 2024 18:28:06 +0400 Subject: [PATCH] Add theme & lib/toast UI exports (#1887) * Add lib/toast and theme exports * Add changeset * Add utils to exports * Fix dist export path --- .changeset/shy-dogs-draw.md | 5 +++++ packages/ui/package.json | 14 ++++++++++++++ packages/ui/vite.config.ts | 7 +++++++ 3 files changed, 26 insertions(+) create mode 100644 .changeset/shy-dogs-draw.md diff --git a/.changeset/shy-dogs-draw.md b/.changeset/shy-dogs-draw.md new file mode 100644 index 0000000000..5f2759282f --- /dev/null +++ b/.changeset/shy-dogs-draw.md @@ -0,0 +1,5 @@ +--- +'@penumbra-zone/ui': minor +--- + +Add theme and lib/toast exports diff --git a/packages/ui/package.json b/packages/ui/package.json index ab6bcd90c8..d667c5d545 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -33,6 +33,8 @@ "./tailwind": "./src/tailwindConfig.ts", "./postcss.config.js": "./postcss.config.js", "./styles/*": "./styles/*", + "./theme": "./src/PenumbraUIProvider/theme.ts", + "./utils/*": "./src/utils/*.ts", "./hooks/*": "./src/hooks/*/index.ts", "./*": "./src/*/index.tsx" }, @@ -46,6 +48,18 @@ "types": "./dist/components/ui/*.d.ts", "default": "./dist/components/ui/*.js" }, + "./theme": { + "types": "./dist/src/PenumbraUIProvider/theme.d.ts", + "default": "./dist/src/PenumbraUIProvider/theme.js" + }, + "./lib/toast/*": { + "types": "./dist/lib/toast/*.d.ts", + "default": "./dist/lib/toast/*.js" + }, + "./utils/*": { + "types": "./dist/src/utils/*.d.ts", + "default": "./dist/src/utils/*.js" + }, "./*": { "types": "./dist/src/*/index.d.ts", "default": "./dist/src/*/index.js" diff --git a/packages/ui/vite.config.ts b/packages/ui/vite.config.ts index d76c920218..db0b6db30a 100644 --- a/packages/ui/vite.config.ts +++ b/packages/ui/vite.config.ts @@ -26,6 +26,11 @@ const getAllUIComponents = (): Record => { ); }; +const getAllLibToastComponents = (): Record => { + const source = resolve(__dirname, 'lib', 'toast'); + return getRecursiveTsxFiles(source, 'lib/toast'); +}; + const getDeprecatedUIComponents = (): Record => { const source = resolve(__dirname, 'components/ui'); return getRecursiveTsxFiles(source, 'components/ui'); @@ -54,6 +59,8 @@ const getAllEntries = (): Record => { return { tailwindconfig: resolve('../tailwind-config'), 'src/tailwindConfig': join(__dirname, 'src', 'tailwindConfig.ts'), + 'src/PenumbraUIProvider/theme': join(__dirname, 'src', 'PenumbraUIProvider', 'theme.ts'), + ...getAllLibToastComponents(), ...getDeprecatedUIComponents(), ...getAllUIComponents(), };