@lunit/design-system 1.0.0-a.5 → 1.0.0-b.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/components/Alert/index.js +1 -1
- package/dist/cjs/components/Alert/index.js.map +1 -1
- package/dist/cjs/components/Button/index.js +1 -1
- package/dist/cjs/components/Button/index.js.map +1 -1
- package/dist/cjs/components/Checkbox/index.js +1 -1
- package/dist/cjs/components/Checkbox/index.js.map +1 -1
- package/dist/cjs/components/Chip/index.js +1 -1
- package/dist/cjs/components/Chip/index.js.map +1 -1
- package/dist/cjs/components/Radio/index.js +1 -1
- package/dist/cjs/components/Radio/index.js.map +1 -1
- package/dist/cjs/components/TextField/index.js +1 -1
- package/dist/cjs/components/TextField/index.js.map +1 -1
- package/dist/cjs/components/Toggle/index.js +1 -1
- package/dist/cjs/components/Toggle/index.js.map +1 -1
- package/dist/cjs/components/ToggleButton/index.js +1 -1
- package/dist/cjs/components/ToggleButton/index.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/components/Alert/Alert.styled.js +2 -2
- package/dist/components/Alert/Alert.styled.js.map +1 -1
- package/dist/components/Alert/Alert.utils.js +12 -12
- package/dist/components/Alert/Alert.utils.js.map +1 -1
- package/dist/components/Button/Button.styled.js +33 -33
- package/dist/components/Button/Button.styled.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +4 -4
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Chip/Chip.styled.js +15 -15
- package/dist/components/Chip/Chip.styled.js.map +1 -1
- package/dist/components/Radio/Radio.js +3 -3
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/TextField/TextField.style.js +27 -27
- package/dist/components/TextField/TextField.style.js.map +1 -1
- package/dist/components/Toast/Toast.styled.js +3 -3
- package/dist/components/Toast/Toast.styled.js.map +1 -1
- package/dist/components/Toast/Toast.utils.js +4 -4
- package/dist/components/Toast/Toast.utils.js.map +1 -1
- package/dist/components/Toggle/Toggle.styled.js +20 -20
- package/dist/components/Toggle/Toggle.styled.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.styled.js +7 -7
- package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
- package/dist/foundation/Elevation/index.js +4 -4
- package/dist/foundation/Elevation/index.js.map +1 -1
- package/dist/foundation/colors/index.js +3 -2
- package/dist/foundation/colors/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/theme.js +3 -2
- package/dist/theme.js.map +1 -1
- package/dist/types/components/Button/Button.styled.d.ts +7 -7
- package/dist/types/components/Chip/Chip.styled.d.ts +12 -12
- package/dist/types/components/Toggle/Toggle.styled.d.ts +1 -1
- package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
- package/dist/types/foundation/colors/index.d.ts +6 -6
- package/dist/types/foundation/index.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/theme.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/Alert/Alert.styled.ts +2 -2
- package/src/components/Alert/Alert.utils.ts +12 -12
- package/src/components/Button/Button.styled.ts +34 -34
- package/src/components/Checkbox/Checkbox.tsx +4 -4
- package/src/components/Chip/Chip.styled.ts +15 -15
- package/src/components/Radio/Radio.tsx +3 -3
- package/src/components/TextField/TextField.style.ts +28 -28
- package/src/components/Toast/Toast.styled.ts +3 -3
- package/src/components/Toast/Toast.utils.ts +4 -4
- package/src/components/Toggle/Toggle.styled.ts +42 -39
- package/src/components/ToggleButton/ToggleButton.styled.ts +7 -7
- package/src/foundation/Elevation/index.ts +4 -4
- package/src/foundation/colors/index.ts +29 -26
- package/src/index.ts +1 -1
- package/src/stories/components/Alert/Alert.stories.tsx +1 -1
- package/src/stories/foundation/Typography/TypographyGroup.tsx +1 -1
- package/src/stories/foundation/colors/Colors.stories.tsx +3 -3
- package/src/stories/foundation/colors/Token.inComponent.stories.tsx +21 -19
- package/src/stories/foundation/colors/TokenPaletteTable.tsx +6 -4
- package/src/stories/foundation/colors/styled.ts +1 -1
- package/src/theme.ts +5 -3
|
@@ -5,13 +5,13 @@ import { Box, styled, TextField, Typography, useTheme } from "@mui/material";
|
|
|
5
5
|
export const InComponentWithStyled = () => {
|
|
6
6
|
const StyledTextField = styled(TextField)(({ theme }) => ({
|
|
7
7
|
"& .MuiInputBase-root": {
|
|
8
|
-
backgroundColor: theme.palette.
|
|
9
|
-
color: theme.palette.
|
|
8
|
+
backgroundColor: theme.palette.lunit_token.component.textfield_bg,
|
|
9
|
+
color: theme.palette.lunit_token.core.text_normal,
|
|
10
10
|
"& .MuiInputBase-input": {
|
|
11
11
|
padding: "8px 16px",
|
|
12
12
|
},
|
|
13
13
|
"&.Mui-focused fieldset": {
|
|
14
|
-
borderColor: theme.palette.
|
|
14
|
+
borderColor: theme.palette.lunit_token.core.focused,
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
}));
|
|
@@ -49,13 +49,13 @@ export const InComponentWithSx = () => {
|
|
|
49
49
|
sx={{
|
|
50
50
|
"& .MuiInputBase-root": {
|
|
51
51
|
backgroundColor: (theme) =>
|
|
52
|
-
theme.palette.
|
|
53
|
-
color: (theme) => theme.palette.
|
|
52
|
+
theme.palette.lunit_token.component.textfield_bg,
|
|
53
|
+
color: (theme) => theme.palette.lunit_token.core.text_normal,
|
|
54
54
|
"& .MuiInputBase-input": {
|
|
55
55
|
padding: "8px 16px",
|
|
56
56
|
},
|
|
57
57
|
"&.Mui-focused fieldset": {
|
|
58
|
-
borderColor: (theme) => theme.palette.
|
|
58
|
+
borderColor: (theme) => theme.palette.lunit_token.core.focused,
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
}}
|
|
@@ -65,10 +65,11 @@ export const InComponentWithSx = () => {
|
|
|
65
65
|
<Box
|
|
66
66
|
sx={{
|
|
67
67
|
backgroundColor: (theme) =>
|
|
68
|
-
theme.palette.
|
|
69
|
-
color: (theme) =>
|
|
68
|
+
theme.palette.lunit_token.component.alert_info_bg,
|
|
69
|
+
color: (theme) =>
|
|
70
|
+
theme.palette.lunit_token.component.alert_info_border,
|
|
70
71
|
boxShadow: (theme) =>
|
|
71
|
-
`20px -10px 5px ${theme.palette.
|
|
72
|
+
`20px -10px 5px ${theme.palette.lunit_token.core.shadow_01}`,
|
|
72
73
|
width: 300,
|
|
73
74
|
height: 80,
|
|
74
75
|
}}
|
|
@@ -83,13 +84,13 @@ export const InComponentWithSx = () => {
|
|
|
83
84
|
sx={{
|
|
84
85
|
"& .MuiInputBase-root": {
|
|
85
86
|
backgroundColor: (theme) =>
|
|
86
|
-
theme.palette.
|
|
87
|
-
color: (theme) => theme.palette.
|
|
87
|
+
theme.palette.lunit_token.component.textfield_bg,
|
|
88
|
+
color: (theme) => theme.palette.lunit_token.core.text_normal,
|
|
88
89
|
"& .MuiInputBase-input": {
|
|
89
90
|
padding: "8px 16px",
|
|
90
91
|
},
|
|
91
92
|
"&.Mui-focused fieldset": {
|
|
92
|
-
borderColor: (theme) => theme.palette.
|
|
93
|
+
borderColor: (theme) => theme.palette.lunit_token.core.focused,
|
|
93
94
|
},
|
|
94
95
|
},
|
|
95
96
|
}}
|
|
@@ -99,10 +100,11 @@ export const InComponentWithSx = () => {
|
|
|
99
100
|
<Box
|
|
100
101
|
sx={{
|
|
101
102
|
backgroundColor: (theme) =>
|
|
102
|
-
theme.palette.
|
|
103
|
-
color: (theme) =>
|
|
103
|
+
theme.palette.lunit_token.component.alert_info_bg,
|
|
104
|
+
color: (theme) =>
|
|
105
|
+
theme.palette.lunit_token.component.alert_info_border,
|
|
104
106
|
boxShadow: (theme) =>
|
|
105
|
-
`20px -10px 5px ${theme.palette.
|
|
107
|
+
`20px -10px 5px ${theme.palette.lunit_token.core.shadow_01}`,
|
|
106
108
|
width: 300,
|
|
107
109
|
height: 80,
|
|
108
110
|
}}
|
|
@@ -124,7 +126,7 @@ export const InComponentWithInlineStyle = () => {
|
|
|
124
126
|
<TextField
|
|
125
127
|
placeholder="Inline Styled Text Field"
|
|
126
128
|
style={{
|
|
127
|
-
backgroundColor: theme.palette.
|
|
129
|
+
backgroundColor: theme.palette.lunit_token.component.textfield_bg,
|
|
128
130
|
}}
|
|
129
131
|
/>
|
|
130
132
|
</BaseBox>
|
|
@@ -132,7 +134,7 @@ export const InComponentWithInlineStyle = () => {
|
|
|
132
134
|
<TextField
|
|
133
135
|
placeholder="Inline Styled Text Field"
|
|
134
136
|
style={{
|
|
135
|
-
backgroundColor: theme.palette.
|
|
137
|
+
backgroundColor: theme.palette.lunit_token.component.textfield_bg,
|
|
136
138
|
}}
|
|
137
139
|
/>
|
|
138
140
|
</BaseBox>
|
|
@@ -151,13 +153,13 @@ const BaseBox = ({ theme, children }: BaseBoxProps) => {
|
|
|
151
153
|
className={theme === "light" ? "light1" : "dark1"}
|
|
152
154
|
width={500}
|
|
153
155
|
height={200}
|
|
154
|
-
bgcolor={
|
|
156
|
+
bgcolor={(sxTheme) => sxTheme.palette.lunit_token.core.bg_01}
|
|
155
157
|
border="1px solid"
|
|
156
158
|
p={2}
|
|
157
159
|
>
|
|
158
160
|
<Typography
|
|
159
161
|
variant="body1_16_semibold"
|
|
160
|
-
color={(
|
|
162
|
+
color={(sxTheme) => sxTheme.palette.lunit_token.core.text_normal}
|
|
161
163
|
>
|
|
162
164
|
{theme === "light" ? "= light1 =" : "= dark1 ="}
|
|
163
165
|
</Typography>
|
|
@@ -25,7 +25,9 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
25
25
|
const theme = useTheme();
|
|
26
26
|
|
|
27
27
|
const colorTokenMap = Object.entries(
|
|
28
|
-
kind === "core"
|
|
28
|
+
kind === "core"
|
|
29
|
+
? theme.palette.lunit_token.core
|
|
30
|
+
: theme.palette.lunit_token.component
|
|
29
31
|
);
|
|
30
32
|
|
|
31
33
|
const TokenPaletteCell = (props: {
|
|
@@ -43,8 +45,8 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
43
45
|
|
|
44
46
|
const boxColorByToken =
|
|
45
47
|
kind === "core"
|
|
46
|
-
? theme.palette.
|
|
47
|
-
: theme.palette.
|
|
48
|
+
? theme.palette.lunit_token.core[paletteKey as keyof ColorToken["core"]]
|
|
49
|
+
: theme.palette.lunit_token.component[
|
|
48
50
|
paletteKey as keyof ColorToken["component"]
|
|
49
51
|
];
|
|
50
52
|
|
|
@@ -57,7 +59,7 @@ const TokenPaletteTable = ({ kind }: TokenPaletteTableProps) => {
|
|
|
57
59
|
<TableCell
|
|
58
60
|
className={surface}
|
|
59
61
|
sx={{
|
|
60
|
-
background: theme.palette.
|
|
62
|
+
background: theme.palette.lunit_token.core.bg_01,
|
|
61
63
|
padding: 0,
|
|
62
64
|
}}
|
|
63
65
|
>
|
|
@@ -33,7 +33,7 @@ export const Color = styled(Box)({
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
export const StyledTypography = styled(Typography)(({ theme }) => ({
|
|
36
|
-
color: theme.palette.
|
|
36
|
+
color: theme.palette.lunit_token.core.text_normal,
|
|
37
37
|
marginLeft: 8,
|
|
38
38
|
fontSize: "12px",
|
|
39
39
|
}));
|
package/src/theme.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { deepmerge } from "@mui/utils";
|
|
2
|
-
import {
|
|
2
|
+
import { createTheme, ThemeOptions } from "@mui/material";
|
|
3
3
|
import {
|
|
4
4
|
foundationCssBaseline,
|
|
5
5
|
palette,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./foundation";
|
|
10
10
|
import { componentsCssBaseline } from "./components";
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
export const themeOptions: ThemeOptions = {
|
|
13
13
|
typography,
|
|
14
14
|
palette,
|
|
15
15
|
spacing,
|
|
@@ -41,6 +41,8 @@ const theme = createTheme({
|
|
|
41
41
|
},
|
|
42
42
|
// @todo add any MUI components theme exported from ./components/index.ts
|
|
43
43
|
},
|
|
44
|
-
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const theme = createTheme(themeOptions);
|
|
45
47
|
|
|
46
48
|
export default theme;
|