@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
|
@@ -70,7 +70,7 @@ const getTextFieldPaddingBySize = ({
|
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
const commonStyle = ({
|
|
73
|
+
const commonStyle = ({ lunit_token }: { lunit_token: ColorToken }) => ({
|
|
74
74
|
"&.MuiTextField-root": {
|
|
75
75
|
width: "100%",
|
|
76
76
|
},
|
|
@@ -82,24 +82,24 @@ const commonStyle = ({ token }: { token: ColorToken }) => ({
|
|
|
82
82
|
border: "none",
|
|
83
83
|
},
|
|
84
84
|
"&.Mui-error fieldset": {
|
|
85
|
-
border: `1px solid ${
|
|
85
|
+
border: `1px solid ${lunit_token.component.textfield_border_error}`,
|
|
86
86
|
},
|
|
87
87
|
"&.Mui-focused fieldset": {
|
|
88
|
-
border: `1px solid ${
|
|
88
|
+
border: `1px solid ${lunit_token.core.focused}`,
|
|
89
89
|
},
|
|
90
90
|
"&.Mui-disabled": {
|
|
91
91
|
opacity: 0.38,
|
|
92
92
|
"&:hover::before": {
|
|
93
|
-
backgroundColor:
|
|
93
|
+
backgroundColor: lunit_token.component.textfield_bg,
|
|
94
94
|
},
|
|
95
95
|
},
|
|
96
96
|
"& input, textarea": {
|
|
97
97
|
padding: 0,
|
|
98
98
|
textOverflow: "ellipsis",
|
|
99
99
|
"&::placeholder": {
|
|
100
|
-
color:
|
|
100
|
+
color: lunit_token.core.text_medium,
|
|
101
101
|
opacity: 1,
|
|
102
|
-
WebkitTextFillColor:
|
|
102
|
+
WebkitTextFillColor: lunit_token.core.text_medium,
|
|
103
103
|
},
|
|
104
104
|
},
|
|
105
105
|
"& textarea": {
|
|
@@ -110,16 +110,16 @@ const commonStyle = ({ token }: { token: ColorToken }) => ({
|
|
|
110
110
|
},
|
|
111
111
|
"&::-webkit-scrollbar-thumb": {
|
|
112
112
|
borderRadius: "6px",
|
|
113
|
-
backgroundColor:
|
|
113
|
+
backgroundColor: lunit_token.component.scrollbars_bg,
|
|
114
114
|
},
|
|
115
115
|
},
|
|
116
|
-
background:
|
|
116
|
+
background: lunit_token.component.textfield_bg,
|
|
117
117
|
overflow: "hidden",
|
|
118
|
-
color:
|
|
118
|
+
color: lunit_token.core.text_normal,
|
|
119
119
|
"&:hover": {
|
|
120
120
|
position: "relative",
|
|
121
121
|
zIndex: 0,
|
|
122
|
-
backgroundColor:
|
|
122
|
+
backgroundColor: lunit_token.component.textfield_bg,
|
|
123
123
|
},
|
|
124
124
|
"&:hover::before": {
|
|
125
125
|
content: '""',
|
|
@@ -129,11 +129,11 @@ const commonStyle = ({ token }: { token: ColorToken }) => ({
|
|
|
129
129
|
width: "100%",
|
|
130
130
|
height: "100%",
|
|
131
131
|
zIndex: -1,
|
|
132
|
-
backgroundColor:
|
|
132
|
+
backgroundColor: lunit_token.core.hover,
|
|
133
133
|
},
|
|
134
134
|
"&.Mui-focused": {
|
|
135
135
|
"&:hover::before": {
|
|
136
|
-
backgroundColor:
|
|
136
|
+
backgroundColor: lunit_token.component.textfield_bg,
|
|
137
137
|
},
|
|
138
138
|
},
|
|
139
139
|
},
|
|
@@ -142,13 +142,13 @@ const commonStyle = ({ token }: { token: ColorToken }) => ({
|
|
|
142
142
|
opacity: 0.38,
|
|
143
143
|
},
|
|
144
144
|
"&.Mui-error": {
|
|
145
|
-
color:
|
|
145
|
+
color: lunit_token.core.text_error,
|
|
146
146
|
},
|
|
147
147
|
},
|
|
148
148
|
});
|
|
149
149
|
|
|
150
150
|
const sizeStyle = ({
|
|
151
|
-
|
|
151
|
+
lunit_token,
|
|
152
152
|
textFieldSize,
|
|
153
153
|
hasLeftIcon,
|
|
154
154
|
hasRightIcon,
|
|
@@ -157,7 +157,7 @@ const sizeStyle = ({
|
|
|
157
157
|
}: Pick<
|
|
158
158
|
BaseTextFieldProps,
|
|
159
159
|
"textFieldSize" | "hasLeftIcon" | "hasRightIcon" | "multiline"
|
|
160
|
-
> & {
|
|
160
|
+
> & { lunit_token: ColorToken; typography: Typography }) => ({
|
|
161
161
|
...(textFieldSize === "small" && {
|
|
162
162
|
"& .MuiInputBase-root": {
|
|
163
163
|
padding: getTextFieldPaddingBySize({
|
|
@@ -179,17 +179,17 @@ const sizeStyle = ({
|
|
|
179
179
|
},
|
|
180
180
|
"& .MuiFormHelperText-root": {
|
|
181
181
|
...typography.body2_14_regular,
|
|
182
|
-
color:
|
|
182
|
+
color: lunit_token.core.text_medium,
|
|
183
183
|
margin: 0,
|
|
184
184
|
marginTop: "4px",
|
|
185
185
|
paddingLeft: "4px",
|
|
186
186
|
|
|
187
187
|
"&.Mui-disabled": {
|
|
188
|
-
color:
|
|
188
|
+
color: lunit_token.core.text_medium,
|
|
189
189
|
opacity: 0.38,
|
|
190
190
|
},
|
|
191
191
|
"&.Mui-error": {
|
|
192
|
-
color:
|
|
192
|
+
color: lunit_token.core.text_error,
|
|
193
193
|
},
|
|
194
194
|
},
|
|
195
195
|
}),
|
|
@@ -214,17 +214,17 @@ const sizeStyle = ({
|
|
|
214
214
|
},
|
|
215
215
|
"& .MuiFormHelperText-root": {
|
|
216
216
|
...typography.body2_14_regular,
|
|
217
|
-
color:
|
|
217
|
+
color: lunit_token.core.text_medium,
|
|
218
218
|
margin: 0,
|
|
219
219
|
marginTop: "4px",
|
|
220
220
|
paddingLeft: "4px",
|
|
221
221
|
|
|
222
222
|
"&.Mui-disabled": {
|
|
223
|
-
color:
|
|
223
|
+
color: lunit_token.core.text_medium,
|
|
224
224
|
opacity: 0.38,
|
|
225
225
|
},
|
|
226
226
|
"&.Mui-error": {
|
|
227
|
-
color:
|
|
227
|
+
color: lunit_token.core.text_error,
|
|
228
228
|
},
|
|
229
229
|
},
|
|
230
230
|
}),
|
|
@@ -249,17 +249,17 @@ const sizeStyle = ({
|
|
|
249
249
|
},
|
|
250
250
|
"& .MuiFormHelperText-root": {
|
|
251
251
|
...typography.body1_16_regular,
|
|
252
|
-
color:
|
|
252
|
+
color: lunit_token.core.text_medium,
|
|
253
253
|
margin: 0,
|
|
254
254
|
marginTop: "4px",
|
|
255
255
|
paddingLeft: "4px",
|
|
256
256
|
|
|
257
257
|
"&.Mui-disabled": {
|
|
258
|
-
color:
|
|
258
|
+
color: lunit_token.core.text_medium,
|
|
259
259
|
opacity: 0.38,
|
|
260
260
|
},
|
|
261
261
|
"&.Mui-error": {
|
|
262
|
-
color:
|
|
262
|
+
color: lunit_token.core.text_error,
|
|
263
263
|
},
|
|
264
264
|
},
|
|
265
265
|
}),
|
|
@@ -282,16 +282,16 @@ const BaseTextField = styled(MuiTextField, {
|
|
|
282
282
|
({
|
|
283
283
|
theme: {
|
|
284
284
|
typography,
|
|
285
|
-
palette: {
|
|
285
|
+
palette: { lunit_token },
|
|
286
286
|
},
|
|
287
287
|
multiline,
|
|
288
288
|
textFieldSize,
|
|
289
289
|
hasLeftIcon,
|
|
290
290
|
hasRightIcon,
|
|
291
291
|
}) => ({
|
|
292
|
-
...commonStyle({
|
|
292
|
+
...commonStyle({ lunit_token }),
|
|
293
293
|
...sizeStyle({
|
|
294
|
-
|
|
294
|
+
lunit_token,
|
|
295
295
|
textFieldSize,
|
|
296
296
|
hasLeftIcon,
|
|
297
297
|
hasRightIcon,
|
|
@@ -312,7 +312,7 @@ const IconWrapper = styled("div")(({ theme }) => ({
|
|
|
312
312
|
"& svg": {
|
|
313
313
|
width: "20px",
|
|
314
314
|
height: "20px",
|
|
315
|
-
color: theme.palette.
|
|
315
|
+
color: theme.palette.lunit_token.core.text_normal,
|
|
316
316
|
},
|
|
317
317
|
}));
|
|
318
318
|
|
|
@@ -10,8 +10,8 @@ export const StyledToast = styled(Alert)(({ theme, severity }) => {
|
|
|
10
10
|
"&.MuiAlert-root": {
|
|
11
11
|
padding: "8px 16px 8px 16px",
|
|
12
12
|
margin: 0,
|
|
13
|
-
color: theme.palette.
|
|
14
|
-
backgroundColor: theme.palette.
|
|
13
|
+
color: theme.palette.lunit_token.core.text_normal,
|
|
14
|
+
backgroundColor: theme.palette.lunit_token.core.bg_03,
|
|
15
15
|
borderRadius: "8px",
|
|
16
16
|
},
|
|
17
17
|
"& .MuiAlert-icon": {
|
|
@@ -42,7 +42,7 @@ export const StyledToast = styled(Alert)(({ theme, severity }) => {
|
|
|
42
42
|
marginRight: "0px",
|
|
43
43
|
padding: 0,
|
|
44
44
|
"& .MuiSvgIcon-root": {
|
|
45
|
-
color: theme.palette.
|
|
45
|
+
color: theme.palette.lunit_token.core.text_normal,
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
};
|
|
@@ -6,12 +6,12 @@ export const getIconColor = (
|
|
|
6
6
|
) => {
|
|
7
7
|
switch (severity) {
|
|
8
8
|
case "info":
|
|
9
|
-
return theme.palette.
|
|
9
|
+
return theme.palette.lunit_token.core.icon_info_02;
|
|
10
10
|
case "warning":
|
|
11
|
-
return theme.palette.
|
|
11
|
+
return theme.palette.lunit_token.core.icon_warning_02;
|
|
12
12
|
case "error":
|
|
13
|
-
return theme.palette.
|
|
13
|
+
return theme.palette.lunit_token.core.icon_error_02;
|
|
14
14
|
default:
|
|
15
|
-
return theme.palette.
|
|
15
|
+
return theme.palette.lunit_token.core.icon_success_02;
|
|
16
16
|
}
|
|
17
17
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { styled, Switch as MuiSwitch, SwitchProps } from "@mui/material";
|
|
2
2
|
interface ToggleProps extends SwitchProps {
|
|
3
|
-
toggleSize:
|
|
3
|
+
toggleSize: "medium" | "large";
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
const toggleStyles = {
|
|
@@ -19,15 +19,15 @@ const toggleStyles = {
|
|
|
19
19
|
transition: "all 100ms ease-in-out",
|
|
20
20
|
},
|
|
21
21
|
switchChecked: {
|
|
22
|
-
transform:
|
|
22
|
+
transform: "translateX(10px)",
|
|
23
23
|
},
|
|
24
24
|
thumb: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
25
|
+
width: 14,
|
|
26
|
+
height: 14,
|
|
27
|
+
},
|
|
28
28
|
},
|
|
29
29
|
large: {
|
|
30
|
-
root:{
|
|
30
|
+
root: {
|
|
31
31
|
width: 44,
|
|
32
32
|
height: 24,
|
|
33
33
|
borderRadius: 12,
|
|
@@ -41,20 +41,20 @@ const toggleStyles = {
|
|
|
41
41
|
transition: "all 150ms ease-in-out",
|
|
42
42
|
},
|
|
43
43
|
switchChecked: {
|
|
44
|
-
transform:
|
|
44
|
+
transform: "translateX(20px)",
|
|
45
45
|
},
|
|
46
46
|
thumb: {
|
|
47
47
|
width: 20,
|
|
48
48
|
height: 20,
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
|
-
}
|
|
51
|
+
};
|
|
52
52
|
|
|
53
53
|
const indeterminateStyles = {
|
|
54
54
|
large: {
|
|
55
55
|
switchChecked: {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
top: 8,
|
|
57
|
+
left: -8,
|
|
58
58
|
},
|
|
59
59
|
track: {
|
|
60
60
|
borderRadius: 12,
|
|
@@ -67,8 +67,8 @@ const indeterminateStyles = {
|
|
|
67
67
|
},
|
|
68
68
|
medium: {
|
|
69
69
|
switchChecked: {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
top: 6,
|
|
71
|
+
left: -4,
|
|
72
72
|
},
|
|
73
73
|
track: {
|
|
74
74
|
borderRadius: 12,
|
|
@@ -78,28 +78,29 @@ const indeterminateStyles = {
|
|
|
78
78
|
width: 12,
|
|
79
79
|
borderRadius: 2,
|
|
80
80
|
},
|
|
81
|
-
}
|
|
82
|
-
}
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
83
|
|
|
84
84
|
export const CommonToggle = styled(MuiSwitch, {
|
|
85
|
-
shouldForwardProp: (props) => props !==
|
|
85
|
+
shouldForwardProp: (props) => props !== "toggleSize",
|
|
86
86
|
})<ToggleProps>(({ theme, toggleSize, disabled }) => {
|
|
87
|
-
const checkedColor = theme.palette.
|
|
88
|
-
const uncheckedColor = theme.palette.
|
|
89
|
-
const handlerColor =
|
|
87
|
+
const checkedColor = theme.palette.lunit_token.component.selectcontrol_on;
|
|
88
|
+
const uncheckedColor = theme.palette.lunit_token.component.selectcontrol_off;
|
|
89
|
+
const handlerColor =
|
|
90
|
+
theme.palette.lunit_token.component.selectcontrol_handler;
|
|
90
91
|
|
|
91
92
|
const toggleStyle = toggleStyles[toggleSize];
|
|
92
93
|
const toggleOpacity = disabled ? 0.38 : 1;
|
|
93
94
|
|
|
94
95
|
return {
|
|
95
96
|
...toggleStyle.root,
|
|
96
|
-
display:
|
|
97
|
+
display: "flex",
|
|
97
98
|
padding: 0,
|
|
98
99
|
overflow: "visible",
|
|
99
100
|
backgroundColor: "transparent",
|
|
100
101
|
opacity: toggleOpacity,
|
|
101
102
|
"& .Mui-focusVisible": {
|
|
102
|
-
|
|
103
|
+
// clear default focus style
|
|
103
104
|
boxShadow: "none",
|
|
104
105
|
background: "transparent",
|
|
105
106
|
borderColor: "transparent",
|
|
@@ -112,51 +113,53 @@ export const CommonToggle = styled(MuiSwitch, {
|
|
|
112
113
|
boxSizing: "border-box",
|
|
113
114
|
top: -3, // border 1px + offset 2px
|
|
114
115
|
left: -3, // border 1px + offset 2px
|
|
115
|
-
}
|
|
116
|
+
},
|
|
116
117
|
},
|
|
117
|
-
|
|
118
|
+
"& .MuiSwitch-track": {
|
|
118
119
|
opacity: 1,
|
|
119
120
|
borderRadius: 12,
|
|
120
121
|
backgroundColor: uncheckedColor,
|
|
121
122
|
},
|
|
122
|
-
|
|
123
|
+
"& .MuiSwitch-thumb": {
|
|
123
124
|
...toggleStyle.thumb,
|
|
124
125
|
boxShadow: "0px 0px 1px rgba(0, 0, 0, 0.4)",
|
|
125
126
|
},
|
|
126
|
-
|
|
127
|
+
"& .MuiSwitch-switchBase": {
|
|
127
128
|
...toggleStyle.switch,
|
|
128
129
|
padding: 2,
|
|
129
130
|
opacity: 1,
|
|
130
|
-
|
|
131
|
+
"&.Mui-checked": {
|
|
131
132
|
...toggleStyle.switchChecked,
|
|
132
133
|
color: handlerColor,
|
|
133
|
-
|
|
134
|
+
"& + .MuiSwitch-track": {
|
|
134
135
|
opacity: 1,
|
|
135
136
|
backgroundColor: checkedColor,
|
|
136
137
|
},
|
|
137
138
|
},
|
|
138
139
|
},
|
|
139
|
-
|
|
140
|
+
"& .Mui-disabled + .MuiSwitch-track": {
|
|
140
141
|
opacity: 1,
|
|
141
142
|
},
|
|
142
|
-
}
|
|
143
|
+
};
|
|
144
|
+
});
|
|
143
145
|
|
|
144
146
|
export const CommonIndeterminateToggle = styled(CommonToggle, {
|
|
145
|
-
shouldForwardProp: (props) => props !==
|
|
147
|
+
shouldForwardProp: (props) => props !== "toggleSize",
|
|
146
148
|
})(({ toggleSize }) => {
|
|
147
149
|
const indeterminateStyle = indeterminateStyles[toggleSize];
|
|
148
150
|
|
|
149
151
|
return {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
padding: 0,
|
|
153
|
+
cursor: "pointer",
|
|
154
|
+
"& .MuiSwitch-switchBase.Mui-checked": {
|
|
153
155
|
...indeterminateStyle.switchChecked,
|
|
154
|
-
|
|
156
|
+
"& + .MuiSwitch-track": {
|
|
155
157
|
...indeterminateStyle.track,
|
|
158
|
+
},
|
|
156
159
|
},
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
}
|
|
160
|
+
"& .MuiSwitch-thumb": {
|
|
161
|
+
...indeterminateStyle.thumb,
|
|
162
|
+
boxShadow: "none",
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
});
|
|
@@ -19,7 +19,7 @@ export const CustomToggleButton = styled(MuiToggleButton, {
|
|
|
19
19
|
({
|
|
20
20
|
theme: {
|
|
21
21
|
typography,
|
|
22
|
-
palette: {
|
|
22
|
+
palette: { lunit_token },
|
|
23
23
|
},
|
|
24
24
|
kind,
|
|
25
25
|
size,
|
|
@@ -30,22 +30,22 @@ export const CustomToggleButton = styled(MuiToggleButton, {
|
|
|
30
30
|
}) => {
|
|
31
31
|
return {
|
|
32
32
|
border: "none",
|
|
33
|
-
...commonStyle({
|
|
33
|
+
...commonStyle({ lunit_token }),
|
|
34
34
|
...iconStyle({ size, hasIconOnly }),
|
|
35
35
|
...sizeStyle({ size, kind, hasIconOnly, selected, typography }),
|
|
36
|
-
...kindStyle({ kind, color,
|
|
36
|
+
...kindStyle({ kind, color, lunit_token }),
|
|
37
37
|
...(selectedColor === "primary" && {
|
|
38
38
|
"&.Mui-selected, &.Mui-selected:hover": {
|
|
39
39
|
border: "none",
|
|
40
|
-
backgroundColor:
|
|
41
|
-
color:
|
|
40
|
+
backgroundColor: lunit_token.component.btn_selected_primary_bg,
|
|
41
|
+
color: lunit_token.component.btn_selected_primary_text,
|
|
42
42
|
},
|
|
43
43
|
}),
|
|
44
44
|
...(selectedColor === "secondary" && {
|
|
45
45
|
"&.Mui-selected, &.Mui-selected:hover": {
|
|
46
46
|
border: "none",
|
|
47
|
-
backgroundColor:
|
|
48
|
-
color:
|
|
47
|
+
backgroundColor: lunit_token.component.btn_selected_secondary_bg,
|
|
48
|
+
color: lunit_token.component.btn_selected_secondary_text,
|
|
49
49
|
},
|
|
50
50
|
}),
|
|
51
51
|
};
|
|
@@ -2,10 +2,10 @@ import paletteOptions from "../colors";
|
|
|
2
2
|
import { createCSSVarNames, createCSSVars } from "./utils";
|
|
3
3
|
|
|
4
4
|
export const shadows = {
|
|
5
|
-
shadow1: `0px 4px 8px ${paletteOptions.
|
|
6
|
-
shadow2: `0px 3px 12px ${paletteOptions.
|
|
7
|
-
shadow3: `0px 12px 24px ${paletteOptions.
|
|
8
|
-
shadow4: `0px 12px 44px ${paletteOptions.
|
|
5
|
+
shadow1: `0px 4px 8px ${paletteOptions.lunit_token.core.shadow_01}`,
|
|
6
|
+
shadow2: `0px 3px 12px ${paletteOptions.lunit_token.core.shadow_02}`,
|
|
7
|
+
shadow3: `0px 12px 24px ${paletteOptions.lunit_token.core.shadow_03}`,
|
|
8
|
+
shadow4: `0px 12px 44px ${paletteOptions.lunit_token.core.shadow_04}`,
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
const shadowVars = createCSSVarNames(shadows);
|
|
@@ -11,7 +11,7 @@ export type GreyColor = Record<keyof typeof base.grey, PaletteColor>;
|
|
|
11
11
|
|
|
12
12
|
declare module "@mui/material/styles/createPalette" {
|
|
13
13
|
interface PaletteOptions {
|
|
14
|
-
|
|
14
|
+
lunit_global?: {
|
|
15
15
|
grey: GreyColor;
|
|
16
16
|
blue: BaseColor;
|
|
17
17
|
green: BaseColor;
|
|
@@ -22,11 +22,11 @@ declare module "@mui/material/styles/createPalette" {
|
|
|
22
22
|
red: BaseColor;
|
|
23
23
|
yellow: BaseColor;
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
lunit_token?: ColorToken;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
interface Palette {
|
|
29
|
-
|
|
29
|
+
lunit_global: {
|
|
30
30
|
grey: GreyColor;
|
|
31
31
|
blue: BaseColor;
|
|
32
32
|
green: BaseColor;
|
|
@@ -37,7 +37,7 @@ declare module "@mui/material/styles/createPalette" {
|
|
|
37
37
|
red: BaseColor;
|
|
38
38
|
yellow: BaseColor;
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
lunit_token: ColorToken;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -123,29 +123,32 @@ export const createColorCssBaseline = () => {
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
// TODO: TextColors 삭제하고 관련된 설정 수정하기
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
126
|
+
// TODO: opacity 글로벌 팔레트에 추가 여부 확인해서 작업하기
|
|
127
|
+
const lunitColors: PaletteOptions["lunit_global"] =
|
|
128
|
+
((): PaletteOptions["lunit_global"] => {
|
|
129
|
+
const ret: any = {};
|
|
130
|
+
for (const colorKey in base) {
|
|
131
|
+
if (base[`${colorKey}Text` as ColorKey]) {
|
|
132
|
+
const baseColors = base[colorKey as ColorKey];
|
|
133
|
+
const textColors = base[`${colorKey}Text` as ColorKey];
|
|
134
|
+
ret[colorKey] = {};
|
|
135
|
+
for (const key in baseColors) {
|
|
136
|
+
if (baseColors.hasOwnProperty(key)) {
|
|
137
|
+
const color = baseColors[Number(key) as keyof typeof baseColors];
|
|
138
|
+
const textColor =
|
|
139
|
+
textColors[Number(key) as keyof typeof textColors];
|
|
140
|
+
ret[colorKey][Number(key)] = {
|
|
141
|
+
light: color,
|
|
142
|
+
main: color,
|
|
143
|
+
dark: color,
|
|
144
|
+
contrastText: textColor,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
149
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
})();
|
|
150
|
+
return ret;
|
|
151
|
+
})();
|
|
149
152
|
|
|
150
153
|
const paletteOptions = {
|
|
151
154
|
primary: {
|
|
@@ -167,8 +170,8 @@ const paletteOptions = {
|
|
|
167
170
|
main: base.green[40], // core.text_success.dark1
|
|
168
171
|
},
|
|
169
172
|
grey: base.greyForMUI,
|
|
170
|
-
|
|
171
|
-
|
|
173
|
+
lunit_global: lunitColors,
|
|
174
|
+
lunit_token: {
|
|
172
175
|
core: {
|
|
173
176
|
bg_01: "var(--bg_01)",
|
|
174
177
|
bg_02: "var(--bg_02)",
|
package/src/index.ts
CHANGED
|
@@ -62,7 +62,7 @@ const AlertChildrenContentLong = () => {
|
|
|
62
62
|
<Typography variant="body2_14_regular">
|
|
63
63
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
|
|
64
64
|
tempor incididunt ut{" "}
|
|
65
|
-
<u style={{ color: theme.palette.
|
|
65
|
+
<u style={{ color: theme.palette.lunit_token.core.link_primary }}>
|
|
66
66
|
labore et dolore
|
|
67
67
|
</u>{" "}
|
|
68
68
|
magna aliqua. A diam sollicitudin tempor id eu nisl nunc mi. Auctor augue
|
|
@@ -18,7 +18,7 @@ export const TypographyItem = styled(Box)({
|
|
|
18
18
|
|
|
19
19
|
export const TypographyTitle = styled(Typography)(({ theme }) => ({
|
|
20
20
|
width: 200,
|
|
21
|
-
color: theme.palette.
|
|
21
|
+
color: theme.palette.lunit_token.core.text_light,
|
|
22
22
|
}));
|
|
23
23
|
|
|
24
24
|
export const TypographyDummy = styled(Typography)({
|
|
@@ -18,7 +18,7 @@ const BaseColors = () => {
|
|
|
18
18
|
return (
|
|
19
19
|
<Container>
|
|
20
20
|
{map(
|
|
21
|
-
theme.palette.
|
|
21
|
+
theme.palette.lunit_global,
|
|
22
22
|
(colors: BaseColor | GreyColor, paletteKey: string) => (
|
|
23
23
|
<div key={paletteKey}>
|
|
24
24
|
<Typography
|
|
@@ -34,8 +34,8 @@ const BaseColors = () => {
|
|
|
34
34
|
{map(colors, (_: string, colorKey: string) => (
|
|
35
35
|
<ColorContainer key={colorKey}>
|
|
36
36
|
<Color
|
|
37
|
-
color={`
|
|
38
|
-
bgcolor={`
|
|
37
|
+
color={`lunit_global.${paletteKey}.${colorKey}.contrastText`}
|
|
38
|
+
bgcolor={`lunit_global.${paletteKey}.${colorKey}.main`}
|
|
39
39
|
>
|
|
40
40
|
<Typography variant="h4">T</Typography>
|
|
41
41
|
</Color>
|