@lunit/design-system 1.0.0-a.4 → 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 (117) hide show
  1. package/README.md +2 -2
  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/components/Typography/index.js +2 -0
  19. package/dist/cjs/components/Typography/index.js.map +1 -0
  20. package/dist/cjs/index.js +1 -1
  21. package/dist/cjs/index.js.map +1 -1
  22. package/dist/components/Alert/Alert.js.map +1 -1
  23. package/dist/components/Alert/Alert.styled.js +2 -2
  24. package/dist/components/Alert/Alert.styled.js.map +1 -1
  25. package/dist/components/Alert/Alert.utils.js +12 -12
  26. package/dist/components/Alert/Alert.utils.js.map +1 -1
  27. package/dist/components/Button/Button.js +2 -2
  28. package/dist/components/Button/Button.js.map +1 -1
  29. package/dist/components/Button/Button.styled.js +50 -29
  30. package/dist/components/Button/Button.styled.js.map +1 -1
  31. package/dist/components/Checkbox/Checkbox.js +4 -4
  32. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  33. package/dist/components/Chip/Chip.styled.js +15 -15
  34. package/dist/components/Chip/Chip.styled.js.map +1 -1
  35. package/dist/components/Radio/Radio.js +3 -3
  36. package/dist/components/Radio/Radio.js.map +1 -1
  37. package/dist/components/TextField/TextField.js +3 -3
  38. package/dist/components/TextField/TextField.js.map +1 -1
  39. package/dist/components/TextField/TextField.style.js +30 -27
  40. package/dist/components/TextField/TextField.style.js.map +1 -1
  41. package/dist/components/Toast/Toast.js +1 -1
  42. package/dist/components/Toast/Toast.js.map +1 -1
  43. package/dist/components/Toast/Toast.styled.js +3 -3
  44. package/dist/components/Toast/Toast.styled.js.map +1 -1
  45. package/dist/components/Toast/Toast.utils.js +4 -4
  46. package/dist/components/Toast/Toast.utils.js.map +1 -1
  47. package/dist/components/Toast/index.js +1 -1
  48. package/dist/components/Toast/index.js.map +1 -1
  49. package/dist/components/Toggle/Toggle.styled.js +20 -20
  50. package/dist/components/Toggle/Toggle.styled.js.map +1 -1
  51. package/dist/components/ToggleButton/ToggleButton.styled.js +7 -7
  52. package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
  53. package/dist/components/Typography/index.js +3 -0
  54. package/dist/components/Typography/index.js.map +1 -0
  55. package/dist/foundation/Elevation/index.js +4 -4
  56. package/dist/foundation/Elevation/index.js.map +1 -1
  57. package/dist/foundation/Typography/index.js.map +1 -1
  58. package/dist/foundation/colors/index.js +12 -13
  59. package/dist/foundation/colors/index.js.map +1 -1
  60. package/dist/foundation/colors/token/component.js +22 -38
  61. package/dist/foundation/colors/token/component.js.map +1 -1
  62. package/dist/index.js +4 -1
  63. package/dist/index.js.map +1 -1
  64. package/dist/theme.js +3 -2
  65. package/dist/theme.js.map +1 -1
  66. package/dist/types/components/Button/Button.styled.d.ts +40 -20
  67. package/dist/types/components/Button/Button.types.d.ts +1 -1
  68. package/dist/types/components/Chip/Chip.types.d.ts +1 -0
  69. package/dist/types/components/TextField/TextField.style.d.ts +3 -1
  70. package/dist/types/components/TextField/TextField.types.d.ts +2 -3
  71. package/dist/types/components/TextField/TextFieldIcon.d.ts +1 -0
  72. package/dist/types/components/Toast/index.d.ts +2 -1
  73. package/dist/types/components/Toggle/Toggle.styled.d.ts +1 -1
  74. package/dist/types/components/Typography/index.d.ts +7 -0
  75. package/dist/types/foundation/Typography/index.d.ts +1 -5
  76. package/dist/types/foundation/colors/index.d.ts +15 -17
  77. package/dist/types/foundation/colors/types.d.ts +9 -11
  78. package/dist/types/foundation/index.d.ts +11 -13
  79. package/dist/types/index.d.ts +4 -1
  80. package/dist/types/theme.d.ts +2 -0
  81. package/package.json +21 -16
  82. package/src/components/Alert/Alert.styled.ts +2 -2
  83. package/src/components/Alert/Alert.utils.ts +12 -12
  84. package/src/components/Button/Button.styled.ts +51 -31
  85. package/src/components/Button/Button.tsx +12 -10
  86. package/src/components/Button/Button.types.ts +1 -1
  87. package/src/components/Checkbox/Checkbox.tsx +4 -4
  88. package/src/components/Chip/Chip.styled.ts +15 -15
  89. package/src/components/Radio/Radio.tsx +3 -3
  90. package/src/components/TextField/TextField.style.ts +31 -28
  91. package/src/components/TextField/TextField.tsx +3 -3
  92. package/src/components/TextField/TextField.types.ts +1 -3
  93. package/src/components/Toast/Toast.styled.ts +3 -3
  94. package/src/components/Toast/Toast.tsx +1 -1
  95. package/src/components/Toast/Toast.utils.ts +4 -4
  96. package/src/components/Toast/index.tsx +2 -1
  97. package/src/components/Toggle/Toggle.styled.ts +42 -39
  98. package/src/components/ToggleButton/ToggleButton.styled.ts +7 -7
  99. package/src/components/Typography/index.ts +9 -0
  100. package/src/foundation/Elevation/index.ts +4 -4
  101. package/src/foundation/Typography/index.ts +2 -6
  102. package/src/foundation/colors/index.ts +38 -37
  103. package/src/foundation/colors/token/component.ts +22 -38
  104. package/src/foundation/colors/types.ts +9 -11
  105. package/src/index.ts +4 -1
  106. package/src/stories/components/Alert/Alert.stories.tsx +1 -1
  107. package/src/stories/components/Button/Kind.stories.tsx +38 -5
  108. package/src/stories/components/Toast/Toast.stories.tsx +1 -1
  109. package/src/stories/foundation/Typography/Typography.mdx +1 -1
  110. package/src/stories/foundation/Typography/Typography.stories.tsx +3 -1
  111. package/src/stories/foundation/Typography/TypographyExamples.stories.tsx +2 -2
  112. package/src/stories/foundation/Typography/TypographyGroup.tsx +4 -8
  113. package/src/stories/foundation/colors/Colors.stories.tsx +3 -3
  114. package/src/stories/foundation/colors/Token.inComponent.stories.tsx +21 -19
  115. package/src/stories/foundation/colors/TokenPaletteTable.tsx +6 -4
  116. package/src/stories/foundation/colors/styled.ts +1 -1
  117. package/src/theme.ts +5 -3
@@ -29,17 +29,15 @@ export interface ColorToken {
29
29
  shadow_04: CSSPropertyColor;
30
30
  };
31
31
  component: {
32
- btn_contained_primary_bg: CSSPropertyColor;
33
- btn_contained_primary_text: CSSPropertyColor;
34
- btn_contained_secondary_bg: CSSPropertyColor;
35
- btn_contained_secondary_text: CSSPropertyColor;
36
- btn_contained_error_bg: CSSPropertyColor;
37
- btn_contained_error_text: CSSPropertyColor;
38
- btn_outlined_primary_border: CSSPropertyColor;
39
- btn_outlined_primary_text: CSSPropertyColor;
40
- btn_ghost_primary_text: CSSPropertyColor;
41
- btn_ghost_secondary_text: CSSPropertyColor;
42
- btn_ghost_error_text: CSSPropertyColor;
32
+ btn_primary_bg: CSSPropertyColor;
33
+ btn_secondary_bg: CSSPropertyColor;
34
+ btn_error_bg: CSSPropertyColor;
35
+ btn_primary_border: CSSPropertyColor;
36
+ btn_secondary_border: CSSPropertyColor;
37
+ btn_primary_text_1: CSSPropertyColor;
38
+ btn_primary_text_2: CSSPropertyColor;
39
+ btn_secondary_text: CSSPropertyColor;
40
+ btn_error_text: CSSPropertyColor;
43
41
  btn_selected_primary_bg: CSSPropertyColor;
44
42
  btn_selected_primary_text: CSSPropertyColor;
45
43
  btn_selected_secondary_bg: CSSPropertyColor;
@@ -38,7 +38,7 @@ export declare const palette: {
38
38
  A400: string;
39
39
  A700: string;
40
40
  };
41
- lunit: {
41
+ lunit_global: {
42
42
  grey: import("./colors").GreyColor;
43
43
  blue: import("./colors").BaseColor;
44
44
  green: import("./colors").BaseColor;
@@ -49,7 +49,7 @@ export declare const palette: {
49
49
  red: import("./colors").BaseColor;
50
50
  yellow: import("./colors").BaseColor;
51
51
  } | undefined;
52
- token: {
52
+ lunit_token: {
53
53
  core: {
54
54
  bg_01: string;
55
55
  bg_02: string;
@@ -78,17 +78,15 @@ export declare const palette: {
78
78
  shadow_04: string;
79
79
  };
80
80
  component: {
81
- btn_contained_primary_bg: string;
82
- btn_contained_primary_text: string;
83
- btn_contained_secondary_bg: string;
84
- btn_contained_secondary_text: string;
85
- btn_contained_error_bg: string;
86
- btn_contained_error_text: string;
87
- btn_outlined_primary_border: string;
88
- btn_outlined_primary_text: string;
89
- btn_ghost_primary_text: string;
90
- btn_ghost_secondary_text: string;
91
- btn_ghost_error_text: string;
81
+ btn_primary_bg: string;
82
+ btn_secondary_bg: string;
83
+ btn_error_bg: string;
84
+ btn_primary_border: string;
85
+ btn_secondary_border: string;
86
+ btn_primary_text_1: string;
87
+ btn_primary_text_2: string;
88
+ btn_secondary_text: string;
89
+ btn_error_text: string;
92
90
  btn_selected_primary_bg: string;
93
91
  btn_selected_primary_text: string;
94
92
  btn_selected_secondary_bg: string;
@@ -1,8 +1,9 @@
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
  export { default as Alert } from "./components/Alert";
4
4
  export { default as Button } from "./components/Button";
5
5
  export { default as Chip } from "./components/Chip";
6
+ export { default as Checkbox } from "./components/Checkbox";
6
7
  export { default as DataTable } from "./components/DataTable";
7
8
  export { default as DatePicker } from "./components/DatePicker";
8
9
  export { default as Dropdown } from "./components/Dropdown";
@@ -11,7 +12,9 @@ export { default as Modal } from "./components/Modal";
11
12
  export { default as Radio } from "./components/Radio";
12
13
  export { default as RadioGroup } from "./components/RadioGroup";
13
14
  export { default as TextField } from "./components/TextField";
15
+ export { default as Toast } from "./components/Toast";
14
16
  export { default as Toggle } from "./components/Toggle";
15
17
  export { default as ToggleButton } from "./components/ToggleButton";
16
18
  export { default as ToggleButtonGroup } from "./components/ToggleButtonGroup";
17
19
  export { default as Tooltip } from "./components/Tooltip";
20
+ export { default as Typography } from "./components/Typography";
@@ -1,2 +1,4 @@
1
+ import { ThemeOptions } from "@mui/material";
2
+ export declare const themeOptions: ThemeOptions;
1
3
  declare const theme: import("@mui/material").Theme;
2
4
  export default theme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunit/design-system",
3
- "version": "1.0.0-a.4",
3
+ "version": "1.0.0-b.1",
4
4
  "description": "Lunit Design System",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/index.js",
@@ -37,7 +37,7 @@
37
37
  "scripts": {
38
38
  "build:transpile": "tsc -p tsconfig.build.json",
39
39
  "build:cjs": "webpack -c webpack/cjs.config.js",
40
- "build": "yarn build:transpile && yarn build:cjs",
40
+ "build": "npm run build:transpile && npm run build:cjs",
41
41
  "storybook": "storybook dev -p 6006",
42
42
  "build-storybook": "storybook build",
43
43
  "chromatic": "chromatic"
@@ -48,6 +48,11 @@
48
48
  "dependsOn": [
49
49
  "^build"
50
50
  ]
51
+ },
52
+ "build-storybook": {
53
+ "dependsOn": [
54
+ "^build"
55
+ ]
51
56
  }
52
57
  }
53
58
  },
@@ -61,27 +66,27 @@
61
66
  "@mui/icons-material": "^5.11.3",
62
67
  "@mui/material": "^5.11.3",
63
68
  "@mui/utils": "^5.11.3",
64
- "@mui/x-date-pickers": "^5.0.16",
65
- "@storybook/addon-actions": "^7.0.6",
66
- "@storybook/addon-essentials": "^7.0.6",
67
- "@storybook/addon-interactions": "^7.0.6",
68
- "@storybook/addon-links": "^7.0.6",
69
- "@storybook/addon-storysource": "^7.0.6",
70
- "@storybook/blocks": "^7.0.6",
71
- "@storybook/react": "^7.0.6",
72
- "@storybook/react-webpack5": "^7.0.6",
69
+ "@mui/x-date-pickers": "^5.0.20",
70
+ "@storybook/addon-actions": "^7.0.21",
71
+ "@storybook/addon-essentials": "^7.0.21",
72
+ "@storybook/addon-interactions": "^7.0.21",
73
+ "@storybook/addon-links": "^7.0.21",
74
+ "@storybook/addon-storysource": "^7.0.21",
75
+ "@storybook/blocks": "^7.0.21",
76
+ "@storybook/react": "^7.0.21",
77
+ "@storybook/react-webpack5": "^7.0.21",
73
78
  "@storybook/testing-library": "^0.1.0",
74
- "@storybook/theming": "^7.0.6",
79
+ "@storybook/theming": "^7.0.21",
75
80
  "@types/lodash": "^4.14.182",
76
81
  "babel-loader": "^8.2.5",
77
82
  "chromatic": "^6.7.0",
78
83
  "dayjs": "^1.11.7",
79
84
  "lodash": "^4.17.21",
80
85
  "mustache": "^4.2.0",
81
- "react": "^17.0.2",
82
- "react-dom": "^17.0.2",
83
- "storybook": "^7.0.6",
84
- "storybook-addon-pseudo-states": "^2.0.0",
86
+ "react": "18.2.0",
87
+ "react-dom": "18.2.0",
88
+ "storybook": "^7.0.21",
89
+ "storybook-addon-pseudo-states": "^2.0.1",
85
90
  "ts-loader": "^9.3.0",
86
91
  "typescript": "^4.6.4",
87
92
  "webpack": "^5.72.0",
@@ -50,12 +50,12 @@ export const StyledAlertTitle = styled(MuiAlertTitle)(({ theme }) => ({
50
50
  fontWeight: 700,
51
51
  fontSize: "14px",
52
52
  lineHeight: "20px",
53
- color: theme.palette.token.core.text_normal,
53
+ color: theme.palette.lunit_token.core.text_normal,
54
54
  },
55
55
  }));
56
56
 
57
57
  export const StyledAlertChildren = styled("div")(({ theme }) => ({
58
- color: theme.palette.token.core.text_normal,
58
+ color: theme.palette.lunit_token.core.text_normal,
59
59
  }));
60
60
 
61
61
  export const StyledBottomAction = styled("div")({
@@ -6,13 +6,13 @@ export const getBackgroundColor = (
6
6
  ) => {
7
7
  switch (severity) {
8
8
  case "info":
9
- return theme.palette.token.component.alert_info_bg;
9
+ return theme.palette.lunit_token.component.alert_info_bg;
10
10
  case "warning":
11
- return theme.palette.token.component.alert_warning_bg;
11
+ return theme.palette.lunit_token.component.alert_warning_bg;
12
12
  case "error":
13
- return theme.palette.token.component.alert_error_bg;
13
+ return theme.palette.lunit_token.component.alert_error_bg;
14
14
  default:
15
- return theme.palette.token.component.alert_success_bg;
15
+ return theme.palette.lunit_token.component.alert_success_bg;
16
16
  }
17
17
  };
18
18
 
@@ -22,13 +22,13 @@ export const getBorderColor = (
22
22
  ) => {
23
23
  switch (severity) {
24
24
  case "info":
25
- return theme.palette.token.component.alert_info_border;
25
+ return theme.palette.lunit_token.component.alert_info_border;
26
26
  case "warning":
27
- return theme.palette.token.component.alert_warning_border;
27
+ return theme.palette.lunit_token.component.alert_warning_border;
28
28
  case "error":
29
- return theme.palette.token.component.alert_error_border;
29
+ return theme.palette.lunit_token.component.alert_error_border;
30
30
  default:
31
- return theme.palette.token.component.alert_success_border;
31
+ return theme.palette.lunit_token.component.alert_success_border;
32
32
  }
33
33
  };
34
34
 
@@ -38,12 +38,12 @@ export const getIconColor = (
38
38
  ) => {
39
39
  switch (severity) {
40
40
  case "info":
41
- return theme.palette.token.core.icon_info_02;
41
+ return theme.palette.lunit_token.core.icon_info_02;
42
42
  case "warning":
43
- return theme.palette.token.core.icon_warning_02;
43
+ return theme.palette.lunit_token.core.icon_warning_02;
44
44
  case "error":
45
- return theme.palette.token.core.icon_error_02;
45
+ return theme.palette.lunit_token.core.icon_error_02;
46
46
  default:
47
- return theme.palette.token.core.icon_success_02;
47
+ return theme.palette.lunit_token.core.icon_success_02;
48
48
  }
49
49
  };
@@ -12,7 +12,7 @@ import type { ToggleButtonProps } from "../ToggleButton/ToggleButton.types";
12
12
  import type { Typography } from "@mui/material/styles/createTypography";
13
13
 
14
14
  type KindStyleParams = Pick<ButtonProps, "kind" | "color"> & {
15
- token: ColorToken;
15
+ lunit_token: ColorToken;
16
16
  };
17
17
 
18
18
  type CustomButtonProps = ButtonProps & { hasIconOnly: boolean };
@@ -64,80 +64,100 @@ export const sizeStyle = ({
64
64
  }),
65
65
  });
66
66
 
67
- export const kindStyle = ({ kind, color, token }: KindStyleParams) => ({
67
+ export const kindStyle = ({ kind, color, lunit_token }: KindStyleParams) => ({
68
68
  // kind: container
69
69
  ...(kind === "contained" &&
70
70
  color === "primary" && {
71
- color: token.component.btn_contained_primary_text,
72
- backgroundColor: token.component.btn_contained_primary_bg,
73
- "&:hover": getHoverStyle(token.component.btn_contained_primary_bg),
71
+ color: lunit_token.component.btn_primary_text_2,
72
+ backgroundColor: lunit_token.component.btn_primary_bg,
73
+ "&:hover": getHoverStyle(lunit_token.component.btn_primary_bg),
74
74
  "&.Mui-disabled": {
75
75
  opacity: 0.38,
76
76
  border: "none",
77
- color: token.component.btn_contained_primary_text,
77
+ color: lunit_token.component.btn_primary_text_2,
78
78
  },
79
79
  }),
80
80
  ...(kind === "contained" &&
81
81
  color === "secondary" && {
82
- color: token.component.btn_contained_secondary_text,
83
-
84
- backgroundColor: token.component.btn_contained_secondary_bg,
85
- "&:hover": getHoverStyle(token.component.btn_contained_secondary_bg),
82
+ color: lunit_token.component.btn_secondary_text,
83
+ backgroundColor: lunit_token.component.btn_secondary_bg,
84
+ "&:hover": getHoverStyle(lunit_token.component.btn_secondary_bg),
86
85
  "&.Mui-disabled": {
87
86
  opacity: 0.38,
88
87
  border: "none",
89
- color: token.component.btn_contained_secondary_text,
88
+ color: lunit_token.component.btn_secondary_text,
90
89
  },
91
90
  }),
92
91
  ...(kind === "contained" &&
93
92
  color === "error" && {
94
- color: token.component.btn_contained_error_text,
95
- backgroundColor: token.component.btn_contained_error_bg,
96
- "&:hover": getHoverStyle(token.component.btn_contained_error_bg),
93
+ color: lunit_token.component.btn_primary_text_2,
94
+ backgroundColor: lunit_token.component.btn_error_bg,
95
+ "&:hover": getHoverStyle(lunit_token.component.btn_error_bg),
97
96
  "&.Mui-disabled": {
98
97
  opacity: 0.38,
99
98
  border: "none",
100
- color: token.component.btn_contained_error_text,
99
+ color: lunit_token.component.btn_primary_text_2,
101
100
  },
102
101
  }),
103
102
  // kind: ghost
104
103
  ...(kind === "ghost" &&
105
104
  color === "primary" && {
106
- color: token.component.btn_ghost_primary_text,
105
+ color: lunit_token.component.btn_primary_text_1,
107
106
  border: "none",
108
107
  "&:hover": getHoverStyle("none"),
109
108
  "&.Mui-disabled": {
110
109
  opacity: 0.38,
111
110
  border: "none",
112
- color: token.component.btn_ghost_primary_text,
111
+ color: lunit_token.component.btn_primary_text_1,
113
112
  },
114
113
  }),
115
114
  ...(kind === "ghost" &&
116
115
  color === "secondary" && {
117
- color: token.component.btn_ghost_secondary_text,
116
+ color: lunit_token.component.btn_secondary_text,
118
117
  border: "none",
119
118
  "&:hover": getHoverStyle("none"),
120
119
  "&.Mui-disabled": {
121
120
  opacity: 0.38,
122
121
  border: "none",
123
- color: token.component.btn_ghost_secondary_text,
122
+ color: lunit_token.component.btn_secondary_text,
124
123
  },
125
124
  }),
126
125
  ...(kind === "ghost" &&
127
126
  color === "error" && {
128
- color: token.component.btn_ghost_error_text,
127
+ color: lunit_token.component.btn_error_text,
129
128
  "&:hover": getHoverStyle("none"),
130
129
  "&.Mui-disabled": {
131
130
  opacity: 0.38,
132
131
  border: "none",
133
- color: token.component.btn_ghost_error_text,
132
+ color: lunit_token.component.btn_error_text,
134
133
  },
135
134
  }),
136
135
  // kind: outlined
137
136
  ...(kind === "outlined" &&
138
137
  color === "primary" && {
139
- color: token.component.btn_outlined_primary_text,
140
- border: `${OUTLINED_BORDER_WIDTH}px solid ${token.component.btn_outlined_primary_border}`,
138
+ color: lunit_token.component.btn_primary_text_1,
139
+ border: `${OUTLINED_BORDER_WIDTH}px solid ${lunit_token.component.btn_primary_border}`,
140
+ "&:hover": getHoverStyle("none"),
141
+ "&:hover:before": {
142
+ content: "''",
143
+ position: "absolute",
144
+ left: "-1px",
145
+ top: "-1px",
146
+ width: "calc(100% + 2px)",
147
+ height: "calc(100% + 2px)",
148
+ zIndex: -1,
149
+ backgroundColor: lunit_token.core.hover,
150
+ borderRadius,
151
+ },
152
+ "&.Mui-disabled": {
153
+ opacity: 0.38,
154
+ color: lunit_token.component.btn_primary_text_1,
155
+ },
156
+ }),
157
+ ...(kind === "outlined" &&
158
+ color === "secondary" && {
159
+ color: lunit_token.component.btn_secondary_text,
160
+ border: `${OUTLINED_BORDER_WIDTH}px solid ${lunit_token.component.btn_secondary_border}`,
141
161
  "&:hover": getHoverStyle("none"),
142
162
  "&:hover:before": {
143
163
  content: "''",
@@ -147,17 +167,17 @@ export const kindStyle = ({ kind, color, token }: KindStyleParams) => ({
147
167
  width: "calc(100% + 2px)",
148
168
  height: "calc(100% + 2px)",
149
169
  zIndex: -1,
150
- backgroundColor: token.core.hover,
170
+ backgroundColor: lunit_token.core.hover,
151
171
  borderRadius,
152
172
  },
153
173
  "&.Mui-disabled": {
154
174
  opacity: 0.38,
155
- color: token.component.btn_outlined_primary_text,
175
+ color: lunit_token.component.btn_secondary_text,
156
176
  },
157
177
  }),
158
178
  });
159
179
 
160
- export const commonStyle = ({ token }: { token: ColorToken }) =>
180
+ export const commonStyle = ({ lunit_token }: { lunit_token: ColorToken }) =>
161
181
  ({
162
182
  fontWeight: "500",
163
183
  borderRadius,
@@ -169,7 +189,7 @@ export const commonStyle = ({ token }: { token: ColorToken }) =>
169
189
  height: `calc(100% + ${PADDING_OF_FOCUS}px)`,
170
190
  content: '""',
171
191
  borderRadius: "11px",
172
- border: `1px solid ${token.core.focused}`,
192
+ border: `1px solid ${lunit_token.core.focused}`,
173
193
  boxSizing: "border-box",
174
194
  },
175
195
  },
@@ -181,7 +201,7 @@ export const commonStyle = ({ token }: { token: ColorToken }) =>
181
201
  width: "100%",
182
202
  height: "100%",
183
203
  zIndex: -1,
184
- backgroundColor: token.core.hover,
204
+ backgroundColor: lunit_token.core.hover,
185
205
  borderRadius,
186
206
  },
187
207
  } as const);
@@ -217,16 +237,16 @@ export const CustomButton = styled(MuiButton, {
217
237
  ({
218
238
  theme: {
219
239
  typography,
220
- palette: { token },
240
+ palette: { lunit_token },
221
241
  },
222
242
  kind,
223
243
  size,
224
244
  color,
225
245
  hasIconOnly,
226
246
  }) => ({
227
- ...commonStyle({ token }),
247
+ ...commonStyle({ lunit_token }),
228
248
  ...iconStyle({ size, hasIconOnly }),
229
249
  ...sizeStyle({ size, kind, hasIconOnly, typography }),
230
- ...kindStyle({ kind, color, token }),
250
+ ...kindStyle({ kind, color, lunit_token }),
231
251
  })
232
252
  );
@@ -6,7 +6,6 @@ import type { ButtonProps } from "./Button.types";
6
6
 
7
7
  const Button = (props: ButtonProps) => {
8
8
  const {
9
- kind = "contained",
10
9
  size = "small",
11
10
  color = "primary",
12
11
  icon,
@@ -18,27 +17,30 @@ const Button = (props: ButtonProps) => {
18
17
 
19
18
  return (
20
19
  <>
21
- {kind === "contained" || kind === "ghost" ? (
20
+ {/** props.kind 사용 이유: props.color 타입 좁히기 활용을 위해 사용 */}
21
+ {props.kind === "outlined" ? (
22
22
  <CustomButton
23
- className={`${kind} ${className ? className : ""}`}
24
- kind={kind}
25
- color={color}
23
+ {...buttonProps}
24
+ className={`outlined ${className ? className : ""}`}
25
+ kind="outlined"
26
+ color={props.color ?? "primary"}
26
27
  size={size}
27
28
  startIcon={icon}
28
29
  hasIconOnly={hasIconOnly}
29
- {...buttonProps}
30
30
  >
31
31
  {!hasIconOnly && <>{children}</>}
32
32
  </CustomButton>
33
33
  ) : (
34
34
  <CustomButton
35
- className={`outlined ${className ? className : ""}`}
36
- kind="outlined"
37
- color="primary"
35
+ {...buttonProps}
36
+ className={`${props.kind ?? "contained"} ${
37
+ className ? className : ""
38
+ }`}
39
+ kind={props.kind ?? "contained"}
40
+ color={props.color ?? "primary"}
38
41
  size={size}
39
42
  startIcon={icon}
40
43
  hasIconOnly={hasIconOnly}
41
- {...buttonProps}
42
44
  >
43
45
  {!hasIconOnly && <>{children}</>}
44
46
  </CustomButton>
@@ -16,7 +16,7 @@ interface GhostButtonProps extends BaseButtonProps {
16
16
 
17
17
  interface OutlinedButtonProps extends BaseButtonProps {
18
18
  kind?: "outlined";
19
- color?: "primary";
19
+ color?: "primary" | "secondary";
20
20
  }
21
21
 
22
22
  export type ButtonProps =
@@ -15,7 +15,7 @@ const CustomCheckbox = styled(MuiCheckbox)(({ theme }) => ({
15
15
  position: "absolute",
16
16
  width: 24,
17
17
  height: 24,
18
- border: `1px solid ${theme.palette.token.core.focused}`,
18
+ border: `1px solid ${theme.palette.lunit_token.core.focused}`,
19
19
  borderRadius: "7px",
20
20
  },
21
21
  }));
@@ -27,7 +27,7 @@ const iconSize = {
27
27
 
28
28
  const DefaultIcon = styled("span")(({ theme }) => ({
29
29
  ...iconSize,
30
- backgroundColor: theme.palette.token.component.selectcontrol_off,
30
+ backgroundColor: theme.palette.lunit_token.component.selectcontrol_off,
31
31
  maskImage:
32
32
  "url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath" +
33
33
  " fill-rule='evenodd' clip-rule='evenodd' d='M14 1.5H4C2.61929 1.5 1.5 2.61929 1.5 4V14C1.5 15.3807 2.61929 16.5 4 16.5H14C15.3807 " +
@@ -36,7 +36,7 @@ const DefaultIcon = styled("span")(({ theme }) => ({
36
36
 
37
37
  const CheckedIcon = styled("span")(({ theme }) => ({
38
38
  ...iconSize,
39
- backgroundColor: theme.palette.token.component.selectcontrol_on,
39
+ backgroundColor: theme.palette.lunit_token.component.selectcontrol_on,
40
40
  maskImage:
41
41
  "url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath" +
42
42
  " fill-rule='evenodd' clip-rule='evenodd' d='M4 0C1.79086 0 0 1.79086 0 4V14C0 16.2091 1.79086 18 4 18H14C16.2091 18 18 16.2091 18 14V4C18 1.79086 16.2091 0 14 0H4ZM14.2516 " +
@@ -45,7 +45,7 @@ const CheckedIcon = styled("span")(({ theme }) => ({
45
45
 
46
46
  const IndeterminateIcon = styled("span")(({ theme }) => ({
47
47
  ...iconSize,
48
- backgroundColor: theme.palette.token.component.selectcontrol_on,
48
+ backgroundColor: theme.palette.lunit_token.component.selectcontrol_on,
49
49
  maskImage:
50
50
  "url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath" +
51
51
  " fill-rule='evenodd' clip-rule='evenodd' d='M4 0C1.79086 0 0 1.79086 0 4V14C0 16.2091 1.79086 18 4 18H14C16.2091 18 18 16.2091 18 14V4C18 1.79086 16.2091 0 " +
@@ -36,32 +36,32 @@ const getColorToken = (
36
36
  if (token === "text") {
37
37
  switch (color) {
38
38
  case CHIP_COLORS.PRIMARY:
39
- return theme.palette.token.component.chip_primary_text;
39
+ return theme.palette.lunit_token.component.chip_primary_text;
40
40
  case CHIP_COLORS.SECONDARY:
41
- return theme.palette.token.component.chip_secondary_text;
41
+ return theme.palette.lunit_token.component.chip_secondary_text;
42
42
  case CHIP_COLORS.ERROR:
43
- return theme.palette.token.component.chip_error_text;
43
+ return theme.palette.lunit_token.component.chip_error_text;
44
44
  case CHIP_COLORS.WARNING:
45
- return theme.palette.token.component.chip_warning_text;
45
+ return theme.palette.lunit_token.component.chip_warning_text;
46
46
  case CHIP_COLORS.SUCCESS:
47
- return theme.palette.token.component.chip_success_text;
47
+ return theme.palette.lunit_token.component.chip_success_text;
48
48
  default:
49
- return theme.palette.token.component.chip_primary_text;
49
+ return theme.palette.lunit_token.component.chip_primary_text;
50
50
  }
51
51
  } else {
52
52
  switch (color) {
53
53
  case CHIP_COLORS.PRIMARY:
54
- return theme.palette.token.component.chip_primary_bg;
54
+ return theme.palette.lunit_token.component.chip_primary_bg;
55
55
  case CHIP_COLORS.SECONDARY:
56
- return theme.palette.token.component.chip_secondary_bg;
56
+ return theme.palette.lunit_token.component.chip_secondary_bg;
57
57
  case CHIP_COLORS.ERROR:
58
- return theme.palette.token.component.chip_error_bg;
58
+ return theme.palette.lunit_token.component.chip_error_bg;
59
59
  case CHIP_COLORS.WARNING:
60
- return theme.palette.token.component.chip_warning_bg;
60
+ return theme.palette.lunit_token.component.chip_warning_bg;
61
61
  case CHIP_COLORS.SUCCESS:
62
- return theme.palette.token.component.chip_success_bg;
62
+ return theme.palette.lunit_token.component.chip_success_bg;
63
63
  default:
64
- return theme.palette.token.component.chip_primary_bg;
64
+ return theme.palette.lunit_token.component.chip_primary_bg;
65
65
  }
66
66
  }
67
67
  };
@@ -82,7 +82,7 @@ export const StyledContainedChipBase = styled(MuiChip, {
82
82
  ...COMMON_STYLES,
83
83
  ...theme.typography.caption,
84
84
 
85
- color: theme.palette.token.core.text_normal,
85
+ color: theme.palette.lunit_token.core.text_normal,
86
86
  backgroundColor: getColorToken("bg", theme, color),
87
87
 
88
88
  "& .MuiSvgIcon-root": {
@@ -134,7 +134,7 @@ export const StyledContainedChipEnable = styled(StyledContainedChipBase, {
134
134
  left: 0,
135
135
  right: 0,
136
136
  bottom: 0,
137
- backgroundColor: theme.palette.token.core.hover,
137
+ backgroundColor: theme.palette.lunit_token.core.hover,
138
138
  borderRadius: "11px",
139
139
  },
140
140
  }));
@@ -155,7 +155,7 @@ export const StyledContainedChipDeletable = styled(
155
155
  right: 0,
156
156
  bottom: 0,
157
157
  opacity: 0,
158
- color: theme.palette.token.core.hover,
158
+ color: theme.palette.lunit_token.core.hover,
159
159
  ":hover": {
160
160
  cursor: "pointer",
161
161
  opacity: 1,
@@ -13,7 +13,7 @@ const CustomRadio = styled(MuiRadio)(({ theme }) => ({
13
13
  display: "block",
14
14
  width: 24,
15
15
  height: 24,
16
- backgroundColor: theme.palette.token.core.focused,
16
+ backgroundColor: theme.palette.lunit_token.core.focused,
17
17
  maskImage:
18
18
  "url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath" +
19
19
  " fill-rule='evenodd' clip-rule='evenodd' d='M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 " +
@@ -28,7 +28,7 @@ const iconSize = {
28
28
 
29
29
  const DefaultIcon = styled("span")(({ theme }) => ({
30
30
  ...iconSize,
31
- backgroundColor: theme.palette.token.component.selectcontrol_off,
31
+ backgroundColor: theme.palette.lunit_token.component.selectcontrol_off,
32
32
  maskImage:
33
33
  "url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath" +
34
34
  " fill-rule='evenodd' clip-rule='evenodd' d='M10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 " +
@@ -37,7 +37,7 @@ const DefaultIcon = styled("span")(({ theme }) => ({
37
37
 
38
38
  const CheckedIcon = styled("span")(({ theme }) => ({
39
39
  ...iconSize,
40
- backgroundColor: theme.palette.token.component.selectcontrol_on,
40
+ backgroundColor: theme.palette.lunit_token.component.selectcontrol_on,
41
41
  maskImage:
42
42
  "url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath" +
43
43
  " fill-rule='evenodd' clip-rule='evenodd' d='M10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5C7.23858 5 5" +