@@ -16,8 +16,8 @@ import {
1616 Zap ,
1717 Sun ,
1818 FileQuestion ,
19- Loader2 ,
2019} from "lucide-react" ;
20+ import { PixelGrid } from "@/components/ui/pixel-grid" ;
2121
2222export default function StatesPatternPage ( ) {
2323 return (
@@ -182,46 +182,62 @@ export default function StatesPatternPage() {
182182 </ ComponentPreview >
183183 </ div >
184184
185- { /* Loading Spinner */ }
185+ { /* Loading Animation */ }
186186 < div className = "space-y-4" >
187187 < h2 className = "scroll-m-20 border-b pb-2 text-2xl font-semibold tracking-tight" >
188- Loading Spinner
188+ Loading Animation
189189 </ h2 >
190190 < p className = "text-muted-foreground" >
191- For quick operations or when skeleton doesn't fit, use a spinner .
191+ Use the branded PixelGrid animation for loading states. Available in multiple sizes and patterns .
192192 </ p >
193193 < ComponentPreview
194- code = { `{/* Centered spinner */}
194+ code = { `import { PixelGrid } from "@sourceful-energy/ui"
195+
196+ {/* Centered loading */}
195197<div className="flex flex-col items-center justify-center py-12">
196- <Loader2 className="h-8 w-8 animate-spin text-muted-foreground" />
197- <p className="text-sm text-muted-foreground mt-2">Loading devices...</p>
198+ <PixelGrid pattern="frame" size="md" />
199+ <p className="text-sm text-muted-foreground mt-4">Loading devices...</p>
200+ </div>
201+
202+ {/* Compact loading */}
203+ <div className="flex items-center gap-3">
204+ <PixelGrid pattern="corners-sync" size="sm" />
205+ <span className="text-sm text-muted-foreground">Saving...</span>
198206</div>
199207
200- {/* Button with spinner */}
201- <Button disabled >
202- <Loader2 className="h-4 w-4 animate- spin mr-2 " />
203- Saving...
204- </Button >` }
208+ {/* Minimal inline loading */}
209+ <div className="flex items-center gap-2" >
210+ <PixelGrid dimension="4x4" pattern="cross- spin" size="sm " />
211+ <span className="text-sm">Processing</span>
212+ </div >` }
205213 >
206214 < div className = "space-y-6 w-full max-w-md" >
207215 < Card >
208216 < CardContent className = "pt-6" >
209217 < div className = "flex flex-col items-center justify-center py-8" >
210- < Loader2 className = "h-8 w-8 animate-spin text-muted-foreground" />
211- < p className = "text-sm text-muted-foreground mt-2" > Loading devices...</ p >
218+ < PixelGrid pattern = "frame" size = "md" />
219+ < p className = "text-sm text-muted-foreground mt-4" > Loading devices...</ p >
220+ </ div >
221+ </ CardContent >
222+ </ Card >
223+ < Card >
224+ < CardContent className = "pt-6" >
225+ < div className = "flex flex-col gap-4" >
226+ < div className = "flex items-center gap-3" >
227+ < PixelGrid pattern = "corners-sync" size = "sm" />
228+ < span className = "text-sm text-muted-foreground" > Saving changes...</ span >
229+ </ div >
230+ < div className = "flex items-center gap-3" >
231+ < PixelGrid dimension = "4x4" pattern = "cross-spin" size = "sm" />
232+ < span className = "text-sm text-muted-foreground" > Processing data...</ span >
233+ </ div >
234+ < div className = "flex items-center gap-3" >
235+ < PixelGrid dimension = "4x4" pattern = "ripple" size = "sm" />
236+ < span className = "text-sm text-muted-foreground" > Syncing...</ span >
237+ </ div >
212238 </ div >
213239 </ CardContent >
214240 </ Card >
215- < div className = "flex gap-2" >
216- < Button disabled >
217- < Loader2 className = "h-4 w-4 animate-spin mr-2" />
218- Saving...
219- </ Button >
220- < Button variant = "outline" disabled >
221- < Loader2 className = "h-4 w-4 animate-spin mr-2" />
222- Loading...
223- </ Button >
224- </ div >
225241 </ div >
226242 </ ComponentPreview >
227243 </ div >
0 commit comments