-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Summary
Toast wraps Sonner for notifications. Has type safety issues with the toast function signature and missing ref prop support on the container.
Improvements
1. Fix toast function type signature
toast() uses ToasterProps as the options type but Sonner expects ToastOptions. The Object.assign pattern masks this type mismatch.
2. Accept ref as a prop on ToastContainer
Container component doesn't accept a ref prop, limiting imperative control.
3. Document exposed Sonner props
position, dir, hotkey, and other ToasterProps are passable via spread but not documented or discoverable.
4. Remove empty interface extension
ToastContainerProps extends ToasterProps {} is an empty interface providing no additional typing benefit.
5. Add CSS variable fallbacks
All styling hardcoded to CSS variables (lines 21-25) with no fallback values if variables are undefined.
6. Verify and document accessibility
Relies on Sonner's accessibility (aria-live, roles, keyboard shortcuts) without verification or documentation. The alt+T hotkey is undocumented.
Files
packages/raystack/raystack/components/toast/