@lunit/design-system 1.0.0-b.4 → 2.0.0

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 (132) hide show
  1. package/dist/cjs/components/Alert/index.js +1 -1
  2. package/dist/cjs/components/Alert/index.js.map +1 -1
  3. package/dist/cjs/components/Button/index.js +1 -1
  4. package/dist/cjs/components/Button/index.js.map +1 -1
  5. package/dist/cjs/components/Checkbox/index.js +1 -1
  6. package/dist/cjs/components/Checkbox/index.js.map +1 -1
  7. package/dist/cjs/components/Chip/index.js +1 -1
  8. package/dist/cjs/components/Chip/index.js.map +1 -1
  9. package/dist/cjs/components/Dialog/index.js +2 -0
  10. package/dist/cjs/components/Dialog/index.js.map +1 -0
  11. package/dist/cjs/components/Radio/index.js +1 -1
  12. package/dist/cjs/components/Radio/index.js.map +1 -1
  13. package/dist/cjs/components/TextField/index.js +1 -1
  14. package/dist/cjs/components/TextField/index.js.map +1 -1
  15. package/dist/cjs/components/ToggleButton/index.js +1 -1
  16. package/dist/cjs/components/ToggleButton/index.js.map +1 -1
  17. package/dist/cjs/index.js +1 -1
  18. package/dist/cjs/index.js.map +1 -1
  19. package/dist/components/Button/Button.js +21 -3
  20. package/dist/components/Button/Button.js.map +1 -1
  21. package/dist/components/Button/Button.styled.js +3 -6
  22. package/dist/components/Button/Button.styled.js.map +1 -1
  23. package/dist/components/Checkbox/Checkbox.js +9 -19
  24. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  25. package/dist/components/Chip/Chip.js +6 -5
  26. package/dist/components/Chip/Chip.js.map +1 -1
  27. package/dist/components/Dialog/Dialog.js +61 -0
  28. package/dist/components/Dialog/Dialog.js.map +1 -0
  29. package/dist/components/Dialog/Dialog.styled.js +137 -0
  30. package/dist/components/Dialog/Dialog.styled.js.map +1 -0
  31. package/dist/components/Dialog/components/DialogAction.js +18 -0
  32. package/dist/components/Dialog/components/DialogAction.js.map +1 -0
  33. package/dist/components/Dialog/index.js +2 -0
  34. package/dist/components/Dialog/index.js.map +1 -0
  35. package/dist/components/Radio/Radio.js +7 -21
  36. package/dist/components/Radio/Radio.js.map +1 -1
  37. package/dist/components/TextField/TextField.js +4 -4
  38. package/dist/components/TextField/TextField.js.map +1 -1
  39. package/dist/components/ToggleButton/ToggleButton.styled.js +2 -3
  40. package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -1
  41. package/dist/foundation/Elevation/index.js +1 -1
  42. package/dist/foundation/Elevation/index.js.map +1 -1
  43. package/dist/foundation/Typography/index.js +12 -0
  44. package/dist/foundation/Typography/index.js.map +1 -1
  45. package/dist/foundation/Typography/tokens.js +1 -17
  46. package/dist/foundation/Typography/tokens.js.map +1 -1
  47. package/dist/foundation/colors/base/grey.js +3 -1
  48. package/dist/foundation/colors/base/grey.js.map +1 -1
  49. package/dist/foundation/colors/index.js +9 -6
  50. package/dist/foundation/colors/index.js.map +1 -1
  51. package/dist/foundation/colors/token/component.js +31 -115
  52. package/dist/foundation/colors/token/component.js.map +1 -1
  53. package/dist/foundation/colors/token/core.js +43 -75
  54. package/dist/foundation/colors/token/core.js.map +1 -1
  55. package/dist/foundation/index.js +1 -1
  56. package/dist/foundation/index.js.map +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/index.js.map +1 -1
  59. package/dist/types/components/Alert/Alert.utils.d.ts +3 -3
  60. package/dist/types/components/Button/Button.styled.d.ts +9 -12
  61. package/dist/types/components/Button/Button.types.d.ts +8 -5
  62. package/dist/types/components/Chip/Chip.styled.d.ts +12 -12
  63. package/dist/types/components/Chip/Chip.types.d.ts +7 -2
  64. package/dist/types/components/Dialog/Dialog.d.ts +50 -0
  65. package/dist/types/components/Dialog/Dialog.styled.d.ts +12 -0
  66. package/dist/types/components/Dialog/components/DialogAction.d.ts +8 -0
  67. package/dist/types/components/Dialog/index.d.ts +2 -0
  68. package/dist/types/components/TextField/TextField.types.d.ts +8 -3
  69. package/dist/types/components/Toast/Toast.utils.d.ts +1 -1
  70. package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
  71. package/dist/types/foundation/Elevation/index.d.ts +1 -1
  72. package/dist/types/foundation/Typography/index.d.ts +13 -1
  73. package/dist/types/foundation/Typography/tokens.d.ts +1 -1
  74. package/dist/types/foundation/colors/base/grey.d.ts +2 -0
  75. package/dist/types/foundation/colors/index.d.ts +9 -6
  76. package/dist/types/foundation/colors/token/types.d.ts +0 -2
  77. package/dist/types/foundation/colors/types.d.ts +78 -76
  78. package/dist/types/foundation/index.d.ts +9 -0
  79. package/dist/types/index.d.ts +1 -1
  80. package/package.json +1 -1
  81. package/src/components/Button/Button.styled.ts +3 -6
  82. package/src/components/Button/Button.tsx +117 -42
  83. package/src/components/Button/Button.types.ts +8 -4
  84. package/src/components/Checkbox/Checkbox.tsx +39 -22
  85. package/src/components/Chip/Chip.tsx +15 -4
  86. package/src/components/Chip/Chip.types.ts +9 -2
  87. package/src/components/Dialog/Dialog.styled.ts +165 -0
  88. package/src/components/Dialog/Dialog.tsx +195 -0
  89. package/src/components/Dialog/components/DialogAction.tsx +36 -0
  90. package/src/components/Dialog/index.ts +14 -0
  91. package/src/components/Radio/Radio.tsx +37 -25
  92. package/src/components/TextField/TextField.tsx +10 -10
  93. package/src/components/TextField/TextField.types.ts +11 -4
  94. package/src/components/ToggleButton/ToggleButton.styled.ts +2 -3
  95. package/src/foundation/Elevation/index.ts +1 -1
  96. package/src/foundation/Typography/index.ts +12 -0
  97. package/src/foundation/Typography/tokens.ts +1 -17
  98. package/src/foundation/colors/base/grey.ts +3 -1
  99. package/src/foundation/colors/index.ts +9 -6
  100. package/src/foundation/colors/token/component.ts +24 -108
  101. package/src/foundation/colors/token/core.ts +39 -71
  102. package/src/foundation/colors/token/types.ts +0 -2
  103. package/src/foundation/colors/types.ts +78 -75
  104. package/src/foundation/index.ts +1 -1
  105. package/src/index.ts +1 -1
  106. package/src/stories/GettingStarted.mdx +88 -0
  107. package/src/stories/components/Button/BasicButton.stories.tsx +91 -52
  108. package/src/stories/components/Button/ButtonDocs.mdx +187 -0
  109. package/src/stories/components/Button/Color.stories.tsx +132 -0
  110. package/src/stories/components/Button/IconButton.stories.tsx +42 -25
  111. package/src/stories/components/Button/Kind.stories.tsx +75 -77
  112. package/src/stories/components/{SelectControl/Checkbox.stories.tsx → CheckBox/BasicCheckbox.stories.tsx} +84 -105
  113. package/src/stories/components/CheckBox/CheckboxDocs.mdx +85 -0
  114. package/src/stories/components/Chip/Chip.stories.tsx +80 -5
  115. package/src/stories/components/Chip/ChipDocs.mdx +132 -0
  116. package/src/stories/components/Dialog/Dialog.stories.tsx +320 -0
  117. package/src/stories/components/TextField/BasicTextField.stories.tsx +214 -0
  118. package/src/stories/components/TextField/TextFieldDocs.mdx +140 -0
  119. package/src/stories/components/TextField/TextFieldSize.stories.tsx +26 -3
  120. package/src/stories/components/ToggleButton/Basic.stories.tsx +312 -0
  121. package/src/stories/components/ToggleButton/ToggleButtonDocs.mdx +180 -0
  122. package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +65 -0
  123. package/src/stories/components/ToggleButton/WithIcon.stories.tsx +138 -0
  124. package/src/stories/foundation/Typography/Typography.mdx +31 -46
  125. package/src/stories/foundation/Typography/Typography.stories.tsx +30 -1
  126. package/src/stories/foundation/colors/ColorSystem.tsx +86 -0
  127. package/src/stories/foundation/colors/Docs.mdx +225 -0
  128. package/src/stories/foundation/colors/TokenPaletteTable.tsx +1 -5
  129. package/src/components/Modal/Modal.tsx +0 -8
  130. package/src/components/Modal/index.ts +0 -1
  131. package/src/stories/components/Modal/Modal.stories.tsx +0 -15
  132. package/src/stories/foundation/Typography/TypographyExamples.stories.tsx +0 -44
@@ -25,6 +25,7 @@ const SingleTextField = forwardRef<HTMLDivElement, SingleTextFieldProps>(
25
25
 
26
26
  return (
27
27
  <BaseTextField
28
+ variant="outlined"
28
29
  {...restProps}
29
30
  ref={ref}
30
31
  textFieldSize={size}
@@ -57,19 +58,19 @@ const SingleTextField = forwardRef<HTMLDivElement, SingleTextFieldProps>(
57
58
  const MultiTextField = forwardRef<HTMLDivElement, MultiTextFieldProps>(
58
59
  ({ size = "small", ...restProps }, ref) => {
59
60
  return (
60
- <BaseTextField {...restProps} ref={ref} textFieldSize={size} multiline />
61
+ <BaseTextField
62
+ variant="outlined"
63
+ {...restProps}
64
+ ref={ref}
65
+ textFieldSize={size}
66
+ multiline
67
+ />
61
68
  );
62
69
  }
63
70
  );
64
71
 
65
72
  const TextField = forwardRef<HTMLDivElement, TextFieldProps>((props, ref) => {
66
- const {
67
- rows,
68
- size,
69
- multiline = false,
70
- variant = "outlined",
71
- ...restProps
72
- } = props;
73
+ const { rows, size, multiline = false, variant, ...restProps } = props;
73
74
 
74
75
  return multiline ? (
75
76
  <MultiTextField
@@ -77,11 +78,10 @@ const TextField = forwardRef<HTMLDivElement, TextFieldProps>((props, ref) => {
77
78
  ref={ref}
78
79
  maxRows={Infinity}
79
80
  size={size}
80
- variant={variant}
81
81
  rows={rows}
82
82
  />
83
83
  ) : (
84
- <SingleTextField {...restProps} ref={ref} size={size} variant={variant} />
84
+ <SingleTextField {...restProps} ref={ref} size={size} />
85
85
  );
86
86
  });
87
87
 
@@ -1,5 +1,8 @@
1
1
  import type { SxProps } from "@mui/material";
2
- import type { OutlinedTextFieldProps } from "@mui/material/TextField";
2
+ import type {
3
+ TextFieldProps as MuiTextFieldProps,
4
+ OutlinedTextFieldProps,
5
+ } from "@mui/material/TextField";
3
6
 
4
7
  export type TextFieldSize = "small" | "medium" | "large";
5
8
  export interface BaseTextFieldProps
@@ -8,12 +11,16 @@ export interface BaseTextFieldProps
8
11
  "size" | "value" | "helperText" | "variant"
9
12
  > {
10
13
  /**
11
- * The design system TextField variable is outlined fixed.
14
+ * The design system TextField has only on kind, which is "contained"
15
+ Below are all return same kind "contained"
16
+ <TextField variant="outlined" />
17
+ <TextField variant="contained" />
18
+ <TextField variant="filled" />
19
+ <TextField variant="standard" />
12
20
  */
13
- variant?: "outlined";
21
+ variant?: MuiTextFieldProps["variant"];
14
22
  value?: string;
15
23
  helperText?: string;
16
-
17
24
  /**
18
25
  * @default "small"
19
26
  */
@@ -38,7 +38,7 @@ export const CustomToggleButton = styled(MuiToggleButton, {
38
38
  ...(selectedColor === "secondary" && {
39
39
  "&.Mui-selected, &.Mui-selected:hover": {
40
40
  border: "none",
41
- backgroundColor: lunit_token.component.btn_selected_secondary_bg,
41
+ backgroundColor: lunit_token.component.btn_secondary_bg,
42
42
  color: lunit_token.component.btn_selected_secondary_text,
43
43
  },
44
44
  }),
@@ -57,10 +57,9 @@ export const IconWrapper = styled("div")<{
57
57
  }>(({ hasIconOnly, size }) => ({
58
58
  width: "20px",
59
59
  height: "20px",
60
- padding: "1px",
61
60
  marginRight: hasIconOnly ? "0px" : size === "large" ? "8px" : "4px",
62
61
 
63
62
  "*:nth-of-type(1)": {
64
- fontSize: "18px",
63
+ fontSize: "20px",
65
64
  },
66
65
  }));
@@ -24,7 +24,7 @@ export const elevationOptions = {
24
24
  export const createElevationCssBaseline = () => {
25
25
  return {
26
26
  // :root에 모든 theme이 정의되어 있지 않으므로 surface*에서 찾아야 함
27
- ".light1, .light2, .dark1, .dark2, .dark3, .dark4": {
27
+ ".light1, .light2, .dark1, .dark2": {
28
28
  ...createCSSVars(shadows),
29
29
  ...createCSSVars(elevations),
30
30
  // `--elevation-shadow`가 정의되지 않아도 `box-shadow: var(--elevation-shadow)` 구문을 해석하려면 필요함
@@ -86,6 +86,18 @@ export const createTypographyCssBaseline = () => {
86
86
  ":root": {
87
87
  ...cssVariables,
88
88
  },
89
+ ".light1": {
90
+ color: "var(--text_normal)",
91
+ },
92
+ ".light2": {
93
+ color: "var(--text_normal)",
94
+ },
95
+ ".dark1": {
96
+ color: "var(--text_normal)",
97
+ },
98
+ ".dark2": {
99
+ color: "var(--text_normal)",
100
+ },
89
101
  };
90
102
  };
91
103
 
@@ -16,7 +16,7 @@ const headline = {
16
16
  "--headline2-line-height": "65px",
17
17
  "--headline3-font-weight": "var(--font-weight-semibold)",
18
18
  "--headline3-font-size": "24px",
19
- "--headline3-line-height": "57px",
19
+ "--headline3-line-height": "29px",
20
20
  "--headline4-font-weight": "var(--font-weight-semibold)",
21
21
  "--headline4-font-size": "20px",
22
22
  "--headline4-line-height": "28px",
@@ -69,73 +69,61 @@ const fontVariants: Record<string, TypographyStyleOptions> = {
69
69
  fontWeight: "var(--headline1-font-weight)",
70
70
  fontSize: "var(--headline1-font-size)",
71
71
  lineHeight: "var(--headline1-line-height)",
72
- color: "var(--text_normal)",
73
72
  },
74
73
  headline2: {
75
74
  fontWeight: "var(--headline2-font-weight)",
76
75
  fontSize: "var(--headline2-font-size)",
77
76
  lineHeight: "var(--headline2-line-height)",
78
- color: "var(--text_normal)",
79
77
  },
80
78
  headline3: {
81
79
  fontWeight: "var(--headline3-font-weight)",
82
80
  fontSize: "var(--headline3-font-size)",
83
81
  lineHeight: "var(--headline3-line-height)",
84
- color: "var(--text_normal)",
85
82
  },
86
83
  headline4: {
87
84
  fontWeight: "var(--headline4-font-weight)",
88
85
  fontSize: "var(--headline4-font-size)",
89
86
  lineHeight: "var(--headline4-line-height)",
90
- color: "var(--text_normal)",
91
87
  },
92
88
  headline5: {
93
89
  fontWeight: "var(--headline5-font-weight)",
94
90
  fontSize: "var(--headline5-font-size)",
95
91
  lineHeight: "var(--headline5-line-height)",
96
- color: "var(--text_normal)",
97
92
  },
98
93
  body1_16_semibold: {
99
94
  fontWeight: "var(--body1-16-semibold-font-weight)",
100
95
  fontSize: "var(--body1-16-semibold-font-size)",
101
96
  lineHeight: "var(--body1-16-semibold-line-height)",
102
- color: "var(--text_normal)",
103
97
  },
104
98
  body1_16_regular: {
105
99
  fontWeight: "var(--body1-16-regular-font-weight)",
106
100
  fontSize: "var(--body1-16-regular-font-size)",
107
101
  lineHeight: "var(--body1-16-regular-line-height)",
108
- color: "var(--text_normal)",
109
102
  },
110
103
  body2_14_bold: {
111
104
  fontWeight: "var(--body2-14-bold-font-weight)",
112
105
  fontSize: "var(--body2-14-bold-font-size)",
113
106
  lineHeight: "var(--body2-14-bold-line-height)",
114
- color: "var(--text_normal)",
115
107
  },
116
108
  body2_14_medium: {
117
109
  fontWeight: "var(--body2-14-medium-font-weight)",
118
110
  fontSize: "var(--body2-14-medium-font-size)",
119
111
  lineHeight: "var(--body2-14-medium-line-height)",
120
- color: "var(--text_normal)",
121
112
  },
122
113
  body2_14_regular: {
123
114
  fontWeight: "var(--body2-14-regular-font-weight)",
124
115
  fontSize: "var(--body2-14-regular-font-size)",
125
116
  lineHeight: "var(--body2-14-regular-line-height)",
126
- color: "var(--text_normal)",
127
117
  },
128
118
  body3_12_semibold: {
129
119
  fontWeight: "var(--body3-12-semibold-font-weight)",
130
120
  fontSize: "var(--body3-12-semibold-font-size)",
131
121
  lineHeight: "var(--body3-12-semibold-line-height)",
132
- color: "var(--text_normal)",
133
122
  },
134
123
  body3_12_regular: {
135
124
  fontWeight: "var(--body3-12-regular-font-weight)",
136
125
  fontSize: "var(--body3-12-regular-font-size)",
137
126
  lineHeight: "var(--body3-12-regular-line-height)",
138
- color: "var(--text_normal)",
139
127
  },
140
128
  overline: {
141
129
  fontWeight: "var(--overline-font-weight)",
@@ -143,14 +131,12 @@ const fontVariants: Record<string, TypographyStyleOptions> = {
143
131
  lineHeight: "var(--overline-line-height)",
144
132
  letterSpacing: "1px",
145
133
  textTransform: "uppercase",
146
- color: "var(--text_normal)",
147
134
  },
148
135
  button1: {
149
136
  fontWeight: "var(--button1-font-weight)",
150
137
  fontSize: "var(--button1-font-size)",
151
138
  lineHeight: "var(--button1-line-height)",
152
139
  textTransform: "capitalize",
153
- color: "var(--text_normal)",
154
140
  },
155
141
  button2: {
156
142
  fontWeight: "var(--button2-font-weight)",
@@ -158,13 +144,11 @@ const fontVariants: Record<string, TypographyStyleOptions> = {
158
144
  lineHeight: "var(--button2-line-height)",
159
145
  letterSpacing: "0.2px",
160
146
  textTransform: "capitalize",
161
- color: "var(--text_normal)",
162
147
  },
163
148
  caption: {
164
149
  fontWeight: "var(--caption-font-weight)",
165
150
  fontSize: "var(--caption-font-size)",
166
151
  lineHeight: "var(--caption-line-height)",
167
- color: "var(--text_normal)",
168
152
  },
169
153
  };
170
154
 
@@ -3,7 +3,8 @@ export const grey = {
3
3
  5: "#FAFAFB",
4
4
  10: "#F1F1F4",
5
5
  15: "#DFDFE2",
6
- 20: "#C6C6C8",
6
+ 20: "#CFCFD1",
7
+ 25: "#C0C0C2",
7
8
  30: "#AFAFB1",
8
9
  40: "#99999B",
9
10
  50: "#747477",
@@ -23,6 +24,7 @@ export const greyText = {
23
24
  10: grey[95],
24
25
  15: grey[95],
25
26
  20: grey[95],
27
+ 25: grey[95],
26
28
  30: grey[95],
27
29
  40: grey[95],
28
30
  50: grey[5],
@@ -115,12 +115,6 @@ export const createColorCssBaseline = () => {
115
115
  ".dark2": {
116
116
  ...createTokenColorVariables("dark2"),
117
117
  },
118
- ".dark3": {
119
- ...createTokenColorVariables("dark3"),
120
- },
121
- ".dark4": {
122
- ...createTokenColorVariables("dark4"),
123
- },
124
118
  };
125
119
  };
126
120
 
@@ -172,12 +166,17 @@ const paletteOptions = {
172
166
  main: base.green[40], // core.text_success.dark1
173
167
  },
174
168
  grey: base.greyForMUI,
169
+ text: {
170
+ primary: base.grey[5], // core.text_normal.dark1
171
+ secondary: base.grey[40], // core.text_medium.dark1
172
+ },
175
173
  lunit_global: lunitColors,
176
174
  lunit_token: {
177
175
  core: {
178
176
  bg_01: "var(--bg_01)",
179
177
  bg_02: "var(--bg_02)",
180
178
  bg_03: "var(--bg_03)",
179
+ layer_01: "var(--layer_01)",
181
180
  text_primary: "var(--text_primary)",
182
181
  text_normal: "var(--text_normal)",
183
182
  text_medium: "var(--text_medium)",
@@ -200,6 +199,8 @@ const paletteOptions = {
200
199
  shadow_02: "var(--shadow_02)",
201
200
  shadow_03: "var(--shadow_03)",
202
201
  shadow_04: "var(--shadow_04)",
202
+ border_light: "var(--border_light)",
203
+ border_medium: "var(--border_medium)",
203
204
  },
204
205
  component: {
205
206
  btn_primary_bg: "var(--btn_primary_bg)",
@@ -215,6 +216,8 @@ const paletteOptions = {
215
216
  btn_selected_primary_text: "var(--btn_selected_primary_text)",
216
217
  btn_selected_secondary_bg: "var(--btn_selected_secondary_bg)",
217
218
  btn_selected_secondary_text: "var(--btn_selected_secondary_text)",
219
+ btn_selected_tertiary_bg: "var(--btn_selected_tertiary_bg)",
220
+ btn_selected_tertiary_text: "var(--btn_selected_tertiary_text)",
218
221
  selectcontrol_on: "var(--selectcontrol_on)",
219
222
  selectcontrol_off: "var(--selectcontrol_off)",
220
223
  selectcontrol_handler: "var(--selectcontrol_handler)",