It turns out my code was fine, it was the package/vite/tsconfig settings. I found a library (mui-color-input) that used vite and also responded appropriately to dark/light theme settings. Then I compared that line by line with what I had, and made changes accordingly. I believe there was still a dependency conflict even though I had @mui in the peer dependencies. The index.d.ts was also no getting written to dist.