Skip to content

Commit

Permalink
feat: switch to emotion
Browse files Browse the repository at this point in the history
  • Loading branch information
malcodeman committed Oct 3, 2024
1 parent 384712f commit f176794
Show file tree
Hide file tree
Showing 19 changed files with 487 additions and 205 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
## [1.5.2](https://github.com/vault-developer/event-loop-explorer/compare/v1.5.1...v1.5.2) (2024-08-31)


### Bug Fixes

* fix pause animation bug ([c7abf68](https://github.com/vault-developer/event-loop-explorer/commit/c7abf68dba7607a53413de13f2e51ef46e7bd07c))
- fix pause animation bug ([c7abf68](https://github.com/vault-developer/event-loop-explorer/commit/c7abf68dba7607a53413de13f2e51ef46e7bd07c))

## [1.5.1](https://github.com/vault-developer/event-loop-explorer/compare/v1.5.0...v1.5.1) (2024-08-31)

Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,21 @@
},
"dependencies": {
"@commitlint/cli": "^19.4.0",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@eslint/compat": "^1.1.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.9.1",
"@mui/icons-material": "^6.0.1",
"@mui/material": "^5.16.7",
"@mui/styled-engine": "npm:@mui/styled-engine-sc@latest",
"@mui/styled-engine-sc": "6.0.0-alpha.18",
"ace-builds": "^1.36.0",
"acorn": "^8.12.1",
"globals": "^15.9.0",
"react": "^18.3.1",
"react-ace": "^12.0.0",
"react-dom": "^18.3.1",
"styled-components": "^6.1.12",
"zustand": "^4.5.5"
},
"resolutions": {
"@mui/styled-engine": "npm:@mui/styled-engine-sc@latest"
},
"devDependencies": {
"@commitlint/config-conventional": "^19.2.2",
"@semantic-release/changelog": "^6.0.3",
Expand Down
4 changes: 2 additions & 2 deletions src/App.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';

export const Layout = styled.div`
flex: 1;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Callstack/Callstack.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';
import InfoClosed from '../CloseIcon/InfoIcon.tsx';

export const Callstack = styled.div`
Expand Down
4 changes: 2 additions & 2 deletions src/components/CloseIcon/InfoIcon.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';

export const Closed = styled.svg(
({ theme }) => css`
Expand Down
4 changes: 2 additions & 2 deletions src/components/Console/Console.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';

export const LogQueue = styled.div`
flex: 1;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Editor/Editor.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';
import Button from '@mui/material/Button';

export const SectionWrapper = styled.div`
Expand Down
4 changes: 2 additions & 2 deletions src/components/EventLoop/CircleLabels/CircleLabels.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';

export const LabelsWrapper = styled.div`
position: absolute;
Expand Down
4 changes: 2 additions & 2 deletions src/components/EventLoop/EventLoop.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';
import InfoClosed from '../CloseIcon/InfoIcon.tsx';

export const CircleContainer = styled.div(
Expand Down
2 changes: 1 addition & 1 deletion src/components/EventLoop/EventLoop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEventLoopAnimation } from '../../store/store.ts';
import CircleLabels from './CircleLabels/CircleLabels.tsx';
import { events } from './EventLoop.data.ts';
import * as Styled from './EventLoop.styled.ts';
import { useTheme } from 'styled-components';
import { useTheme } from '@emotion/react';
import InfoIcon from '../InfoIcon/InfoIcon.tsx';
import InfoModal from '../Modal/Modal.tsx';
import useBoolean from '../../utils/useBoolean.tsx';
Expand Down
4 changes: 2 additions & 2 deletions src/components/EventLoop/Pointer/Pointer.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';

export const SectorWithInnerBorder = styled.div(
({
Expand Down
4 changes: 2 additions & 2 deletions src/components/InfoIcon/InfoIcon.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';

export const Info = styled.svg(
({ theme }) => css`
Expand Down
4 changes: 2 additions & 2 deletions src/components/MicroTasksQueue/MicroTasksQueue.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';
import InfoClosed from '../CloseIcon/InfoIcon.tsx';

export const MicroTasksQueue = styled.div`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components';
import styled from '@emotion/styled';
import { css } from '@mui/material';
import InfoClosed from '../CloseIcon/InfoIcon.tsx';

Expand Down
4 changes: 2 additions & 2 deletions src/components/TasksQueue/TasksQueue.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';
import InfoClosed from '../CloseIcon/InfoIcon.tsx';

export const TasksQueue = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion src/components/WebApiQueue/WebApiQueue.styled.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components';
import styled from '@emotion/styled';
import InfoClosed from '../CloseIcon/InfoIcon.tsx';

export const WebApiQueue = styled.div`
Expand Down
4 changes: 2 additions & 2 deletions src/components/WebApiQueue/WebApiTask.styled.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import { css } from '@mui/material';
import styled from '@emotion/styled';
import { css } from '@emotion/react';

export const WebApiItem = styled.div(
({ theme }) => css`
Expand Down
113 changes: 57 additions & 56 deletions src/providers/StylesProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createTheme } from '@mui/material';
import { createGlobalStyle, ThemeProvider } from 'styled-components';
import { ThemeProvider, Global, css } from '@emotion/react';
import { PropsWithChildren } from 'react';

const muiTheme = createTheme({
Expand Down Expand Up @@ -87,66 +87,67 @@ const theme = {
},
};

const GlobalStyles = createGlobalStyle(
({ theme }) => `
html {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
color: ${theme.custom.colors.contrastWhiteColor};
background-color: ${theme.custom.colors.backgroundDark};
height: 100%;
}
div, span, p {
font-size: 14px;
margin: 0;
}
ul, ol {
padding-left: 15px;
&>li:not(:last-child) {
margin-bottom: 10px;
}
}
a {
const globalStyles = css`
html {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
color: ${theme.custom.colors.contrastWhiteColor};
}
body {
margin: 0;
display: flex;
height: 100%;
}
#root {
min-width: 1024px;
margin: 0;
text-align: center;
display: flex;
height: 100%;
width: 100%;
min-height: 814px;
}
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-thumb {
background: ${theme.custom.colors.listItemBackground};
}
:focus-visible {
outline: 2px solid ${theme.custom.colors.listItemBackground};
}
`
);
background-color: ${theme.custom.colors.backgroundDark};
height: 100%;
}
div,
span,
p {
font-size: 14px;
margin: 0;
}
ul,
ol {
padding-left: 15px;
& > li:not(:last-child) {
margin-bottom: 10px;
}
}
a {
color: ${theme.custom.colors.contrastWhiteColor};
}
body {
margin: 0;
display: flex;
height: 100%;
}
#root {
min-width: 1024px;
margin: 0;
text-align: center;
display: flex;
height: 100%;
width: 100%;
min-height: 814px;
}
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-thumb {
background: ${theme.custom.colors.listItemBackground};
}
:focus-visible {
outline: 2px solid ${theme.custom.colors.listItemBackground};
}
`;

function StylesProvider({ children }: PropsWithChildren) {
return (
<ThemeProvider theme={theme}>
<GlobalStyles />
<Global styles={globalStyles} />
{children}
</ThemeProvider>
);
Expand Down
Loading

0 comments on commit f176794

Please sign in to comment.