Refactor dialog components and styles for improved UI consistency
ci / build-backend (push) Successful in 2m34s
ci / build-frontend (push) Successful in 1m5s
ci / tests (push) Successful in 2m25s
ci / sonar (push) Successful in 6m4s

Updated the dialog components to use a unified class name, replacing 'crt-panel' with 'crt-dialog' for better clarity and consistency across the application. Enhanced the dialog overlay with a denser background and blur effect to improve readability against underlying content. Additionally, modified the UploadSnackbar and ShowsPanel to reflect these changes, ensuring a cohesive user experience.
This commit is contained in:
Leonid Pershin
2026-07-28 00:39:36 +03:00
parent 9f86016a2c
commit e0b85807df
5 changed files with 20 additions and 5 deletions
@@ -48,7 +48,7 @@ export function UploadSnackbar() {
else header = t('admin.media.uploadedCount', { count: done }) else header = t('admin.media.uploadedCount', { count: done })
return ( return (
<div className="crt-panel fixed bottom-4 right-4 z-50 w-96 max-w-[calc(100vw-2rem)] rounded-md shadow-lg"> <div className="crt-dialog fixed bottom-4 right-4 z-50 w-96 max-w-[calc(100vw-2rem)] rounded-md">
<div className="flex items-center gap-2 border-b border-border px-3 py-2 text-sm"> <div className="flex items-center gap-2 border-b border-border px-3 py-2 text-sm">
<span className="truncate font-medium">{header}</span> <span className="truncate font-medium">{header}</span>
{hasItems && ( {hasItems && (
@@ -359,7 +359,7 @@ function GenreCell({ primary, others }: Readonly<{ primary: string | null; other
</button> </button>
{at && ( {at && (
<div <div
className="crt-panel fixed z-50 max-w-56 rounded-md border border-border bg-background px-2 py-1.5 text-xs" className="crt-popover fixed z-50 max-w-56 rounded-md px-2 py-1.5 text-xs"
style={{ left: at.left, top: at.top }} style={{ left: at.left, top: at.top }}
> >
<p className="mb-1 text-[10px] uppercase tracking-wide text-muted-foreground"> <p className="mb-1 text-[10px] uppercase tracking-wide text-muted-foreground">
+13
View File
@@ -122,6 +122,19 @@
0 8px 30px rgba(0, 0, 0, 0.25); 0 8px 30px rgba(0, 0, 0, 0.25);
} }
/*
* Модальное окно. Тот же оттенок, что у карточки, но фон непрозрачный: диалог висит над сеткой
* и таблицами, и сквозь полупрозрачную панель чужой текст читался прямо поверх полей ввода.
* Тень глубже, чем у карточки, — окно должно отрываться от страницы, а не лежать на ней.
*/
.crt-dialog {
background: color-mix(in srgb, var(--muted) 82%, var(--background));
border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
box-shadow:
0 0 0 1px color-mix(in srgb, var(--primary) 15%, transparent) inset,
0 24px 64px rgba(0, 0, 0, 0.7);
}
/* /*
* Всплывающая панель (поповер, автокомплит). Отдельный класс, а не crt-panel с правкой фона: * Всплывающая панель (поповер, автокомплит). Отдельный класс, а не crt-panel с правкой фона:
* фон там задан в этом же слое, и утилита вроде bg-muted его не перебивает — выигрывает то, * фон там задан в этом же слое, и утилита вроде bg-muted его не перебивает — выигрывает то,
+4 -2
View File
@@ -12,7 +12,9 @@ const DialogOverlay = forwardRef<
>(({ className, ...props }, ref) => ( >(({ className, ...props }, ref) => (
<DialogPrimitive.Overlay <DialogPrimitive.Overlay
ref={ref} ref={ref}
className={cn('fixed inset-0 z-50 bg-black/60', className)} // Затемнение плотнее и с размытием: под диалогом обычно сетка эфира, и её строки
// просвечивали сквозь окно, мешая читать поля.
className={cn('fixed inset-0 z-50 bg-black/80 backdrop-blur-sm', className)}
{...props} {...props}
/> />
)) ))
@@ -27,7 +29,7 @@ export const DialogContent = forwardRef<
<DialogPrimitive.Content <DialogPrimitive.Content
ref={ref} ref={ref}
className={cn( className={cn(
'crt-panel fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 rounded-md p-6', 'crt-dialog fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 rounded-md p-6',
className, className,
)} )}
{...props} {...props}
+1 -1
View File
@@ -47,7 +47,7 @@ function ToastItem({
return ( return (
<output <output
className={cn( className={cn(
'crt-panel pointer-events-auto flex items-start gap-3 rounded-md px-4 py-3 text-sm shadow-lg', 'crt-dialog pointer-events-auto flex items-start gap-3 rounded-md px-4 py-3 text-sm',
variant === 'success' && 'border-primary/60', variant === 'success' && 'border-primary/60',
variant === 'error' && 'border-red-700/60 text-red-400', variant === 'error' && 'border-red-700/60 text-red-400',
)} )}