Skip to content

Commit 13be30f

Browse files
feat: update design system tokens (#39)
1 parent c21e04f commit 13be30f

31 files changed

Lines changed: 355 additions & 377 deletions
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import styled from '@emotion/styled';
2+
import { css } from '@emotion/react';
3+
4+
export const CloseIcon = styled.svg(
5+
({ theme: { custom } }) => css`
6+
cursor: pointer;
7+
fill: ${custom.com.icon.background};
8+
`
9+
);
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import * as Styled from './InfoIcon.styled.ts';
1+
import * as Styled from './CloseIcon.styled.ts';
22

3-
function InfoClosed({
3+
function CloseIcon({
44
className,
55
onClick,
66
}: {
77
className?: string;
88
onClick: () => void;
99
}) {
1010
return (
11-
<Styled.Closed
11+
<Styled.CloseIcon
1212
xmlns="http://www.w3.org/2000/svg"
1313
viewBox="0 0 24 24"
1414
width="32"
1515
className={className}
1616
onClick={onClick}
1717
>
1818
<path d="M12,2A10,10,0,1,0,22,12,10,10,0,0,0,12,2Zm3.707,12.293a1,1,0,1,1-1.414,1.414L12,13.414,9.707,15.707a1,1,0,0,1-1.414-1.414L10.586,12,8.293,9.707A1,1,0,0,1,9.707,8.293L12,10.586l2.293-2.293a1,1,0,0,1,1.414,1.414L13.414,12Z" />
19-
</Styled.Closed>
19+
</Styled.CloseIcon>
2020
);
2121
}
2222

23-
export default InfoClosed;
23+
export default CloseIcon;

src/components/CloseIcon/InfoIcon.styled.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/components/InfoIcon/InfoIcon.styled.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ import styled from '@emotion/styled';
22
import { css } from '@emotion/react';
33

44
export const Info = styled.svg(
5-
({ theme }) => css`
5+
({ theme: { custom } }) => css`
66
position: absolute;
7-
top: 4px;
8-
right: 4px;
7+
top: 6px;
8+
right: 6px;
99
cursor: pointer;
10-
fill: ${theme.custom.colors.onContainer.normal};
11-
12-
&:hover {
13-
fill: ${theme.custom.colors.onContainer.contrast};
14-
}
10+
fill: ${custom.com.icon.background};
1511
`
1612
);

src/components/Modal/Modal.styled.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import styled from '@emotion/styled';
33
import { Box } from '@mui/material';
44

55
export const StyledBox = styled(Box)(
6-
({ theme }) => css`
6+
({ theme: { custom } }) => css`
77
position: absolute;
88
top: 50%;
99
left: 50%;
1010
transform: translate(-50%, -50%);
1111
box-sizing: border-box;
12-
background: ${theme.custom.colors.container};
12+
background: ${custom.com.modal.background};
1313
padding: 40px;
1414
max-width: 400px;
1515
width: 90%;

src/components/MoonIcon/MoonIcon.styled.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { css } from '@emotion/react';
44
export const Sun = styled.svg(
55
({ theme }) => css`
66
cursor: pointer;
7-
fill: ${theme.custom.colors.onContainer.contrast};
7+
fill: ${theme.custom.sys.colors.onBackground};
88
`
99
);

src/components/MoonIcon/MoonIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function MoonIcon({
99
onClick: () => void;
1010
}) {
1111
const theme = useTheme();
12-
const textColor = theme.custom.colors.onContainer.contrast;
12+
const textColor = theme.custom.sys.colors.onBackground;
1313

1414
return (
1515
<Styled.Sun

src/components/SunIcon/SunIcon.styled.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { css } from '@emotion/react';
44
export const Sun = styled.svg(
55
({ theme }) => css`
66
cursor: pointer;
7-
fill: ${theme.custom.colors.onContainer.contrast};
7+
fill: ${theme.custom.sys.colors.onBackground};
88
`
99
);

src/components/SunIcon/SunIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function SunIcon({
99
onClick: () => void;
1010
}) {
1111
const theme = useTheme();
12-
const textColor = theme.custom.colors.onContainer.contrast;
12+
const textColor = theme.custom.sys.colors.onBackground;
1313

1414
return (
1515
<Styled.Sun

src/emotion.d.ts

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,15 @@
11
import '@emotion/react';
2+
import { ReferenceTokens } from './theme/tokens.ref.ts';
3+
import { SystemTokens } from './theme/tokens.sys.ts';
4+
import { ComponentTokens } from './theme/tokens.com.ts';
25

36
declare module '@emotion/react' {
47
export interface Theme {
58
custom: {
69
mode: 'light' | 'dark';
7-
breakpoints: {
8-
desktop: number;
9-
};
10-
transitions: {
11-
color: string;
12-
};
13-
animations: {
14-
zoomIn: string;
15-
};
16-
widths: {
17-
eventLoopRadius: number;
18-
eventLoopDiameter: number;
19-
eventLoopWheelWidth: number;
20-
eventLoopPointerBorderWidth: number;
21-
};
22-
colors: {
23-
background: string;
24-
onBackground: string;
25-
container: string;
26-
onContainer: {
27-
dim: string;
28-
normal: string;
29-
contrast: string;
30-
};
31-
primary: {
32-
dim: string;
33-
normal: string;
34-
contrast: string;
35-
};
36-
secondary: {
37-
dim: string;
38-
normal: string;
39-
contrast: string;
40-
};
41-
tertiary: {
42-
dim: string;
43-
normal: string;
44-
contrast: string;
45-
};
46-
};
10+
ref: ReferenceTokens;
11+
sys: SystemTokens;
12+
com: ComponentTokens;
4713
};
4814
}
4915
}

0 commit comments

Comments
 (0)