diff --git a/webapp/packages/core-blocks/src/ErrorMessage.m.css b/webapp/packages/core-blocks/src/ErrorMessage.m.css new file mode 100644 index 0000000000..bc8ca0c711 --- /dev/null +++ b/webapp/packages/core-blocks/src/ErrorMessage.m.css @@ -0,0 +1,30 @@ +.message { + box-sizing: border-box; + display: flex; + align-items: center; + border-radius: var(--theme-group-element-radius); + height: 50px; + padding: 8px 12px; +} + +.errorIcon { + width: 24px; + height: 24px; + margin-right: 8px; +} + +.messageBody { + composes: theme-typography--body2 from global; + max-height: 100%; + line-height: 1.2; + box-sizing: border-box; + flex: 1; + -webkit-line-clamp: 2; + display: -webkit-box; + -webkit-box-orient: vertical; + overflow: hidden; +} + +.messageActions { + margin-left: 16px; +} \ No newline at end of file diff --git a/webapp/packages/core-blocks/src/ErrorMessage.tsx b/webapp/packages/core-blocks/src/ErrorMessage.tsx index c771f390aa..8f92a8eb2a 100644 --- a/webapp/packages/core-blocks/src/ErrorMessage.tsx +++ b/webapp/packages/core-blocks/src/ErrorMessage.tsx @@ -6,43 +6,13 @@ * you may not use this file except in compliance with the License. */ import { observer } from 'mobx-react-lite'; -import styled, { css } from 'reshadow'; - import { Button } from './Button'; import { IconOrImage } from './IconOrImage'; import { useTranslate } from './localization/useTranslate'; +import { useS } from './useS'; -const styles = css` - message { - box-sizing: border-box; - display: flex; - align-items: center; - border-radius: var(--theme-group-element-radius); - height: 50px; - padding: 8px 12px; - } - - IconOrImage { - width: 24px; - height: 24px; - margin-right: 8px; - } - - message-body { - composes: theme-typography--body2 from global; - max-height: 100%; - line-height: 1.2; - box-sizing: border-box; - flex: 1; - -webkit-line-clamp: 2; - display: -webkit-box; - -webkit-box-orient: vertical; - overflow: hidden; - } - message-actions { - margin-left: 16px; - } -`; +import styles from './ErrorMessage.m.css'; +import { s } from './s'; interface Props { hasDetails?: boolean; @@ -53,18 +23,19 @@ interface Props { export const ErrorMessage = observer(function ErrorMessage({ text, className, hasDetails, onShowDetails }) { const translate = useTranslate(); + const style = useS(styles); - return styled(styles)( - - - {text} - + return ( +
+ +
{text}
+
{hasDetails && ( )} - - , +
+
); }); diff --git a/webapp/packages/core-blocks/src/ItemList/ItemListSearch.tsx b/webapp/packages/core-blocks/src/ItemList/ItemListSearch.tsx index 5cf7446aaf..e18ffe2eb2 100644 --- a/webapp/packages/core-blocks/src/ItemList/ItemListSearch.tsx +++ b/webapp/packages/core-blocks/src/ItemList/ItemListSearch.tsx @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { useCallback, useRef, useState } from 'react'; -import { use } from 'reshadow'; import { IconButton } from '../IconButton'; import { useTranslate } from '../localization/useTranslate'; @@ -67,7 +66,6 @@ export const ItemListSearch: React.FC = function ItemListSearch({ value, autoComplete="off" disabled={disabled} onChange={event => changeHandler(event.target.value)} - {...use({ mod: 'surface' })} />
{!onSearch && inputValue ? ( diff --git a/webapp/packages/core-blocks/src/LoadingScreen/LoadingScreen.tsx b/webapp/packages/core-blocks/src/LoadingScreen/LoadingScreen.tsx deleted file mode 100644 index 5b93f9eaef..0000000000 --- a/webapp/packages/core-blocks/src/LoadingScreen/LoadingScreen.tsx +++ /dev/null @@ -1,34 +0,0 @@ -/* - * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2023 DBeaver Corp and others - * - * Licensed under the Apache License, Version 2.0. - * you may not use this file except in compliance with the License. - */ -import { useEffect, useRef } from 'react'; -import styled from 'reshadow'; - -import { Icon } from '../Icon'; -import styles from './loading-screen.css'; - -const FADE_IN_DELAY = 300; - -function LoadingScreen() { - const ref = useRef(null); - - useEffect( - () => () => { - const appContainer = document.querySelector('#__next')!; - const loadingNode = appContainer.appendChild(ref.current!.cloneNode(true)); - setTimeout(() => (loadingNode as any).classList.add(styles.fadeIn)); - setTimeout(() => appContainer.removeChild(loadingNode), FADE_IN_DELAY); - }, - [], - ); - - return styled(styles)( -
- -
, - ); -} diff --git a/webapp/packages/core-blocks/src/LoadingScreen/loading-screen.css b/webapp/packages/core-blocks/src/LoadingScreen/loading-screen.css deleted file mode 100644 index 11ae5cccf6..0000000000 --- a/webapp/packages/core-blocks/src/LoadingScreen/loading-screen.css +++ /dev/null @@ -1,56 +0,0 @@ -:global(html) { - font-family: 'Roboto', sans-serif; -} - -div { - display: flex; - position: absolute; - background-color: #ffffff; - top: 0; - left: 0; - width: 100%; - height: 100%; - overflow: hidden; -} - -.fadeIn { - transition: opacity 0.3s ease; - opacity: 0; - animation: none; -} - -Icon { - position: relative; - width: 100%; - margin: auto; - max-width: 600px; -} - -div::before { - content: ' '; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 50%; - z-index: 1; - width: 500%; - margin-left: -250%; - animation: wave 1.3s linear infinite; - background: linear-gradient( - to right, - rgba(255, 255, 255, 0) 46%, - rgba(255, 255, 255, 0.35) 50%, - rgba(255, 255, 255, 0) 54% - ) - 50% 50%; -} - -@keyframes wave { - 0% { - transform: translate3d(-30%, 0, 0); - } - 100% { - transform: translate3d(30%, 0, 0); - } -} diff --git a/webapp/packages/core-blocks/src/Slide/SlideOverlay.tsx b/webapp/packages/core-blocks/src/Slide/SlideOverlay.tsx index e3c01e15b9..59f14ccff7 100644 --- a/webapp/packages/core-blocks/src/Slide/SlideOverlay.tsx +++ b/webapp/packages/core-blocks/src/Slide/SlideOverlay.tsx @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ import { observer } from 'mobx-react-lite'; -import styled, { css } from 'reshadow'; import { Icon } from '../Icon'; import { s } from '../s'; diff --git a/webapp/packages/core-blocks/src/Table/TableItemSelect.m.css b/webapp/packages/core-blocks/src/Table/TableItemSelect.m.css new file mode 100644 index 0000000000..3f390620cd --- /dev/null +++ b/webapp/packages/core-blocks/src/Table/TableItemSelect.m.css @@ -0,0 +1,4 @@ +.checkbox { + margin-left: -10px; + margin-right: -10px; +} \ No newline at end of file diff --git a/webapp/packages/core-blocks/src/Table/TableItemSelect.tsx b/webapp/packages/core-blocks/src/Table/TableItemSelect.tsx index d2a6266fe8..b793055620 100644 --- a/webapp/packages/core-blocks/src/Table/TableItemSelect.tsx +++ b/webapp/packages/core-blocks/src/Table/TableItemSelect.tsx @@ -7,7 +7,6 @@ */ import { observer } from 'mobx-react-lite'; import { useContext } from 'react'; -import styled, { css } from 'reshadow'; import { EventContext } from '@cloudbeaver/core-events'; @@ -15,6 +14,9 @@ import { Checkbox } from '../FormControls/Checkboxes/Checkbox'; import { EventTableItemSelectionFlag } from './EventTableItemSelectionFlag'; import { TableContext } from './TableContext'; import { TableItemContext } from './TableItemContext'; +import { useS } from '../useS'; +import styles from './TableItemSelect.m.css'; +import { s } from '../s'; interface Props { checked?: boolean; @@ -23,17 +25,11 @@ interface Props { className?: string; } -const styles = css` - Checkbox { - margin-left: -10px; - margin-right: -10px; - } -`; - export const TableItemSelect = observer(function TableItemSelect({ checked, disabled, tooltip, className }) { const tableContext = useContext(TableContext); const context = useContext(TableItemContext); const selected = checked ?? context?.isSelected(); + const style = useS(styles); function handleClick(event: React.MouseEvent) { if (!context) { @@ -48,7 +44,13 @@ export const TableItemSelect = observer(function TableItemSelect({ checke return null; } - return styled(styles)( - , + return ( + ); }); diff --git a/webapp/packages/core-blocks/src/layout/TopAppBar.m.css b/webapp/packages/core-blocks/src/layout/TopAppBar.m.css new file mode 100644 index 0000000000..0d3c1ccfac --- /dev/null +++ b/webapp/packages/core-blocks/src/layout/TopAppBar.m.css @@ -0,0 +1,10 @@ +.header { + composes: theme-text-on-primary theme-typography--body2 from global; + display: flex; + align-items: center; + height: 48px; + padding: 0 8px; + background-color: #2a7cb4; + z-index: 1; + flex-shrink: 0; +} \ No newline at end of file diff --git a/webapp/packages/core-blocks/src/layout/TopAppBar.tsx b/webapp/packages/core-blocks/src/layout/TopAppBar.tsx index 9bc131a8ea..957c16d477 100644 --- a/webapp/packages/core-blocks/src/layout/TopAppBar.tsx +++ b/webapp/packages/core-blocks/src/layout/TopAppBar.tsx @@ -5,25 +5,17 @@ * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. */ -import styled, { css } from 'reshadow'; -export const topAppBarStyles = css` - header { - composes: theme-text-on-primary theme-typography--body2 from global; - display: flex; - align-items: center; - height: 48px; - padding: 0 8px; - background-color: #2a7cb4; - z-index: 1; - flex-shrink: 0; - } -`; +import { s } from '../s'; +import { useS } from '../useS'; +import styles from './TopAppBar.m.css'; interface Props extends React.PropsWithChildren { className?: string; } export const TopAppBar: React.FC = function TopAppBar({ children, className }) { - return styled(topAppBarStyles)(
{children}
); + const style = useS(styles); + + return (
{children}
); }; diff --git a/webapp/packages/core-bootstrap/src/renderLayout.m.css b/webapp/packages/core-bootstrap/src/renderLayout.m.css new file mode 100644 index 0000000000..028a292406 --- /dev/null +++ b/webapp/packages/core-bootstrap/src/renderLayout.m.css @@ -0,0 +1,3 @@ +.loader { + height: 100vh; +} \ No newline at end of file diff --git a/webapp/packages/core-bootstrap/src/renderLayout.tsx b/webapp/packages/core-bootstrap/src/renderLayout.tsx index 5144166733..a92f14c8d3 100644 --- a/webapp/packages/core-bootstrap/src/renderLayout.tsx +++ b/webapp/packages/core-bootstrap/src/renderLayout.tsx @@ -7,11 +7,11 @@ */ import { Suspense } from 'react'; import { createRoot, Root } from 'react-dom/client'; -import styled from 'reshadow'; import { Body } from '@cloudbeaver/core-app'; -import { DisplayError, ErrorBoundary, Loader } from '@cloudbeaver/core-blocks'; +import { DisplayError, ErrorBoundary, Loader, s } from '@cloudbeaver/core-blocks'; import { AppContext, IServiceInjector } from '@cloudbeaver/core-di'; +import styles from './renderLayout.m.css'; interface IRender { initRoot(): Root; @@ -46,18 +46,14 @@ export function renderLayout(serviceInjector: IServiceInjector): IRender { }, renderApp() { this.initRoot().render( - styled` - Loader { - height: 100vh; - } - `( + ( - }> + }> - , + ), ); }, diff --git a/webapp/packages/core-view/src/View/CaptureView.m.css b/webapp/packages/core-view/src/View/CaptureView.m.css new file mode 100644 index 0000000000..2e897002a3 --- /dev/null +++ b/webapp/packages/core-view/src/View/CaptureView.m.css @@ -0,0 +1,3 @@ +.container { + outline: none; +} \ No newline at end of file diff --git a/webapp/packages/core-view/src/View/CaptureView.tsx b/webapp/packages/core-view/src/View/CaptureView.tsx index 0865f7375c..9724cd2987 100644 --- a/webapp/packages/core-view/src/View/CaptureView.tsx +++ b/webapp/packages/core-view/src/View/CaptureView.tsx @@ -8,9 +8,7 @@ import { observer } from 'mobx-react-lite'; import { useContext } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; -import styled, { css } from 'reshadow'; - -import { useFocus } from '@cloudbeaver/core-blocks'; +import { s, useFocus, useS } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { isObjectsEqual } from '@cloudbeaver/core-utils'; @@ -22,12 +20,7 @@ import type { IView } from './IView'; import { parseHotkey } from './parseHotkey'; import { useActiveView } from './useActiveView'; import { useViewContext } from './useViewContext'; - -const styles = css` - div { - outline: none; - } -`; +import styles from './CaptureView.m.css'; interface Props { view: IView; @@ -40,6 +33,7 @@ export const CaptureView = observer>(function Cap const actionService = useService(ActionService); const activeView = useActiveView(view); const [ref, state] = useFocus({ onFocus: activeView.focusView, onBlur: activeView.blurView }); + const style = useS(styles); const actionItems = view.actions .map(action => actionService.getAction(viewContext, action)) @@ -85,11 +79,11 @@ export const CaptureView = observer>(function Cap }, ); - return styled(styles)( + return ( -
+
{children}
- , + ); }); diff --git a/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardStepper.m.css b/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardStepper.m.css new file mode 100644 index 0000000000..a0b431fee2 --- /dev/null +++ b/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardStepper.m.css @@ -0,0 +1,30 @@ +.wizardStepper { + composes: theme-background-surface theme-text-on-surface theme-border-color-background from global; + position: sticky; + top: 0; + height: 48px; + display: flex; + padding: 0 16px; + align-items: center; + border-bottom: solid 2px; + z-index: 1; + flex-shrink: 0; +} + +.actions { + composes: theme-border-color-background from global; + border-right: solid 1px; + display: flex; + gap: 16px; +} + +.actions, +.wizardText { + display: flex; + align-items: center; + height: 28px; +} + +.wizardText { + padding: 0 16px; +} \ No newline at end of file diff --git a/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardStepper.tsx b/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardStepper.tsx index 4d4d7f09f4..ef589ae437 100644 --- a/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardStepper.tsx +++ b/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardStepper.tsx @@ -6,60 +6,28 @@ * you may not use this file except in compliance with the License. */ import { observer } from 'mobx-react-lite'; -import styled, { css } from 'reshadow'; import { ConfigurationWizardService } from '@cloudbeaver/core-administration'; -import { Button, useStyles, useTranslate } from '@cloudbeaver/core-blocks'; +import { Button, s, useS, useTranslate } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; - -const styles = css` - wizard-stepper { - composes: theme-background-surface theme-text-on-surface theme-border-color-background from global; - position: sticky; - top: 0; - height: 48px; - display: flex; - padding: 0 16px; - align-items: center; - border-bottom: solid 2px; - z-index: 1; - flex-shrink: 0; - } - - actions { - composes: theme-border-color-background from global; - border-right: solid 1px; - display: flex; - gap: 16px; - } - - actions, - wizard-text { - display: flex; - align-items: center; - height: 28px; - } - - wizard-text { - padding: 0 16px; - } -`; +import styles from './WizardStepper.m.css'; export const WizardStepper = observer(function WizardStepper() { const service = useService(ConfigurationWizardService); const translate = useTranslate(); + const style = useS(styles); - return styled(useStyles(styles))( - - + return ( +
+
- - {translate(service.currentStep?.configurationWizardOptions?.description || '')} - , +
+
{translate(service.currentStep?.configurationWizardOptions?.description || '')}
+
); }); diff --git a/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardTopAppBar/ConfigurationWizardTitle.m.css b/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardTopAppBar/ConfigurationWizardTitle.m.css new file mode 100644 index 0000000000..5345834e3e --- /dev/null +++ b/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardTopAppBar/ConfigurationWizardTitle.m.css @@ -0,0 +1,4 @@ +.wizardTitle { + text-transform: uppercase; + font-weight: 700; +} \ No newline at end of file diff --git a/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardTopAppBar/ConfigurationWizardTitle.tsx b/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardTopAppBar/ConfigurationWizardTitle.tsx index 6c3617898b..d888337c81 100644 --- a/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardTopAppBar/ConfigurationWizardTitle.tsx +++ b/webapp/packages/plugin-administration/src/AdministrationScreen/ConfigurationWizard/WizardTopAppBar/ConfigurationWizardTitle.tsx @@ -5,21 +5,14 @@ * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. */ -import styled, { css } from 'reshadow'; - -import { Translate } from '@cloudbeaver/core-blocks'; - -const styles = css` - wizard-title { - text-transform: uppercase; - font-weight: 700; - } -`; +import { Translate, s, useS } from '@cloudbeaver/core-blocks'; +import styles from './ConfigurationWizardTitle.m.css'; export function ConfigurationWizardTitle() { - return styled(styles)( - + const style = useS(styles); + return ( +
- , +
); } diff --git a/webapp/packages/plugin-authentication-administration/src/Administration/Users/Teams/GrantedConnections/ConnectionList.m.css b/webapp/packages/plugin-authentication-administration/src/Administration/Users/Teams/GrantedConnections/ConnectionList.m.css new file mode 100644 index 0000000000..08b446ef0f --- /dev/null +++ b/webapp/packages/plugin-authentication-administration/src/Administration/Users/Teams/GrantedConnections/ConnectionList.m.css @@ -0,0 +1,28 @@ +.group { + position: relative; +} + +.group, +.container, +.tableContainer { + height: 100%; +} + +.container { + display: flex; + flex-direction: column; + width: 100%; +} + +.tableContainer { + overflow: auto; +} + +.grantedConnectionsTableHeader { + flex: 0 0 auto; +} + +.table { + composes: theme-background-surface theme-text-on-surface from global; + width: 100%; +} \ No newline at end of file diff --git a/webapp/packages/plugin-authentication-administration/src/Administration/Users/Teams/GrantedConnections/ConnectionList.tsx b/webapp/packages/plugin-authentication-administration/src/Administration/Users/Teams/GrantedConnections/ConnectionList.tsx index f2da8a0a04..dd5767b920 100644 --- a/webapp/packages/plugin-authentication-administration/src/Administration/Users/Teams/GrantedConnections/ConnectionList.tsx +++ b/webapp/packages/plugin-authentication-administration/src/Administration/Users/Teams/GrantedConnections/ConnectionList.tsx @@ -8,19 +8,19 @@ import { observable } from 'mobx'; import { observer } from 'mobx-react-lite'; import { useCallback, useState } from 'react'; -import styled, { css } from 'reshadow'; import { Button, getComputed, getSelectedItems, Group, + s, Table, TableBody, TableColumnValue, TableItem, useObjectRef, - useStyles, + useS, useTranslate, } from '@cloudbeaver/core-blocks'; import { Connection, DBDriverResource } from '@cloudbeaver/core-connections'; @@ -30,32 +30,7 @@ import { getFilteredConnections } from './getFilteredConnections'; import { GrantedConnectionsTableHeader, IFilterState } from './GrantedConnectionsTableHeader/GrantedConnectionsTableHeader'; import { GrantedConnectionsTableInnerHeader } from './GrantedConnectionsTableHeader/GrantedConnectionsTableInnerHeader'; import { GrantedConnectionsTableItem } from './GrantedConnectionsTableItem'; - -const styles = css` - Group { - position: relative; - } - Group, - container, - table-container { - height: 100%; - } - container { - display: flex; - flex-direction: column; - width: 100%; - } - table-container { - overflow: auto; - } - GrantedConnectionsTableHeader { - flex: 0 0 auto; - } - Table { - composes: theme-background-surface theme-text-on-surface from global; - width: 100%; - } -`; +import styles from './ConnectionList.m.css'; interface Props { connectionList: Connection[]; @@ -66,7 +41,7 @@ interface Props { export const ConnectionList = observer(function ConnectionList({ connectionList, grantedSubjects, disabled, onGrant }) { const props = useObjectRef({ onGrant }); - const style = useStyles(styles); + const style = useS(styles); const translate = useTranslate(); const driversResource = useService(DBDriverResource); @@ -84,17 +59,17 @@ export const ConnectionList = observer(function ConnectionList({ connecti const connections = getFilteredConnections(connectionList, filterState.filterValue); const keys = connections.map(connection => connection.id); - return styled(style)( - - + return ( + +
- - !grantedSubjects.includes(item)} size="big"> - +
+
!grantedSubjects.includes(item)} size="big"> + {!connections.length && filterState.filterValue && ( @@ -117,8 +92,8 @@ export const ConnectionList = observer(function ConnectionList({ connecti })}
-
- - , +
+
+ ); }); diff --git a/webapp/packages/plugin-version-update-administration/src/VersionInfo.m.css b/webapp/packages/plugin-version-update-administration/src/VersionInfo.m.css new file mode 100644 index 0000000000..d1feb88d47 --- /dev/null +++ b/webapp/packages/plugin-version-update-administration/src/VersionInfo.m.css @@ -0,0 +1,10 @@ +.group { + list-style-position: inside; + height: 100%; + max-height: 300px; +} + +.reactMarkdown > * { + margin: 0; + padding: 0; +} \ No newline at end of file diff --git a/webapp/packages/plugin-version-update-administration/src/VersionInfo.tsx b/webapp/packages/plugin-version-update-administration/src/VersionInfo.tsx index cdfb7d8384..1133a47609 100644 --- a/webapp/packages/plugin-version-update-administration/src/VersionInfo.tsx +++ b/webapp/packages/plugin-version-update-administration/src/VersionInfo.tsx @@ -7,44 +7,32 @@ */ import { observer } from 'mobx-react-lite'; import ReactMarkdown from 'react-markdown'; -import styled, { css } from 'reshadow'; -import { Container, Group, GroupItem, GroupTitle, useResource, useStyles, useTranslate } from '@cloudbeaver/core-blocks'; +import { Container, Group, GroupItem, GroupTitle, s, useResource, useS, useTranslate } from '@cloudbeaver/core-blocks'; import { VersionResource } from '@cloudbeaver/core-version'; +import styles from './VersionInfo.m.css'; interface Props { item: string; } -const style = css` - Group { - list-style-position: inside; - height: 100%; - max-height: 300px; - } - ReactMarkdown > * { - margin: 0; - padding: 0; - } -`; - export const VersionInfo = observer(function VersionInfo({ item }) { const translate = useTranslate(); - const styles = useStyles(style); + const style = useS(styles); const versionResource = useResource(VersionInfo, VersionResource, item); const version = versionResource.tryGetData; - return styled(styles)( + return ( - + {version ? `Release notes ${version.number} - ${version.date}` : translate('version_update_version_no_info')} {version && ( - {version.releaseNotes} + {version.releaseNotes} )} - , + ); }); diff --git a/webapp/packages/plugin-version-update-administration/src/VersionSelector.m.css b/webapp/packages/plugin-version-update-administration/src/VersionSelector.m.css new file mode 100644 index 0000000000..e4c42472b4 --- /dev/null +++ b/webapp/packages/plugin-version-update-administration/src/VersionSelector.m.css @@ -0,0 +1,11 @@ +.group { + list-style-position: inside; +} + +.instruction { + white-space: pre-line; +} + +.h4 { + margin: 0; +} \ No newline at end of file diff --git a/webapp/packages/plugin-version-update-administration/src/VersionSelector.tsx b/webapp/packages/plugin-version-update-administration/src/VersionSelector.tsx index fa7eceaa86..2e3ee513e1 100644 --- a/webapp/packages/plugin-version-update-administration/src/VersionSelector.tsx +++ b/webapp/packages/plugin-version-update-administration/src/VersionSelector.tsx @@ -7,37 +7,26 @@ */ import { observer } from 'mobx-react-lite'; import { useEffect, useState } from 'react'; -import styled, { css } from 'reshadow'; -import { Combobox, Container, Group, GroupItem, GroupTitle, useTranslate } from '@cloudbeaver/core-blocks'; +import { Combobox, Container, Group, GroupItem, GroupTitle, s, useS, useTranslate } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { ServerConfigResource } from '@cloudbeaver/core-root'; import { IVersion, VersionResource } from '@cloudbeaver/core-version'; import { VersionUpdateService } from '@cloudbeaver/core-version-update'; import { VersionInfo } from './VersionInfo'; +import styles from './VersionSelector.m.css'; interface Props { versions: IVersion[]; } -const style = css` - Group { - list-style-position: inside; - } - Instruction { - white-space: pre-line; - } - h4 { - margin: 0; - } -`; - export const VersionSelector = observer(function VersionSelector({ versions }) { const versionUpdateService = useService(VersionUpdateService); const versionResource = useService(VersionResource); const serverConfigResource = useService(ServerConfigResource); const translate = useTranslate(); + const style = useS(styles); const [selected, setSelected] = useState(''); @@ -50,9 +39,9 @@ export const VersionSelector = observer(function VersionSelector({ versio const version = versions.find(v => v.number === selected); const Instruction = versionUpdateService.versionInstructionGetter?.(); - return styled(style)( + return ( - + value.number} @@ -65,15 +54,15 @@ export const VersionSelector = observer(function VersionSelector({ versio {version && Instruction && ( - + )} {translate('plugin_version_update_administration_recommendations_label')} -

{translate('plugin_version_update_administration_recommendations')}

+

{translate('plugin_version_update_administration_recommendations')}

{version && } -
, + ); }); diff --git a/webapp/packages/plugin-version-update-administration/src/VersionUpdate.m.css b/webapp/packages/plugin-version-update-administration/src/VersionUpdate.m.css new file mode 100644 index 0000000000..9228375c4e --- /dev/null +++ b/webapp/packages/plugin-version-update-administration/src/VersionUpdate.m.css @@ -0,0 +1,4 @@ +.coloredContainer { + composes: theme-typography--body2 from global; + list-style-position: inside; +} \ No newline at end of file diff --git a/webapp/packages/plugin-version-update-administration/src/VersionUpdate.tsx b/webapp/packages/plugin-version-update-administration/src/VersionUpdate.tsx index 80b51adca6..90f83e5a60 100644 --- a/webapp/packages/plugin-version-update-administration/src/VersionUpdate.tsx +++ b/webapp/packages/plugin-version-update-administration/src/VersionUpdate.tsx @@ -6,11 +6,10 @@ * you may not use this file except in compliance with the License. */ import { observer } from 'mobx-react-lite'; -import styled, { css } from 'reshadow'; import { gte } from 'semver'; import type { AdministrationItemContentComponent } from '@cloudbeaver/core-administration'; -import { ColoredContainer, useResource, useStyles } from '@cloudbeaver/core-blocks'; +import { ColoredContainer, s, useResource, useS, useStyles } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { CachedMapAllKey } from '@cloudbeaver/core-resource'; import { VersionResource, VersionService } from '@cloudbeaver/core-version'; @@ -18,16 +17,10 @@ import { VersionUpdateService } from '@cloudbeaver/core-version-update'; import { VersionChecker } from './VersionChecker'; import { VersionSelector } from './VersionSelector'; - -const styles = css` - ColoredContainer { - composes: theme-typography--body2 from global; - list-style-position: inside; - } -`; +import styles from './VersionUpdate.m.css'; export const VersionUpdate: AdministrationItemContentComponent = observer(function VersionUpdate() { - const style = useStyles(styles); + const style = useS(styles); const versionService = useService(VersionService); const versionUpdateService = useService(VersionUpdateService); const versionResource = useResource(VersionUpdate, VersionResource, CachedMapAllKey, { @@ -37,8 +30,8 @@ export const VersionUpdate: AdministrationItemContentComponent = observer(functi const GeneralInstructions = versionUpdateService.generalInstructionsGetter?.(); const versions = versionResource.resource.values.filter(v => gte(v.number, versionService.current)); - return styled(style)( - + return ( + {versions.length > 0 && ( <> @@ -46,6 +39,6 @@ export const VersionUpdate: AdministrationItemContentComponent = observer(functi )} - , + ); });