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

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 (351) hide show
  1. package/dist/cjs/components/Alert/index.js +2 -0
  2. package/dist/cjs/components/Alert/index.js.map +1 -0
  3. package/dist/cjs/components/Button/index.js +2 -0
  4. package/dist/cjs/components/Button/index.js.map +1 -0
  5. package/dist/cjs/components/Checkbox/index.js +2 -0
  6. package/dist/cjs/components/Checkbox/index.js.map +1 -0
  7. package/dist/cjs/components/Chip/index.js +2 -0
  8. package/dist/cjs/components/Chip/index.js.map +1 -0
  9. package/dist/cjs/components/DataTable/index.js +2 -0
  10. package/dist/cjs/components/DataTable/index.js.map +1 -0
  11. package/dist/cjs/components/DatePicker/index.js +2 -0
  12. package/dist/cjs/components/DatePicker/index.js.map +1 -0
  13. package/dist/cjs/components/Dropdown/index.js +2 -0
  14. package/dist/cjs/components/Dropdown/index.js.map +1 -0
  15. package/dist/cjs/components/FormLabel/index.js +2 -0
  16. package/dist/cjs/components/FormLabel/index.js.map +1 -0
  17. package/dist/cjs/components/Modal/index.js +2 -0
  18. package/dist/cjs/components/Modal/index.js.map +1 -0
  19. package/dist/cjs/components/Radio/index.js +2 -0
  20. package/dist/cjs/components/Radio/index.js.map +1 -0
  21. package/dist/cjs/components/RadioGroup/index.js +2 -0
  22. package/dist/cjs/components/RadioGroup/index.js.map +1 -0
  23. package/dist/cjs/components/TextField/index.js +2 -0
  24. package/dist/cjs/components/TextField/index.js.map +1 -0
  25. package/dist/cjs/components/Toggle/index.js +2 -0
  26. package/dist/cjs/components/Toggle/index.js.map +1 -0
  27. package/dist/cjs/components/ToggleButton/index.js +2 -0
  28. package/dist/cjs/components/ToggleButton/index.js.map +1 -0
  29. package/dist/cjs/components/Tooltip/index.js +2 -0
  30. package/dist/cjs/components/Tooltip/index.js.map +1 -0
  31. package/dist/cjs/index.js +2 -0
  32. package/dist/cjs/index.js.map +1 -0
  33. package/dist/components/Alert/Alert.js +7 -0
  34. package/dist/components/Alert/Alert.js.map +1 -0
  35. package/dist/components/Alert/index.js +1 -1
  36. package/dist/components/Alert/index.js.map +1 -1
  37. package/dist/components/Button/Button.js +9 -0
  38. package/dist/components/Button/Button.js.map +1 -0
  39. package/dist/components/Button/Button.styled.js +170 -0
  40. package/dist/components/Button/Button.styled.js.map +1 -0
  41. package/dist/components/Button/Button.types.js +2 -0
  42. package/dist/components/Button/Button.types.js.map +1 -0
  43. package/dist/components/Button/const.js +3 -0
  44. package/dist/components/Button/const.js.map +1 -0
  45. package/dist/components/Button/index.js +1 -1
  46. package/dist/components/Button/index.js.map +1 -1
  47. package/dist/components/Button/utils/getButtonPaddingBySizeAndKind.js +23 -0
  48. package/dist/components/Button/utils/getButtonPaddingBySizeAndKind.js.map +1 -0
  49. package/dist/components/Button/utils/getIconButtonPaddingBySizeAndKind.js +23 -0
  50. package/dist/components/Button/utils/getIconButtonPaddingBySizeAndKind.js.map +1 -0
  51. package/dist/components/Checkbox/Checkbox.js +49 -0
  52. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  53. package/dist/components/Checkbox/index.js +1 -1
  54. package/dist/components/Checkbox/index.js.map +1 -1
  55. package/dist/components/Chip/Chip.js +70 -0
  56. package/dist/components/Chip/Chip.js.map +1 -0
  57. package/dist/components/Chip/Chip.styled.js +143 -0
  58. package/dist/components/Chip/Chip.styled.js.map +1 -0
  59. package/dist/components/Chip/Chip.types.js +2 -0
  60. package/dist/components/Chip/Chip.types.js.map +1 -0
  61. package/dist/components/Chip/consts.js +8 -0
  62. package/dist/components/Chip/consts.js.map +1 -0
  63. package/dist/components/Chip/index.js +1 -1
  64. package/dist/components/Chip/index.js.map +1 -1
  65. package/dist/components/DataTable/DataTable.js +7 -0
  66. package/dist/components/DataTable/DataTable.js.map +1 -0
  67. package/dist/components/DataTable/index.js +1 -1
  68. package/dist/components/DataTable/index.js.map +1 -1
  69. package/dist/components/DatePicker/DatePicker.js +7 -0
  70. package/dist/components/DatePicker/DatePicker.js.map +1 -0
  71. package/dist/components/DatePicker/index.js +1 -1
  72. package/dist/components/DatePicker/index.js.map +1 -1
  73. package/dist/components/Dropdown/Dropdown.js +7 -0
  74. package/dist/components/Dropdown/Dropdown.js.map +1 -0
  75. package/dist/components/Dropdown/index.js +1 -1
  76. package/dist/components/Dropdown/index.js.map +1 -1
  77. package/dist/components/FormLabel/FormLabel.js +7 -0
  78. package/dist/components/FormLabel/FormLabel.js.map +1 -0
  79. package/dist/components/FormLabel/FormLabel.styled.js +8 -0
  80. package/dist/components/FormLabel/FormLabel.styled.js.map +1 -0
  81. package/dist/components/FormLabel/index.js +1 -1
  82. package/dist/components/FormLabel/index.js.map +1 -1
  83. package/dist/components/Modal/Modal.js +7 -0
  84. package/dist/components/Modal/Modal.js.map +1 -0
  85. package/dist/components/Modal/index.js +1 -1
  86. package/dist/components/Modal/index.js.map +1 -1
  87. package/dist/components/Radio/Radio.js +43 -0
  88. package/dist/components/Radio/Radio.js.map +1 -0
  89. package/dist/components/Radio/index.js +1 -1
  90. package/dist/components/Radio/index.js.map +1 -1
  91. package/dist/components/RadioGroup/index.js +2 -1
  92. package/dist/components/RadioGroup/index.js.map +1 -1
  93. package/dist/components/TextField/TextField.js +7 -0
  94. package/dist/components/TextField/TextField.js.map +1 -0
  95. package/dist/components/TextField/index.js +1 -1
  96. package/dist/components/TextField/index.js.map +1 -1
  97. package/dist/components/Toggle/Toggle.js +13 -0
  98. package/dist/components/Toggle/Toggle.js.map +1 -0
  99. package/dist/components/Toggle/Toggle.styled.js +155 -0
  100. package/dist/components/Toggle/Toggle.styled.js.map +1 -0
  101. package/dist/components/Toggle/Toggle.types.js +2 -0
  102. package/dist/components/Toggle/Toggle.types.js.map +1 -0
  103. package/dist/components/Toggle/index.js +1 -1
  104. package/dist/components/Toggle/index.js.map +1 -1
  105. package/dist/components/ToggleButton/ToggleButton.js +12 -0
  106. package/dist/components/ToggleButton/ToggleButton.js.map +1 -0
  107. package/dist/components/ToggleButton/ToggleButton.styled.js +35 -0
  108. package/dist/components/ToggleButton/ToggleButton.styled.js.map +1 -0
  109. package/dist/components/ToggleButton/ToggleButton.types.js +2 -0
  110. package/dist/components/ToggleButton/ToggleButton.types.js.map +1 -0
  111. package/dist/components/ToggleButton/index.js +1 -1
  112. package/dist/components/ToggleButton/index.js.map +1 -1
  113. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.js +7 -0
  114. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.js.map +1 -0
  115. package/dist/components/ToggleButtonGroup/index.js +2 -0
  116. package/dist/components/ToggleButtonGroup/index.js.map +1 -0
  117. package/dist/components/Tooltip/Tooltip.js +7 -0
  118. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  119. package/dist/components/Tooltip/index.js +1 -1
  120. package/dist/components/Tooltip/index.js.map +1 -1
  121. package/dist/components/index.js +7 -0
  122. package/dist/components/index.js.map +1 -0
  123. package/dist/foundation/Elevation/index.js +66 -0
  124. package/dist/foundation/Elevation/index.js.map +1 -0
  125. package/dist/foundation/Elevation/utils.js +9 -0
  126. package/dist/foundation/Elevation/utils.js.map +1 -0
  127. package/dist/foundation/Typography/index.js +62 -0
  128. package/dist/foundation/Typography/index.js.map +1 -0
  129. package/dist/foundation/Typography/tokens.js +155 -0
  130. package/dist/foundation/Typography/tokens.js.map +1 -0
  131. package/dist/foundation/colors/base/blue.js +26 -0
  132. package/dist/foundation/colors/base/blue.js.map +1 -0
  133. package/dist/foundation/colors/base/green.js +26 -0
  134. package/dist/foundation/colors/base/green.js.map +1 -0
  135. package/dist/foundation/colors/base/grey.js +36 -0
  136. package/dist/foundation/colors/base/grey.js.map +1 -0
  137. package/dist/foundation/colors/base/index.js +12 -0
  138. package/dist/foundation/colors/base/index.js.map +1 -0
  139. package/dist/foundation/colors/base/lunitGreen.js +26 -0
  140. package/dist/foundation/colors/base/lunitGreen.js.map +1 -0
  141. package/dist/foundation/colors/base/lunitTeal.js +26 -0
  142. package/dist/foundation/colors/base/lunitTeal.js.map +1 -0
  143. package/dist/foundation/colors/base/magenta.js +26 -0
  144. package/dist/foundation/colors/base/magenta.js.map +1 -0
  145. package/dist/foundation/colors/base/opacity.js +7 -0
  146. package/dist/foundation/colors/base/opacity.js.map +1 -0
  147. package/dist/foundation/colors/base/orange.js +26 -0
  148. package/dist/foundation/colors/base/orange.js.map +1 -0
  149. package/dist/foundation/colors/base/purple.js +26 -0
  150. package/dist/foundation/colors/base/purple.js.map +1 -0
  151. package/dist/foundation/colors/base/red.js +26 -0
  152. package/dist/foundation/colors/base/red.js.map +1 -0
  153. package/dist/foundation/colors/base/yellow.js +26 -0
  154. package/dist/foundation/colors/base/yellow.js.map +1 -0
  155. package/dist/foundation/colors/index.js +188 -0
  156. package/dist/foundation/colors/index.js.map +1 -0
  157. package/dist/foundation/colors/token/component.js +449 -0
  158. package/dist/foundation/colors/token/component.js.map +1 -0
  159. package/dist/foundation/colors/token/core.js +199 -0
  160. package/dist/foundation/colors/token/core.js.map +1 -0
  161. package/dist/foundation/colors/token/index.js +3 -0
  162. package/dist/foundation/colors/token/index.js.map +1 -0
  163. package/dist/foundation/colors/token/types.js +2 -0
  164. package/dist/foundation/colors/token/types.js.map +1 -0
  165. package/dist/foundation/colors/types.js +2 -0
  166. package/dist/foundation/colors/types.js.map +1 -0
  167. package/dist/foundation/index.js +13 -0
  168. package/dist/foundation/index.js.map +1 -0
  169. package/dist/foundation/spacing.js +2 -0
  170. package/dist/foundation/spacing.js.map +1 -0
  171. package/dist/index.js +16 -1
  172. package/dist/index.js.map +1 -1
  173. package/dist/theme.js +34 -0
  174. package/dist/theme.js.map +1 -0
  175. package/dist/types/components/Chip/Chip.styled.d.ts +79 -0
  176. package/package.json +19 -10
  177. package/src/components/Alert/Alert.tsx +9 -0
  178. package/src/components/Alert/index.ts +1 -0
  179. package/src/components/Button/Button.styled.ts +220 -0
  180. package/src/components/Button/Button.tsx +54 -0
  181. package/src/components/Button/Button.types.ts +25 -0
  182. package/src/components/Button/const.ts +2 -0
  183. package/src/components/Button/index.ts +1 -0
  184. package/src/components/Button/utils/getButtonPaddingBySizeAndKind.ts +35 -0
  185. package/src/components/Button/utils/getIconButtonPaddingBySizeAndKind.ts +38 -0
  186. package/src/components/Checkbox/Checkbox.tsx +67 -0
  187. package/src/components/Checkbox/index.ts +1 -0
  188. package/src/components/Chip/Chip.styled.ts +162 -0
  189. package/src/components/Chip/Chip.tsx +132 -0
  190. package/src/components/Chip/Chip.types.ts +56 -0
  191. package/src/components/Chip/consts.ts +7 -0
  192. package/src/components/Chip/index.ts +1 -0
  193. package/src/components/DataTable/DataTable.tsx +8 -0
  194. package/src/components/DataTable/index.ts +1 -0
  195. package/src/components/DatePicker/DatePicker.tsx +8 -0
  196. package/src/components/DatePicker/index.ts +1 -0
  197. package/src/components/Dropdown/Dropdown.tsx +11 -0
  198. package/src/components/Dropdown/index.ts +1 -0
  199. package/src/components/FormLabel/FormLabel.styled.ts +8 -0
  200. package/src/components/FormLabel/FormLabel.tsx +9 -0
  201. package/src/components/FormLabel/index.ts +1 -0
  202. package/src/components/Modal/Modal.tsx +8 -0
  203. package/src/components/Modal/index.ts +1 -0
  204. package/src/components/Radio/Radio.tsx +58 -0
  205. package/src/components/Radio/index.ts +1 -0
  206. package/src/components/RadioGroup/index.ts +2 -0
  207. package/src/components/TextField/TextField.tsx +8 -0
  208. package/src/components/TextField/index.ts +1 -0
  209. package/src/components/Toggle/Toggle.styled.ts +162 -0
  210. package/src/components/Toggle/Toggle.tsx +18 -0
  211. package/src/components/Toggle/Toggle.types.ts +14 -0
  212. package/src/components/Toggle/index.ts +1 -0
  213. package/src/components/ToggleButton/ToggleButton.styled.ts +58 -0
  214. package/src/components/ToggleButton/ToggleButton.tsx +89 -0
  215. package/src/components/ToggleButton/ToggleButton.types.ts +28 -0
  216. package/src/components/ToggleButton/index.ts +1 -0
  217. package/src/components/ToggleButtonGroup/ToggleButtonGroup.tsx +13 -0
  218. package/src/components/ToggleButtonGroup/index.tsx +1 -0
  219. package/src/components/Tooltip/Tooltip.tsx +9 -0
  220. package/src/components/Tooltip/index.ts +1 -0
  221. package/src/components/index.ts +9 -0
  222. package/src/foundation/Elevation/index.ts +72 -0
  223. package/src/foundation/Elevation/utils.ts +11 -0
  224. package/src/foundation/Typography/index.ts +96 -0
  225. package/src/foundation/Typography/tokens.ts +162 -0
  226. package/src/foundation/colors/base/blue.ts +27 -0
  227. package/src/foundation/colors/base/green.ts +27 -0
  228. package/src/foundation/colors/base/grey.ts +36 -0
  229. package/src/foundation/colors/base/index.ts +11 -0
  230. package/src/foundation/colors/base/lunitGreen.ts +27 -0
  231. package/src/foundation/colors/base/lunitTeal.ts +27 -0
  232. package/src/foundation/colors/base/magenta.ts +27 -0
  233. package/src/foundation/colors/base/opacity.ts +6 -0
  234. package/src/foundation/colors/base/orange.ts +27 -0
  235. package/src/foundation/colors/base/purple.ts +27 -0
  236. package/src/foundation/colors/base/red.ts +27 -0
  237. package/src/foundation/colors/base/yellow.ts +27 -0
  238. package/src/foundation/colors/index.ts +235 -0
  239. package/src/foundation/colors/token/component.ts +456 -0
  240. package/src/foundation/colors/token/core.ts +204 -0
  241. package/src/foundation/colors/token/index.ts +2 -0
  242. package/src/foundation/colors/token/types.ts +8 -0
  243. package/src/foundation/colors/types.ts +85 -0
  244. package/src/foundation/index.ts +25 -0
  245. package/src/foundation/spacing.ts +3 -0
  246. package/src/index.ts +17 -0
  247. package/src/stories/components/Alert/Alert.stories.tsx +13 -0
  248. package/src/stories/components/Button/BasicButton.stories.tsx +177 -0
  249. package/src/stories/components/Button/IconButton.stories.tsx +128 -0
  250. package/src/stories/components/Button/Kind.stories.tsx +514 -0
  251. package/src/stories/components/Chip/Chip.stories.tsx +196 -0
  252. package/src/stories/components/DataTable/DataTable.stories.tsx +13 -0
  253. package/src/stories/components/DatePicker/DatePicker.stories.tsx +13 -0
  254. package/src/stories/components/Dropdown/Dropdown.stories.tsx +15 -0
  255. package/src/stories/components/Modal/Modal.stories.tsx +13 -0
  256. package/src/stories/components/SelectControl/Checkbox.stories.tsx +248 -0
  257. package/src/stories/components/SelectControl/RadioGroup.stories.tsx +67 -0
  258. package/src/stories/components/SelectControl/RadioStatus.stories.tsx +91 -0
  259. package/src/stories/components/SelectControl/Toggle.stories.tsx +429 -0
  260. package/src/stories/components/TextField/TextField.stories.tsx +13 -0
  261. package/src/stories/components/ToggleButton/Basic.stories.tsx +342 -0
  262. package/src/stories/components/ToggleButton/Group.stories.tsx +221 -0
  263. package/src/stories/components/ToggleButton/ToggleButtonKind.stories.tsx +698 -0
  264. package/src/stories/components/ToggleButton/WithIcon.stories.tsx +293 -0
  265. package/src/stories/components/Tooltip/Tooltip.stories.tsx +13 -0
  266. package/src/stories/foundation/Elevation/Elevation.stories.tsx +264 -0
  267. package/src/stories/foundation/Elevation/styled.ts +12 -0
  268. package/src/stories/foundation/Typography/Typography.stories.mdx +71 -0
  269. package/src/stories/foundation/Typography/Typography.stories.tsx +91 -0
  270. package/src/stories/foundation/Typography/TypographyGroup.tsx +71 -0
  271. package/src/stories/foundation/Typography/const.ts +25 -0
  272. package/src/stories/foundation/colors/Colors.stories.tsx +64 -0
  273. package/src/stories/foundation/colors/Token.inComponent.stories.tsx +167 -0
  274. package/src/stories/foundation/colors/Token.stories.tsx +190 -0
  275. package/src/stories/foundation/colors/styled.ts +39 -0
  276. package/src/theme.ts +41 -0
  277. package/src/types.d.ts +4 -0
  278. package/tsconfig.build.json +2 -0
  279. package/dist/components/Chip/Chip.styled.d.ts +0 -41
  280. package/dist/components/HelloWorld/HelloWorld.d.ts +0 -28
  281. package/webpack.config.js +0 -51
  282. /package/dist/{components → types/components}/Alert/Alert.d.ts +0 -0
  283. /package/dist/{components → types/components}/Alert/index.d.ts +0 -0
  284. /package/dist/{components → types/components}/Button/Button.d.ts +0 -0
  285. /package/dist/{components → types/components}/Button/Button.styled.d.ts +0 -0
  286. /package/dist/{components → types/components}/Button/Button.types.d.ts +0 -0
  287. /package/dist/{components → types/components}/Button/const.d.ts +0 -0
  288. /package/dist/{components → types/components}/Button/index.d.ts +0 -0
  289. /package/dist/{components → types/components}/Button/utils/getButtonPaddingBySizeAndKind.d.ts +0 -0
  290. /package/dist/{components → types/components}/Button/utils/getIconButtonPaddingBySizeAndKind.d.ts +0 -0
  291. /package/dist/{components → types/components}/Checkbox/Checkbox.d.ts +0 -0
  292. /package/dist/{components → types/components}/Checkbox/index.d.ts +0 -0
  293. /package/dist/{components → types/components}/Chip/Chip.d.ts +0 -0
  294. /package/dist/{components → types/components}/Chip/Chip.types.d.ts +0 -0
  295. /package/dist/{components → types/components}/Chip/consts.d.ts +0 -0
  296. /package/dist/{components → types/components}/Chip/index.d.ts +0 -0
  297. /package/dist/{components → types/components}/DataTable/DataTable.d.ts +0 -0
  298. /package/dist/{components → types/components}/DataTable/index.d.ts +0 -0
  299. /package/dist/{components → types/components}/DatePicker/DatePicker.d.ts +0 -0
  300. /package/dist/{components → types/components}/DatePicker/index.d.ts +0 -0
  301. /package/dist/{components → types/components}/Dropdown/Dropdown.d.ts +0 -0
  302. /package/dist/{components → types/components}/Dropdown/index.d.ts +0 -0
  303. /package/dist/{components → types/components}/FormLabel/FormLabel.d.ts +0 -0
  304. /package/dist/{components → types/components}/FormLabel/FormLabel.styled.d.ts +0 -0
  305. /package/dist/{components → types/components}/FormLabel/index.d.ts +0 -0
  306. /package/dist/{components → types/components}/Modal/Modal.d.ts +0 -0
  307. /package/dist/{components → types/components}/Modal/index.d.ts +0 -0
  308. /package/dist/{components → types/components}/Radio/Radio.d.ts +0 -0
  309. /package/dist/{components → types/components}/Radio/index.d.ts +0 -0
  310. /package/dist/{components → types/components}/RadioGroup/index.d.ts +0 -0
  311. /package/dist/{components → types/components}/TextField/TextField.d.ts +0 -0
  312. /package/dist/{components → types/components}/TextField/index.d.ts +0 -0
  313. /package/dist/{components → types/components}/Toggle/Toggle.d.ts +0 -0
  314. /package/dist/{components → types/components}/Toggle/Toggle.styled.d.ts +0 -0
  315. /package/dist/{components → types/components}/Toggle/Toggle.types.d.ts +0 -0
  316. /package/dist/{components → types/components}/Toggle/index.d.ts +0 -0
  317. /package/dist/{components → types/components}/ToggleButton/ToggleButton.d.ts +0 -0
  318. /package/dist/{components → types/components}/ToggleButton/ToggleButton.styled.d.ts +0 -0
  319. /package/dist/{components → types/components}/ToggleButton/ToggleButton.types.d.ts +0 -0
  320. /package/dist/{components → types/components}/ToggleButton/index.d.ts +0 -0
  321. /package/dist/{components → types/components}/ToggleButtonGroup/ToggleButtonGroup.d.ts +0 -0
  322. /package/dist/{components → types/components}/ToggleButtonGroup/index.d.ts +0 -0
  323. /package/dist/{components → types/components}/Tooltip/Tooltip.d.ts +0 -0
  324. /package/dist/{components → types/components}/Tooltip/index.d.ts +0 -0
  325. /package/dist/{components → types/components}/index.d.ts +0 -0
  326. /package/dist/{foundation → types/foundation}/Elevation/index.d.ts +0 -0
  327. /package/dist/{foundation → types/foundation}/Elevation/utils.d.ts +0 -0
  328. /package/dist/{foundation → types/foundation}/Typography/index.d.ts +0 -0
  329. /package/dist/{foundation → types/foundation}/Typography/tokens.d.ts +0 -0
  330. /package/dist/{foundation → types/foundation}/colors/base/blue.d.ts +0 -0
  331. /package/dist/{foundation → types/foundation}/colors/base/green.d.ts +0 -0
  332. /package/dist/{foundation → types/foundation}/colors/base/grey.d.ts +0 -0
  333. /package/dist/{foundation → types/foundation}/colors/base/index.d.ts +0 -0
  334. /package/dist/{foundation → types/foundation}/colors/base/lunitGreen.d.ts +0 -0
  335. /package/dist/{foundation → types/foundation}/colors/base/lunitTeal.d.ts +0 -0
  336. /package/dist/{foundation → types/foundation}/colors/base/magenta.d.ts +0 -0
  337. /package/dist/{foundation → types/foundation}/colors/base/opacity.d.ts +0 -0
  338. /package/dist/{foundation → types/foundation}/colors/base/orange.d.ts +0 -0
  339. /package/dist/{foundation → types/foundation}/colors/base/purple.d.ts +0 -0
  340. /package/dist/{foundation → types/foundation}/colors/base/red.d.ts +0 -0
  341. /package/dist/{foundation → types/foundation}/colors/base/yellow.d.ts +0 -0
  342. /package/dist/{foundation → types/foundation}/colors/index.d.ts +0 -0
  343. /package/dist/{foundation → types/foundation}/colors/token/component.d.ts +0 -0
  344. /package/dist/{foundation → types/foundation}/colors/token/core.d.ts +0 -0
  345. /package/dist/{foundation → types/foundation}/colors/token/index.d.ts +0 -0
  346. /package/dist/{foundation → types/foundation}/colors/token/types.d.ts +0 -0
  347. /package/dist/{foundation → types/foundation}/colors/types.d.ts +0 -0
  348. /package/dist/{foundation → types/foundation}/index.d.ts +0 -0
  349. /package/dist/{foundation → types/foundation}/spacing.d.ts +0 -0
  350. /package/dist/{index.d.ts → types/index.d.ts} +0 -0
  351. /package/dist/{theme.d.ts → types/theme.d.ts} +0 -0
@@ -0,0 +1,91 @@
1
+ import React from "react";
2
+
3
+ import { ComponentStory } from "@storybook/react";
4
+ import { Box, Typography } from "@mui/material";
5
+ import { styled } from "@mui/material/styles";
6
+
7
+ import { variantArray } from "./const";
8
+
9
+ export default {
10
+ title: "Foundation/Typography",
11
+ component: Typography,
12
+ argTypes: {
13
+ variant: {
14
+ control: "select",
15
+ options: variantArray,
16
+ },
17
+ },
18
+ };
19
+
20
+ const TypographyTemplate: ComponentStory<typeof Typography> = (args) => {
21
+ const { variant, children } = args;
22
+ return (
23
+ <Typography variant={variant} sx={{ whiteSpace: "pre-line" }}>
24
+ {children}
25
+ </Typography>
26
+ );
27
+ };
28
+
29
+ export const TypographyComponent = TypographyTemplate.bind({});
30
+ TypographyComponent.args = {
31
+ variant: "body1_16_regular",
32
+ children:
33
+ "AI will be the new standard of care. 123456789\nBy Lunit. With AI, we aim to make data-driven medicine\nthe new standard of care.",
34
+ };
35
+
36
+ const SXTemplate: ComponentStory<typeof Typography> = (args) => {
37
+ const { variant, children } = args;
38
+ return (
39
+ <Box sx={{ typography: variant, whiteSpace: "pre-line" }}>{children}</Box>
40
+ );
41
+ };
42
+
43
+ export const SXProps = SXTemplate.bind({});
44
+ SXProps.args = {
45
+ variant: "body1_16_regular",
46
+ children:
47
+ "AI will be the new standard of care. 123456789\nBy Lunit. With AI, we aim to make data-driven medicine\nthe new standard of care.",
48
+ };
49
+
50
+ const StyledBox = styled(Box, {
51
+ shouldForwardProp: (prop) => !["variant"].includes(prop.toString()),
52
+ })<{ variant: typeof variantArray[number] }>(({ theme, variant }) => ({
53
+ ...theme.typography[variant],
54
+ whiteSpace: "pre-line",
55
+ }));
56
+
57
+ const StyledTemplate: ComponentStory<typeof StyledBox> = (args) => {
58
+ /**
59
+ const StyledBox = styled(Box)(({ theme }) => ({
60
+ ...theme.typography.body1_16_regular,
61
+ whiteSpace: "pre-line",
62
+ }));
63
+ */
64
+ const { variant, children } = args;
65
+ return <StyledBox variant={variant}>{children}</StyledBox>;
66
+ };
67
+
68
+ export const Styled = StyledTemplate.bind({});
69
+ Styled.args = {
70
+ variant: "body1_16_regular",
71
+ children:
72
+ "AI will be the new standard of care. 123456789\nBy Lunit. With AI, we aim to make data-driven medicine\nthe new standard of care.",
73
+ };
74
+ Styled.parameters = {
75
+ docs: {
76
+ source: {
77
+ code: `
78
+ const StyledBox = styled(Box)(({ theme }) => ({
79
+ ...theme.typography.body1_16_regular,
80
+ whiteSpace: "pre-line",
81
+ }));
82
+ ...
83
+ return (
84
+ <StyledBox>AI will be the new standard of care. 123456789\nBy Lunit. With AI, we aim to make data-driven medicine\nthe new standard of care.</StyledBox>
85
+ );
86
+ `,
87
+ language: "tsx",
88
+ type: "code",
89
+ },
90
+ },
91
+ };
@@ -0,0 +1,71 @@
1
+ import React from "react";
2
+
3
+ import {
4
+ Box,
5
+ Typography,
6
+ styled,
7
+ useTheme,
8
+ TypographyProps,
9
+ } from "@mui/material";
10
+
11
+ export const TypographyContent = styled(Box)({
12
+ display: "flex",
13
+ flexDirection: "column",
14
+ width: "100%",
15
+ });
16
+
17
+ export const TypographyItem = styled(Box)({
18
+ display: "flex",
19
+ flexWrap: "wrap",
20
+ marginBottom: "24px",
21
+ });
22
+
23
+ export const TypographyTitle = styled(Typography)(({ theme }) => ({
24
+ width: 200,
25
+ color: theme.palette.token.core.text_light,
26
+ }));
27
+
28
+ export const TypographyDummy = styled(Typography)({
29
+ width: 560,
30
+ });
31
+
32
+ type ReadableArray<T> = Array<T> | ReadonlyArray<T>;
33
+
34
+ interface TypographyGroupProps {
35
+ heading: React.ReactNode;
36
+ dummy: React.ReactNode;
37
+ variants: ReadableArray<
38
+ Exclude<TypographyProps["variant"], "inherit" | undefined>
39
+ >;
40
+ }
41
+
42
+ const TypographyGroup = ({
43
+ heading,
44
+ dummy,
45
+ variants,
46
+ }: TypographyGroupProps) => {
47
+ const theme = useTheme();
48
+ return (
49
+ <>
50
+ <Typography variant="h4" component="h2" sx={{ mb: 5 }}>
51
+ {heading}
52
+ </Typography>
53
+ <TypographyContent>
54
+ {variants.map((variant) => {
55
+ const { fontWeight, fontSize, lineHeight } =
56
+ theme.typography[variant] ?? {};
57
+ return (
58
+ <TypographyItem key={variant}>
59
+ <TypographyTitle variant="body1_16_semibold">
60
+ {variant}
61
+ </TypographyTitle>
62
+ <TypographyDummy variant={variant}>{dummy}</TypographyDummy>
63
+ </TypographyItem>
64
+ );
65
+ })}
66
+ </TypographyContent>
67
+ </>
68
+ );
69
+ };
70
+
71
+ export default TypographyGroup;
@@ -0,0 +1,25 @@
1
+ const headline = [
2
+ "headline1",
3
+ "headline2",
4
+ "headline3",
5
+ "headline4",
6
+ "headline5",
7
+ ] as const;
8
+ const body = [
9
+ "body1_16_semibold",
10
+ "body1_16_regular",
11
+ "body2_14_bold",
12
+ "body2_14_medium",
13
+ "body2_14_regular",
14
+ "body3_12_semibold",
15
+ "body3_12_regular",
16
+ ] as const;
17
+ const etc = ["button1", "button2", "caption", "overline"] as const;
18
+
19
+ export const variants = {
20
+ headline,
21
+ body,
22
+ etc,
23
+ };
24
+
25
+ export const variantArray = [...headline, ...body, ...etc];
@@ -0,0 +1,64 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import { Typography, useTheme } from "@mui/material";
4
+ import { Color, ColorContainer, Container, PaletteContainer } from "./styled";
5
+ import map from "lodash/map";
6
+ import lowerCase from "lodash/lowerCase";
7
+ import capitalize from "lodash/capitalize";
8
+ import { BaseColor, GreyColor } from "@/foundation/colors";
9
+
10
+ const convertColorPaletteKeyToDisplay = (key: string): string =>
11
+ lowerCase(key)
12
+ .split(" ")
13
+ .map((str) => capitalize(str))
14
+ .join(" ");
15
+
16
+ const BaseColors = () => {
17
+ const theme = useTheme();
18
+ return (
19
+ <Container>
20
+ {map(
21
+ theme.palette.lunit,
22
+ (colors: BaseColor | GreyColor, paletteKey: string) => (
23
+ <div key={paletteKey}>
24
+ <Typography
25
+ variant="h4"
26
+ sx={{
27
+ marginBottom: 11,
28
+ "&:not(:first-of-type)": { marginTop: 11 },
29
+ }}
30
+ >
31
+ {convertColorPaletteKeyToDisplay(paletteKey)}
32
+ </Typography>
33
+ <PaletteContainer>
34
+ {map(colors, (_: string, colorKey: string) => (
35
+ <ColorContainer key={colorKey}>
36
+ <Color
37
+ color={`lunit.${paletteKey}.${colorKey}.contrastText`}
38
+ bgcolor={`lunit.${paletteKey}.${colorKey}.main`}
39
+ >
40
+ <Typography variant="h4">T</Typography>
41
+ </Color>
42
+ <Typography variant="body2">{`${paletteKey}_${colorKey}`}</Typography>
43
+ </ColorContainer>
44
+ ))}
45
+ </PaletteContainer>
46
+ </div>
47
+ )
48
+ )}
49
+ </Container>
50
+ );
51
+ };
52
+
53
+ // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
54
+ export default {
55
+ // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
56
+ title: "Foundation/Colors",
57
+ component: BaseColors,
58
+ } as ComponentMeta<typeof BaseColors>;
59
+
60
+ // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
61
+ const BaseTemplate: ComponentStory<typeof BaseColors> = () => <BaseColors />;
62
+
63
+ export const Base = BaseTemplate.bind({});
64
+ // More on args: https://storybook.js.org/docs/react/writing-stories/args
@@ -0,0 +1,167 @@
1
+ import React, { ReactNode } from "react";
2
+ import { ComponentMeta } from "@storybook/react";
3
+ import { Box, styled, TextField, Typography, useTheme } from "@mui/material";
4
+
5
+ export const InComponentWithStyled = () => {
6
+ const StyledTextField = styled(TextField)(({ theme }) => ({
7
+ "& .MuiInputBase-root": {
8
+ backgroundColor: theme.palette.token.component.textfield_bg,
9
+ color: theme.palette.token.core.text_normal,
10
+ "& .MuiInputBase-input": {
11
+ padding: "8px 16px",
12
+ },
13
+ "&.Mui-focused fieldset": {
14
+ borderColor: theme.palette.token.core.focused,
15
+ },
16
+ },
17
+ }));
18
+
19
+ return (
20
+ <>
21
+ <BaseBox theme="light">
22
+ <StyledTextField placeholder="Styled Text Field" />
23
+ </BaseBox>
24
+ <BaseBox theme="dark">
25
+ <StyledTextField placeholder="Styled Text Field" />
26
+ </BaseBox>
27
+ </>
28
+ );
29
+ };
30
+
31
+ export default {
32
+ title: "Foundation/Colors/ColorToken",
33
+ component: InComponentWithStyled,
34
+ decorators: [
35
+ (Story) => (
36
+ <div style={{ display: "flex", flexDirection: "column", width: "100%" }}>
37
+ <Story />
38
+ </div>
39
+ ),
40
+ ],
41
+ } as ComponentMeta<typeof InComponentWithStyled>;
42
+
43
+ export const InComponentWithSx = () => {
44
+ return (
45
+ <>
46
+ <BaseBox theme="light">
47
+ <TextField
48
+ placeholder="Text Field with SX"
49
+ sx={{
50
+ "& .MuiInputBase-root": {
51
+ backgroundColor: (theme) =>
52
+ theme.palette.token.component.textfield_bg,
53
+ color: (theme) => theme.palette.token.core.text_normal,
54
+ "& .MuiInputBase-input": {
55
+ padding: "8px 16px",
56
+ },
57
+ "&.Mui-focused fieldset": {
58
+ borderColor: (theme) => theme.palette.token.core.focused,
59
+ },
60
+ },
61
+ }}
62
+ />
63
+ <Box width={150} height={50} bgcolor="#DFDFE2" mt={3}>
64
+ Hello!
65
+ <Box
66
+ sx={{
67
+ backgroundColor: (theme) =>
68
+ theme.palette.token.component.alert_info_bg,
69
+ color: (theme) => theme.palette.token.component.alert_info_border,
70
+ boxShadow: (theme) =>
71
+ `20px -10px 5px ${theme.palette.token.core.shadow_01}`,
72
+ width: 300,
73
+ height: 80,
74
+ }}
75
+ >
76
+ - with alpha value
77
+ </Box>
78
+ </Box>
79
+ </BaseBox>
80
+ <BaseBox theme="dark">
81
+ <TextField
82
+ placeholder="Text Field with SX"
83
+ sx={{
84
+ "& .MuiInputBase-root": {
85
+ backgroundColor: (theme) =>
86
+ theme.palette.token.component.textfield_bg,
87
+ color: (theme) => theme.palette.token.core.text_normal,
88
+ "& .MuiInputBase-input": {
89
+ padding: "8px 16px",
90
+ },
91
+ "&.Mui-focused fieldset": {
92
+ borderColor: (theme) => theme.palette.token.core.focused,
93
+ },
94
+ },
95
+ }}
96
+ />
97
+ <Box width={150} height={50} bgcolor="#DFDFE2" mt={3}>
98
+ Hello!
99
+ <Box
100
+ sx={{
101
+ backgroundColor: (theme) =>
102
+ theme.palette.token.component.alert_info_bg,
103
+ color: (theme) => theme.palette.token.component.alert_info_border,
104
+ boxShadow: (theme) =>
105
+ `20px -10px 5px ${theme.palette.token.core.shadow_01}`,
106
+ width: 300,
107
+ height: 80,
108
+ }}
109
+ >
110
+ - with alpha value
111
+ </Box>
112
+ </Box>
113
+ </BaseBox>
114
+ </>
115
+ );
116
+ };
117
+
118
+ export const InComponentWithInlineStyle = () => {
119
+ const theme = useTheme();
120
+
121
+ return (
122
+ <>
123
+ <BaseBox theme="light">
124
+ <TextField
125
+ placeholder="Inline Styled Text Field"
126
+ style={{
127
+ backgroundColor: theme.palette.token.component.textfield_bg,
128
+ }}
129
+ />
130
+ </BaseBox>
131
+ <BaseBox theme="dark">
132
+ <TextField
133
+ placeholder="Inline Styled Text Field"
134
+ style={{
135
+ backgroundColor: theme.palette.token.component.textfield_bg,
136
+ }}
137
+ />
138
+ </BaseBox>
139
+ </>
140
+ );
141
+ };
142
+
143
+ interface BaseBoxProps {
144
+ theme: "light" | "dark";
145
+ children: ReactNode;
146
+ }
147
+
148
+ const BaseBox = ({ theme, children }: BaseBoxProps) => {
149
+ return (
150
+ <Box
151
+ className={theme === "light" ? "light1" : "dark1"}
152
+ width={500}
153
+ height={200}
154
+ bgcolor={theme === "light" ? `lunit.grey.0.main` : `lunit.grey.80.main`}
155
+ border="1px solid"
156
+ p={2}
157
+ >
158
+ <Typography
159
+ variant="body1_16_semibold"
160
+ color={(theme) => theme.palette.token.core.text_normal}
161
+ >
162
+ {theme === "light" ? "= light1 =" : "= dark1 ="}
163
+ </Typography>
164
+ {children}
165
+ </Box>
166
+ );
167
+ };
@@ -0,0 +1,190 @@
1
+ import React from "react";
2
+ import { ComponentStory, ComponentMeta } from "@storybook/react";
3
+ import {
4
+ useTheme,
5
+ Box,
6
+ Table,
7
+ TableHead,
8
+ TableRow,
9
+ TableBody,
10
+ TableContainer,
11
+ TableCell,
12
+ } from "@mui/material";
13
+ import { StyledTypography } from "./styled";
14
+ import { tokenCoreColor } from "@/foundation/colors/token/core";
15
+ import type { ColorToken } from "@/foundation/colors/types";
16
+
17
+ const CoreTokenColors = () => {
18
+ const theme = useTheme();
19
+
20
+ const colorBoxStyle = {
21
+ borderTop: "1px solid",
22
+ borderBottom: "1px solid",
23
+ borderColor: "rgba(0, 0, 0, 0.12)",
24
+ height: "12px",
25
+ };
26
+
27
+ return (
28
+ <TableContainer>
29
+ <Table stickyHeader>
30
+ <TableHead>
31
+ <TableRow>
32
+ <TableCell colSpan={2}> </TableCell>
33
+ <TableCell colSpan={2}>Light</TableCell>
34
+ <TableCell colSpan={4}>Dark</TableCell>
35
+ </TableRow>
36
+ <TableRow>
37
+ <TableCell>Token name</TableCell>
38
+ <TableCell>Light 1</TableCell>
39
+ <TableCell>Light 2</TableCell>
40
+ <TableCell>Dark 1</TableCell>
41
+ <TableCell>Dark 2</TableCell>
42
+ <TableCell>Dark 3</TableCell>
43
+ <TableCell>Dark 4</TableCell>
44
+ </TableRow>
45
+ </TableHead>
46
+ <TableBody>
47
+ {Object.entries(theme.palette.token.core).map(
48
+ ([paletteKey, _colorVariable]) => (
49
+ <TableRow key={paletteKey}>
50
+ <TableCell sx={{ height: "72px" }}>
51
+ <StyledTypography>core.{paletteKey}</StyledTypography>
52
+ </TableCell>
53
+ <TableCell
54
+ className="light1"
55
+ sx={{
56
+ background: "var(--grey-0)",
57
+ padding: 0,
58
+ }}
59
+ >
60
+ <Box
61
+ sx={{
62
+ background:
63
+ theme.palette.token.core[
64
+ paletteKey as keyof ColorToken["core"]
65
+ ],
66
+ borderLeft: "1px solid",
67
+ ...colorBoxStyle,
68
+ }}
69
+ ></Box>
70
+ <StyledTypography>
71
+ {tokenCoreColor[paletteKey]["light1"]}
72
+ </StyledTypography>
73
+ </TableCell>
74
+ <TableCell
75
+ className="light2"
76
+ sx={{ background: "var(--grey-10)", padding: 0 }}
77
+ >
78
+ <Box
79
+ sx={{
80
+ background:
81
+ theme.palette.token.core[
82
+ paletteKey as keyof ColorToken["core"]
83
+ ],
84
+ ...colorBoxStyle,
85
+ }}
86
+ ></Box>
87
+ <StyledTypography>
88
+ {tokenCoreColor[paletteKey]["light2"]}
89
+ </StyledTypography>
90
+ </TableCell>
91
+ <TableCell
92
+ className="dark1"
93
+ sx={{
94
+ background: "var(--grey-90)",
95
+ padding: 0,
96
+ }}
97
+ >
98
+ <Box
99
+ sx={{
100
+ background:
101
+ theme.palette.token.core[
102
+ paletteKey as keyof ColorToken["core"]
103
+ ],
104
+ ...colorBoxStyle,
105
+ }}
106
+ ></Box>
107
+ <StyledTypography>
108
+ {tokenCoreColor[paletteKey]["dark1"]}
109
+ </StyledTypography>
110
+ </TableCell>
111
+ <TableCell
112
+ className="dark2"
113
+ sx={{
114
+ background: "var(--grey-85)",
115
+ padding: 0,
116
+ }}
117
+ >
118
+ <Box
119
+ sx={{
120
+ background:
121
+ theme.palette.token.core[
122
+ paletteKey as keyof ColorToken["core"]
123
+ ],
124
+ ...colorBoxStyle,
125
+ }}
126
+ ></Box>
127
+
128
+ <StyledTypography>
129
+ {tokenCoreColor[paletteKey]["dark2"]}
130
+ </StyledTypography>
131
+ </TableCell>
132
+ <TableCell
133
+ className="dark3"
134
+ sx={{
135
+ background: "var(--grey-80)",
136
+ padding: 0,
137
+ }}
138
+ >
139
+ <Box
140
+ sx={{
141
+ background:
142
+ theme.palette.token.core[
143
+ paletteKey as keyof ColorToken["core"]
144
+ ],
145
+ ...colorBoxStyle,
146
+ }}
147
+ ></Box>
148
+ <StyledTypography>
149
+ {tokenCoreColor[paletteKey]["dark3"]}
150
+ </StyledTypography>
151
+ </TableCell>
152
+ <TableCell
153
+ className="dark4"
154
+ sx={{
155
+ background: "var(--grey-70)",
156
+ padding: 0,
157
+ }}
158
+ >
159
+ <Box
160
+ sx={{
161
+ background:
162
+ theme.palette.token.core[
163
+ paletteKey as keyof ColorToken["core"]
164
+ ],
165
+ ...colorBoxStyle,
166
+ }}
167
+ ></Box>
168
+ <StyledTypography>
169
+ {tokenCoreColor[paletteKey]["dark4"]}
170
+ </StyledTypography>
171
+ </TableCell>
172
+ </TableRow>
173
+ )
174
+ )}
175
+ </TableBody>
176
+ </Table>
177
+ </TableContainer>
178
+ );
179
+ };
180
+
181
+ export default {
182
+ title: "Foundation/Colors/ColorToken",
183
+ component: CoreTokenColors,
184
+ } as ComponentMeta<typeof CoreTokenColors>;
185
+
186
+ const Template: ComponentStory<typeof CoreTokenColors> = () => (
187
+ <CoreTokenColors />
188
+ );
189
+
190
+ export const CoreTokens = Template.bind({});
@@ -0,0 +1,39 @@
1
+ import { Box, styled, Typography } from "@mui/material";
2
+
3
+ export const Container = styled(Box)({
4
+ display: "flex",
5
+ flexDirection: "column",
6
+ width: "100%",
7
+ });
8
+
9
+ export const PaletteContainer = styled(Box)({
10
+ display: "flex",
11
+ width: "100%",
12
+ flexWrap: "wrap",
13
+ });
14
+
15
+ export const ColorContainer = styled(Box)({
16
+ display: "flex",
17
+ flexDirection: "column",
18
+ alignItems: "center",
19
+ width: "84px",
20
+ marginRight: "20px",
21
+ marginBottom: "20px",
22
+ });
23
+
24
+ export const Color = styled(Box)({
25
+ width: "84px",
26
+ height: "84px",
27
+ borderRadius: "16px",
28
+ marginBottom: "4px",
29
+ display: "flex",
30
+ justifyContent: "center",
31
+ alignItems: "center",
32
+ border: "1px solid rgba(0, 0, 0, 0.03)",
33
+ });
34
+
35
+ export const StyledTypography = styled(Typography)(({ theme }) => ({
36
+ color: theme.palette.token.core.text_normal,
37
+ marginLeft: 8,
38
+ fontSize: "12px",
39
+ }));
package/src/theme.ts ADDED
@@ -0,0 +1,41 @@
1
+ import { deepmerge } from "@mui/utils";
2
+ import { ComponentsOverrides, createTheme } from "@mui/material";
3
+ import {
4
+ foundationCssBaseline,
5
+ palette,
6
+ typography,
7
+ typographyDefaultProps,
8
+ spacing,
9
+ } from "./foundation";
10
+ import { componentsCssBaseline } from "./components";
11
+
12
+ const theme = createTheme({
13
+ typography,
14
+ palette,
15
+ spacing,
16
+ components: {
17
+ MuiCssBaseline: deepmerge(foundationCssBaseline, componentsCssBaseline),
18
+ MuiPaper: {
19
+ styleOverrides: {
20
+ // css-in-js이기 때문에 MuiPaper-root class에만 추가해도
21
+ // Paper 컴포넌트를 쓰는 모든 스타일에서 명시도 역전이 발생하지 않음
22
+ root: {
23
+ boxShadow: "var(--elevation-shadow)",
24
+ },
25
+ },
26
+ },
27
+ MuiTooltip: {
28
+ styleOverrides: {
29
+ tooltip: {
30
+ boxShadow: "var(--elevation-shadow)",
31
+ },
32
+ },
33
+ },
34
+ MuiTypography: {
35
+ defaultProps: typographyDefaultProps,
36
+ },
37
+ // @todo add any MUI components theme exported from ./components/index.ts
38
+ },
39
+ });
40
+
41
+ export default theme;
package/src/types.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ declare module "*.mdx" {
2
+ const docs: any; // Add better type definitions here if desired.
3
+ export default docs;
4
+ }