Skip to content

Commit

Permalink
Add theme & lib/toast UI exports (#1887)
Browse files Browse the repository at this point in the history
* Add lib/toast and theme exports

* Add changeset

* Add utils to exports

* Fix dist export path
  • Loading branch information
JasonMHasperhoven authored Oct 31, 2024
1 parent 38ce981 commit ef1a89d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-dogs-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@penumbra-zone/ui': minor
---

Add theme and lib/toast exports
14 changes: 14 additions & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions packages/ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ const getAllUIComponents = (): Record<string, string> => {
);
};

const getAllLibToastComponents = (): Record<string, string> => {
const source = resolve(__dirname, 'lib', 'toast');
return getRecursiveTsxFiles(source, 'lib/toast');
};

const getDeprecatedUIComponents = (): Record<string, string> => {
const source = resolve(__dirname, 'components/ui');
return getRecursiveTsxFiles(source, 'components/ui');
Expand Down Expand Up @@ -54,6 +59,8 @@ const getAllEntries = (): Record<string, string> => {
return {
tailwindconfig: resolve('../tailwind-config'),
'src/tailwindConfig': join(__dirname, 'src', 'tailwindConfig.ts'),
'src/PenumbraUIProvider/theme': join(__dirname, 'src', 'PenumbraUIProvider', 'theme.ts'),
...getAllLibToastComponents(),
...getDeprecatedUIComponents(),
...getAllUIComponents(),
};
Expand Down

0 comments on commit ef1a89d

Please sign in to comment.