@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.
Files changed (79) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/components/Alert/index.js +1 -1
  3. package/dist/cjs/components/Alert/index.js.map +1 -1
  4. package/dist/cjs/components/Button/index.js +1 -1
  5. package/dist/cjs/components/Button/index.js.map +1 -1
  6. package/dist/cjs/components/Checkbox/index.js +1 -1
  7. package/dist/cjs/components/Checkbox/index.js.map +1 -1
  8. package/dist/cjs/components/Chip/index.js +1 -1
  9. package/dist/cjs/components/Chip/index.js.map +1 -1
  10. package/dist/cjs/components/Radio/index.js +1 -1
  11. package/dist/cjs/components/Radio/index.js.map +1 -1
  12. package/dist/cjs/components/TextField/index.js +1 -1
  13. package/dist/cjs/components/TextField/index.js.map +1 -1
  14. package/dist/cjs/components/Toggle/index.js +1 -1
  15. package/dist/cjs/components/Toggle/index.js.map +1 -1
  16. package/dist/cjs/components/ToggleButton/index.js +1 -1
  17. package/dist/cjs/components/ToggleButton/index.js.map +1 -1
  18. package/dist/cjs/index.js +1 -1
  19. package/dist/cjs/index.js.map +1 -1
  20. package/dist/components/Alert/Alert.styled.js +2 -2
  21. package/dist/components/Alert/Alert.styled.js.map +1 -1
  22. package/dist/components/Alert/Alert.utils.js +12 -12
  23. package/dist/components/Alert/Alert.utils.js.map +1 -1
  24. package/dist/components/Button/Button.styled.js +33 -33
  25. package/dist/components/Button/Button.styled.js.map +1 -1
  26. package/dist/components/Checkbox/Checkbox.js +4 -4
  27. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  28. package/dist/components/Chip/Chip.styled.js +15 -15
  29. package/dist/components/Chip/Chip.styled.js.map +1 -1
  30. package/dist/components/Radio/Radio.js +3 -3
  31. package/dist/components/Radio/Radio.js.map +1 -1
  32. package/dist/components/TextField/TextField.style.js +27 -27
  33. package/dist/components/TextField/TextField.style.js.map +1 -1
  34. package/dist/components/Toast/Toast.styled.js +3 -3
  35. package/dist/components/Toast/Toast.styled.js.map +1 -1
  36. package/dist/components/Toast/Toast.utils.js +4 -4
  37. package/dist/components/Toast/Toast.utils.js.map +1 -1
  38. package/dist/components/Toggle/Toggle.styled.js +20 -20
  39. package/dist/components/Toggle/Toggle.styled.js.map +1 -1
  40. package/dist/components/ToggleButton/ToggleButton.styled.js +7 -7
  41. package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
  42. package/dist/foundation/Elevation/index.js +4 -4
  43. package/dist/foundation/Elevation/index.js.map +1 -1
  44. package/dist/foundation/colors/index.js +3 -2
  45. package/dist/foundation/colors/index.js.map +1 -1
  46. package/dist/index.js +1 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/theme.js +3 -2
  49. package/dist/theme.js.map +1 -1
  50. package/dist/types/components/Button/Button.styled.d.ts +7 -7
  51. package/dist/types/components/Chip/Chip.styled.d.ts +12 -12
  52. package/dist/types/components/Toggle/Toggle.styled.d.ts +1 -1
  53. package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
  54. package/dist/types/foundation/colors/index.d.ts +6 -6
  55. package/dist/types/foundation/index.d.ts +2 -2
  56. package/dist/types/index.d.ts +1 -1
  57. package/dist/types/theme.d.ts +2 -0
  58. package/package.json +1 -1
  59. package/src/components/Alert/Alert.styled.ts +2 -2
  60. package/src/components/Alert/Alert.utils.ts +12 -12
  61. package/src/components/Button/Button.styled.ts +34 -34
  62. package/src/components/Checkbox/Checkbox.tsx +4 -4
  63. package/src/components/Chip/Chip.styled.ts +15 -15
  64. package/src/components/Radio/Radio.tsx +3 -3
  65. package/src/components/TextField/TextField.style.ts +28 -28
  66. package/src/components/Toast/Toast.styled.ts +3 -3
  67. package/src/components/Toast/Toast.utils.ts +4 -4
  68. package/src/components/Toggle/Toggle.styled.ts +42 -39
  69. package/src/components/ToggleButton/ToggleButton.styled.ts +7 -7
  70. package/src/foundation/Elevation/index.ts +4 -4
  71. package/src/foundation/colors/index.ts +29 -26
  72. package/src/index.ts +1 -1
  73. package/src/stories/components/Alert/Alert.stories.tsx +1 -1
  74. package/src/stories/foundation/Typography/TypographyGroup.tsx +1 -1
  75. package/src/stories/foundation/colors/Colors.stories.tsx +3 -3
  76. package/src/stories/foundation/colors/Token.inComponent.stories.tsx +21 -19
  77. package/src/stories/foundation/colors/TokenPaletteTable.tsx +6 -4
  78. package/src/stories/foundation/colors/styled.ts +1 -1
  79. package/src/theme.ts +5 -3
@@ -70,7 +70,7 @@ const getTextFieldPaddingBySize = ({
70
70
  });
71
71
  };
72
72
 
73
- const commonStyle = ({ token }: { token: ColorToken }) => ({
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 ${token.component.textfield_border_error}`,
85
+ border: `1px solid ${lunit_token.component.textfield_border_error}`,
86
86
  },
87
87
  "&.Mui-focused fieldset": {
88
- border: `1px solid ${token.core.focused}`,
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: token.component.textfield_bg,
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: token.core.text_medium,
100
+ color: lunit_token.core.text_medium,
101
101
  opacity: 1,
102
- WebkitTextFillColor: token.core.text_medium,
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: token.component.scrollbars_bg,
113
+ backgroundColor: lunit_token.component.scrollbars_bg,
114
114
  },
115
115
  },
116
- background: token.component.textfield_bg,
116
+ background: lunit_token.component.textfield_bg,
117
117
  overflow: "hidden",
118
- color: token.core.text_normal,
118
+ color: lunit_token.core.text_normal,
119
119
  "&:hover": {
120
120
  position: "relative",
121
121
  zIndex: 0,
122
- backgroundColor: token.component.textfield_bg,
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: token.core.hover,
132
+ backgroundColor: lunit_token.core.hover,
133
133
  },
134
134
  "&.Mui-focused": {
135
135
  "&:hover::before": {
136
- backgroundColor: token.component.textfield_bg,
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: token.core.text_error,
145
+ color: lunit_token.core.text_error,
146
146
  },
147
147
  },
148
148
  });
149
149
 
150
150
  const sizeStyle = ({
151
- token,
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
- > & { token: ColorToken; typography: Typography }) => ({
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: token.core.text_medium,
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: token.core.text_medium,
188
+ color: lunit_token.core.text_medium,
189
189
  opacity: 0.38,
190
190
  },
191
191
  "&.Mui-error": {
192
- color: token.core.text_error,
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: token.core.text_medium,
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: token.core.text_medium,
223
+ color: lunit_token.core.text_medium,
224
224
  opacity: 0.38,
225
225
  },
226
226
  "&.Mui-error": {
227
- color: token.core.text_error,
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: token.core.text_medium,
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: token.core.text_medium,
258
+ color: lunit_token.core.text_medium,
259
259
  opacity: 0.38,
260
260
  },
261
261
  "&.Mui-error": {
262
- color: token.core.text_error,
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: { token },
285
+ palette: { lunit_token },
286
286
  },
287
287
  multiline,
288
288
  textFieldSize,
289
289
  hasLeftIcon,
290
290
  hasRightIcon,
291
291
  }) => ({
292
- ...commonStyle({ token }),
292
+ ...commonStyle({ lunit_token }),
293
293
  ...sizeStyle({
294
- token,
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.token.core.text_normal,
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.token.core.text_normal,
14
- backgroundColor: theme.palette.token.core.bg_03,
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.token.core.text_normal,
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.token.core.icon_info_02;
9
+ return theme.palette.lunit_token.core.icon_info_02;
10
10
  case "warning":
11
- return theme.palette.token.core.icon_warning_02;
11
+ return theme.palette.lunit_token.core.icon_warning_02;
12
12
  case "error":
13
- return theme.palette.token.core.icon_error_02;
13
+ return theme.palette.lunit_token.core.icon_error_02;
14
14
  default:
15
- return theme.palette.token.core.icon_success_02;
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: 'medium' | 'large'
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: 'translateX(10px)',
22
+ transform: "translateX(10px)",
23
23
  },
24
24
  thumb: {
25
- width: 14,
26
- height: 14,
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: 'translateX(20px)',
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
- top: 8,
57
- left: -8,
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
- top: 6,
71
- left: -4,
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 !== 'toggleSize',
85
+ shouldForwardProp: (props) => props !== "toggleSize",
86
86
  })<ToggleProps>(({ theme, toggleSize, disabled }) => {
87
- const checkedColor = theme.palette.token.component.selectcontrol_on;
88
- const uncheckedColor = theme.palette.token.component.selectcontrol_off;
89
- const handlerColor = theme.palette.token.component.selectcontrol_handler;
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: 'flex',
97
+ display: "flex",
97
98
  padding: 0,
98
99
  overflow: "visible",
99
100
  backgroundColor: "transparent",
100
101
  opacity: toggleOpacity,
101
102
  "& .Mui-focusVisible": {
102
- // clear default focus style
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
- '& .MuiSwitch-track': {
118
+ "& .MuiSwitch-track": {
118
119
  opacity: 1,
119
120
  borderRadius: 12,
120
121
  backgroundColor: uncheckedColor,
121
122
  },
122
- '& .MuiSwitch-thumb': {
123
+ "& .MuiSwitch-thumb": {
123
124
  ...toggleStyle.thumb,
124
125
  boxShadow: "0px 0px 1px rgba(0, 0, 0, 0.4)",
125
126
  },
126
- '& .MuiSwitch-switchBase': {
127
+ "& .MuiSwitch-switchBase": {
127
128
  ...toggleStyle.switch,
128
129
  padding: 2,
129
130
  opacity: 1,
130
- '&.Mui-checked': {
131
+ "&.Mui-checked": {
131
132
  ...toggleStyle.switchChecked,
132
133
  color: handlerColor,
133
- '& + .MuiSwitch-track': {
134
+ "& + .MuiSwitch-track": {
134
135
  opacity: 1,
135
136
  backgroundColor: checkedColor,
136
137
  },
137
138
  },
138
139
  },
139
- '& .Mui-disabled + .MuiSwitch-track': {
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 !== 'toggleSize',
147
+ shouldForwardProp: (props) => props !== "toggleSize",
146
148
  })(({ toggleSize }) => {
147
149
  const indeterminateStyle = indeterminateStyles[toggleSize];
148
150
 
149
151
  return {
150
- padding: 0,
151
- cursor: "pointer",
152
- '& .MuiSwitch-switchBase.Mui-checked': {
152
+ padding: 0,
153
+ cursor: "pointer",
154
+ "& .MuiSwitch-switchBase.Mui-checked": {
153
155
  ...indeterminateStyle.switchChecked,
154
- '& + .MuiSwitch-track': {
156
+ "& + .MuiSwitch-track": {
155
157
  ...indeterminateStyle.track,
158
+ },
156
159
  },
157
- },
158
- '& .MuiSwitch-thumb': {
159
- ...indeterminateStyle.thumb,
160
- boxShadow: "none",
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: { token },
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({ token }),
33
+ ...commonStyle({ lunit_token }),
34
34
  ...iconStyle({ size, hasIconOnly }),
35
35
  ...sizeStyle({ size, kind, hasIconOnly, selected, typography }),
36
- ...kindStyle({ kind, color, token }),
36
+ ...kindStyle({ kind, color, lunit_token }),
37
37
  ...(selectedColor === "primary" && {
38
38
  "&.Mui-selected, &.Mui-selected:hover": {
39
39
  border: "none",
40
- backgroundColor: token.component.btn_selected_primary_bg,
41
- color: token.component.btn_selected_primary_text,
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: token.component.btn_selected_secondary_bg,
48
- color: token.component.btn_selected_secondary_text,
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.token.core.shadow_01}`,
6
- shadow2: `0px 3px 12px ${paletteOptions.token.core.shadow_02}`,
7
- shadow3: `0px 12px 24px ${paletteOptions.token.core.shadow_03}`,
8
- shadow4: `0px 12px 44px ${paletteOptions.token.core.shadow_04}`,
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
- lunit?: {
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
- token?: ColorToken;
25
+ lunit_token?: ColorToken;
26
26
  }
27
27
 
28
28
  interface Palette {
29
- lunit: {
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
- token: ColorToken;
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
- const lunitColors: PaletteOptions["lunit"] = ((): PaletteOptions["lunit"] => {
127
- const ret: any = {};
128
- for (const colorKey in base) {
129
- if (base[`${colorKey}Text` as ColorKey]) {
130
- const baseColors = base[colorKey as ColorKey];
131
- const textColors = base[`${colorKey}Text` as ColorKey];
132
- ret[colorKey] = {};
133
- for (const key in baseColors) {
134
- if (baseColors.hasOwnProperty(key)) {
135
- const color = baseColors[Number(key) as keyof typeof baseColors];
136
- const textColor = textColors[Number(key) as keyof typeof textColors];
137
- ret[colorKey][Number(key)] = {
138
- light: color,
139
- main: color,
140
- dark: color,
141
- contrastText: textColor,
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
- return ret;
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
- lunit: lunitColors,
171
- token: {
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
@@ -1,4 +1,4 @@
1
- export { default as theme } from "./theme";
1
+ export { default as theme, themeOptions } from "./theme";
2
2
  export { base as baseColors } from "./foundation/colors";
3
3
 
4
4
  export { default as Alert } from "./components/Alert";
@@ -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.token.core.link_primary }}>
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.token.core.text_light,
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.lunit,
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={`lunit.${paletteKey}.${colorKey}.contrastText`}
38
- bgcolor={`lunit.${paletteKey}.${colorKey}.main`}
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>