diff --git a/webapp/packages/core-blocks/src/Alert.module.css b/webapp/packages/core-blocks/src/Alert.module.css deleted file mode 100644 index 6898546c00..0000000000 --- a/webapp/packages/core-blocks/src/Alert.module.css +++ /dev/null @@ -1,45 +0,0 @@ -/* - * CloudBeaver - Cloud Database Manager - * Copyright (C) 2019-2024 DBeaver Corp - * - * All Rights Reserved - * - * NOTICE: All information contained herein is, and remains - * the property of DBeaver Corp and its suppliers, if any. - * The intellectual and technical concepts contained - * herein are proprietary to DBeaver Corp and its suppliers - * and may be covered by U.S. and Foreign Patents, - * patents in process, and are protected by trade secret or copyright law. - * Dissemination of this information or reproduction of this material - * is strictly forbidden unless prior written permission is obtained - * from DBeaver Corp. - */ - -.alert { - display: flex; - align-items: flex-start; - gap: 14px; - background-color: rgba(34, 139, 230, 0.15); - padding: 16px; - border-radius: 4px; -} - -.body { - display: flex; - gap: 8px; - flex-direction: column; -} - -.title { - color: var(--theme-primary); - font-weight: 500; - margin: 0; -} - -.alert.error { - background-color: rgba(255, 77, 79, 0.15); - - .title { - color: var(--theme-error); - } -} diff --git a/webapp/packages/core-blocks/src/Alert.tsx b/webapp/packages/core-blocks/src/Alert.tsx index ce15a3983d..952be13637 100644 --- a/webapp/packages/core-blocks/src/Alert.tsx +++ b/webapp/packages/core-blocks/src/Alert.tsx @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2025 DBeaver Corp and others + * Copyright (C) 2020-2026 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -10,28 +10,46 @@ import type { PropsWithChildren } from 'react'; import { observer } from 'mobx-react-lite'; import { useTranslate } from './localization/useTranslate.js'; -import { useS } from './useS.js'; -import { s } from './s.js'; import { IconOrImage } from './IconOrImage.js'; -import classes from './Alert.module.css'; + +type Size = 'small' | 'medium' | 'large'; interface Props { title?: string; variant?: 'info' | 'error'; + size?: Size; className?: string; } -export const Alert = observer>(function Alert({ title, variant = 'info', className, children }) { +export const Alert = observer>(function Alert({ title, variant = 'info', size = 'medium', className, children }) { const translate = useTranslate(); - const styles = useS(classes); - const icon = variant === 'info' ? '/icons/preload/info_icon_sm.svg' : '/icons/preload/error_icon_sm.svg'; + const sizeClasses: Record = { + small: 'tw:gap-2.5 tw:p-3', + medium: 'tw:gap-3.5 tw:p-4', + large: 'tw:gap-[18px] tw:p-5', + }; + const iconSizes: Record = { + small: 'tw:size-4', + medium: 'tw:size-5', + large: 'tw:size-6', + }; + const titleSizes: Record = { + small: 'tw:text-sm', + medium: '', + large: 'tw:text-lg', + }; + + const bgColor = variant === 'info' ? 'tw:bg-[rgba(34,139,230,0.15)]' : 'tw:bg-[rgba(255,77,79,0.15)]'; + const titleColor = variant === 'info' ? 'tw:text-[color:var(--theme-primary)]' : 'tw:text-[color:var(--theme-error)]'; return ( -
- -
-

{title ?? translate(variant === 'info' ? 'ui_information' : 'ui_error')}

+
+ +
+

+ {title ?? translate(variant === 'info' ? 'ui_information' : 'ui_error')} +

{children}
diff --git a/webapp/packages/plugin-sql-editor/src/renderQueryParamsForConfirmation.tsx b/webapp/packages/plugin-sql-editor/src/renderQueryParamsForConfirmation.tsx index 3acc1d1bef..87a02641e0 100644 --- a/webapp/packages/plugin-sql-editor/src/renderQueryParamsForConfirmation.tsx +++ b/webapp/packages/plugin-sql-editor/src/renderQueryParamsForConfirmation.tsx @@ -99,7 +99,7 @@ const RenderParametersForm = observer(function RenderParametersForm({ {!sqlEditorSettingsService.disabled && ( )} - +
); });