feat(admin-ui): codemod @nstart/ui → @/ui (Stage 2.2)

This commit is contained in:
Александр Зимин
2026-05-10 22:17:06 +00:00
parent 0710efb8ce
commit b7d2fbd7ce
34 changed files with 398 additions and 92 deletions
@@ -4,23 +4,37 @@ import { cn } from '@/lib/utils'
/**
* LoadingBlock — central spinner с подписью. Заменяет {@code @nstart/ui}
* LoadingBlock. Для inline placeholder используйте Skeleton.
*
* Size variants:
* - sm: small inline spinner (py-4)
* - md: default centered (py-12)
* - lg: prominent (py-20)
*/
export type LoadingBlockProps = React.HTMLAttributes<HTMLDivElement> & {
label?: React.ReactNode
size?: 'sm' | 'md' | 'lg'
}
export function LoadingBlock({ className, label, ...props }: LoadingBlockProps) {
const SIZES = {
sm: { wrapper: 'py-4', icon: 'size-3' },
md: { wrapper: 'py-12', icon: 'size-5' },
lg: { wrapper: 'py-20', icon: 'size-8' },
} as const
export function LoadingBlock({ className, label, size = 'md', ...props }: LoadingBlockProps) {
const s = SIZES[size]
return (
<div
role="status"
aria-busy="true"
className={cn(
'flex flex-col items-center justify-center gap-2 py-12 text-mute',
'flex flex-col items-center justify-center gap-2 text-mute',
s.wrapper,
className,
)}
{...props}
>
<Loader2 className="size-5 animate-spin text-accent" />
<Loader2 className={cn('animate-spin text-accent', s.icon)} />
{label && <span className="text-sm">{label}</span>}
</div>
)