Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cb 3861 Migrate Simple component to CSS modules #2009

Merged
merged 41 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f1117c6
feat: migrate Body to css-modules
teunlao Sep 19, 2023
99aabb9
feat: migrate Main to css-modules
teunlao Sep 19, 2023
986d6b8
feat: migrate AppRefreshButton to css-modules
teunlao Sep 19, 2023
af50248
feat: migrate Button to css-modules
teunlao Sep 19, 2023
b18a141
feat: migrate Cell to css-modules
teunlao Sep 19, 2023
5695e4d
feat: migrate Code to css-modules
teunlao Sep 19, 2023
4b16942
feat: migrate DisplayError to css-modules
teunlao Sep 19, 2023
f518c8b
feat: migrate ErrorBoundary to css-modules
teunlao Sep 19, 2023
6861539
feat: migrate ExceptionMessage to css-modules
teunlao Sep 19, 2023
37a40a6
feat: migrate Iframe to css-modules
teunlao Sep 19, 2023
c7de207
feat: migrate InfoItem to css-modules
teunlao Sep 19, 2023
56495f0
feat: migrate Link to css-modules
teunlao Sep 19, 2023
e6d6cab
feat: migrate StatusMessage to css-modules
teunlao Sep 19, 2023
94ef0dd
feat: migrate TextPlaceholder to css-modules
teunlao Sep 19, 2023
d6d68d1
feat: migrate TimerIcon to css-modules
teunlao Sep 19, 2023
0a7c2b4
feat: migrate UploadArea to css-modules
teunlao Sep 19, 2023
bbf4a32
feat: migrate ConnectionMark to css-modules
teunlao Sep 19, 2023
905077a
feat: Expandable ConnectionMark to css-modules
teunlao Sep 20, 2023
fca6a7f
feat: migrate RightArea, Split styles to css-modules
teunlao Sep 20, 2023
0b0a0ac
feat: fixes after review
teunlao Sep 21, 2023
18e6456
feat: fixes after review
teunlao Sep 21, 2023
b8c53c7
feat: fixes after review
teunlao Sep 22, 2023
634eecd
feat: fixes after review
teunlao Sep 22, 2023
6ed0239
Merge remote-tracking branch 'origin/devel' into CB-3861
teunlao Sep 22, 2023
16fdbb8
fix: fixes after review
teunlao Sep 25, 2023
1ba96e6
fix: iframe style import
teunlao Sep 25, 2023
6127d23
Merge remote-tracking branch 'origin/devel' into CB-3861
teunlao Sep 25, 2023
18d30dc
Merge branch 'devel' into CB-3861
mr-anton-t Sep 26, 2023
aac080f
Merge remote-tracking branch 'origin/devel' into CB-3861
teunlao Sep 28, 2023
41463d6
fix: fix ui bugs after tests
teunlao Sep 28, 2023
83428a4
Merge remote-tracking branch 'origin/devel' into CB-3861
teunlao Sep 28, 2023
b8c486d
Merge remote-tracking branch 'origin/devel' into CB-3861
teunlao Oct 2, 2023
e2b1b65
fix: versionChecker styles
teunlao Oct 2, 2023
7353c34
fix: properties-table add button styles
teunlao Oct 2, 2023
610de09
fix: table-viewer border styles
teunlao Oct 2, 2023
cfb4823
Merge remote-tracking branch 'origin/devel' into CB-3861
teunlao Oct 2, 2023
fe4f2bc
CB-3861 fix: styles
Wroud Oct 3, 2023
7786add
CB-3861 fix: styles
Wroud Oct 3, 2023
b2a574f
fix: fix test error
teunlao Oct 3, 2023
3d8af60
Merge remote-tracking branch 'origin/devel' into CB-3861
teunlao Oct 3, 2023
f4a02c0
Merge branch 'devel' into CB-3861
mr-anton-t Oct 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions webapp/packages/core-app/src/AppScreen/Main.m.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,7 @@
composes: theme-background-surface theme-text-on-surface from global;
display: flex;
position: relative;
flex: 1 1 0%;
overflow: auto;
z-index: 0;
}
.loader {
height: 100%;
}
.split {
display: flex;
flex-direction: row;
flex: 1;
overflow: hidden;
z-index: 0;
}

15 changes: 4 additions & 11 deletions webapp/packages/core-app/src/AppScreen/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,24 @@ export const Main = observer(function Main() {
<Loader className={s(styles, { loader: true })} suspense>
<main className={s(styles, { space: true })}>
<Split
className={s(styles, { split: true })}
{...splitMainState}
sticky={30}
mode={leftBarDisabled ? 'minimize' : splitMainState.mode}
disable={leftBarDisabled}
>
<Pane className={s(styles, { pane: true })} basis="250px" main>
<Pane basis="250px" main>
<Loader suspense>
<SideBarPanel container={leftBarPanelService.tabsContainer} />
</Loader>
</Pane>
<ResizerControls />
<Pane className={s(styles, { pane: true })}>
<Split
className={s(styles, { split: true })}
{...splitRightState}
mode={sideBarDisabled ? 'minimize' : splitRightState.mode}
disable={sideBarDisabled}
sticky={30}
>
<Pane>
<Split {...splitRightState} mode={sideBarDisabled ? 'minimize' : splitRightState.mode} disable={sideBarDisabled} sticky={30}>
<Pane className={s(styles, { pane: true })}>
<RightArea />
</Pane>
<ResizerControls />
<Pane basis="250px" main className={s(styles, { pane: true })}>
<Pane basis="250px" main >
<Loader suspense className={s(styles, { loader: true })}>
<SideBarPanel container={sideBarPanelService.tabsContainer} />
</Loader>
Expand Down
25 changes: 0 additions & 25 deletions webapp/packages/core-app/src/AppScreen/RightArea.m.css
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
.pane {
composes: theme-background-surface theme-text-on-surface from global;
display: flex;
overflow: auto;
}
.loader {
height: 100%;
}
.slideBox {
flex: 1;
}
.space {
display: flex;
flex-direction: row;
flex: 1;
overflow: hidden;
height: 100%;
}
.split {
display: flex;
flex-direction: column;
height: 100%;
flex: 1;
overflow: hidden;
z-index: 0;
}
.pane {
flex: 1 1 0%;
overflow: auto;
z-index: 0;
}
25 changes: 8 additions & 17 deletions webapp/packages/core-app/src/AppScreen/RightArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
ResizerControls,
s,
SlideBox,
SlideBoxStyles,
SlideElement,
SlideOverlay,
Split,
Expand All @@ -32,7 +31,7 @@ interface Props {
}

export const RightArea = observer<Props>(function RightArea({ className }) {
const styles = useS(SlideBoxStyles, style);
const styles = useS(style);
const toolsPanelService = useService(ToolsPanelService);
const optionsPanelService = useService(OptionsPanelService);
const splitState = useSplitUserState('right-area');
Expand All @@ -43,35 +42,27 @@ export const RightArea = observer<Props>(function RightArea({ className }) {
const toolsDisabled = activeTools.length === 0 || toolsPanelService.disabled;

return (
<SlideBox open={optionsPanelService.active} className={s(styles, { slideBox: true, open: optionsPanelService.active }, className)}>
<SlideElement className={s(styles, { slideElement: true })}>
<SlideBox className={s(styles, { slideBox: true }, className)}>
<SlideElement open={optionsPanelService.active}>
<Loader className={s(styles, { loader: true })} suspense>
<OptionsPanel />
</Loader>
</SlideElement>
<SlideElement className={s(styles, { slideElement: true })}>
<Split
className={s(styles, { split: true })}
{...splitState}
sticky={30}
split="horizontal"
mode={toolsDisabled ? 'minimize' : splitState.mode}
disable={toolsDisabled}
keepRatio
>
<Pane className={s(styles, { pane: true })}>
<SlideElement open={optionsPanelService.active}>
<Split {...splitState} sticky={30} split="horizontal" mode={toolsDisabled ? 'minimize' : splitState.mode} disable={toolsDisabled} keepRatio>
<Pane>
<Loader className={s(styles, { loader: true })} suspense>
<NavigationTabsBar />
</Loader>
</Pane>
<ResizerControls />
<Pane className={s(styles, { pane: true })} basis="30%" main>
<Pane basis="30%" main>
<Loader className={s(styles, { loader: true })} suspense>
<ToolsPanel container={toolsPanelService.tabsContainer} />
</Loader>
</Pane>
</Split>
<SlideOverlay className={s(styles, { slideOverlay: true })} onClick={() => optionsPanelService.close()} />
<SlideOverlay open={optionsPanelService.active} onClick={() => optionsPanelService.close()} />
</SlideElement>
</SlideBox>
);
Expand Down
47 changes: 0 additions & 47 deletions webapp/packages/core-blocks/src/Slide/SlideBox.m.css
Original file line number Diff line number Diff line change
@@ -1,51 +1,4 @@
.slideBox {
overflow: hidden;
white-space: nowrap;

& .slideElement {
width: 100%;
height: 100%;
display: inline-block;
vertical-align: top;
white-space: normal;
transition: transform cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
transform: translateX(-100%);

&:first-child {
transition: width cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
width: 100%;
}
}

& .slideOverlay {
position: absolute;
cursor: pointer;
display: flex;
align-items: center;
width: 0;
height: 0;
top: 0;
left: 0;
background: rgb(0 0 0 / 0%);
transition: background cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
}

&.open {
& .slideOverlay {
width: 100%;
height: 100%;
background: rgb(0 0 0 / 35%);

& > :global(div) {
display: flex;
}
}
& .slideElement {
transform: translateX(0%);

&:first-child {
width: calc(100% - 120px);
}
}
}
}
13 changes: 9 additions & 4 deletions webapp/packages/core-blocks/src/Slide/SlideBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { observer } from 'mobx-react-lite';
import { useEffect, useRef } from 'react';

import { s, useS } from '../index';
import style from './SlideBox.m.css';

interface Props {
open?: boolean;
className?: string;
children?: React.ReactNode;
}

export const SlideBox: React.FC<React.PropsWithChildren<Props>> = function SlideBox({ children, className }) {
export const SlideBox = observer<Props>(function SlideBox({ children, className }) {
const styles = useS(style);
const divRef = useRef<HTMLDivElement>(null);

useEffect(() => {
Expand All @@ -37,8 +42,8 @@ export const SlideBox: React.FC<React.PropsWithChildren<Props>> = function Slide
}, []);

return (
<div ref={divRef} className={className}>
<div ref={divRef} className={s(styles, { slideBox: true }, className)}>
{children}
</div>
);
};
});
22 changes: 22 additions & 0 deletions webapp/packages/core-blocks/src/Slide/SlideElement.m.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.slideElement {
width: 100%;
height: 100%;
display: inline-block;
vertical-align: top;
white-space: normal;
transition: transform cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
transform: translateX(-100%);

&:first-child {
transition: width cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
width: 100%;
}

&.open {
transform: translateX(0%);

&:first-child {
width: calc(100% - 120px);
}
}
}
15 changes: 12 additions & 3 deletions webapp/packages/core-blocks/src/Slide/SlideElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { observer } from 'mobx-react-lite';

import { s } from '../s';
import { useS } from '../useS';
import style from './SlideElement.m.css';

interface Props {
className?: string;
children?: React.ReactNode;
open?: boolean;
}

export const SlideElement: React.FC<React.PropsWithChildren<Props>> = function SlideElement({ children, className }) {
return <div className={className}>{children}</div>;
};
export const SlideElement = observer<Props>(function SlideElement({ children,open, className }) {
const styles = useS(style);

return <div className={s(styles, { slideElement: true, open }, className)}>{children}</div>;
});
40 changes: 40 additions & 0 deletions webapp/packages/core-blocks/src/Slide/SlideOverlay.m.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.slideOverlay {
z-index: 1;
position: absolute;
cursor: pointer;
display: flex;
align-items: center;
width: 0;
height: 0;
top: 0;
left: 0;
background: rgb(0 0 0 / 0%);
transition: background cubic-bezier(0.4, 0, 0.2, 1) 0.6s;

&.open {
width: 100%;
height: 100%;
background: rgb(0 0 0 / 35%);

& > :global(div) {
display: flex;
}
}
}

.iconBtn {
composes: theme-background-surface theme-text-on-surface theme-ripple from global;
box-sizing: border-box;
margin-left: 36px;
width: 48px;
height: 48px;
padding: 16px;
border-radius: 50%;
display: none;
overflow: hidden;
align-items: center;
transform: rotate(90deg);
}
.icon {
width: 100%;
}
43 changes: 14 additions & 29 deletions webapp/packages/core-blocks/src/Slide/SlideOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,28 @@
* Licensed under the Apache License, Version 2.0.
* 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';
import { useS } from '../useS';
import style from './SlideOverlay.m.css';

interface Props {
className?: string;
onClick?: () => void;
open?: boolean;
}

const styles = css`
div {
z-index: 1;
}
icon-btn {
composes: theme-background-surface theme-text-on-surface theme-ripple from global;
box-sizing: border-box;
margin-left: 36px;
width: 48px;
height: 48px;
padding: 16px;
border-radius: 50%;
display: none;
overflow: hidden;
align-items: center;
transform: rotate(90deg);
}
Icon {
width: 100%;
}
`;
export const SlideOverlay = observer<Props>(function SlideOverlay({ className, open, onClick }) {
const styles = useS(style);

export const SlideOverlay: React.FC<Props> = function SlideOverlay({ className, onClick }) {
return styled(styles)(
<div className={className} onClick={onClick}>
<icon-btn>
<Icon name="angle" viewBox="0 0 15 8" />
</icon-btn>
</div>,
return (
<div className={s(styles, { slideOverlay: true, open }, className)} onClick={onClick}>
<div className={s(styles, { iconBtn: true })}>
<Icon className={s(styles, { icon: true })} name="angle" viewBox="0 0 15 8" />
</div>
</div>
);
};
});
7 changes: 7 additions & 0 deletions webapp/packages/core-blocks/src/Split/Pane.m.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.pane {
flex: 1 1 0%;
overflow: auto;
z-index: 0;
composes: theme-background-surface theme-text-on-surface from global;
display: flex;
}
Loading
Loading