@lunit/design-system 1.0.0-a.2 → 1.0.0-a.4

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 (173) hide show
  1. package/.babelrc.json +16 -0
  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/Chip/index.js +1 -1
  7. package/dist/cjs/components/Chip/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/components/ToggleButton/index.js +1 -1
  11. package/dist/cjs/components/ToggleButton/index.js.map +1 -1
  12. package/dist/cjs/index.js +1 -1
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/components/Alert/Alert.js +20 -4
  15. package/dist/components/Alert/Alert.js.map +1 -1
  16. package/dist/components/Alert/Alert.styled.js +49 -0
  17. package/dist/components/Alert/Alert.styled.js.map +1 -0
  18. package/dist/components/Alert/Alert.types.js +2 -0
  19. package/dist/components/Alert/Alert.types.js.map +1 -0
  20. package/dist/components/Alert/Alert.utils.js +37 -0
  21. package/dist/components/Alert/Alert.utils.js.map +1 -0
  22. package/dist/components/Button/Button.js +1 -1
  23. package/dist/components/Button/Button.js.map +1 -1
  24. package/dist/components/Button/Button.styled.js +31 -21
  25. package/dist/components/Button/Button.styled.js.map +1 -1
  26. package/dist/components/Button/utils/getHoverStyle.js +7 -0
  27. package/dist/components/Button/utils/getHoverStyle.js.map +1 -0
  28. package/dist/components/Chip/Chip.js +1 -1
  29. package/dist/components/Chip/Chip.js.map +1 -1
  30. package/dist/components/Chip/Chip.styled.js +2 -3
  31. package/dist/components/Chip/Chip.styled.js.map +1 -1
  32. package/dist/components/TextField/TextField.js +15 -3
  33. package/dist/components/TextField/TextField.js.map +1 -1
  34. package/dist/components/TextField/TextField.style.js +245 -0
  35. package/dist/components/TextField/TextField.style.js.map +1 -0
  36. package/dist/components/TextField/TextField.types.js +2 -0
  37. package/dist/components/TextField/TextField.types.js.map +1 -0
  38. package/dist/components/TextField/TextFieldIcon.js +7 -0
  39. package/dist/components/TextField/TextFieldIcon.js.map +1 -0
  40. package/dist/components/Toast/Toast.js +26 -0
  41. package/dist/components/Toast/Toast.js.map +1 -0
  42. package/dist/components/Toast/Toast.styled.js +49 -0
  43. package/dist/components/Toast/Toast.styled.js.map +1 -0
  44. package/dist/components/Toast/Toast.types.js +2 -0
  45. package/dist/components/Toast/Toast.types.js.map +1 -0
  46. package/dist/components/Toast/Toast.utils.js +13 -0
  47. package/dist/components/Toast/Toast.utils.js.map +1 -0
  48. package/dist/components/Toast/index.js +2 -0
  49. package/dist/components/Toast/index.js.map +1 -0
  50. package/dist/foundation/colors/base/grey.js +16 -0
  51. package/dist/foundation/colors/base/grey.js.map +1 -1
  52. package/dist/foundation/colors/base/lunitGreen.js +2 -2
  53. package/dist/foundation/colors/base/lunitGreen.js.map +1 -1
  54. package/dist/foundation/colors/base/lunitTeal.js +5 -5
  55. package/dist/foundation/colors/base/lunitTeal.js.map +1 -1
  56. package/dist/foundation/colors/base/red.js +2 -2
  57. package/dist/foundation/colors/index.js +24 -4
  58. package/dist/foundation/colors/index.js.map +1 -1
  59. package/dist/foundation/colors/token/component.js +265 -291
  60. package/dist/foundation/colors/token/component.js.map +1 -1
  61. package/dist/foundation/colors/token/core.js +132 -125
  62. package/dist/foundation/colors/token/core.js.map +1 -1
  63. package/dist/index.js +1 -0
  64. package/dist/index.js.map +1 -1
  65. package/dist/theme.js +5 -0
  66. package/dist/theme.js.map +1 -1
  67. package/dist/types/components/Alert/Alert.d.ts +3 -1
  68. package/dist/types/components/Alert/Alert.styled.d.ts +6 -0
  69. package/dist/types/components/Alert/Alert.types.d.ts +9 -0
  70. package/dist/types/components/Alert/Alert.utils.d.ts +4 -0
  71. package/dist/types/components/Button/Button.d.ts +1 -1
  72. package/dist/types/components/Button/Button.styled.d.ts +26 -2
  73. package/dist/types/components/Button/Button.types.d.ts +4 -4
  74. package/dist/types/components/Button/utils/getHoverStyle.d.ts +6 -0
  75. package/dist/types/components/Checkbox/Checkbox.d.ts +1 -1
  76. package/dist/types/components/Chip/Chip.d.ts +1 -1
  77. package/dist/types/components/Chip/Chip.styled.d.ts +13 -13
  78. package/dist/types/components/Chip/Chip.types.d.ts +1 -1
  79. package/dist/types/components/DataTable/DataTable.d.ts +1 -1
  80. package/dist/types/components/DatePicker/DatePicker.d.ts +1 -1
  81. package/dist/types/components/Dropdown/Dropdown.d.ts +1 -1
  82. package/dist/types/components/FormLabel/FormLabel.d.ts +1 -1
  83. package/dist/types/components/Modal/Modal.d.ts +1 -1
  84. package/dist/types/components/Radio/Radio.d.ts +1 -1
  85. package/dist/types/components/TextField/TextField.d.ts +2 -1
  86. package/dist/types/components/TextField/TextField.style.d.ts +9 -0
  87. package/dist/types/components/TextField/TextField.types.d.ts +29 -0
  88. package/dist/types/components/TextField/TextFieldIcon.d.ts +8 -0
  89. package/dist/types/components/TextField/index.d.ts +1 -0
  90. package/dist/types/components/Toast/Toast.d.ts +4 -0
  91. package/dist/types/components/Toast/Toast.styled.d.ts +1 -0
  92. package/dist/types/components/Toast/Toast.types.d.ts +4 -0
  93. package/dist/types/components/Toast/Toast.utils.d.ts +2 -0
  94. package/dist/types/components/Toast/index.d.ts +1 -0
  95. package/dist/types/components/Toggle/Toggle.d.ts +1 -1
  96. package/dist/types/components/ToggleButton/ToggleButton.d.ts +1 -1
  97. package/dist/types/components/ToggleButton/ToggleButton.styled.d.ts +2 -2
  98. package/dist/types/components/ToggleButton/ToggleButton.types.d.ts +4 -4
  99. package/dist/types/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +1 -1
  100. package/dist/types/components/Tooltip/Tooltip.d.ts +1 -1
  101. package/dist/types/foundation/colors/base/grey.d.ts +16 -0
  102. package/dist/types/foundation/colors/base/lunitGreen.d.ts +2 -2
  103. package/dist/types/foundation/colors/base/lunitTeal.d.ts +2 -2
  104. package/dist/types/foundation/colors/index.d.ts +42 -9
  105. package/dist/types/foundation/colors/types.d.ts +1 -3
  106. package/dist/types/foundation/index.d.ts +37 -5
  107. package/dist/types/index.d.ts +1 -0
  108. package/package.json +21 -16
  109. package/src/components/Alert/Alert.styled.ts +63 -0
  110. package/src/components/Alert/Alert.tsx +47 -5
  111. package/src/components/Alert/Alert.types.ts +10 -0
  112. package/src/components/Alert/Alert.utils.ts +49 -0
  113. package/src/components/Button/Button.styled.ts +33 -21
  114. package/src/components/Button/Button.tsx +1 -5
  115. package/src/components/Button/Button.types.ts +4 -4
  116. package/src/components/Button/utils/getHoverStyle.ts +7 -0
  117. package/src/components/Chip/Chip.styled.ts +6 -4
  118. package/src/components/Chip/Chip.tsx +1 -1
  119. package/src/components/Chip/Chip.types.ts +2 -2
  120. package/src/components/TextField/TextField.style.ts +316 -0
  121. package/src/components/TextField/TextField.tsx +75 -3
  122. package/src/components/TextField/TextField.types.ts +38 -0
  123. package/src/components/TextField/TextFieldIcon.tsx +24 -0
  124. package/src/components/TextField/index.ts +6 -0
  125. package/src/components/Toast/Toast.styled.ts +49 -0
  126. package/src/components/Toast/Toast.tsx +66 -0
  127. package/src/components/Toast/Toast.types.ts +14 -0
  128. package/src/components/Toast/Toast.utils.ts +17 -0
  129. package/src/components/Toast/index.tsx +1 -0
  130. package/src/components/ToggleButton/ToggleButton.types.ts +4 -7
  131. package/src/foundation/colors/base/grey.ts +17 -0
  132. package/src/foundation/colors/base/lunitGreen.ts +2 -2
  133. package/src/foundation/colors/base/lunitTeal.ts +5 -5
  134. package/src/foundation/colors/base/red.ts +2 -2
  135. package/src/foundation/colors/index.ts +29 -8
  136. package/src/foundation/colors/token/component.ts +300 -326
  137. package/src/foundation/colors/token/core.ts +152 -145
  138. package/src/foundation/colors/types.ts +1 -3
  139. package/src/index.ts +1 -0
  140. package/src/stories/components/Alert/Alert.stories.tsx +148 -4
  141. package/src/stories/components/Button/BasicButton.stories.tsx +19 -28
  142. package/src/stories/components/Button/IconButton.stories.tsx +39 -28
  143. package/src/stories/components/Button/Kind.stories.tsx +83 -57
  144. package/src/stories/components/Chip/Chip.stories.tsx +94 -82
  145. package/src/stories/components/DataTable/DataTable.stories.tsx +6 -4
  146. package/src/stories/components/DatePicker/DatePicker.stories.tsx +6 -4
  147. package/src/stories/components/Dropdown/Dropdown.stories.tsx +12 -6
  148. package/src/stories/components/Modal/Modal.stories.tsx +6 -4
  149. package/src/stories/components/SelectControl/Checkbox.stories.tsx +31 -23
  150. package/src/stories/components/SelectControl/RadioGroup.stories.tsx +6 -5
  151. package/src/stories/components/SelectControl/RadioStatus.stories.tsx +6 -4
  152. package/src/stories/components/SelectControl/Toggle.stories.tsx +33 -19
  153. package/src/stories/components/TextField/TextFieldMulti.stories.tsx +137 -0
  154. package/src/stories/components/TextField/TextFieldSingle.stories.tsx +283 -0
  155. package/src/stories/components/TextField/TextFieldSize.stories.tsx +134 -0
  156. package/src/stories/components/Toast/Toast.stories.tsx +152 -0
  157. package/src/stories/components/ToggleButton/Basic.stories.tsx +35 -31
  158. package/src/stories/components/ToggleButton/Group.stories.tsx +21 -21
  159. package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +53 -43
  160. package/src/stories/components/ToggleButton/WithIcon.stories.tsx +35 -36
  161. package/src/stories/components/Tooltip/Tooltip.stories.tsx +6 -4
  162. package/src/stories/foundation/Elevation/Elevation.stories.tsx +10 -6
  163. package/src/stories/foundation/Typography/{Typography.stories.mdx → Typography.mdx} +10 -5
  164. package/src/stories/foundation/Typography/Typography.stories.tsx +46 -36
  165. package/src/stories/foundation/Typography/TypographyExamples.stories.tsx +44 -0
  166. package/src/stories/foundation/colors/Colors.stories.tsx +7 -5
  167. package/src/stories/foundation/colors/Mui.stories.tsx +18 -0
  168. package/src/stories/foundation/colors/Token.inComponent.stories.tsx +2 -2
  169. package/src/stories/foundation/colors/TokenPaletteTable.stories.tsx +28 -0
  170. package/src/stories/foundation/colors/TokenPaletteTable.tsx +127 -0
  171. package/src/theme.ts +5 -0
  172. package/src/stories/components/TextField/TextField.stories.tsx +0 -13
  173. package/src/stories/foundation/colors/Token.stories.tsx +0 -190
@@ -6,199 +6,206 @@ export interface TokenCoreColorValue {
6
6
 
7
7
  export const tokenCoreColor: TokenCoreColorValue = {
8
8
  bg_01: {
9
- light1: "--grey-0",
10
- light2: "--grey-10",
11
- dark1: "--grey-90",
12
- dark2: "--grey-85",
13
- dark3: "--grey-80",
14
- dark4: "--grey-70",
9
+ light1: "--grey_0",
10
+ light2: "--grey_10",
11
+ dark1: "--grey_90",
12
+ dark2: "--grey_85",
13
+ dark3: "--grey_80",
14
+ dark4: "--grey_70",
15
15
  },
16
16
  bg_02: {
17
- light1: "--grey-0",
18
- light2: "--grey-0",
19
- dark1: "--grey-70",
20
- dark2: "--grey-70",
21
- dark3: "--grey-70",
22
- dark4: "--grey-70",
17
+ light1: "--grey_0",
18
+ light2: "--grey_0",
19
+ dark1: "--grey_70",
20
+ dark2: "--grey_70",
21
+ dark3: "--grey_70",
22
+ dark4: "--grey_70",
23
23
  },
24
24
  bg_03: {
25
- light1: "--grey-0",
26
- light2: "--grey-0",
27
- dark1: "--grey-85",
28
- dark2: "--grey-85",
29
- dark3: "--grey-85",
30
- dark4: "--grey-85",
25
+ light1: "--grey_0",
26
+ light2: "--grey_0",
27
+ dark1: "--grey_85",
28
+ dark2: "--grey_85",
29
+ dark3: "--grey_85",
30
+ dark4: "--grey_85",
31
31
  },
32
32
  text_primary: {
33
- light1: "--lunitTeal-50",
34
- light2: "--lunitTeal-50",
35
- dark1: "--lunitTeal-40",
36
- dark2: "--lunitTeal-40",
37
- dark3: "--lunitTeal-40",
38
- dark4: "--lunitTeal-40",
33
+ light1: "--lunit_teal_50",
34
+ light2: "--lunit_teal_50",
35
+ dark1: "--lunit_teal_40",
36
+ dark2: "--lunit_teal_40",
37
+ dark3: "--lunit_teal_40",
38
+ dark4: "--lunit_teal_40",
39
39
  },
40
40
  text_normal: {
41
- light1: "--grey-95",
42
- light2: "--grey-95",
43
- dark1: "--grey-5",
44
- dark2: "--grey-5",
45
- dark3: "--grey-5",
46
- dark4: "--grey-5",
41
+ light1: "--grey_95",
42
+ light2: "--grey_95",
43
+ dark1: "--grey_5",
44
+ dark2: "--grey_5",
45
+ dark3: "--grey_5",
46
+ dark4: "--grey_5",
47
47
  },
48
48
  text_medium: {
49
- light1: "--grey-60",
50
- light2: "--grey-60",
51
- dark1: "--grey-40",
52
- dark2: "--grey-40",
53
- dark3: "--grey-40",
54
- dark4: "--grey-30",
49
+ light1: "--grey_60",
50
+ light2: "--grey_60",
51
+ dark1: "--grey_40",
52
+ dark2: "--grey_40",
53
+ dark3: "--grey_40",
54
+ dark4: "--grey_30",
55
55
  },
56
56
  text_light: {
57
- light1: "--grey-40",
58
- light2: "--grey-40",
59
- dark1: "--grey-50",
60
- dark2: "--grey-50",
61
- dark3: "--grey-50",
62
- dark4: "--grey-40",
57
+ light1: "--grey_40",
58
+ light2: "--grey_40",
59
+ dark1: "--grey_50",
60
+ dark2: "--grey_50",
61
+ dark3: "--grey_50",
62
+ dark4: "--grey_40",
63
63
  },
64
64
  text_error: {
65
- light1: "--red-40",
66
- light2: "--red-40",
67
- dark1: "--red-40",
68
- dark2: "--red-40",
69
- dark3: "--red-30",
70
- dark4: "--red-30",
65
+ light1: "--red_40",
66
+ light2: "--red_40",
67
+ dark1: "--red_40",
68
+ dark2: "--red_40",
69
+ dark3: "--red_30",
70
+ dark4: "--red_30",
71
71
  },
72
72
  text_success: {
73
73
  // TODO: sucess -> success 로 바뀌었으니 코드 내 사용되는 부분 확인해서 업데이트. 개발자들에게도 공지할것.
74
- light1: "--green-40",
75
- light2: "--green-40",
76
- dark1: "--green-40",
77
- dark2: "--green-40",
78
- dark3: "--green-30",
79
- dark4: "--green-30",
74
+ light1: "--green_40",
75
+ light2: "--green_40",
76
+ dark1: "--green_40",
77
+ dark2: "--green_40",
78
+ dark3: "--green_30",
79
+ dark4: "--green_30",
80
80
  },
81
81
  text_warning: {
82
- light1: "--orange-40",
83
- light2: "--orange-40",
84
- dark1: "--orange-40",
85
- dark2: "--orange-40",
86
- dark3: "--orange-30",
87
- dark4: "--orange-30",
82
+ light1: "--orange_40",
83
+ light2: "--orange_40",
84
+ dark1: "--orange_40",
85
+ dark2: "--orange_40",
86
+ dark3: "--orange_30",
87
+ dark4: "--orange_30",
88
88
  },
89
89
  text_info: {
90
- light1: "--blue-40",
91
- light2: "--blue-40",
92
- dark1: "--blue-40",
93
- dark2: "--blue-40",
94
- dark3: "--blue-30",
95
- dark4: "--blue-30",
90
+ light1: "--blue_40",
91
+ light2: "--blue_40",
92
+ dark1: "--blue_40",
93
+ dark2: "--blue_40",
94
+ dark3: "--blue_30",
95
+ dark4: "--blue_30",
96
96
  },
97
97
  link_primary: {
98
- light1: "--blue-40",
99
- light2: "--blue-40",
100
- dark1: "--blue-40",
101
- dark2: "--blue-40",
102
- dark3: "--blue-30",
103
- dark4: "--blue-30",
98
+ light1: "--blue_40",
99
+ light2: "--blue_40",
100
+ dark1: "--blue_40",
101
+ dark2: "--blue_40",
102
+ dark3: "--blue_30",
103
+ dark4: "--blue_30",
104
104
  },
105
105
  link_hover: {
106
- light1: "--blue-50",
107
- light2: "--blue-50",
108
- dark1: "--blue-50",
109
- dark2: "--blue-50",
110
- dark3: "--blue-40",
111
- dark4: "--blue-40",
106
+ light1: "--blue_50",
107
+ light2: "--blue_50",
108
+ dark1: "--blue_50",
109
+ dark2: "--blue_50",
110
+ dark3: "--blue_40",
111
+ dark4: "--blue_40",
112
112
  },
113
113
  link_visited: {
114
- light1: "--purple-50",
115
- light2: "--purple-50",
116
- dark1: "--purple-50",
117
- dark2: "--purple-50",
118
- dark3: "--purple-40",
119
- dark4: "--purple-40",
114
+ light1: "--purple_50",
115
+ light2: "--purple_50",
116
+ dark1: "--purple_50",
117
+ dark2: "--purple_50",
118
+ dark3: "--purple_40",
119
+ dark4: "--purple_40",
120
120
  },
121
121
  icon_error_02: {
122
- light1: "--red-40",
123
- light2: "--red-40",
124
- dark1: "--red-30",
125
- dark2: "--red-30",
126
- dark3: "--red-30",
127
- dark4: "--red-30",
122
+ light1: "--red_40",
123
+ light2: "--red_40",
124
+ dark1: "--red_30",
125
+ dark2: "--red_30",
126
+ dark3: "--red_30",
127
+ dark4: "--red_30",
128
128
  },
129
129
  icon_success_02: {
130
130
  // TODO: sucess -> success 로 바뀌었으니 코드 내 사용되는 부분 확인해서 업데이트. 개발자들에게도 공지할것.
131
- // TODO: 피그마에 오타 수정 요청한 상태. 확인되면 todo 지우기
132
- light1: "--green-40",
133
- light2: "--green-40",
134
- dark1: "--green-30",
135
- dark2: "--green-30",
136
- dark3: "--green-30",
137
- dark4: "--green-30",
131
+ light1: "--green_40",
132
+ light2: "--green_40",
133
+ dark1: "--green_30",
134
+ dark2: "--green_30",
135
+ dark3: "--green_30",
136
+ dark4: "--green_30",
138
137
  },
139
138
  icon_warning_02: {
140
- light1: "--orange-40",
141
- light2: "--orange-40",
142
- dark1: "--orange-30",
143
- dark2: "--orange-30",
144
- dark3: "--orange-30",
145
- dark4: "--orange-30",
139
+ light1: "--orange_40",
140
+ light2: "--orange_40",
141
+ dark1: "--orange_30",
142
+ dark2: "--orange_30",
143
+ dark3: "--orange_30",
144
+ dark4: "--orange_30",
146
145
  },
147
146
  icon_info_02: {
148
- light1: "--blue-40",
149
- light2: "--blue-40",
150
- dark1: "--blue-30",
151
- dark2: "--blue-30",
152
- dark3: "--blue-30",
153
- dark4: "--blue-30",
147
+ light1: "--blue_40",
148
+ light2: "--blue_40",
149
+ dark1: "--blue_30",
150
+ dark2: "--blue_30",
151
+ dark3: "--blue_30",
152
+ dark4: "--blue_30",
154
153
  },
155
154
  hover: {
156
155
  // TODO: 알파값 적용 코드는 일단 하드코딩. 나중에 수정할것
157
- light1: "rgba(0, 0, 0, 0.06)", // grey_100 6% // TODO: 10%로 수정 예정이라고 하니 다시 확인하기
158
- light2: "rgba(0, 0, 0, 0.06)", // grey_100 6%
159
- dark1: "rgba(255, 255, 255, 0.06)", // grey_00 6%
160
- dark2: "rgba(255, 255, 255, 0.06)", // grey_00 6%
161
- dark3: "rgba(255, 255, 255, 0.06)", // grey_00 6%
162
- dark4: "rgba(255, 255, 255, 0.06)", // grey_00 6%
156
+ light1: "rgba(0, 0, 0, 0.1)", // grey_100 10%
157
+ light2: "rgba(0, 0, 0, 0.1)", // grey_100 10%
158
+ dark1: "rgba(0, 0, 0, 0.1)", // grey_100 10%
159
+ dark2: "rgba(0, 0, 0, 0.1)", // grey_100 10%
160
+ dark3: "rgba(0, 0, 0, 0.1)", // grey_100 10%
161
+ dark4: "rgba(0, 0, 0, 0.1)", // grey_100 10%
163
162
  },
164
163
  focused: {
165
- light1: "--lunitTeal-40",
166
- light2: "--lunitTeal-40",
167
- dark1: "--lunitTeal-40",
168
- dark2: "--lunitTeal-40",
169
- dark3: "--lunitTeal-40",
170
- dark4: "--lunitTeal-40",
164
+ light1: "--lunit_teal_40",
165
+ light2: "--lunit_teal_40",
166
+ dark1: "--lunit_teal_40",
167
+ dark2: "--lunit_teal_40",
168
+ dark3: "--lunit_teal_40",
169
+ dark4: "--lunit_teal_40",
170
+ },
171
+ selected: {
172
+ light1: "--lunit_teal_10",
173
+ light2: "--lunit_teal_10",
174
+ dark1: "--lunit_teal_80",
175
+ dark2: "--lunit_teal_80",
176
+ dark3: "--lunit_teal_80",
177
+ dark4: "--lunit_teal_80",
171
178
  },
172
179
  shadow_01: {
173
- light1: "rgba(0, 0, 0, 0.12)", // "--grey-100 12%",
174
- light2: "rgba(0, 0, 0, 0.12)", // "--grey-100 12%",
175
- dark4: "rgba(0, 0, 0, 0.32)", // "--grey-100 32%",
176
- dark3: "rgba(0, 0, 0, 0.32)", // "--grey-100 32%",
177
- dark2: "rgba(0, 0, 0, 0.32)", // "--grey-100 32%",
178
- dark1: "rgba(0, 0, 0, 0.32)", // "--grey-100 32%",
180
+ light1: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
181
+ light2: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
182
+ dark4: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
183
+ dark3: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
184
+ dark2: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
185
+ dark1: "rgba(0, 0, 0, 0.32)", // "--grey_100 32%",
179
186
  },
180
187
  shadow_02: {
181
- light1: "rgba(0, 0, 0, 0.18)", // "--grey-100 18%",
182
- light2: "rgba(0, 0, 0, 0.18)", // "--grey-100 18%",
183
- dark4: "rgba(0, 0, 0, 0.4)", // "--grey-100 40%",
184
- dark3: "rgba(0, 0, 0, 0.4)", // "--grey-100 40%",
185
- dark2: "rgba(0, 0, 0, 0.4)", // "--grey-100 40%",
186
- dark1: "rgba(0, 0, 0, 0.4)", // "--grey-100 40%",
188
+ light1: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
189
+ light2: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
190
+ dark4: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
191
+ dark3: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
192
+ dark2: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
193
+ dark1: "rgba(0, 0, 0, 0.4)", // "--grey_100 40%",
187
194
  },
188
195
  shadow_03: {
189
- light1: "rgba(0, 0, 0, 0.12)", // "--grey-100 12%",
190
- light2: "rgba(0, 0, 0, 0.12)", // "--grey-100 12%",
191
- dark4: "rgba(0, 0, 0, 0.36)", // "--grey-100 36%",
192
- dark3: "rgba(0, 0, 0, 0.36)", // "--grey-100 36%",
193
- dark2: "rgba(0, 0, 0, 0.36)", // "--grey-100 36%",
194
- dark1: "rgba(0, 0, 0, 0.36)", // "--grey-100 36%",
196
+ light1: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
197
+ light2: "rgba(0, 0, 0, 0.12)", // "--grey_100 12%",
198
+ dark4: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
199
+ dark3: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
200
+ dark2: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
201
+ dark1: "rgba(0, 0, 0, 0.36)", // "--grey_100 36%",
195
202
  },
196
203
  shadow_04: {
197
- light1: "rgba(0, 0, 0, 0.18)", // "--grey-100 18%",
198
- light2: "rgba(0, 0, 0, 0.18)", // "--grey-100 18%",
199
- dark4: "rgba(0, 0, 0, 0.48)", // "--grey-100 48%",
200
- dark3: "rgba(0, 0, 0, 0.48)", // "--grey-100 48%",
201
- dark2: "rgba(0, 0, 0, 0.48)", // "--grey-100 48%",
202
- dark1: "rgba(0, 0, 0, 0.48)", // "--grey-100 48%",
204
+ light1: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
205
+ light2: "rgba(0, 0, 0, 0.18)", // "--grey_100 18%",
206
+ dark4: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
207
+ dark3: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
208
+ dark2: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
209
+ dark1: "rgba(0, 0, 0, 0.48)", // "--grey_100 48%",
203
210
  },
204
211
  };
@@ -22,6 +22,7 @@ export interface ColorToken {
22
22
  icon_info_02: CSSPropertyColor;
23
23
  hover: CSSPropertyColor;
24
24
  focused: CSSPropertyColor;
25
+ selected: CSSPropertyColor;
25
26
  shadow_01: CSSPropertyColor;
26
27
  shadow_02: CSSPropertyColor;
27
28
  shadow_03: CSSPropertyColor;
@@ -49,10 +50,7 @@ export interface ColorToken {
49
50
  selectcontrol_handler_shadow: CSSPropertyColor;
50
51
  textfield_bg: CSSPropertyColor;
51
52
  textfield_border_error: CSSPropertyColor;
52
- dropdown_option_selected: CSSPropertyColor;
53
53
  dropdown_divider_border: CSSPropertyColor;
54
- dropdown_option_activatied: CSSPropertyColor;
55
- datatable_cell_selected: CSSPropertyColor;
56
54
  datatable_border_01: CSSPropertyColor;
57
55
  datatable_border_02: CSSPropertyColor;
58
56
  datatable_zebra: CSSPropertyColor;
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { default as theme } from "./theme";
2
+ export { base as baseColors } from "./foundation/colors";
2
3
 
3
4
  export { default as Alert } from "./components/Alert";
4
5
  export { default as Button } from "./components/Button";
@@ -1,13 +1,157 @@
1
1
  import React from "react";
2
- import { ComponentStory, ComponentMeta } from "@storybook/react";
2
+ import { Box, Typography } from "@mui/material";
3
+ import { StoryFn, Meta } from "@storybook/react";
3
4
 
4
5
  import Alert from "@/components/Alert";
6
+ import Button from "@/components/Button";
7
+ import theme from "@/theme";
8
+ import { action } from "@storybook/addon-actions";
5
9
 
6
10
  export default {
7
11
  title: "Components/Alert",
8
12
  component: Alert,
9
- } as ComponentMeta<typeof Alert>;
13
+ argTypes: {
14
+ title: {
15
+ control: "text",
16
+ description: "Used to represent the title of the alert.",
17
+ },
18
+ severity: {
19
+ control: "radio",
20
+ table: {
21
+ defaultValue: { summary: "success" },
22
+ },
23
+ options: ["success", "info", "warning", "error", undefined],
24
+ description: `\`success\`, \`info\`, \`warning\`, \`error\`, \`undefined\``,
25
+ },
26
+ onClose: {
27
+ control: "function",
28
+ description: `Callback fired when the component requests to be closed.
29
+ When provided, a close icon button is displayed that triggers the callback when clicked.`,
30
+ },
31
+ },
32
+ parameters: {
33
+ controls: {
34
+ include: ["title", "severity", "onClose"],
35
+ },
36
+ docs: {
37
+ description: {
38
+ component: `An alert displays a short, important message in a way that attracts the
39
+ user's attention without interrupting the user's task.
40
+ see [Material-UI Alert](https://mui.com/components/alert/)`,
41
+ },
42
+ },
43
+ },
44
+ decorators: [
45
+ (Story) => (
46
+ <Box
47
+ sx={{
48
+ display: "flex",
49
+ flexDirection: "column",
50
+ padding: "3em",
51
+ gap: "1em",
52
+ }}
53
+ >
54
+ {Story()}
55
+ </Box>
56
+ ),
57
+ ],
58
+ } as Meta<typeof Alert>;
10
59
 
11
- const Template: ComponentStory<typeof Alert> = () => <Alert />;
60
+ const AlertChildrenContentLong = () => {
61
+ return (
62
+ <Typography variant="body2_14_regular">
63
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
64
+ tempor incididunt ut{" "}
65
+ <u style={{ color: theme.palette.token.core.link_primary }}>
66
+ labore et dolore
67
+ </u>{" "}
68
+ magna aliqua. A diam sollicitudin tempor id eu nisl nunc mi. Auctor augue
69
+ mauris augue neque gravida in fermentum.
70
+ </Typography>
71
+ );
72
+ };
12
73
 
13
- export const LunitAlert = Template.bind({});
74
+ const AlertChildrenContentShort = () => {
75
+ return (
76
+ <Typography variant="body2_14_regular">
77
+ Lorem ipsum dolor sit amet, consectetur adipiscin
78
+ </Typography>
79
+ );
80
+ };
81
+
82
+ const AlertBottomAction = () => {
83
+ return (
84
+ <Box sx={{ display: "flex", columnGap: "8px" }}>
85
+ <Button color="primary" kind="contained">
86
+ Button
87
+ </Button>
88
+ <Button color="secondary" kind="ghost">
89
+ Button
90
+ </Button>
91
+ </Box>
92
+ );
93
+ };
94
+
95
+ const Template: StoryFn<typeof Alert> = (args) => (
96
+ <Alert sx={{ width: "620px" }} {...args}>
97
+ <AlertChildrenContentLong />
98
+ </Alert>
99
+ );
100
+
101
+ const Template2: StoryFn<typeof Alert> = (args) => (
102
+ <>
103
+ <Alert sx={{ width: "504px" }} {...args}>
104
+ <AlertChildrenContentLong />
105
+ </Alert>
106
+ <Alert sx={{ width: "620px" }} severity={args.severity} onClose={() => {}}>
107
+ <AlertChildrenContentLong />
108
+ </Alert>
109
+ <Alert sx={{ width: "620px" }} severity={args.severity} onClose={() => {}}>
110
+ <AlertChildrenContentShort />
111
+ </Alert>
112
+ <Alert sx={{ width: "620px" }} severity={args.severity}>
113
+ <AlertChildrenContentShort />
114
+ </Alert>
115
+ </>
116
+ );
117
+ const Template3: StoryFn<typeof Alert> = (args) => (
118
+ <>
119
+ <Alert
120
+ sx={{ width: "504px" }}
121
+ bottomAction={<AlertBottomAction />}
122
+ {...args}
123
+ >
124
+ <AlertChildrenContentLong />
125
+ </Alert>
126
+ </>
127
+ );
128
+
129
+ export const AlertBase = {
130
+ render: Template,
131
+
132
+ args: {
133
+ title: "Alert title",
134
+ severity: "success",
135
+ onClose: action("Close Button is clicked"),
136
+ },
137
+ };
138
+
139
+ export const AlertVariant = {
140
+ render: Template2,
141
+
142
+ args: {
143
+ title: "Alert title",
144
+ severity: "success",
145
+ onClose: action("Close Button is clicked"),
146
+ },
147
+ };
148
+
149
+ export const AlertWithBottomAction = {
150
+ render: Template3,
151
+
152
+ args: {
153
+ title: "Alert title",
154
+ severity: "success",
155
+ onClose: action("Close Button is clicked"),
156
+ },
157
+ };
@@ -7,11 +7,11 @@ import {
7
7
  TableBody,
8
8
  TableCell,
9
9
  } from "@mui/material";
10
- import { Bell } from "@lunit/design-system-icons";
10
+ import Bell from "@lunit/design-system-icons/Bell";
11
11
 
12
12
  import Button from "@/components/Button";
13
13
 
14
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
14
+ import type { StoryObj, StoryFn, Meta } from "@storybook/react";
15
15
  import type { ButtonProps } from "@/components/Button/Button.types";
16
16
 
17
17
  type Size = Pick<ButtonProps, "size">;
@@ -21,31 +21,26 @@ const sizeList: SizeValues[] = ["small", "medium", "large"];
21
21
  export default {
22
22
  title: "Components/Button",
23
23
  component: Button,
24
+ args: {
25
+ kind: "contained",
26
+ children: "Text",
27
+ color: "primary",
28
+ disabled: false,
29
+ size: "small",
30
+ onClick: action("onClick"),
31
+ },
24
32
  argTypes: {
25
33
  icon: {
26
34
  control: false,
27
35
  description: `Use this prop when you want to add icon.
28
- \n It is added to the left of the text criteria,
29
- \n and only Icon can be checked when used with hasIconOnly.`,
36
+ \n It is added to the left of the text criteria`,
30
37
  table: {
31
38
  defaultValue: { summary: "undefined" },
32
39
  type: { summary: "React.ReactNode" },
33
40
  },
34
41
  },
35
- hasIconOnly: {
36
- control: {
37
- type: "boolean",
38
- },
39
- description: `Option to handle so that only icons can be inserted
40
- \n If set to false, you can add Text.`,
41
- defaultValue: false,
42
- table: {
43
- defaultValue: { summary: "false" },
44
- },
45
- },
46
42
  children: {
47
43
  type: "string",
48
- defaultValue: "Text",
49
44
  },
50
45
  kind: {
51
46
  control: {
@@ -53,7 +48,6 @@ export default {
53
48
  },
54
49
  options: ["contained", "outlined", "ghost"],
55
50
  description: "Button has three Kinds Contained, Outlined, Ghost",
56
- defaultValue: "contained",
57
51
  table: {
58
52
  defaultValue: { summary: "contained" },
59
53
  },
@@ -63,7 +57,6 @@ export default {
63
57
  type: "radio",
64
58
  },
65
59
  options: ["primary", "secondary", "error"],
66
- defaultValue: "primary",
67
60
  table: {
68
61
  defaultValue: { summary: "primary" },
69
62
  },
@@ -72,7 +65,6 @@ export default {
72
65
  control: {
73
66
  type: "boolean",
74
67
  },
75
- defaultValue: false,
76
68
  table: {
77
69
  defaultValue: { summary: "false" },
78
70
  },
@@ -82,7 +74,6 @@ export default {
82
74
  type: "radio",
83
75
  },
84
76
  options: ["small", "medium", "large"],
85
- defaultValue: "small",
86
77
  table: {
87
78
  defaultValue: { summary: "small" },
88
79
  },
@@ -97,7 +88,6 @@ export default {
97
88
  function: action("onClick"),
98
89
  undefined: undefined,
99
90
  },
100
- defaultValue: "function",
101
91
  description:
102
92
  "It is a callback function that is called when the button is clicked.",
103
93
  },
@@ -112,7 +102,6 @@ export default {
112
102
  "kind",
113
103
  "color",
114
104
  "icon",
115
- "hasIconOnly",
116
105
  ],
117
106
  },
118
107
  docs: {
@@ -122,13 +111,13 @@ export default {
122
111
  },
123
112
  },
124
113
  },
125
- } as ComponentMeta<typeof Button>;
114
+ } as Meta<typeof Button>;
126
115
 
127
- export const BasicButton: ComponentStory<typeof Button> = (args) => (
128
- <Button {...args}>{args.children}</Button>
129
- );
116
+ export const BasicButton: StoryObj<typeof Button> = {
117
+ render: (args) => <Button {...args}>{args.children}</Button>,
118
+ };
130
119
 
131
- const SizeButtonTemplate: ComponentStory<typeof Button> = (args) => {
120
+ const SizeButtonTemplate: StoryFn<typeof Button> = (args) => {
132
121
  return (
133
122
  <Table sx={{ width: 900 }}>
134
123
  <TableHead>
@@ -174,4 +163,6 @@ const SizeButtonTemplate: ComponentStory<typeof Button> = (args) => {
174
163
  );
175
164
  };
176
165
 
177
- export const Size = SizeButtonTemplate.bind({});
166
+ export const Size = {
167
+ render: SizeButtonTemplate,
168
+ };