enricobuehlerandClaude Fable 5 e50e747839 fix(sound): stop component imports from dragging audio assets into consumer bundles
Importing any sound-aware component (e.g. @unom/ui/button) statically
reached src/sound/defaults.ts via the provider, pulling ~6.7MB of wav/mp3
URL references into every consumer build even with no SoundProvider mounted.

- new src/sound/silent.ts: asset-free silentSoundTheme, now the context default
- SoundTheme.tokens is Partial<> so sparse themes typecheck; merge/resolve
  are null-safe over missing tokens
- SoundProvider: theme prop now optional; new loadTheme prop resolves a
  theme chunk lazily after mount and merges it over theme
- defaults.ts renamed to default-theme.ts, no longer re-exported from
  sound/index.ts; published as the @unom/ui/sound/default-theme subpath
  (the ONLY module referencing the audio assets)
- Storybook preview passes defaultSoundTheme explicitly via the new subpath

Verified: after build, grep -rl "assets/sounds" dist/ lists only
dist/sound/default-theme.js.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 18:34:11 +02:00
2026-06-28 22:37:21 +00:00
S
Description
ui elements for unom
Readme MIT
3.2 MiB
Languages
TypeScript 88.1%
CSS 11.9%