@@ -148,30 +148,73 @@ export const primitiveComponentsDemoResource = defineResource({
148148 gap : "1rem" ,
149149 } }
150150 >
151- < Alert . Root >
152- < Alert . Title > Default Alert</ Alert . Title >
153- < Alert . Description > This is a default alert message.</ Alert . Description >
154- </ Alert . Root >
155- < Alert . Root variant = "success" >
156- < Alert . Title > Success</ Alert . Title >
157- < Alert . Description > Operation completed successfully.</ Alert . Description >
158- </ Alert . Root >
159- < Alert . Root variant = "warning" >
160- < Alert . Title > Warning</ Alert . Title >
161- < Alert . Description > Please review before proceeding.</ Alert . Description >
162- </ Alert . Root >
163- < Alert . Root variant = "error" >
164- < Alert . Title > Error</ Alert . Title >
165- < Alert . Description > Something went wrong. Please try again.</ Alert . Description >
166- </ Alert . Root >
167- < Alert . Root variant = "info" >
168- < Alert . Title > Info</ Alert . Title >
169- < Alert . Description > Here is some useful information.</ Alert . Description >
170- </ Alert . Root >
171- < Alert . Root variant = "neutral" >
172- < Alert . Title > Neutral</ Alert . Title >
173- < Alert . Description > This is a neutral informational message.</ Alert . Description >
174- </ Alert . Root >
151+ < div >
152+ < div style = { labelStyle } > Variants</ div >
153+ < div
154+ style = { {
155+ display : "flex" ,
156+ flexDirection : "column" ,
157+ gap : "0.5rem" ,
158+ } }
159+ >
160+ < Alert . Root >
161+ < Alert . Title > Neutral (default)</ Alert . Title >
162+ < Alert . Description > This is a neutral alert message.</ Alert . Description >
163+ </ Alert . Root >
164+ < Alert . Root variant = "success" >
165+ < Alert . Title > Success</ Alert . Title >
166+ < Alert . Description > Operation completed successfully.</ Alert . Description >
167+ </ Alert . Root >
168+ < Alert . Root variant = "warning" >
169+ < Alert . Title > Warning</ Alert . Title >
170+ < Alert . Description > Please review before proceeding.</ Alert . Description >
171+ </ Alert . Root >
172+ < Alert . Root variant = "error" >
173+ < Alert . Title > Error</ Alert . Title >
174+ < Alert . Description > Something went wrong. Please try again.</ Alert . Description >
175+ </ Alert . Root >
176+ < Alert . Root variant = "info" >
177+ < Alert . Title > Info</ Alert . Title >
178+ < Alert . Description > Here is some useful information.</ Alert . Description >
179+ </ Alert . Root >
180+ </ div >
181+ </ div >
182+ < div >
183+ < div style = { labelStyle } > With Action</ div >
184+ < div
185+ style = { {
186+ display : "flex" ,
187+ flexDirection : "column" ,
188+ gap : "0.5rem" ,
189+ } }
190+ >
191+ < Alert . Root variant = "info" action = { < Alert . Dismiss /> } >
192+ < Alert . Title > Dismissible</ Alert . Title >
193+ < Alert . Description > This alert can be dismissed.</ Alert . Description >
194+ </ Alert . Root >
195+ < Alert . Root
196+ variant = "success"
197+ action = { < Alert . Dismiss onDismiss = { ( ) => console . log ( "dismissed" ) } /> }
198+ >
199+ < Alert . Title > With callback</ Alert . Title >
200+ < Alert . Description > Dismiss fires a callback.</ Alert . Description >
201+ </ Alert . Root >
202+ < Alert . Root
203+ variant = "warning"
204+ action = {
205+ < div style = { { display : "flex" , gap : "0.5rem" } } >
206+ < Button size = "sm" variant = "outline" >
207+ Dismiss
208+ </ Button >
209+ < Button size = "sm" > Action</ Button >
210+ </ div >
211+ }
212+ >
213+ < Alert . Title > Multiple actions</ Alert . Title >
214+ < Alert . Description > This alert has multiple action buttons.</ Alert . Description >
215+ </ Alert . Root >
216+ </ div >
217+ </ div >
175218 </ div >
176219 </ Card . Content >
177220 </ Card . Root >
0 commit comments