@lunit/design-system 2.0.2 → 2.1.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 (128) hide show
  1. package/README.md +107 -7
  2. package/dist/cjs/components/Chip/index.js +1 -1
  3. package/dist/cjs/components/Chip/index.js.map +1 -1
  4. package/dist/cjs/components/Dialog/index.js +1 -1
  5. package/dist/cjs/components/Dialog/index.js.map +1 -1
  6. package/dist/cjs/components/Dropdown/index.js +1 -1
  7. package/dist/cjs/components/Dropdown/index.js.map +1 -1
  8. package/dist/cjs/components/TextField/index.js +1 -1
  9. package/dist/cjs/components/TextField/index.js.map +1 -1
  10. package/dist/cjs/index.js +1 -1
  11. package/dist/cjs/index.js.map +1 -1
  12. package/dist/components/Chip/Chip.styled.js +9 -16
  13. package/dist/components/Chip/Chip.styled.js.map +1 -1
  14. package/dist/components/Dialog/Dialog.js +0 -6
  15. package/dist/components/Dialog/Dialog.js.map +1 -1
  16. package/dist/components/Dropdown/Dropdown.js +37 -4
  17. package/dist/components/Dropdown/Dropdown.js.map +1 -1
  18. package/dist/components/Dropdown/Dropdown.styled.js +161 -0
  19. package/dist/components/Dropdown/Dropdown.styled.js.map +1 -0
  20. package/dist/components/Dropdown/Dropdown.types.js +2 -0
  21. package/dist/components/Dropdown/Dropdown.types.js.map +1 -0
  22. package/dist/components/Dropdown/DropdownItem.js +36 -0
  23. package/dist/components/Dropdown/DropdownItem.js.map +1 -0
  24. package/dist/components/Dropdown/index.js +1 -0
  25. package/dist/components/Dropdown/index.js.map +1 -1
  26. package/dist/components/TextField/TextField.js +1 -1
  27. package/dist/components/TextField/TextField.js.map +1 -1
  28. package/dist/components/TextField/TextField.style.js +27 -3
  29. package/dist/components/TextField/TextField.style.js.map +1 -1
  30. package/dist/foundation/Typography/index.js +5 -0
  31. package/dist/foundation/Typography/index.js.map +1 -1
  32. package/dist/foundation/Typography/tokens.js +44 -0
  33. package/dist/foundation/Typography/tokens.js.map +1 -1
  34. package/dist/foundation/colors/base/blue.js +12 -10
  35. package/dist/foundation/colors/base/blue.js.map +1 -1
  36. package/dist/foundation/colors/base/green.js +11 -9
  37. package/dist/foundation/colors/base/green.js.map +1 -1
  38. package/dist/foundation/colors/base/grey.js +30 -15
  39. package/dist/foundation/colors/base/grey.js.map +1 -1
  40. package/dist/foundation/colors/base/lunitTeal.js +2 -0
  41. package/dist/foundation/colors/base/lunitTeal.js.map +1 -1
  42. package/dist/foundation/colors/base/magenta.js +3 -1
  43. package/dist/foundation/colors/base/magenta.js.map +1 -1
  44. package/dist/foundation/colors/base/orange.js +11 -9
  45. package/dist/foundation/colors/base/orange.js.map +1 -1
  46. package/dist/foundation/colors/base/purple.js +3 -1
  47. package/dist/foundation/colors/base/purple.js.map +1 -1
  48. package/dist/foundation/colors/base/red.js +5 -3
  49. package/dist/foundation/colors/base/red.js.map +1 -1
  50. package/dist/foundation/colors/base/yellow.js +12 -10
  51. package/dist/foundation/colors/base/yellow.js.map +1 -1
  52. package/dist/foundation/colors/index.js +3 -0
  53. package/dist/foundation/colors/index.js.map +1 -1
  54. package/dist/foundation/colors/token/component.js +26 -22
  55. package/dist/foundation/colors/token/component.js.map +1 -1
  56. package/dist/foundation/colors/token/core.js +21 -0
  57. package/dist/foundation/colors/token/core.js.map +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/index.js.map +1 -1
  60. package/dist/types/components/Button/Button.styled.d.ts +3 -3
  61. package/dist/types/components/Chip/Chip.styled.d.ts +12 -12
  62. package/dist/types/components/Dialog/Dialog.d.ts +0 -3
  63. package/dist/types/components/Dropdown/Dropdown.d.ts +3 -1
  64. package/dist/types/components/Dropdown/Dropdown.styled.d.ts +41 -0
  65. package/dist/types/components/Dropdown/Dropdown.types.d.ts +11 -0
  66. package/dist/types/components/Dropdown/DropdownItem.d.ts +13 -0
  67. package/dist/types/components/Dropdown/index.d.ts +2 -0
  68. package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
  69. package/dist/types/foundation/Typography/index.d.ts +21 -1
  70. package/dist/types/foundation/Typography/tokens.d.ts +15 -0
  71. package/dist/types/foundation/colors/base/blue.d.ts +2 -0
  72. package/dist/types/foundation/colors/base/green.d.ts +2 -0
  73. package/dist/types/foundation/colors/base/grey.d.ts +15 -0
  74. package/dist/types/foundation/colors/base/lunitTeal.d.ts +2 -0
  75. package/dist/types/foundation/colors/base/magenta.d.ts +2 -0
  76. package/dist/types/foundation/colors/base/orange.d.ts +2 -0
  77. package/dist/types/foundation/colors/base/purple.d.ts +2 -0
  78. package/dist/types/foundation/colors/base/red.d.ts +2 -0
  79. package/dist/types/foundation/colors/base/yellow.d.ts +2 -0
  80. package/dist/types/foundation/colors/index.d.ts +3 -0
  81. package/dist/types/foundation/colors/types.d.ts +3 -0
  82. package/dist/types/foundation/index.d.ts +3 -0
  83. package/dist/types/index.d.ts +1 -1
  84. package/package.json +2 -2
  85. package/src/components/Chip/Chip.styled.ts +9 -16
  86. package/src/components/Dialog/Dialog.tsx +0 -8
  87. package/src/components/Dropdown/Dropdown.styled.tsx +170 -0
  88. package/src/components/Dropdown/Dropdown.tsx +59 -8
  89. package/src/components/Dropdown/Dropdown.types.ts +15 -0
  90. package/src/components/Dropdown/DropdownItem.tsx +107 -0
  91. package/src/components/Dropdown/index.ts +6 -0
  92. package/src/components/TextField/TextField.style.ts +28 -3
  93. package/src/components/TextField/TextField.tsx +1 -7
  94. package/src/foundation/Typography/index.ts +10 -0
  95. package/src/foundation/Typography/tokens.ts +45 -0
  96. package/src/foundation/colors/base/blue.ts +12 -10
  97. package/src/foundation/colors/base/green.ts +11 -9
  98. package/src/foundation/colors/base/grey.ts +30 -15
  99. package/src/foundation/colors/base/lunitTeal.ts +2 -0
  100. package/src/foundation/colors/base/magenta.ts +3 -1
  101. package/src/foundation/colors/base/orange.ts +11 -9
  102. package/src/foundation/colors/base/purple.ts +3 -1
  103. package/src/foundation/colors/base/red.ts +5 -3
  104. package/src/foundation/colors/base/yellow.ts +12 -10
  105. package/src/foundation/colors/index.ts +3 -0
  106. package/src/foundation/colors/token/component.ts +26 -22
  107. package/src/foundation/colors/token/core.ts +21 -0
  108. package/src/foundation/colors/types.ts +3 -0
  109. package/src/index.ts +6 -1
  110. package/src/stories/components/Chip/Chip.stories.tsx +18 -0
  111. package/src/stories/components/Chip/ChipDocs.mdx +20 -0
  112. package/src/stories/components/Dialog/DialogDocs.mdx +2 -10
  113. package/src/stories/components/Dropdown/Dropdown.stories.tsx +299 -10
  114. package/src/stories/components/Dropdown/DropdownExamples.stories.tsx +221 -0
  115. package/src/stories/components/Dropdown/DropdownItem.stories.tsx +360 -0
  116. package/src/stories/components/TextField/BasicTextField.stories.tsx +28 -0
  117. package/src/stories/components/TextField/TextFieldDocs.mdx +12 -0
  118. package/src/stories/foundation/Typography/Typography.stories.tsx +13 -0
  119. package/src/stories/foundation/Typography/const.ts +6 -1
  120. package/src/stories/foundation/colors/TokenPaletteTable.tsx +19 -1
  121. package/dist/cjs/components/Modal/index.js +0 -2
  122. package/dist/cjs/components/Modal/index.js.map +0 -1
  123. package/dist/components/Modal/Modal.js +0 -7
  124. package/dist/components/Modal/Modal.js.map +0 -1
  125. package/dist/components/Modal/index.js +0 -2
  126. package/dist/components/Modal/index.js.map +0 -1
  127. package/dist/types/components/Modal/Modal.d.ts +0 -2
  128. package/dist/types/components/Modal/index.d.ts +0 -1
@@ -0,0 +1,170 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import Box from "@mui/material/Box";
3
+ import Select from "@mui/material/Select";
4
+ import MenuItem from "@mui/material/MenuItem";
5
+
6
+ import { DropdownProps } from "./Dropdown.types";
7
+ type StyledDropdownProps = Omit<DropdownProps, "size"> & {
8
+ selectSize: "small" | "medium" | "large";
9
+ };
10
+
11
+ const valuesBySize = {
12
+ small: {
13
+ height: "28px",
14
+ padding: "4px 12px",
15
+ iconTop: "4px",
16
+ iconRight: "12px",
17
+ },
18
+ medium: {
19
+ height: "36px",
20
+ padding: "8px 16px",
21
+ iconTop: "8px",
22
+ iconRight: "16px",
23
+ },
24
+ large: {
25
+ height: "44px",
26
+ padding: "10px 16px",
27
+ iconTop: "12px", // large 의 text line height 가 medium, small 보다 4px 크기 때문에 그의 반절인 2px + padding 값 10px => 12px
28
+ iconRight: "16px",
29
+ },
30
+ };
31
+
32
+ export const StyledSelect = styled(Select, {
33
+ shouldForwardProp: (prop: string) => {
34
+ return !["selectSize", "select"].includes(prop);
35
+ },
36
+ })<StyledDropdownProps>(({ theme, selectSize }) => ({
37
+ ...(selectSize === "large"
38
+ ? { ...theme.typography.body1_16_regular }
39
+ : { ...theme.typography.body2_14_regular }),
40
+ height: valuesBySize[selectSize || "medium"].height,
41
+ padding: valuesBySize[selectSize || "medium"].padding,
42
+ backgroundColor: theme.palette.lunit_token.component.textfield_bg,
43
+ overflow: "hidden",
44
+ "& .MuiSelect-select": {
45
+ paddingTop: 0,
46
+ paddingBottom: 0,
47
+ paddingRight: "28px !important", // icon width 20px + 아이콘과 텍스트 사이의 gap 8px
48
+ color: theme.palette.lunit_token.core.text_normal,
49
+ },
50
+ "&.MuiInputBase-root": {
51
+ borderRadius: "8px",
52
+ border: "none",
53
+
54
+ "&:hover:not(.Mui-disabled, .Mui-error):before": {
55
+ border: "none",
56
+ },
57
+ },
58
+ "& .MuiInput-input": {
59
+ "&:focus": {
60
+ backgroundColor: "transparent",
61
+ },
62
+ },
63
+ "&::after": {
64
+ border: "none",
65
+ },
66
+ "&::before": {
67
+ border: "none",
68
+ },
69
+ "&:hover": {
70
+ position: "relative",
71
+ zIndex: 0,
72
+ backgroundColor: theme.palette.lunit_token.component.textfield_bg,
73
+ border: "none",
74
+ },
75
+ "&:hover::before": {
76
+ content: '""',
77
+ position: "absolute",
78
+ top: 0,
79
+ left: 0,
80
+ width: "100%",
81
+ height: "100%",
82
+ zIndex: -1,
83
+ backgroundColor: theme.palette.lunit_token.core.hover,
84
+ border: "none",
85
+ },
86
+ // .Mui-focused 컴포넌트에 바로 border를 적용하면 컴포넌트의 width, height 값이 border 값만큼 늘어나기 때문에 따로 엘리먼트를 만들어서 border 를 적용함.
87
+ // 다른 :before 들도 동일한 이유로 작성
88
+ "&.Mui-focused::before": {
89
+ border: `1px solid ${theme.palette.lunit_token.core.focused}`,
90
+ content: '""',
91
+ position: "absolute",
92
+ top: 0,
93
+ bottom: 0,
94
+ left: 0,
95
+ right: 0,
96
+ borderRadius: "8px",
97
+ transition: "none",
98
+ },
99
+ "&.Mui-disabled": {
100
+ opacity: 0.38,
101
+ },
102
+ "&.Mui-disabled:before": {
103
+ borderBottomStyle: "none",
104
+ },
105
+ "&.Mui-error::before": {
106
+ border: `1px solid ${theme.palette.lunit_token.component.textfield_border_error}`,
107
+ content: '""',
108
+ position: "absolute",
109
+ top: 0,
110
+ bottom: 0,
111
+ left: 0,
112
+ right: 0,
113
+ borderRadius: "8px",
114
+ transition: "none",
115
+ },
116
+ "& .MuiSvgIcon-root": {
117
+ width: "20px",
118
+ height: "20px",
119
+ top: valuesBySize[selectSize || "medium"].iconTop, // mui 에서 이 icon position 이 position: absolute 로 되어 있어서 padding 값에 맞춰 포지션 조절
120
+ right: valuesBySize[selectSize || "medium"].iconRight,
121
+ color: theme.palette.lunit_token.core.text_normal,
122
+ "&.Mui-disabled": {
123
+ color: theme.palette.lunit_token.core.text_normal,
124
+ },
125
+ },
126
+ }));
127
+
128
+ export const StyledMenuItem = styled(MenuItem)(({ theme }) => ({
129
+ ...theme.typography.body2_14_regular,
130
+ padding: "8px",
131
+ borderRadius: "8px",
132
+ color: theme.palette.lunit_token.core.text_normal,
133
+ backgroundColor: "transparent",
134
+ display: "flex",
135
+ flexDirection: "row",
136
+ justifyContent: "space-between",
137
+ gap: "8px",
138
+ "&:hover": {
139
+ backgroundColor: theme.palette.lunit_token.core.hover,
140
+ },
141
+ "&.Mui-focusVisible": {
142
+ backgroundColor: "transparent",
143
+ "&:hover": {
144
+ backgroundColor: theme.palette.lunit_token.core.hover,
145
+ },
146
+ },
147
+ // TODO: 디자이너와 focus 디자인 확인 후 살리든 지우든 하기
148
+ // "&:focus::before": {
149
+ // border: "1px solid",
150
+ // borderColor: theme.palette.lunit_token.core.focused,
151
+ // content: '""',
152
+ // position: "absolute",
153
+ // top: 0,
154
+ // bottom: 0,
155
+ // left: -8,
156
+ // right: -8,
157
+ // },
158
+ "& .multipleChecked": {
159
+ display: "none",
160
+ },
161
+ "&.filledStyle": {
162
+ backgroundColor: theme.palette.lunit_token.core.selected,
163
+ },
164
+ }));
165
+
166
+ export const StyledIconWrapper = styled(Box)({
167
+ width: "20px",
168
+ height: "20px",
169
+ marginRight: "8px",
170
+ });
@@ -1,11 +1,62 @@
1
- import React from 'react'
1
+ import React, { forwardRef } from "react";
2
+ import ArrowDownSm from "@lunit/design-system-icons/ArrowDownSm";
3
+ import { DropdownProps } from "./Dropdown.types";
4
+ import { StyledSelect } from "./Dropdown.styled";
2
5
 
3
- import { Box } from '@mui/material'
6
+ const Dropdown = forwardRef((props: DropdownProps, ref) => {
7
+ const {
8
+ select = "single",
9
+ size = "medium",
10
+ className,
11
+ children,
12
+ sx,
13
+ ...restProps
14
+ } = props;
4
15
 
5
- const Dropdown = () => {
6
- return (
7
- <Box>Dropdown</Box>
8
- )
9
- }
16
+ return (
17
+ <StyledSelect
18
+ className={className}
19
+ variant="standard" // variant standard 기준으로 스타일링 되어있음. 다른 variant 사용 시 스타일이 틀어질 수 있음
20
+ multiple={select === "multiple"}
21
+ IconComponent={(props) => <ArrowDownSm {...props} />}
22
+ MenuProps={{
23
+ anchorOrigin: {
24
+ vertical: "bottom",
25
+ horizontal: "left",
26
+ },
27
+ transformOrigin: {
28
+ vertical: "top",
29
+ horizontal: "left",
30
+ },
31
+ PaperProps: {
32
+ sx: {
33
+ marginTop: "4px",
34
+ padding: "0px 8px",
35
+ borderRadius: "8px",
36
+ backgroundColor: (theme) => theme.palette.lunit_token.core.bg_02,
37
+ },
38
+ className: `elevation2 ${className || "light1"}`,
39
+ },
40
+ MenuListProps: {
41
+ // 추후 MUI 버전 업그레이드 시 MenuListProps 변경 필요. Deprecated-use the slotProps.list prop instead. https://mui.com/material-ui/api/menu/ 의 MenuListProps 참고
42
+ sx: {
43
+ "& .singleChecked": {
44
+ display: select === "single" ? "inherit" : "none",
45
+ },
46
+ "& .multipleChecked": {
47
+ display: select === "multiple" ? "inherit !important" : "none",
48
+ },
49
+ },
50
+ },
51
+ }}
52
+ sx={sx}
53
+ selectSize={size}
54
+ {...restProps}
55
+ ref={ref}
56
+ >
57
+ {children}
58
+ </StyledSelect>
59
+ );
60
+ });
10
61
 
11
- export default Dropdown
62
+ export default Dropdown;
@@ -0,0 +1,15 @@
1
+ import type { MenuItemProps, SelectProps } from "@mui/material";
2
+
3
+ export interface DropdownProps
4
+ extends Omit<SelectProps, "size" | "variant" | "placeholder"> {
5
+ // mui variant 를 바꾸게 되면 스타일이 틀어질 수 있어서 variant 를 아예 사용하지 못하게 props 에서 제거
6
+ // mui select 에서는 placeholder 가 동작하지 않기 때문에 유저가 헷갈리지 않게 props 에서 제거
7
+ select?: "single" | "multiple";
8
+ size?: "small" | "medium" | "large";
9
+ }
10
+
11
+ export interface DropdownItemProps extends MenuItemProps {
12
+ leftIcon?: JSX.Element;
13
+ rightText?: string;
14
+ isFilledStyle?: boolean;
15
+ }
@@ -0,0 +1,107 @@
1
+ import React from "react";
2
+ import { Box, Divider, ListSubheader, SxProps } from "@mui/material";
3
+ import Check from "@lunit/design-system-icons/Check";
4
+
5
+ import Checkbox from "../Checkbox";
6
+ import Typography from "../Typography";
7
+
8
+ import { DropdownItemProps } from "./Dropdown.types";
9
+ import { StyledIconWrapper, StyledMenuItem } from "./Dropdown.styled";
10
+
11
+ export function DropdownItem(props: DropdownItemProps) {
12
+ const {
13
+ leftIcon,
14
+ rightText,
15
+ selected,
16
+ isFilledStyle, // 체크 아이콘이나 체크박스 대신 bg 색깔로 선택된 상태를 표현하기 위한 prop. 일부 상황에서만 사용되고 대부분은 체크 아이콘이나 체크박스 사용
17
+ children,
18
+ sx,
19
+ ...restProps
20
+ } = props;
21
+
22
+ return (
23
+ <StyledMenuItem
24
+ className={isFilledStyle && selected ? "filledStyle" : undefined}
25
+ sx={sx}
26
+ {...restProps}
27
+ >
28
+ <Box
29
+ sx={{
30
+ display: "flex",
31
+ flexDirection: "row",
32
+ justifyContent: "flex-start",
33
+ }}
34
+ >
35
+ {!isFilledStyle && (
36
+ <>
37
+ <StyledIconWrapper className="singleChecked">
38
+ {selected && <Check fontSize="small" />}
39
+ </StyledIconWrapper>
40
+ <Checkbox
41
+ className="multipleChecked"
42
+ sx={{ mr: 2 }}
43
+ checked={selected}
44
+ />
45
+ </>
46
+ )}
47
+ {leftIcon && (
48
+ <StyledIconWrapper>
49
+ {leftIcon}
50
+ {/* <Demo fontSize="small" /> // TODO: icon fontSize 가 항상 small(width, height: 20px) 이어야함. 여기서 값을 고정시킬 방법은?
51
+ */}
52
+ </StyledIconWrapper>
53
+ )}
54
+ {children}
55
+ </Box>
56
+ <Box>
57
+ {rightText && (
58
+ <Typography
59
+ variant="body2_14_medium"
60
+ sx={{
61
+ color: (theme) => theme.palette.lunit_token.core.text_light,
62
+ }}
63
+ >
64
+ {rightText}
65
+ </Typography>
66
+ )}
67
+ </Box>
68
+ </StyledMenuItem>
69
+ );
70
+ }
71
+
72
+ export function DropdownDivider({ sx }: { sx?: SxProps }) {
73
+ return (
74
+ <Divider
75
+ sx={{
76
+ margin: "8px -8px",
77
+ borderColor: (theme) =>
78
+ theme.palette.lunit_token.component.dropdown_divider_border,
79
+ ...sx,
80
+ }}
81
+ />
82
+ );
83
+ }
84
+
85
+ export function DropdownSubtitle({
86
+ title,
87
+ sx,
88
+ }: {
89
+ title: string;
90
+ sx?: SxProps;
91
+ }) {
92
+ return (
93
+ <ListSubheader
94
+ sx={{
95
+ typography: "body3_12_semibold",
96
+ padding: "4px 8px",
97
+ color: (theme) => theme.palette.lunit_token.core.text_light,
98
+ backgroundColor: "transparent",
99
+ ...sx,
100
+ }}
101
+ >
102
+ {title}
103
+ </ListSubheader>
104
+ );
105
+ }
106
+ // 참조 : https://mui.com/material-ui/react-select/#grouping
107
+ DropdownSubtitle.muiSkipListHighlight = true;
@@ -1 +1,7 @@
1
1
  export { default } from "./Dropdown";
2
+ export {
3
+ DropdownItem,
4
+ DropdownDivider,
5
+ DropdownSubtitle,
6
+ } from "./DropdownItem";
7
+ export type { DropdownProps, DropdownItemProps } from "./Dropdown.types";
@@ -30,15 +30,15 @@ const getSinglelineTextFieldPaddingByIconAndSize = ({
30
30
  case "small":
31
31
  return `4px ${hasRightIcon ? "8px" : "12px"} 4px ${
32
32
  hasLeftIcon ? "8px" : "12px"
33
- }}`;
33
+ }`;
34
34
  case "medium":
35
35
  return `8px ${hasRightIcon ? "12px" : "16px"} 8px ${
36
36
  hasLeftIcon ? "12px" : "16px"
37
- }}`;
37
+ }`;
38
38
  case "large":
39
39
  return `10px ${hasRightIcon ? "12px" : "16px"} 10px ${
40
40
  hasLeftIcon ? "12px" : "16px"
41
- }}`;
41
+ }`;
42
42
  }
43
43
  };
44
44
 
@@ -144,6 +144,31 @@ const commonStyle = ({ lunit_token }: { lunit_token: ColorToken }) => ({
144
144
  color: lunit_token.core.text_error,
145
145
  },
146
146
  },
147
+ "& .MuiInputBase-input": {
148
+ "&:-webkit-autofill, &:-webkit-autofill:active, &:-webkit-autofill:focus, &:-webkit-autofill:hover, &:-webkit-autofill:focus-visible, &:-webkit-autofill:focus-within, &:-webkit-autofill:target, &:-webkit-autofill:first-line":
149
+ {
150
+ border: "none",
151
+ borderRadius: "0px",
152
+ backgroundColor: "transparent",
153
+ color: lunit_token.core.text_normal,
154
+ /**
155
+ * the background color and text color are not changed color, background css tag.
156
+ * so we need to use -webkit-text-fill-color to change the text color.
157
+ * and we need to use -webkit-box-shadow, -webkit-transition to change the background color.
158
+ *
159
+ * reference: https://css-tricks.com/almanac/pseudo-selectors/a/autofill/
160
+ */
161
+ WebkitTextFillColor: lunit_token.core.text_normal,
162
+ WebkitBoxShadow: "0 0 0px 1000px transparent inset",
163
+ WebkitTransition: "background-color 5000s ease-in-out 0s",
164
+ /**
165
+ * textfield flash cursor color
166
+ *
167
+ * docs: https://developer.mozilla.org/en-US/docs/Web/CSS/caret-color
168
+ */
169
+ caretColor: lunit_token.core.text_normal,
170
+ },
171
+ },
147
172
  });
148
173
 
149
174
  const sizeStyle = ({
@@ -73,13 +73,7 @@ const TextField = forwardRef<HTMLDivElement, TextFieldProps>((props, ref) => {
73
73
  const { rows, size, multiline = false, variant, ...restProps } = props;
74
74
 
75
75
  return multiline ? (
76
- <MultiTextField
77
- {...restProps}
78
- ref={ref}
79
- maxRows={Infinity}
80
- size={size}
81
- rows={rows}
82
- />
76
+ <MultiTextField {...restProps} ref={ref} size={size} rows={rows} />
83
77
  ) : (
84
78
  <SingleTextField {...restProps} ref={ref} size={size} />
85
79
  );
@@ -14,6 +14,11 @@ type DSVariants =
14
14
  | "body2_14_regular"
15
15
  | "body3_12_semibold"
16
16
  | "body3_12_regular"
17
+ | "body_m2"
18
+ | "body_reg6"
19
+ | "body_reg8"
20
+ | "small_body_sb1"
21
+ | "small_body_m2"
17
22
  | "button1"
18
23
  | "button2";
19
24
 
@@ -74,6 +79,11 @@ export const typographyDefaultProps = {
74
79
  body2_14_regular: "p",
75
80
  body3_12_semibold: "p",
76
81
  body3_12_regular: "p",
82
+ body_m2: "p",
83
+ body_reg6: "p",
84
+ body_reg8: "p",
85
+ small_body_sb1: "p",
86
+ small_body_m2: "p",
77
87
  },
78
88
  };
79
89
 
@@ -47,6 +47,24 @@ const body = {
47
47
  "--body3-12-regular-font-weight": "var(--font-weight-regular)",
48
48
  "--body3-12-regular-font-size": "12.4px",
49
49
  "--body3-12-regular-line-height": "16px",
50
+ "--body_m2-font-weight": "var(--font-weight-medium)",
51
+ "--body_m2-font-size": "13px",
52
+ "--body_m2-line-height": "18px",
53
+ "--body_reg6-font-weight": "var(--font-weight-regular)",
54
+ "--body_reg6-font-size": "13px",
55
+ "--body_reg6-line-height": "18px",
56
+ "--body_reg8-font-weight": "var(--font-weight-regular)",
57
+ "--body_reg8-font-size": "12px",
58
+ "--body_reg8-line-height": "16px",
59
+ } as const;
60
+
61
+ const smallBody = {
62
+ "--small_body_sb1-font-weight": "var(--font-weight-semibold)",
63
+ "--small_body_sb1-font-size": "12px",
64
+ "--small_body_sb1-line-height": "16px",
65
+ "--small_body_m2-font-weight": "var(--font-weight-medium)",
66
+ "--small_body_m2-font-size": "12px",
67
+ "--small_body_m2-line-height": "20px",
50
68
  } as const;
51
69
 
52
70
  const etc = {
@@ -125,6 +143,32 @@ const fontVariants: Record<string, TypographyStyleOptions> = {
125
143
  fontSize: "var(--body3-12-regular-font-size)",
126
144
  lineHeight: "var(--body3-12-regular-line-height)",
127
145
  },
146
+ body_m2: {
147
+ fontWeight: "var(--body_m2-font-weight)",
148
+ fontSize: "var(--body_m2-font-size)",
149
+ lineHeight: "var(--body_m2-line-height)",
150
+ letterSpacing: "0.2px",
151
+ },
152
+ body_reg6: {
153
+ fontWeight: "var(--body_reg6-font-weight)",
154
+ fontSize: "var(--body_reg6-font-size)",
155
+ lineHeight: "var(--body_reg6-line-height)",
156
+ },
157
+ body_reg8: {
158
+ fontWeight: "var(--body_reg8-font-weight)",
159
+ fontSize: "var(--body_reg8-font-size)",
160
+ lineHeight: "var(--body_reg8-line-height)",
161
+ },
162
+ small_body_sb1: {
163
+ fontWeight: "var(--small_body_sb1-font-weight)",
164
+ fontSize: "var(--small_body_sb1-font-size)",
165
+ lineHeight: "var(--small_body_sb1-line-height)",
166
+ },
167
+ small_body_m2: {
168
+ fontWeight: "var(--small_body_m2-font-weight)",
169
+ fontSize: "var(--small_body_m2-font-size)",
170
+ lineHeight: "var(--small_body_m2-line-height)",
171
+ },
128
172
  overline: {
129
173
  fontWeight: "var(--overline-font-weight)",
130
174
  fontSize: "var(--overline-font-size)",
@@ -156,6 +200,7 @@ export const cssVariables = {
156
200
  ...fontWeights,
157
201
  ...headline,
158
202
  ...body,
203
+ ...smallBody,
159
204
  ...etc,
160
205
  };
161
206
 
@@ -1,21 +1,23 @@
1
1
  import { grey } from "./grey";
2
2
 
3
3
  export const blue = {
4
- 5: "#DAECFF",
5
- 10: "#D0E2FF",
6
- 20: "#9DCEFF",
7
- 30: "#78A9FF",
8
- 40: "#4589FF",
9
- 50: "#0F62FE",
10
- 60: "#0043CE",
11
- 70: "#0055AB",
12
- 80: "#001D6C",
13
- 90: "#002041",
4
+ 5: "#EDF6FE",
5
+ 10: "#D9E9FD",
6
+ 15: "#BFD9FC",
7
+ 20: "#A5C8FC",
8
+ 30: "#71A9FA",
9
+ 40: "#3D88FA",
10
+ 50: "#0D68F2",
11
+ 60: "#0E51BA",
12
+ 70: "#0C3F8F",
13
+ 80: "#032765",
14
+ 90: "#03183F",
14
15
  };
15
16
 
16
17
  export const blueText = {
17
18
  5: grey[95],
18
19
  10: grey[95],
20
+ 15: grey[95],
19
21
  20: grey[95],
20
22
  30: grey[95],
21
23
  40: grey[95],
@@ -1,21 +1,23 @@
1
1
  import { grey } from "./grey";
2
2
 
3
3
  export const green = {
4
- 5: "#EBFFF0",
5
- 10: "#B4EFC4",
4
+ 5: "#E6FDEB",
5
+ 10: "#C4F5D1",
6
+ 15: "#A0E5B3",
6
7
  20: "#6FDC8C",
7
- 30: "#42BE65",
8
- 40: "#24A148",
9
- 50: "#198038",
10
- 60: "#0E6027",
11
- 70: "#044317",
12
- 80: "#022D0D",
13
- 90: "#071908",
8
+ 30: "#44BE67",
9
+ 40: "#1A9F3F",
10
+ 50: "#138231",
11
+ 60: "#0D6222",
12
+ 70: "#0B4F1A",
13
+ 80: "#01380F",
14
+ 90: "#082209",
14
15
  };
15
16
 
16
17
  export const greenText = {
17
18
  5: grey[95],
18
19
  10: grey[95],
20
+ 15: grey[95],
19
21
  20: grey[95],
20
22
  30: grey[95],
21
23
  40: grey[95],
@@ -1,20 +1,27 @@
1
1
  export const grey = {
2
2
  0: "#FFFFFF",
3
- 5: "#FAFAFB",
4
- 10: "#F1F1F4",
5
- 15: "#DFDFE2",
6
- 20: "#CFCFD1",
7
- 25: "#C0C0C2",
8
- 30: "#AFAFB1",
9
- 40: "#99999B",
10
- 50: "#747477",
11
- 60: "#626264",
12
- 70: "#4E4E50",
13
- 75: "#404042",
14
- 80: "#333336",
15
- 85: "#2D2D2F",
16
- 90: "#1F1F21",
17
- 95: "#111113",
3
+ 5: "#F5F5F6",
4
+ 10: "#EAEAEC",
5
+ 15: "#DFDFE1",
6
+ 20: "#D5D5D7",
7
+ 25: "#C8C8CA",
8
+ 30: "#BCBCBE",
9
+ 35: "#B1B1B4",
10
+ 40: "#A4A4A8",
11
+ 45: "#9A9A9D",
12
+ 50: "#8D8D90",
13
+ 55: "#808084",
14
+ 60: "#747479",
15
+ 65: "#68686C",
16
+ 70: "#59595D",
17
+ 75: "#4A4A4E",
18
+ 80: "#3B3B3F",
19
+ 82: "#343438",
20
+ 85: "#2E2E32",
21
+ 88: "#27272B",
22
+ 90: "#1F1F23",
23
+ 93: "#16161A",
24
+ 95: "#0F0F12",
18
25
  100: "#000000",
19
26
  };
20
27
 
@@ -26,13 +33,21 @@ export const greyText = {
26
33
  20: grey[95],
27
34
  25: grey[95],
28
35
  30: grey[95],
36
+ 35: grey[95],
29
37
  40: grey[95],
38
+ 45: grey[95],
30
39
  50: grey[5],
40
+ 55: grey[5],
31
41
  60: grey[5],
42
+ 65: grey[5],
32
43
  70: grey[5],
44
+ 75: grey[5],
33
45
  80: grey[5],
46
+ 82: grey[5],
34
47
  85: grey[5],
48
+ 88: grey[5],
35
49
  90: grey[5],
50
+ 93: grey[5],
36
51
  95: grey[5],
37
52
  100: grey[5],
38
53
  };
@@ -3,6 +3,7 @@ import { grey } from "./grey";
3
3
  export const lunit_teal = {
4
4
  5: "#EAFAFF",
5
5
  10: "#D1F7FF",
6
+ 15: "#BDF4FF",
6
7
  20: "#96EDFF",
7
8
  30: "#30DFFC",
8
9
  40: "#00C9EA",
@@ -16,6 +17,7 @@ export const lunit_teal = {
16
17
  export const lunit_tealText = {
17
18
  5: lunit_teal[90],
18
19
  10: lunit_teal[90],
20
+ 15: lunit_teal[90],
19
21
  20: grey[95],
20
22
  30: grey[95],
21
23
  40: grey[95],