@newtonschool/grauity 0.0.13 → 0.1.10

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/README.md +138 -9
  2. package/dist/fonts/grauity-icons.eot +0 -0
  3. package/dist/fonts/grauity-icons.ttf +0 -0
  4. package/dist/fonts/grauity-icons.woff +0 -0
  5. package/dist/fonts/grauity-icons.woff2 +0 -0
  6. package/dist/hooks/index.d.ts +4 -0
  7. package/dist/hooks/index.d.ts.map +1 -0
  8. package/dist/hooks/useClickAway.d.ts +15 -0
  9. package/dist/hooks/useClickAway.d.ts.map +1 -0
  10. package/dist/hooks/useDisableBodyScroll.d.ts +7 -0
  11. package/dist/hooks/useDisableBodyScroll.d.ts.map +1 -0
  12. package/dist/hooks/useKeyboardEvent.d.ts +17 -0
  13. package/dist/hooks/useKeyboardEvent.d.ts.map +1 -0
  14. package/dist/index.d.ts +830 -11
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/main.cjs +1 -1
  17. package/dist/main.cjs.map +1 -1
  18. package/dist/main.css +10 -1
  19. package/dist/main.css.map +1 -1
  20. package/dist/module.css +10 -1
  21. package/dist/module.css.map +1 -1
  22. package/dist/module.mjs +1 -1
  23. package/dist/module.mjs.map +1 -1
  24. package/dist/stories/atoms/Colors/FoundationColors.stories.d.ts +7 -0
  25. package/dist/stories/atoms/Colors/FoundationColors.stories.d.ts.map +1 -0
  26. package/dist/stories/atoms/Colors/index.stories.d.ts +18 -0
  27. package/dist/stories/atoms/Colors/index.stories.d.ts.map +1 -0
  28. package/dist/stories/atoms/CornerRadius/index.stories.d.ts +7 -0
  29. package/dist/stories/atoms/CornerRadius/index.stories.d.ts.map +1 -0
  30. package/dist/stories/atoms/Spacing/index.stories.d.ts +7 -0
  31. package/dist/stories/atoms/Spacing/index.stories.d.ts.map +1 -0
  32. package/dist/stories/decorators/withEnableBodyScroll.d.ts +8 -0
  33. package/dist/stories/decorators/withEnableBodyScroll.d.ts.map +1 -0
  34. package/dist/stories/decorators/withInlineContainer.d.ts +15 -0
  35. package/dist/stories/decorators/withInlineContainer.d.ts.map +1 -0
  36. package/dist/stories/elements/Alert/Gallery.stories.d.ts +30 -0
  37. package/dist/stories/elements/Alert/Gallery.stories.d.ts.map +1 -0
  38. package/dist/stories/elements/Alert/index.stories.d.ts +30 -0
  39. package/dist/stories/elements/Alert/index.stories.d.ts.map +1 -0
  40. package/dist/stories/elements/AlertBanner/Gallery.stories.d.ts +33 -0
  41. package/dist/stories/elements/AlertBanner/Gallery.stories.d.ts.map +1 -0
  42. package/dist/stories/elements/AlertBanner/index.stories.d.ts +30 -0
  43. package/dist/stories/elements/AlertBanner/index.stories.d.ts.map +1 -0
  44. package/dist/stories/elements/Button/Gallery.stories.d.ts +10 -0
  45. package/dist/stories/elements/Button/Gallery.stories.d.ts.map +1 -0
  46. package/dist/stories/elements/Button/index.stories.d.ts +9 -0
  47. package/dist/stories/elements/Button/index.stories.d.ts.map +1 -0
  48. package/dist/stories/elements/Icon/index.stories.d.ts +14 -0
  49. package/dist/stories/elements/Icon/index.stories.d.ts.map +1 -0
  50. package/dist/stories/elements/IconButton/Gallery.stories.d.ts +10 -0
  51. package/dist/stories/elements/IconButton/Gallery.stories.d.ts.map +1 -0
  52. package/dist/stories/elements/IconButton/index.stories.d.ts +9 -0
  53. package/dist/stories/elements/IconButton/index.stories.d.ts.map +1 -0
  54. package/dist/stories/elements/Modal/ConfirmationDialog.source.d.ts +3 -0
  55. package/dist/stories/elements/Modal/ConfirmationDialog.source.d.ts.map +1 -0
  56. package/dist/stories/elements/Modal/ConfirmationDialog.stories.d.ts +43 -0
  57. package/dist/stories/elements/Modal/ConfirmationDialog.stories.d.ts.map +1 -0
  58. package/dist/stories/elements/Modal/ConfirmationDialogWithTrigger.stories.d.ts +42 -0
  59. package/dist/stories/elements/Modal/ConfirmationDialogWithTrigger.stories.d.ts.map +1 -0
  60. package/dist/stories/elements/Modal/MultiStepModal.stories.d.ts +46 -0
  61. package/dist/stories/elements/Modal/MultiStepModal.stories.d.ts.map +1 -0
  62. package/dist/stories/elements/Modal/index.stories.d.ts +32 -0
  63. package/dist/stories/elements/Modal/index.stories.d.ts.map +1 -0
  64. package/dist/stories/elements/Modal/multiStepArgs.d.ts +4 -0
  65. package/dist/stories/elements/Modal/multiStepArgs.d.ts.map +1 -0
  66. package/dist/stories/elements/Modal/singleStepArgs.d.ts +4 -0
  67. package/dist/stories/elements/Modal/singleStepArgs.d.ts.map +1 -0
  68. package/dist/stories/elements/Table/Manual.source.d.ts +3 -0
  69. package/dist/stories/elements/Table/Manual.source.d.ts.map +1 -0
  70. package/dist/stories/elements/Table/Manual.stories.d.ts +54 -0
  71. package/dist/stories/elements/Table/Manual.stories.d.ts.map +1 -0
  72. package/dist/stories/elements/Table/ManualColumnNesting.source.d.ts +3 -0
  73. package/dist/stories/elements/Table/ManualColumnNesting.source.d.ts.map +1 -0
  74. package/dist/stories/elements/Table/ManualColumnNesting.stories.d.ts +53 -0
  75. package/dist/stories/elements/Table/ManualColumnNesting.stories.d.ts.map +1 -0
  76. package/dist/stories/elements/Table/index.stories.d.ts +46 -0
  77. package/dist/stories/elements/Table/index.stories.d.ts.map +1 -0
  78. package/dist/stories/elements/Table/simpleArgs.d.ts +4 -0
  79. package/dist/stories/elements/Table/simpleArgs.d.ts.map +1 -0
  80. package/dist/stories/elements/Typography/TypographyGallery.stories.d.ts +29 -0
  81. package/dist/stories/elements/Typography/TypographyGallery.stories.d.ts.map +1 -0
  82. package/dist/stories/elements/Typography/index.stories.d.ts +28 -0
  83. package/dist/stories/elements/Typography/index.stories.d.ts.map +1 -0
  84. package/dist/stories/helper-components/ColorRenderer/index.d.ts +15 -0
  85. package/dist/stories/helper-components/ColorRenderer/index.d.ts.map +1 -0
  86. package/dist/stories/helper-components/DocPageWithPlayground.d.ts +12 -0
  87. package/dist/stories/helper-components/DocPageWithPlayground.d.ts.map +1 -0
  88. package/dist/stories/helper-components/TokenBlock/index.d.ts +21 -0
  89. package/dist/stories/helper-components/TokenBlock/index.d.ts.map +1 -0
  90. package/dist/stories/helper-components/TokenBlock/index.styles.d.ts +4 -0
  91. package/dist/stories/helper-components/TokenBlock/index.styles.d.ts.map +1 -0
  92. package/dist/stories/utils/index.d.ts +82 -0
  93. package/dist/stories/utils/index.d.ts.map +1 -0
  94. package/dist/ui/core/colors/colorTypes.d.ts +1 -0
  95. package/dist/ui/core/colors/colorTypes.d.ts.map +1 -0
  96. package/dist/ui/core/colors/index.d.ts +1 -0
  97. package/dist/ui/core/colors/index.d.ts.map +1 -0
  98. package/dist/ui/core/icons/iconTags.d.ts.map +1 -0
  99. package/dist/ui/core/icons/iconTypes.d.ts.map +1 -0
  100. package/dist/{core → ui/core}/icons/index.d.ts +1 -1
  101. package/dist/ui/core/icons/index.d.ts.map +1 -0
  102. package/dist/ui/core/index.d.ts +7 -0
  103. package/dist/ui/core/index.d.ts.map +1 -0
  104. package/dist/ui/core/miscellaneous-choices/index.d.ts.map +1 -0
  105. package/dist/ui/core/miscellaneous-choices/miscellaneousTypes.d.ts.map +1 -0
  106. package/dist/ui/core/sizes/index.d.ts.map +1 -0
  107. package/dist/ui/core/sizes/sizeTypes.d.ts +3 -0
  108. package/dist/ui/core/sizes/sizeTypes.d.ts.map +1 -0
  109. package/dist/ui/elements/Alert/Alert.d.ts +8 -0
  110. package/dist/ui/elements/Alert/Alert.d.ts.map +1 -0
  111. package/dist/ui/elements/Alert/Alert.styles.d.ts +7 -0
  112. package/dist/ui/elements/Alert/Alert.styles.d.ts.map +1 -0
  113. package/dist/ui/elements/Alert/Alert.test.d.ts +2 -0
  114. package/dist/ui/elements/Alert/Alert.test.d.ts.map +1 -0
  115. package/dist/ui/elements/Alert/constants.d.ts +140 -0
  116. package/dist/ui/elements/Alert/constants.d.ts.map +1 -0
  117. package/dist/ui/elements/Alert/index.d.ts +7 -0
  118. package/dist/ui/elements/Alert/index.d.ts.map +1 -0
  119. package/dist/ui/elements/Alert/types.d.ts +125 -0
  120. package/dist/ui/elements/Alert/types.d.ts.map +1 -0
  121. package/dist/ui/elements/Alert/utils.d.ts +1 -0
  122. package/dist/ui/elements/Alert/utils.d.ts.map +1 -0
  123. package/dist/ui/elements/AlertBanner/AlertBanner.d.ts +9 -0
  124. package/dist/ui/elements/AlertBanner/AlertBanner.d.ts.map +1 -0
  125. package/dist/ui/elements/AlertBanner/AlertBanner.styles.d.ts +4 -0
  126. package/dist/ui/elements/AlertBanner/AlertBanner.styles.d.ts.map +1 -0
  127. package/dist/ui/elements/AlertBanner/AlertBanner.test.d.ts +2 -0
  128. package/dist/ui/elements/AlertBanner/AlertBanner.test.d.ts.map +1 -0
  129. package/dist/ui/elements/AlertBanner/constants.d.ts +140 -0
  130. package/dist/ui/elements/AlertBanner/constants.d.ts.map +1 -0
  131. package/dist/ui/elements/AlertBanner/index.d.ts +7 -0
  132. package/dist/ui/elements/AlertBanner/index.d.ts.map +1 -0
  133. package/dist/ui/elements/AlertBanner/types.d.ts +111 -0
  134. package/dist/ui/elements/AlertBanner/types.d.ts.map +1 -0
  135. package/dist/ui/elements/AlertBanner/utils.d.ts +105 -0
  136. package/dist/ui/elements/AlertBanner/utils.d.ts.map +1 -0
  137. package/dist/ui/elements/Button/Button.d.ts +11 -0
  138. package/dist/ui/elements/Button/Button.d.ts.map +1 -0
  139. package/dist/ui/elements/Button/Button.styles.d.ts +4 -0
  140. package/dist/ui/elements/Button/Button.styles.d.ts.map +1 -0
  141. package/dist/ui/elements/Button/Button.test.d.ts +2 -0
  142. package/dist/ui/elements/Button/Button.test.d.ts.map +1 -0
  143. package/dist/ui/elements/Button/ButtonGroup.d.ts +11 -0
  144. package/dist/ui/elements/Button/ButtonGroup.d.ts.map +1 -0
  145. package/dist/ui/elements/Button/ButtonGroup.styles.d.ts +2 -0
  146. package/dist/ui/elements/Button/ButtonGroup.styles.d.ts.map +1 -0
  147. package/dist/ui/elements/Button/IconButton.d.ts +8 -0
  148. package/dist/ui/elements/Button/IconButton.d.ts.map +1 -0
  149. package/dist/ui/elements/Button/IconButton.test.d.ts +2 -0
  150. package/dist/ui/elements/Button/IconButton.test.d.ts.map +1 -0
  151. package/dist/ui/elements/Button/constants.d.ts +54 -0
  152. package/dist/ui/elements/Button/constants.d.ts.map +1 -0
  153. package/dist/ui/elements/Button/index.d.ts +9 -0
  154. package/dist/ui/elements/Button/index.d.ts.map +1 -0
  155. package/dist/ui/elements/Button/types.d.ts +226 -0
  156. package/dist/ui/elements/Button/types.d.ts.map +1 -0
  157. package/dist/ui/elements/Button/utils.d.ts +1 -0
  158. package/dist/ui/elements/Button/utils.d.ts.map +1 -0
  159. package/dist/ui/elements/Icon/Icon.d.ts +48 -0
  160. package/dist/ui/elements/Icon/Icon.d.ts.map +1 -0
  161. package/dist/ui/elements/Icon/Icon.styles.d.ts +5 -0
  162. package/dist/ui/elements/Icon/Icon.styles.d.ts.map +1 -0
  163. package/dist/ui/elements/Icon/index.d.ts +3 -0
  164. package/dist/ui/elements/Icon/index.d.ts.map +1 -0
  165. package/dist/ui/elements/Icon/types.d.ts +74 -0
  166. package/dist/ui/elements/Icon/types.d.ts.map +1 -0
  167. package/dist/ui/elements/Modal/ConfirmationDialog/index.d.ts +43 -0
  168. package/dist/ui/elements/Modal/ConfirmationDialog/index.d.ts.map +1 -0
  169. package/dist/ui/elements/Modal/ConfirmationDialog/index.test.d.ts +2 -0
  170. package/dist/ui/elements/Modal/ConfirmationDialog/index.test.d.ts.map +1 -0
  171. package/dist/ui/elements/Modal/Modal.d.ts +21 -0
  172. package/dist/ui/elements/Modal/Modal.d.ts.map +1 -0
  173. package/dist/ui/elements/Modal/Modal.styles.d.ts +18 -0
  174. package/dist/ui/elements/Modal/Modal.styles.d.ts.map +1 -0
  175. package/dist/ui/elements/Modal/Modal.test.d.ts +2 -0
  176. package/dist/ui/elements/Modal/Modal.test.d.ts.map +1 -0
  177. package/dist/ui/elements/Modal/MultiStepModal/index.d.ts +46 -0
  178. package/dist/ui/elements/Modal/MultiStepModal/index.d.ts.map +1 -0
  179. package/dist/ui/elements/Modal/MultiStepModal/index.test.d.ts +2 -0
  180. package/dist/ui/elements/Modal/MultiStepModal/index.test.d.ts.map +1 -0
  181. package/dist/ui/elements/Modal/constants.d.ts +1 -0
  182. package/dist/ui/elements/Modal/constants.d.ts.map +1 -0
  183. package/dist/ui/elements/Modal/index.d.ts +5 -0
  184. package/dist/ui/elements/Modal/index.d.ts.map +1 -0
  185. package/dist/ui/elements/Modal/types.d.ts +312 -0
  186. package/dist/ui/elements/Modal/types.d.ts.map +1 -0
  187. package/dist/ui/elements/Modal/utils.d.ts +1 -0
  188. package/dist/ui/elements/Modal/utils.d.ts.map +1 -0
  189. package/dist/ui/elements/Table/Table.d.ts +47 -0
  190. package/dist/ui/elements/Table/Table.d.ts.map +1 -0
  191. package/dist/ui/elements/Table/Table.styles.d.ts +8 -0
  192. package/dist/ui/elements/Table/Table.styles.d.ts.map +1 -0
  193. package/dist/ui/elements/Table/Table.test.d.ts +2 -0
  194. package/dist/ui/elements/Table/Table.test.d.ts.map +1 -0
  195. package/dist/ui/elements/Table/constants.d.ts +1 -0
  196. package/dist/ui/elements/Table/constants.d.ts.map +1 -0
  197. package/dist/ui/elements/Table/index.d.ts +3 -0
  198. package/dist/ui/elements/Table/index.d.ts.map +1 -0
  199. package/dist/ui/elements/Table/types.d.ts +223 -0
  200. package/dist/ui/elements/Table/types.d.ts.map +1 -0
  201. package/dist/ui/elements/Table/utils.d.ts +1 -0
  202. package/dist/ui/elements/Table/utils.d.ts.map +1 -0
  203. package/dist/ui/elements/Typography/Typography.d.ts +36 -0
  204. package/dist/ui/elements/Typography/Typography.d.ts.map +1 -0
  205. package/dist/ui/elements/Typography/Typography.styles.d.ts +6 -0
  206. package/dist/ui/elements/Typography/Typography.styles.d.ts.map +1 -0
  207. package/dist/ui/elements/Typography/constants.d.ts +22 -0
  208. package/dist/ui/elements/Typography/constants.d.ts.map +1 -0
  209. package/dist/ui/elements/Typography/index.d.ts +5 -0
  210. package/dist/ui/elements/Typography/index.d.ts.map +1 -0
  211. package/dist/ui/elements/Typography/types.d.ts +50 -0
  212. package/dist/ui/elements/Typography/types.d.ts.map +1 -0
  213. package/dist/ui/elements/Typography/utils.d.ts +2 -0
  214. package/dist/ui/elements/Typography/utils.d.ts.map +1 -0
  215. package/dist/ui/helpers/classNameBuilders.d.ts.map +1 -0
  216. package/dist/ui/helpers/index.d.ts +3 -0
  217. package/dist/ui/helpers/index.d.ts.map +1 -0
  218. package/dist/ui/index.d.ts +11 -0
  219. package/dist/ui/index.d.ts.map +1 -0
  220. package/dist/{init → ui/init}/GrauityInit.d.ts +15 -3
  221. package/dist/ui/init/GrauityInit.d.ts.map +1 -0
  222. package/dist/ui/init/index.d.ts.map +1 -0
  223. package/dist/ui/themes/GlobalStyle.d.ts +5 -0
  224. package/dist/ui/themes/GlobalStyle.d.ts.map +1 -0
  225. package/dist/ui/themes/ThemeContext.d.ts +24 -0
  226. package/dist/ui/themes/ThemeContext.d.ts.map +1 -0
  227. package/dist/ui/themes/constants.d.ts +6 -0
  228. package/dist/ui/themes/constants.d.ts.map +1 -0
  229. package/dist/ui/themes/darkThemeConstants.d.ts +70 -0
  230. package/dist/ui/themes/darkThemeConstants.d.ts.map +1 -0
  231. package/dist/ui/themes/lightThemeConstants.d.ts +70 -0
  232. package/dist/ui/themes/lightThemeConstants.d.ts.map +1 -0
  233. package/dist/ui/themes/tokens.d.ts +1 -0
  234. package/dist/ui/themes/tokens.d.ts.map +1 -0
  235. package/dist/ui/themes/types.d.ts +73 -0
  236. package/dist/ui/themes/types.d.ts.map +1 -0
  237. package/package.json +53 -28
  238. package/ui/core/colors/colorTypes.ts +2 -20
  239. package/ui/core/colors/index.ts +23 -23
  240. package/ui/core/icons/index.ts +1 -3
  241. package/ui/core/index.ts +7 -10
  242. package/ui/core/sizes/sizeTypes.ts +1 -0
  243. package/ui/css/fonts.scss +0 -8
  244. package/ui/css/index.scss +0 -8
  245. package/ui/css/reset.scss +2 -5
  246. package/ui/elements/Alert/Alert.styles.ts +66 -0
  247. package/ui/elements/Alert/Alert.test.tsx +81 -0
  248. package/ui/elements/Alert/Alert.tsx +153 -0
  249. package/ui/elements/Alert/constants.ts +169 -0
  250. package/ui/elements/Alert/index.ts +6 -0
  251. package/ui/elements/Alert/types.ts +150 -0
  252. package/ui/elements/AlertBanner/AlertBanner.styles.ts +35 -0
  253. package/ui/elements/AlertBanner/AlertBanner.test.tsx +70 -0
  254. package/ui/elements/AlertBanner/AlertBanner.tsx +137 -0
  255. package/ui/elements/AlertBanner/constants.ts +179 -0
  256. package/ui/elements/AlertBanner/index.ts +6 -0
  257. package/ui/elements/AlertBanner/types.ts +133 -0
  258. package/ui/elements/AlertBanner/utils.ts +52 -0
  259. package/ui/elements/Button/Button.styles.ts +88 -0
  260. package/ui/elements/Button/Button.test.tsx +78 -0
  261. package/ui/elements/Button/Button.tsx +134 -0
  262. package/ui/elements/Button/ButtonGroup.styles.ts +7 -0
  263. package/ui/elements/Button/ButtonGroup.tsx +21 -0
  264. package/ui/elements/Button/IconButton.test.tsx +39 -0
  265. package/ui/elements/Button/IconButton.tsx +118 -0
  266. package/ui/elements/Button/constants.ts +304 -0
  267. package/ui/elements/Button/index.ts +8 -0
  268. package/ui/elements/Button/types.ts +282 -0
  269. package/ui/elements/Button/utils.ts +0 -0
  270. package/ui/elements/Icon/Icon.styles.ts +98 -0
  271. package/ui/elements/Icon/Icon.tsx +17 -107
  272. package/ui/elements/Icon/index.ts +1 -2
  273. package/ui/elements/Icon/types.ts +96 -0
  274. package/ui/elements/Modal/ConfirmationDialog/index.test.tsx +116 -0
  275. package/ui/elements/Modal/ConfirmationDialog/index.tsx +151 -0
  276. package/ui/elements/Modal/Modal.styles.ts +230 -0
  277. package/ui/elements/Modal/Modal.test.tsx +117 -0
  278. package/ui/elements/Modal/Modal.tsx +179 -0
  279. package/ui/elements/Modal/MultiStepModal/index.test.tsx +116 -0
  280. package/ui/elements/Modal/MultiStepModal/index.tsx +184 -0
  281. package/ui/elements/Modal/constants.ts +0 -0
  282. package/ui/elements/Modal/index.ts +4 -0
  283. package/ui/elements/Modal/types.ts +379 -0
  284. package/ui/elements/Modal/utils.tsx +0 -0
  285. package/ui/elements/Table/Table.styles.ts +178 -0
  286. package/ui/elements/Table/Table.test.tsx +72 -0
  287. package/ui/elements/Table/Table.tsx +118 -0
  288. package/ui/elements/Table/constants.ts +0 -0
  289. package/ui/elements/Table/index.ts +2 -0
  290. package/ui/elements/Table/types.ts +270 -0
  291. package/ui/elements/Table/utils.ts +0 -0
  292. package/ui/elements/Typography/Typography.styles.ts +29 -0
  293. package/ui/elements/Typography/Typography.tsx +70 -0
  294. package/ui/elements/Typography/constants.ts +292 -0
  295. package/ui/elements/Typography/index.ts +9 -0
  296. package/ui/elements/Typography/types.ts +116 -0
  297. package/ui/elements/Typography/utils.ts +11 -0
  298. package/ui/fonts/grauity-icons.eot +0 -0
  299. package/ui/fonts/grauity-icons.ttf +0 -0
  300. package/ui/fonts/grauity-icons.woff +0 -0
  301. package/ui/fonts/grauity-icons.woff2 +0 -0
  302. package/ui/helpers/index.ts +1 -7
  303. package/ui/index.ts +42 -3
  304. package/ui/init/GrauityInit.tsx +30 -7
  305. package/ui/init/index.ts +0 -1
  306. package/ui/themes/GlobalStyle.ts +273 -0
  307. package/ui/themes/ThemeContext.tsx +140 -0
  308. package/ui/themes/constants.ts +8 -0
  309. package/ui/themes/darkThemeConstants.ts +73 -0
  310. package/ui/themes/lightThemeConstants.ts +73 -0
  311. package/ui/themes/tokens.ts +0 -0
  312. package/ui/themes/types.ts +77 -0
  313. package/dist/core/colors/colorTypes.d.ts +0 -3
  314. package/dist/core/colors/colorTypes.d.ts.map +0 -1
  315. package/dist/core/colors/index.d.ts +0 -14
  316. package/dist/core/colors/index.d.ts.map +0 -1
  317. package/dist/core/icons/iconTags.d.ts.map +0 -1
  318. package/dist/core/icons/iconTypes.d.ts.map +0 -1
  319. package/dist/core/icons/index.d.ts.map +0 -1
  320. package/dist/core/index.d.ts +0 -9
  321. package/dist/core/index.d.ts.map +0 -1
  322. package/dist/core/miscellaneous-choices/index.d.ts.map +0 -1
  323. package/dist/core/miscellaneous-choices/miscellaneousTypes.d.ts.map +0 -1
  324. package/dist/core/sizes/index.d.ts.map +0 -1
  325. package/dist/core/sizes/sizeTypes.d.ts +0 -3
  326. package/dist/core/sizes/sizeTypes.d.ts.map +0 -1
  327. package/dist/elements/Icon/Icon.d.ts +0 -115
  328. package/dist/elements/Icon/Icon.d.ts.map +0 -1
  329. package/dist/elements/Icon/index.d.ts +0 -3
  330. package/dist/elements/Icon/index.d.ts.map +0 -1
  331. package/dist/elements/index.d.ts +0 -3
  332. package/dist/elements/index.d.ts.map +0 -1
  333. package/dist/helpers/classNameBuilders.d.ts.map +0 -1
  334. package/dist/helpers/getElementTypeFromProps.d.ts +0 -14
  335. package/dist/helpers/getElementTypeFromProps.d.ts.map +0 -1
  336. package/dist/helpers/index.d.ts +0 -4
  337. package/dist/helpers/index.d.ts.map +0 -1
  338. package/dist/init/GrauityInit.d.ts.map +0 -1
  339. package/dist/init/index.d.ts.map +0 -1
  340. package/ui/css/colors.scss +0 -131
  341. package/ui/css/icons.scss +0 -92
  342. package/ui/elements/index.ts +0 -2
  343. package/ui/helpers/getElementTypeFromProps.ts +0 -32
  344. /package/dist/{core → ui/core}/icons/iconTags.d.ts +0 -0
  345. /package/dist/{core → ui/core}/icons/iconTypes.d.ts +0 -0
  346. /package/dist/{core → ui/core}/miscellaneous-choices/index.d.ts +0 -0
  347. /package/dist/{core → ui/core}/miscellaneous-choices/miscellaneousTypes.d.ts +0 -0
  348. /package/dist/{core → ui/core}/sizes/index.d.ts +0 -0
  349. /package/dist/{helpers → ui/helpers}/classNameBuilders.d.ts +0 -0
  350. /package/dist/{init → ui/init}/index.d.ts +0 -0
  351. /package/ui/{css/sizes.scss → elements/Alert/utils.ts} +0 -0
@@ -0,0 +1,379 @@
1
+ import React from 'react';
2
+
3
+ import { ButtonVariants } from '../Button/types';
4
+
5
+ type ModalContentType = React.ReactNode;
6
+
7
+ interface ModalStep {
8
+ /**
9
+ * Banner for the modal, can be a valid React node
10
+ * */
11
+ banner?: ModalContentType;
12
+
13
+ /**
14
+ * Title for the modal, can be a valid React node
15
+ * */
16
+ title: ModalContentType;
17
+
18
+ /**
19
+ * Description for the modal, can be a string
20
+ * */
21
+ description?: string | null;
22
+
23
+ /**
24
+ * Body for the modal, can be a valid React node
25
+ * */
26
+ body?: ModalContentType;
27
+
28
+ /**
29
+ * Text for the next button
30
+ * */
31
+ nextButtonText?: string;
32
+
33
+ /**
34
+ * Determines if the back button should be shown
35
+ * Available choices: `true`, `false`
36
+ *
37
+ * Default: `false`
38
+ * */
39
+ showBackButton?: boolean;
40
+
41
+ /**
42
+ * Variant for the button
43
+ * */
44
+ buttonVariant?: ButtonVariants | null;
45
+ }
46
+
47
+ export interface ModalProps {
48
+ /**
49
+ * Banner for the modal, can be a valid React node
50
+ * */
51
+ banner?: ModalContentType;
52
+
53
+ /**
54
+ * Title for the modal, can be a valid React node
55
+ * */
56
+ title?: ModalContentType;
57
+
58
+ /**
59
+ * Description for the modal, can be a string
60
+ * */
61
+ description?: string;
62
+
63
+ /**
64
+ * Body for the modal, can be a valid React node
65
+ * */
66
+ body?: ModalContentType;
67
+
68
+ /**
69
+ * Action for the modal, can be a valid React node
70
+ * */
71
+ action?: ModalContentType;
72
+
73
+ /**
74
+ * Determines if the modal should hide on click away
75
+ * Available choices: `true`, `false`
76
+ *
77
+ * Default: `false`
78
+ * */
79
+ hideOnClickAway: boolean;
80
+
81
+ /**
82
+ * Determines if the modal should blur the background
83
+ * Available choices: `true`, `false`
84
+ *
85
+ * Default: `false`
86
+ * */
87
+ blurBackground?: boolean;
88
+
89
+ /**
90
+ * Callback function to be called when the modal is hidden
91
+ * */
92
+ onHide?: () => void;
93
+
94
+ /**
95
+ * Determines if the modal should be full width on mobile
96
+ * Available choices: `true`, `false`
97
+ *
98
+ * Default: `false`
99
+ * */
100
+ mobileBottomFullWidth?: boolean;
101
+
102
+ /**
103
+ * Padding for the modal
104
+ * */
105
+ modalPadding?: string;
106
+
107
+ /**
108
+ * Margin for the modal body
109
+ * */
110
+ modalBodyMargin?: string;
111
+
112
+ /**
113
+ * Width of the modal
114
+ * */
115
+ width?: string;
116
+
117
+ /**
118
+ * Height of the modal
119
+ * */
120
+ height?: string;
121
+
122
+ /**
123
+ * Minimum height of the modal
124
+ * */
125
+ minHeight?: string;
126
+
127
+ /**
128
+ * Determines if the close button should be shown
129
+ *
130
+ * Available choices: `true`, `false`
131
+ *
132
+ * Default: `false`
133
+ * */
134
+ showCloseButton?: boolean;
135
+ }
136
+
137
+ export interface MultiStepModalProps {
138
+ /**
139
+ * Modal steps
140
+ * */
141
+ modalSteps: ModalStep[];
142
+
143
+ /**
144
+ * Determines if the modal should show pagination if there are multiple modal steps
145
+ * Available choices: true, false
146
+ *
147
+ * Default: `true`
148
+ * */
149
+ showModalStepsPagination?: boolean;
150
+
151
+ /**
152
+ * Determines if the modal should hide on click away
153
+ * Available choices: true, false
154
+ *
155
+ * Default: `false`
156
+ * */
157
+ hideOnClickAway?: boolean;
158
+
159
+ /**
160
+ * Determines if the modal should blur the background
161
+ * Available choices: true, false
162
+ *
163
+ * Default: `false`
164
+ * */
165
+ blurBackground?: boolean;
166
+
167
+ /**
168
+ * Callback function to be called when the modal is hidden
169
+ * */
170
+ onHide?: () => void;
171
+
172
+ /**
173
+ * Callback function to be called when the final step is reached
174
+ * */
175
+ onFinalStep?: () => void;
176
+
177
+ /**
178
+ * Determines if the modal should be full width on mobile
179
+ * Available choices: true, false
180
+ *
181
+ * Default: `false`
182
+ * */
183
+ mobileBottomFullWidth?: boolean;
184
+
185
+ /**
186
+ * Callback function to be called when the step changes
187
+ * */
188
+ onStepChange?: () => void;
189
+
190
+ /**
191
+ * Determines if the modal buttons should be shown
192
+ * Available choices: true, false
193
+ *
194
+ * Default: `true`
195
+ * */
196
+ showModalButtons?: boolean;
197
+
198
+ /**
199
+ * Determines if the modal header should be shown
200
+ * Available choices: true, false
201
+ *
202
+ * Default: `true`
203
+ * */
204
+ showHeader?: boolean;
205
+
206
+ /**
207
+ * Padding for the modal
208
+ * */
209
+ modalPadding?: string;
210
+
211
+ /**
212
+ * Margin for the modal body
213
+ * */
214
+ modalBodyMargin?: string;
215
+
216
+ /**
217
+ * Width of the modal
218
+ * */
219
+ width?: string;
220
+
221
+ /**
222
+ * Height of the modal
223
+ * */
224
+ height?: string;
225
+
226
+ /**
227
+ * Minimum height of the modal
228
+ * */
229
+ minHeight?: string;
230
+
231
+ /**
232
+ * Determines if the close button should be shown
233
+ *
234
+ * Available choices: true, false
235
+ *
236
+ * NOTE: If Modal has a banner, the close button will be hidden by default
237
+ *
238
+ * Default: `false`
239
+ * */
240
+ showCloseButton?: boolean;
241
+ }
242
+
243
+ export interface StyleData {
244
+ position?: string;
245
+ backgroundColor?: string;
246
+ }
247
+
248
+ // Components interface for ModalWrapper
249
+ export interface ModalWrapperProps {
250
+ blurBackground?: boolean;
251
+ children: React.ReactNode;
252
+ }
253
+
254
+ // Components interface for ModalContainer
255
+ export interface ModalContainerProps {
256
+ width?: string;
257
+ height?: string;
258
+ minHeight?: string;
259
+ mobileBottomFullWidth?: boolean;
260
+ modalPadding?: string;
261
+ onClick?: (e: Event) => void;
262
+ ref?: React.MutableRefObject<any>;
263
+ children: React.ReactNode;
264
+ role: string;
265
+ }
266
+
267
+ // Components interface for ModalTitle
268
+ export interface ModalTitleProps {
269
+ id: string;
270
+ children: React.ReactNode;
271
+ }
272
+
273
+ // Components interface for ModalDescription
274
+ export interface ModalDescriptionProps {
275
+ id: string;
276
+ children: React.ReactNode;
277
+ }
278
+
279
+ // Components interface for ModalBody
280
+ export interface ModalBodyProps {
281
+ modalBodyMargin?: string;
282
+ children: React.ReactNode;
283
+ }
284
+
285
+ // Components interface for ModalBodyMain
286
+ export interface ModalBodyMainProps {
287
+ children: React.ReactNode;
288
+ }
289
+
290
+ // Components interface for ModalPaginationItemProps
291
+ export interface ModalPaginationItemProps {
292
+ key: string | number;
293
+ active: boolean;
294
+ onClick: () => void;
295
+ }
296
+
297
+ export interface ConfirmationDialogProps {
298
+ /**
299
+ * Text for the cancel button
300
+ * */
301
+ cancelText?: string;
302
+
303
+ /**
304
+ * Text for the confirm button
305
+ * */
306
+ confirmText?: string;
307
+
308
+ /**
309
+ * Callback function to be called when the cancel button is clicked
310
+ * */
311
+ onCancel: () => void;
312
+
313
+ /**
314
+ * Callback function to be called when the confirm button is clicked
315
+ * */
316
+ onConfirm: () => void;
317
+
318
+ /**
319
+ * Banner for the modal, can be a valid React node
320
+ * */
321
+ banner?: ModalContentType;
322
+
323
+ /**
324
+ * Title for the modal, can be a valid React node
325
+ * */
326
+ title?: ModalContentType;
327
+
328
+ /**
329
+ * Description for the modal, can be a string
330
+ * */
331
+ description?: string;
332
+
333
+ /**
334
+ * Body for the modal, can be a valid React node
335
+ * */
336
+ body?: ModalContentType;
337
+
338
+ /**
339
+ * Variant for the cancel button
340
+ * */
341
+ cancelButtonVariant?: ButtonVariants;
342
+
343
+ /**
344
+ * Variant for the confirm button
345
+ * */
346
+ confirmButtonVariant?: ButtonVariants;
347
+
348
+ /**
349
+ * Determines if the close button should be shown
350
+ * Available choices: `true`, `false`
351
+ *
352
+ * Default: `false`
353
+ * */
354
+ showCloseButton?: boolean;
355
+
356
+ /**
357
+ * Determines if the modal should hide on click away
358
+ * Available choices: `true`, `false`
359
+ *
360
+ * Default: `false`
361
+ * */
362
+ hideOnClickAway?: boolean;
363
+
364
+ /**
365
+ * Determines if the modal should blur the background
366
+ * Available choices: `true`, `false`
367
+ *
368
+ * Default: `false`
369
+ * */
370
+ blurBackground?: boolean;
371
+
372
+ /**
373
+ * Determines if the modal should be at bottom with full width on mobile
374
+ * Available choices: `true`, `false`
375
+ *
376
+ * Default: `false`
377
+ * */
378
+ mobileBottomFullWidth?: boolean;
379
+ }
File without changes
@@ -0,0 +1,178 @@
1
+ /* eslint-disable @typescript-eslint/no-use-before-define */
2
+ import styled, { css } from 'styled-components';
3
+
4
+ import {
5
+ TableBodyComponentProps,
6
+ TableComponentProps,
7
+ TableDataCellComponentProps,
8
+ TableHeadComponentProps,
9
+ TableHeadingCellComponentProps,
10
+ TableRowComponentProps,
11
+ } from './types';
12
+
13
+ export const StyledTableDataCell = styled.td<TableDataCellComponentProps>`
14
+ color: var(--text-primary, #16191d);
15
+ font-size: var(--font-size-12px, 12px);
16
+ font-weight: var(--font-weight-450, 450);
17
+ line-height: 120%;
18
+ letter-spacing: 0.4px;
19
+ padding: var(--spacing-10px, 10px);
20
+
21
+ &:last-of-type {
22
+ border-right: none;
23
+ }
24
+
25
+ ${({ align }) => align && `text-align: ${align};`}
26
+
27
+ ${({ flexAlign }) =>
28
+ flexAlign &&
29
+ css`
30
+ display: flex;
31
+ flex-direction: row;
32
+ align-items: ${flexAlign};
33
+ `}
34
+
35
+ ${({ vAlign }) => vAlign && `vertical-align: ${vAlign};`}
36
+ `;
37
+
38
+ export const StyledTableHeadingCell = styled.th<TableHeadingCellComponentProps>`
39
+ color: var(--text-secondary, #5b6271);
40
+ font-size: var(--font-size-12px, 12px);
41
+ font-weight: var(--font-weight-550, 550);
42
+ line-height: 120%;
43
+ letter-spacing: 0.4px;
44
+ padding: var(--spacing-10px, 10px);
45
+
46
+ ${({ align }) => `text-align: ${align};`}
47
+ `;
48
+
49
+ export const StyledTableRow = styled.tr<TableRowComponentProps>`
50
+ ${({ condensed }) =>
51
+ !condensed &&
52
+ css`
53
+ ${StyledTableDataCell} {
54
+ padding: 18px;
55
+ }
56
+ ${StyledTableHeadingCell} {
57
+ padding: 18px;
58
+ }
59
+ `}
60
+
61
+ &:last-of-type ${StyledTableDataCell}:first-of-type {
62
+ border-bottom-left-radius: var(--corner-radius-8px, 8px);
63
+ }
64
+
65
+ &:last-of-type ${StyledTableDataCell}:last-of-type {
66
+ border-bottom-right-radius: var(--corner-radius-8px, 8px);
67
+ }
68
+ `;
69
+
70
+ export const StyledTable = styled.table<TableComponentProps>`
71
+ border-collapse: collapse;
72
+ font-size: var(--font-size-12px, 12px);
73
+ width: 100%;
74
+ border-radius: var(--corner-radius-10px, 10px);
75
+ overflow: hidden;
76
+ outline: var(--spacing-1px, 1px) solid var(--border, #e1e5ea);
77
+ font-family: var(--font-family, 'Mona Sans');
78
+
79
+ ${StyledTableRow}:not(:last-child) {
80
+ border-bottom: var(--spacing-1px, 1px) solid var(--border, #e1e5ea);
81
+ }
82
+ ${StyledTableDataCell}:not(:last-child) {
83
+ border-right: var(--spacing-1px, 1px) solid var(--border, #e1e5ea);
84
+ }
85
+ ${StyledTableHeadingCell} {
86
+ border-right: var(--spacing-1px, 1px) solid var(--border, #e1e5ea);
87
+ border-bottom: var(--spacing-1px, 1px) solid var(--border, #e1e5ea);
88
+ }
89
+
90
+ ${({ borderAround }) =>
91
+ borderAround === false &&
92
+ css`
93
+ outline: none;
94
+ ${StyledTableDataCell}:last-of-type {
95
+ border-right: none;
96
+ }
97
+ `}
98
+
99
+ ${({ borderHorizontal }) =>
100
+ borderHorizontal === false &&
101
+ css`
102
+ ${StyledTableRow} {
103
+ border-bottom: none !important;
104
+ }
105
+ ${StyledTableDataCell} {
106
+ border-bottom: none;
107
+ }
108
+ ${StyledTableHeadingCell} {
109
+ border-bottom: none;
110
+ }
111
+ `}
112
+
113
+ ${({ borderVertical }) =>
114
+ borderVertical === false &&
115
+ css`
116
+ ${StyledTableRow} {
117
+ border-right: none !important;
118
+ }
119
+ ${StyledTableDataCell} {
120
+ border-right: none !important;
121
+ }
122
+ ${StyledTableHeadingCell} {
123
+ border-right: none;
124
+ }
125
+ `}
126
+
127
+ ${({ borderWithin }) =>
128
+ borderWithin === false &&
129
+ css`
130
+ ${StyledTableRow} {
131
+ border-bottom: none !important;
132
+ border-right: none !important;
133
+ }
134
+ ${StyledTableDataCell} {
135
+ border-bottom: none !important;
136
+ border-right: none !important;
137
+ }
138
+ ${StyledTableHeadingCell} {
139
+ border-bottom: none !important;
140
+ border-right: none !important;
141
+ }
142
+ `}
143
+
144
+
145
+ ${({ striped }) =>
146
+ striped &&
147
+ css`
148
+ ${StyledTableBody} ${StyledTableRow}:nth-child(even) {
149
+ background-color: var(--bg-secondary, #f6f7f9);
150
+ }
151
+ `}
152
+ `;
153
+
154
+ export const StyledTableHead = styled.thead<TableHeadComponentProps>`
155
+ background: var(--bg-secondary, #f6f7f9);
156
+
157
+ ${({ highlightHeaders }) =>
158
+ highlightHeaders === false && 'background: var(--bg-primary, #ffffff);'}
159
+
160
+ ${({ capitalizeHeaders }) =>
161
+ capitalizeHeaders !== false && 'text-transform: uppercase;'}
162
+
163
+ ${StyledTableRow} ${StyledTableHeadingCell}:last-child {
164
+ border-right: none;
165
+ }
166
+
167
+ ${StyledTableRow}:first-child ${StyledTableHeadingCell}:first-child {
168
+ border-top-left-radius: var(--corner-radius-8px, 8px);
169
+ }
170
+
171
+ ${StyledTableRow}:first-child ${StyledTableHeadingCell}&:last-child {
172
+ border-top-right-radius: var(--corner-radius-8px, 8px);
173
+ }
174
+ `;
175
+
176
+ export const StyledTableBody = styled.tbody<TableBodyComponentProps>`
177
+ background-color: var(--bg-primary, #fff);
178
+ `;
@@ -0,0 +1,72 @@
1
+ import '@testing-library/jest-dom';
2
+
3
+ import { render, screen } from '@testing-library/react';
4
+ import React from 'react';
5
+
6
+ import Table from '.';
7
+ import { TableProps } from './types';
8
+
9
+ describe('Table', () => {
10
+ const columns: TableProps['columns'] = [
11
+ { key: 'col1', display: 'Column 1' },
12
+ { key: 'col2', display: 'Column 2' },
13
+ { key: 'col3', display: 'Column 3' },
14
+ ];
15
+
16
+ const rows: TableProps['rows'] = [
17
+ {
18
+ col1: { display: 'Row 1, Cell 1' },
19
+ col2: { display: 'Row 1, Cell 2' },
20
+ col3: { display: 'Row 1, Cell 3' },
21
+ },
22
+ {
23
+ col1: { display: 'Row 2, Cell 1' },
24
+ col2: { display: 'Row 2, Cell 2' },
25
+ col3: { display: 'Row 2, Cell 3' },
26
+ },
27
+ ];
28
+
29
+ it('renders table with columns and rows', () => {
30
+ render(<Table columns={columns} rows={rows} />);
31
+
32
+ columns.forEach((column) => {
33
+ expect(screen.getByText(column.display)).toBeInTheDocument();
34
+ });
35
+
36
+ rows.forEach((row) => {
37
+ Object.values(row).forEach((cell) => {
38
+ expect(screen.getByText(cell.display as string)).toBeInTheDocument();
39
+ });
40
+ });
41
+ });
42
+
43
+
44
+ it('renders custom cell content using render function', () => {
45
+ const customRows: TableProps['rows'] = [
46
+ {
47
+ col1: { render: () => <span>Custom Cell 1</span> },
48
+ col2: { display: 'Row 1, Cell 2' },
49
+ col3: { display: 'Row 1, Cell 3' },
50
+ },
51
+ ];
52
+
53
+ render(<Table columns={columns} rows={customRows} />);
54
+
55
+ expect(screen.getByText('Custom Cell 1')).toBeInTheDocument();
56
+ });
57
+
58
+ it('applies custom styles and classes', () => {
59
+ render(
60
+ <Table
61
+ columns={columns}
62
+ rows={rows}
63
+ className="custom-class"
64
+ style={{ backgroundColor: 'red' }}
65
+ />
66
+ );
67
+
68
+ const tableElement = screen.getByRole('table');
69
+ expect(tableElement).toHaveClass('custom-class');
70
+ expect(tableElement).toHaveStyle('background-color: red');
71
+ });
72
+ });