feat: migrate Alert component from MUI to shadcn #18412
Draft
+100
−61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates the Alert component from MUI to shadcn implementation while maintaining full backward compatibility with the existing API.
Changes
Core Alert Component
class-variance-authority
severity
(info, success, warning, error)dismissible
for showing dismiss buttonactions
for custom action buttonsonDismiss
callbackrole="alert"
Updated Imports
Updated 6 files that were importing
AlertTitle
from MUI to use our new implementation:ChangeWorkspaceVersionDialog.tsx
ProvisionerAlert.tsx
GitDeviceAuth.tsx
OverviewPageView.tsx
Workspace.tsx
SetupPageView.tsx
Benefits
Testing
The component maintains the exact same API as before, so all existing tests should continue to pass. The styling has been updated to use Tailwind classes with proper color variants for each severity level.
Files Changed
site/src/components/Alert/Alert.tsx
- Main Alert component migrationsite/src/components/Alert/ErrorAlert.tsx
- Updated importThis migration aligns with the project's move towards shadcn components and provides a more maintainable and customizable Alert system.