@onewelcome/react-lib-components 6.7.1 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (387) hide show
  1. package/README.md +6 -0
  2. package/dist/cjs/DataGrid/DataGrid.cjs.js +1 -1
  3. package/dist/cjs/DataGrid/DataGrid.cjs.js.map +1 -1
  4. package/dist/cjs/DataGrid/DataGridBody/DataGridBody.cjs.js +1 -1
  5. package/dist/cjs/DataGrid/DataGridBody/DataGridBody.cjs.js.map +1 -1
  6. package/dist/cjs/DataGrid/DataGridBody/DataGridCell/DataGridCell.cjs.js +2 -0
  7. package/dist/cjs/DataGrid/DataGridBody/DataGridCell/DataGridCell.cjs.js.map +1 -0
  8. package/dist/cjs/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.cjs.js +2 -0
  9. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.cjs.js +2 -0
  10. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.cjs.js.map +1 -0
  11. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.cjs.js +2 -0
  12. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.cjs.js.map +1 -0
  13. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.cjs.js +2 -0
  14. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.cjs.js.map +1 -0
  15. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.cjs.js +2 -0
  16. package/dist/cjs/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.cjs.js.map +1 -0
  17. package/dist/cjs/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js +2 -0
  18. package/dist/cjs/DataGrid/DataGridBody/DataGridRow/DataGridRow.cjs.js.map +1 -0
  19. package/dist/cjs/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.cjs.js +2 -0
  20. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.cjs.js +2 -0
  21. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.cjs.js.map +1 -0
  22. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.module.cjs.js +2 -0
  23. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilter.module.cjs.js.map +1 -0
  24. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterPopover.cjs.js +2 -0
  25. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterPopover.cjs.js.map +1 -0
  26. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterService.cjs.js +2 -0
  27. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterService.cjs.js.map +1 -0
  28. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js +2 -0
  29. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilterTag.cjs.js.map +1 -0
  30. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilters.interfaces.cjs.js +2 -0
  31. package/dist/cjs/DataGrid/DataGridFilters/DataGridFilters.interfaces.cjs.js.map +1 -0
  32. package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.cjs.js +2 -0
  33. package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.cjs.js.map +1 -0
  34. package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.module.cjs.js +2 -0
  35. package/dist/cjs/DataGrid/DataGridFilters/DataGridToolbar.module.cjs.js.map +1 -0
  36. package/dist/cjs/DataGrid/DataGridHeader/DataGridHeader.cjs.js +1 -1
  37. package/dist/cjs/DataGrid/DataGridHeader/DataGridHeader.cjs.js.map +1 -1
  38. package/dist/cjs/Form/FileUpload/FileItem/FileItem.cjs.js +1 -1
  39. package/dist/cjs/Form/FileUpload/FileItem/FileItem.cjs.js.map +1 -1
  40. package/dist/cjs/Form/FileUpload/FileUpload.cjs.js +1 -1
  41. package/dist/cjs/Form/FileUpload/FileUpload.cjs.js.map +1 -1
  42. package/dist/cjs/Form/FileUpload/FileUpload.module.cjs.js +1 -1
  43. package/dist/cjs/Form/Select/MultiSelect/MultiOption.cjs.js +1 -1
  44. package/dist/cjs/Form/Select/MultiSelect/MultiOption.cjs.js.map +1 -1
  45. package/dist/cjs/Form/Select/MultiSelect/MultiSelect.cjs.js +1 -1
  46. package/dist/cjs/Form/Select/MultiSelect/MultiSelect.cjs.js.map +1 -1
  47. package/dist/cjs/Form/Select/MultiSelect/useSearch.cjs.js +1 -1
  48. package/dist/cjs/Form/Select/MultiSelect/useSearch.cjs.js.map +1 -1
  49. package/dist/cjs/Form/Select/SingleSelect/Select.cjs.js +1 -1
  50. package/dist/cjs/Form/Select/SingleSelect/Select.cjs.js.map +1 -1
  51. package/dist/cjs/Form/Select/SingleSelect/useSearch.cjs.js +1 -1
  52. package/dist/cjs/Form/Select/SingleSelect/useSearch.cjs.js.map +1 -1
  53. package/dist/cjs/Icon/Icon.cjs.js +1 -1
  54. package/dist/cjs/Icon/Icon.cjs.js.map +1 -1
  55. package/dist/cjs/Icon/Icon.module.cjs.js +1 -1
  56. package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.cjs.js +1 -1
  57. package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.cjs.js.map +1 -1
  58. package/dist/cjs/Layout/FormPage/FormWithStepper/FormWithStepper.module.cjs.js +1 -1
  59. package/dist/cjs/Notifications/NotificationProvider/NotificationContext.cjs.js +1 -1
  60. package/dist/cjs/Notifications/NotificationProvider/NotificationContext.cjs.js.map +1 -1
  61. package/dist/cjs/Pagination/Pagination.cjs.js +1 -1
  62. package/dist/cjs/Pagination/Pagination.cjs.js.map +1 -1
  63. package/dist/cjs/Popover/Popover.cjs.js +1 -1
  64. package/dist/cjs/Popover/Popover.cjs.js.map +1 -1
  65. package/dist/cjs/Tag/RemoveButton.module.cjs.js +1 -1
  66. package/dist/cjs/_BaseStyling_/BaseStyling.cjs.js +1 -1
  67. package/dist/cjs/_BaseStyling_/BaseStyling.cjs.js.map +1 -1
  68. package/dist/cjs/src/components/DataGrid/DataGrid.d.ts +6 -0
  69. package/dist/cjs/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.d.ts +5 -0
  70. package/dist/cjs/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.d.ts +6 -0
  71. package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridRow.d.ts → DataGridRow/DataGridRow.d.ts} +8 -1
  72. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilter.d.ts +15 -0
  73. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.d.ts +22 -0
  74. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilterService.d.ts +15 -0
  75. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilterTag.d.ts +12 -0
  76. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.d.ts +57 -0
  77. package/dist/cjs/src/components/DataGrid/DataGridFilters/DataGridToolbar.d.ts +13 -0
  78. package/dist/cjs/src/components/DataGrid/DataGridHeader/DataGridHeader.d.ts +1 -0
  79. package/dist/cjs/src/components/DataGrid/testUtils.d.ts +13 -0
  80. package/dist/cjs/src/components/Form/FileUpload/FileUpload.d.ts +2 -1
  81. package/dist/cjs/src/components/Form/Select/MultiSelect/MultiSelect.test.d.ts +2 -3
  82. package/dist/cjs/src/components/Form/Select/MultiSelect/useSearch.d.ts +2 -12
  83. package/dist/cjs/src/components/Form/Select/Select.interfaces.d.ts +1 -11
  84. package/dist/cjs/src/components/Form/Select/SingleSelect/Select.test.d.ts +2 -3
  85. package/dist/cjs/src/components/Form/Select/SingleSelect/useSearch.d.ts +2 -12
  86. package/dist/cjs/src/components/Form/Select/useSelectPositionList.d.ts +2 -2
  87. package/dist/cjs/src/components/Icon/Icon.d.ts +2 -1
  88. package/dist/cjs/src/components/_BaseStyling_/BaseStyling.d.ts +0 -26
  89. package/dist/cjs/src/hooks/useFullHeightCollapse.cjs.js +2 -0
  90. package/dist/cjs/src/hooks/useFullHeightCollapse.cjs.js.map +1 -0
  91. package/dist/cjs/src/hooks/useFullHeightCollapse.d.ts +4 -0
  92. package/dist/cjs/src/hooks/usePosition.cjs.js +1 -1
  93. package/dist/cjs/src/hooks/usePosition.cjs.js.map +1 -1
  94. package/dist/cjs/src/index.cjs.js +1 -1
  95. package/dist/cjs/src/index.d.ts +7 -21
  96. package/dist/esm/DataGrid/DataGrid.esm.js +1 -1
  97. package/dist/esm/DataGrid/DataGrid.esm.js.map +1 -1
  98. package/dist/esm/DataGrid/DataGridBody/DataGridBody.esm.js +1 -1
  99. package/dist/esm/DataGrid/DataGridBody/DataGridBody.esm.js.map +1 -1
  100. package/dist/esm/DataGrid/DataGridBody/DataGridCell/DataGridCell.esm.js +2 -0
  101. package/dist/esm/DataGrid/DataGridBody/DataGridCell/DataGridCell.esm.js.map +1 -0
  102. package/dist/esm/DataGrid/DataGridBody/DataGridCell/DataGridCell.module.esm.js +2 -0
  103. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.esm.js +2 -0
  104. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.esm.js.map +1 -0
  105. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.esm.js +2 -0
  106. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.esm.js.map +1 -0
  107. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.esm.js +2 -0
  108. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.esm.js.map +1 -0
  109. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.esm.js +2 -0
  110. package/dist/esm/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.esm.js.map +1 -0
  111. package/dist/esm/DataGrid/DataGridBody/DataGridRow/DataGridRow.esm.js +2 -0
  112. package/dist/esm/DataGrid/DataGridBody/DataGridRow/DataGridRow.esm.js.map +1 -0
  113. package/dist/esm/DataGrid/DataGridBody/DataGridRow/DataGridRow.module.esm.js +2 -0
  114. package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.esm.js +2 -0
  115. package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.esm.js.map +1 -0
  116. package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.module.esm.js +2 -0
  117. package/dist/esm/DataGrid/DataGridFilters/DataGridFilter.module.esm.js.map +1 -0
  118. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterPopover.esm.js +2 -0
  119. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterPopover.esm.js.map +1 -0
  120. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterService.esm.js +2 -0
  121. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterService.esm.js.map +1 -0
  122. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterTag.esm.js +2 -0
  123. package/dist/esm/DataGrid/DataGridFilters/DataGridFilterTag.esm.js.map +1 -0
  124. package/dist/esm/DataGrid/DataGridFilters/DataGridFilters.interfaces.esm.js +2 -0
  125. package/dist/esm/DataGrid/DataGridFilters/DataGridFilters.interfaces.esm.js.map +1 -0
  126. package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.esm.js +2 -0
  127. package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.esm.js.map +1 -0
  128. package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.module.esm.js +2 -0
  129. package/dist/esm/DataGrid/DataGridFilters/DataGridToolbar.module.esm.js.map +1 -0
  130. package/dist/esm/DataGrid/DataGridHeader/DataGridHeader.esm.js +1 -1
  131. package/dist/esm/DataGrid/DataGridHeader/DataGridHeader.esm.js.map +1 -1
  132. package/dist/esm/Form/FileUpload/FileItem/FileItem.esm.js +1 -1
  133. package/dist/esm/Form/FileUpload/FileItem/FileItem.esm.js.map +1 -1
  134. package/dist/esm/Form/FileUpload/FileUpload.esm.js +1 -1
  135. package/dist/esm/Form/FileUpload/FileUpload.esm.js.map +1 -1
  136. package/dist/esm/Form/FileUpload/FileUpload.module.esm.js +1 -1
  137. package/dist/esm/Form/Select/MultiSelect/MultiOption.esm.js +1 -1
  138. package/dist/esm/Form/Select/MultiSelect/MultiOption.esm.js.map +1 -1
  139. package/dist/esm/Form/Select/MultiSelect/MultiSelect.esm.js +1 -1
  140. package/dist/esm/Form/Select/MultiSelect/MultiSelect.esm.js.map +1 -1
  141. package/dist/esm/Form/Select/MultiSelect/useSearch.esm.js +1 -1
  142. package/dist/esm/Form/Select/MultiSelect/useSearch.esm.js.map +1 -1
  143. package/dist/esm/Form/Select/SingleSelect/Select.esm.js +1 -1
  144. package/dist/esm/Form/Select/SingleSelect/Select.esm.js.map +1 -1
  145. package/dist/esm/Form/Select/SingleSelect/useSearch.esm.js +1 -1
  146. package/dist/esm/Form/Select/SingleSelect/useSearch.esm.js.map +1 -1
  147. package/dist/esm/Icon/Icon.esm.js +1 -1
  148. package/dist/esm/Icon/Icon.esm.js.map +1 -1
  149. package/dist/esm/Icon/Icon.module.esm.js +1 -1
  150. package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.esm.js +1 -1
  151. package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.esm.js.map +1 -1
  152. package/dist/esm/Layout/FormPage/FormWithStepper/FormWithStepper.module.esm.js +1 -1
  153. package/dist/esm/Notifications/NotificationProvider/NotificationContext.esm.js +1 -1
  154. package/dist/esm/Notifications/NotificationProvider/NotificationContext.esm.js.map +1 -1
  155. package/dist/esm/Pagination/Pagination.esm.js +1 -1
  156. package/dist/esm/Pagination/Pagination.esm.js.map +1 -1
  157. package/dist/esm/Popover/Popover.esm.js +1 -1
  158. package/dist/esm/Popover/Popover.esm.js.map +1 -1
  159. package/dist/esm/Tag/RemoveButton.module.esm.js +1 -1
  160. package/dist/esm/_BaseStyling_/BaseStyling.esm.js +1 -1
  161. package/dist/esm/_BaseStyling_/BaseStyling.esm.js.map +1 -1
  162. package/dist/esm/src/components/DataGrid/DataGrid.d.ts +6 -0
  163. package/dist/esm/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.d.ts +5 -0
  164. package/dist/esm/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.d.ts +6 -0
  165. package/dist/esm/src/components/DataGrid/DataGridBody/{DataGridRow.d.ts → DataGridRow/DataGridRow.d.ts} +8 -1
  166. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilter.d.ts +15 -0
  167. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.d.ts +22 -0
  168. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilterService.d.ts +15 -0
  169. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilterTag.d.ts +12 -0
  170. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.d.ts +57 -0
  171. package/dist/esm/src/components/DataGrid/DataGridFilters/DataGridToolbar.d.ts +13 -0
  172. package/dist/esm/src/components/DataGrid/DataGridHeader/DataGridHeader.d.ts +1 -0
  173. package/dist/esm/src/components/DataGrid/testUtils.d.ts +13 -0
  174. package/dist/esm/src/components/Form/FileUpload/FileUpload.d.ts +2 -1
  175. package/dist/esm/src/components/Form/Select/MultiSelect/MultiSelect.test.d.ts +2 -3
  176. package/dist/esm/src/components/Form/Select/MultiSelect/useSearch.d.ts +2 -12
  177. package/dist/esm/src/components/Form/Select/Select.interfaces.d.ts +1 -11
  178. package/dist/esm/src/components/Form/Select/SingleSelect/Select.test.d.ts +2 -3
  179. package/dist/esm/src/components/Form/Select/SingleSelect/useSearch.d.ts +2 -12
  180. package/dist/esm/src/components/Form/Select/useSelectPositionList.d.ts +2 -2
  181. package/dist/esm/src/components/Icon/Icon.d.ts +2 -1
  182. package/dist/esm/src/components/_BaseStyling_/BaseStyling.d.ts +0 -26
  183. package/dist/esm/src/hooks/useFullHeightCollapse.d.ts +4 -0
  184. package/dist/esm/src/hooks/useFullHeightCollapse.esm.js +2 -0
  185. package/dist/esm/src/hooks/useFullHeightCollapse.esm.js.map +1 -0
  186. package/dist/esm/src/hooks/usePosition.esm.js +1 -1
  187. package/dist/esm/src/hooks/usePosition.esm.js.map +1 -1
  188. package/dist/esm/src/index.d.ts +7 -21
  189. package/dist/esm/src/index.esm.js +1 -1
  190. package/package.json +50 -49
  191. package/src/components/DataGrid/DataGrid.tsx +24 -10
  192. package/src/components/DataGrid/DataGridBody/DataGridBody.tsx +2 -2
  193. package/src/components/DataGrid/DataGridBody/{DataGridCell.module.scss → DataGridCell/DataGridCell.module.scss} +2 -2
  194. package/src/components/DataGrid/DataGridBody/{DataGridCell.tsx → DataGridCell/DataGridCell.tsx} +1 -1
  195. package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.module.scss +60 -0
  196. package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawer.tsx +39 -0
  197. package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.module.scss +21 -0
  198. package/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.tsx +47 -0
  199. package/src/components/DataGrid/DataGridBody/{DataGridRow.module.scss → DataGridRow/DataGridRow.module.scss} +17 -1
  200. package/src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.tsx +122 -0
  201. package/src/components/DataGrid/DataGridBody/__snapshots__/DataGridBody.test.tsx.snap +4 -4
  202. package/src/components/DataGrid/DataGridFilters/DataGridFilter.module.scss +105 -0
  203. package/src/components/DataGrid/DataGridFilters/DataGridFilter.tsx +150 -0
  204. package/src/components/DataGrid/DataGridFilters/DataGridFilterPopover.tsx +181 -0
  205. package/src/components/DataGrid/DataGridFilters/DataGridFilterService.ts +97 -0
  206. package/src/components/DataGrid/DataGridFilters/DataGridFilterTag.tsx +91 -0
  207. package/src/components/DataGrid/DataGridFilters/DataGridFilters.interfaces.ts +84 -0
  208. package/src/components/{Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.scss → DataGrid/DataGridFilters/DataGridToolbar.module.scss} +27 -34
  209. package/src/components/DataGrid/DataGridFilters/DataGridToolbar.tsx +126 -0
  210. package/src/components/DataGrid/DataGridHeader/DataGridHeader.tsx +6 -1
  211. package/src/components/DataGrid/testUtils.ts +77 -0
  212. package/src/components/Form/FileUpload/FileItem/FileItem.tsx +5 -8
  213. package/src/components/Form/FileUpload/FileUpload.module.scss +9 -4
  214. package/src/components/Form/FileUpload/FileUpload.tsx +34 -15
  215. package/src/components/Form/Select/MultiSelect/MultiOption.tsx +4 -2
  216. package/src/components/Form/Select/MultiSelect/MultiSelect.tsx +1 -5
  217. package/src/components/Form/Select/MultiSelect/useSearch.tsx +6 -16
  218. package/src/components/Form/Select/Select.interfaces.ts +1 -9
  219. package/src/components/Form/Select/SingleSelect/Select.tsx +1 -5
  220. package/src/components/Form/Select/SingleSelect/useSearch.tsx +6 -18
  221. package/src/components/Icon/Icon.module.scss +5 -0
  222. package/src/components/Icon/Icon.tsx +2 -1
  223. package/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.module.scss +12 -15
  224. package/src/components/Layout/FormPage/FormWithStepper/FormWithStepper.tsx +3 -5
  225. package/src/components/Notifications/NotificationProvider/NotificationContext.tsx +12 -16
  226. package/src/components/Pagination/Pagination.tsx +15 -6
  227. package/src/components/Popover/Popover.tsx +1 -1
  228. package/src/components/Tag/RemoveButton.module.scss +1 -0
  229. package/src/components/_BaseStyling_/BaseStyling.tsx +0 -36
  230. package/src/font/icomoon.eot +0 -0
  231. package/src/font/icomoon.svg +1 -0
  232. package/src/font/icomoon.ttf +0 -0
  233. package/src/font/icomoon.woff +0 -0
  234. package/src/font/selection.json +1 -1
  235. package/src/{components/Notifications/Snackbar/useSnackbar.ts → hooks/useFullHeightCollapse.ts} +12 -11
  236. package/src/hooks/usePosition.ts +3 -4
  237. package/src/index.ts +7 -25
  238. package/dist/cjs/DataGrid/DataGridBody/DataGridCell.cjs.js +0 -2
  239. package/dist/cjs/DataGrid/DataGridBody/DataGridCell.cjs.js.map +0 -1
  240. package/dist/cjs/DataGrid/DataGridBody/DataGridCell.module.cjs.js +0 -2
  241. package/dist/cjs/DataGrid/DataGridBody/DataGridRow.cjs.js +0 -2
  242. package/dist/cjs/DataGrid/DataGridBody/DataGridRow.cjs.js.map +0 -1
  243. package/dist/cjs/DataGrid/DataGridBody/DataGridRow.module.cjs.js +0 -2
  244. package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.cjs.js +0 -2
  245. package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.cjs.js.map +0 -1
  246. package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.cjs.js +0 -2
  247. package/dist/cjs/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.cjs.js.map +0 -1
  248. package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.cjs.js +0 -2
  249. package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.cjs.js.map +0 -1
  250. package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.cjs.js +0 -2
  251. package/dist/cjs/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.cjs.js.map +0 -1
  252. package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.cjs.js +0 -2
  253. package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.cjs.js.map +0 -1
  254. package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.cjs.js +0 -2
  255. package/dist/cjs/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.cjs.js.map +0 -1
  256. package/dist/cjs/Notifications/Snackbar/interfaces.cjs.js +0 -2
  257. package/dist/cjs/Notifications/Snackbar/interfaces.cjs.js.map +0 -1
  258. package/dist/cjs/Notifications/Snackbar/useSnackbar.cjs.js +0 -2
  259. package/dist/cjs/Notifications/Snackbar/useSnackbar.cjs.js.map +0 -1
  260. package/dist/cjs/StatusIndicator/StatusIndicator.cjs.js +0 -2
  261. package/dist/cjs/StatusIndicator/StatusIndicator.cjs.js.map +0 -1
  262. package/dist/cjs/StatusIndicator/StatusIndicator.module.cjs.js +0 -2
  263. package/dist/cjs/StatusIndicator/StatusIndicator.module.cjs.js.map +0 -1
  264. package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.cjs.js +0 -2
  265. package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.cjs.js.map +0 -1
  266. package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.module.cjs.js +0 -2
  267. package/dist/cjs/Wizard/BaseWizardSteps/BaseWizardSteps.module.cjs.js.map +0 -1
  268. package/dist/cjs/Wizard/Wizard.cjs.js +0 -2
  269. package/dist/cjs/Wizard/Wizard.cjs.js.map +0 -1
  270. package/dist/cjs/Wizard/WizardActions/WizardActions.cjs.js +0 -2
  271. package/dist/cjs/Wizard/WizardActions/WizardActions.cjs.js.map +0 -1
  272. package/dist/cjs/Wizard/WizardStateProvider.cjs.js +0 -2
  273. package/dist/cjs/Wizard/WizardStateProvider.cjs.js.map +0 -1
  274. package/dist/cjs/Wizard/WizardSteps/WizardSteps.cjs.js +0 -2
  275. package/dist/cjs/Wizard/WizardSteps/WizardSteps.cjs.js.map +0 -1
  276. package/dist/cjs/Wizard/wizardStateReducer.cjs.js +0 -2
  277. package/dist/cjs/Wizard/wizardStateReducer.cjs.js.map +0 -1
  278. package/dist/cjs/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +0 -21
  279. package/dist/cjs/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +0 -20
  280. package/dist/cjs/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +0 -39
  281. package/dist/cjs/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +0 -27
  282. package/dist/cjs/src/components/Notifications/Snackbar/interfaces.d.ts +0 -36
  283. package/dist/cjs/src/components/Notifications/Snackbar/useSnackbar.d.ts +0 -9
  284. package/dist/cjs/src/components/StatusIndicator/StatusIndicator.d.ts +0 -9
  285. package/dist/cjs/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +0 -12
  286. package/dist/cjs/src/components/Wizard/Wizard.d.ts +0 -11
  287. package/dist/cjs/src/components/Wizard/WizardActions/WizardActions.d.ts +0 -25
  288. package/dist/cjs/src/components/Wizard/WizardStateProvider.d.ts +0 -15
  289. package/dist/cjs/src/components/Wizard/WizardSteps/WizardSteps.d.ts +0 -8
  290. package/dist/cjs/src/components/Wizard/WizardSteps/WizardSteps.test.d.ts +0 -1
  291. package/dist/cjs/src/components/Wizard/wizardStateReducer.d.ts +0 -24
  292. package/dist/esm/DataGrid/DataGridBody/DataGridCell.esm.js +0 -2
  293. package/dist/esm/DataGrid/DataGridBody/DataGridCell.esm.js.map +0 -1
  294. package/dist/esm/DataGrid/DataGridBody/DataGridCell.module.esm.js +0 -2
  295. package/dist/esm/DataGrid/DataGridBody/DataGridRow.esm.js +0 -2
  296. package/dist/esm/DataGrid/DataGridBody/DataGridRow.esm.js.map +0 -1
  297. package/dist/esm/DataGrid/DataGridBody/DataGridRow.module.esm.js +0 -2
  298. package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.esm.js +0 -2
  299. package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.esm.js.map +0 -1
  300. package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.esm.js +0 -2
  301. package/dist/esm/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.esm.js.map +0 -1
  302. package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.esm.js +0 -2
  303. package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.esm.js.map +0 -1
  304. package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.esm.js +0 -2
  305. package/dist/esm/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.esm.js.map +0 -1
  306. package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.esm.js +0 -2
  307. package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.esm.js.map +0 -1
  308. package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.esm.js +0 -2
  309. package/dist/esm/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.esm.js.map +0 -1
  310. package/dist/esm/Notifications/Snackbar/interfaces.esm.js +0 -2
  311. package/dist/esm/Notifications/Snackbar/interfaces.esm.js.map +0 -1
  312. package/dist/esm/Notifications/Snackbar/useSnackbar.esm.js +0 -2
  313. package/dist/esm/Notifications/Snackbar/useSnackbar.esm.js.map +0 -1
  314. package/dist/esm/StatusIndicator/StatusIndicator.esm.js +0 -2
  315. package/dist/esm/StatusIndicator/StatusIndicator.esm.js.map +0 -1
  316. package/dist/esm/StatusIndicator/StatusIndicator.module.esm.js +0 -2
  317. package/dist/esm/StatusIndicator/StatusIndicator.module.esm.js.map +0 -1
  318. package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.esm.js +0 -2
  319. package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.esm.js.map +0 -1
  320. package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.module.esm.js +0 -2
  321. package/dist/esm/Wizard/BaseWizardSteps/BaseWizardSteps.module.esm.js.map +0 -1
  322. package/dist/esm/Wizard/Wizard.esm.js +0 -2
  323. package/dist/esm/Wizard/Wizard.esm.js.map +0 -1
  324. package/dist/esm/Wizard/WizardActions/WizardActions.esm.js +0 -2
  325. package/dist/esm/Wizard/WizardActions/WizardActions.esm.js.map +0 -1
  326. package/dist/esm/Wizard/WizardStateProvider.esm.js +0 -2
  327. package/dist/esm/Wizard/WizardStateProvider.esm.js.map +0 -1
  328. package/dist/esm/Wizard/WizardSteps/WizardSteps.esm.js +0 -2
  329. package/dist/esm/Wizard/WizardSteps/WizardSteps.esm.js.map +0 -1
  330. package/dist/esm/Wizard/wizardStateReducer.esm.js +0 -2
  331. package/dist/esm/Wizard/wizardStateReducer.esm.js.map +0 -1
  332. package/dist/esm/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +0 -21
  333. package/dist/esm/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.d.ts +0 -1
  334. package/dist/esm/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.d.ts +0 -20
  335. package/dist/esm/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.test.d.ts +0 -1
  336. package/dist/esm/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +0 -39
  337. package/dist/esm/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.d.ts +0 -1
  338. package/dist/esm/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +0 -27
  339. package/dist/esm/src/components/Notifications/Snackbar/interfaces.d.ts +0 -36
  340. package/dist/esm/src/components/Notifications/Snackbar/useSnackbar.d.ts +0 -9
  341. package/dist/esm/src/components/Notifications/Snackbar/useSnackbar.test.d.ts +0 -1
  342. package/dist/esm/src/components/StatusIndicator/StatusIndicator.d.ts +0 -9
  343. package/dist/esm/src/components/StatusIndicator/StatusIndicator.test.d.ts +0 -1
  344. package/dist/esm/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +0 -12
  345. package/dist/esm/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.test.d.ts +0 -1
  346. package/dist/esm/src/components/Wizard/Wizard.d.ts +0 -11
  347. package/dist/esm/src/components/Wizard/Wizard.test.d.ts +0 -1
  348. package/dist/esm/src/components/Wizard/WizardActions/WizardActions.d.ts +0 -25
  349. package/dist/esm/src/components/Wizard/WizardActions/WizardActions.test.d.ts +0 -1
  350. package/dist/esm/src/components/Wizard/WizardStateProvider.d.ts +0 -15
  351. package/dist/esm/src/components/Wizard/WizardSteps/WizardSteps.d.ts +0 -8
  352. package/dist/esm/src/components/Wizard/WizardSteps/WizardSteps.test.d.ts +0 -1
  353. package/dist/esm/src/components/Wizard/wizardStateReducer.d.ts +0 -24
  354. package/src/components/DataGrid/DataGridBody/DataGridRow.tsx +0 -58
  355. package/src/components/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.tsx +0 -92
  356. package/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.scss +0 -156
  357. package/src/components/Notifications/Snackbar/SnackbarItem/SnackbarItem.tsx +0 -161
  358. package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.tsx +0 -219
  359. package/src/components/Notifications/Snackbar/SnackbarProvider/SnackbarStateProvider.tsx +0 -57
  360. package/src/components/Notifications/Snackbar/interfaces.ts +0 -62
  361. package/src/components/StatusIndicator/StatusIndicator.module.scss +0 -43
  362. package/src/components/StatusIndicator/StatusIndicator.tsx +0 -44
  363. package/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.module.scss +0 -214
  364. package/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.tsx +0 -93
  365. package/src/components/Wizard/Wizard.tsx +0 -67
  366. package/src/components/Wizard/WizardActions/WizardActions.tsx +0 -116
  367. package/src/components/Wizard/WizardStateProvider.tsx +0 -45
  368. package/src/components/Wizard/WizardSteps/WizardSteps.tsx +0 -54
  369. package/src/components/Wizard/wizardStateReducer.ts +0 -61
  370. /package/dist/cjs/DataGrid/DataGridBody/{DataGridCell.module.cjs.js.map → DataGridCell/DataGridCell.module.cjs.js.map} +0 -0
  371. /package/dist/cjs/DataGrid/DataGridBody/{DataGridRow.module.cjs.js.map → DataGridRow/DataGridRow.module.cjs.js.map} +0 -0
  372. /package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridCell.d.ts → DataGridCell/DataGridCell.d.ts} +0 -0
  373. /package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridCell.test.d.ts → DataGridCell/DataGridCell.test.d.ts} +0 -0
  374. /package/dist/cjs/src/components/DataGrid/DataGridBody/{DataGridRow.test.d.ts → DataGridDrawer/DataGridDrawerItem.test.d.ts} +0 -0
  375. /package/dist/{esm/src/components/DataGrid/DataGridBody → cjs/src/components/DataGrid/DataGridBody/DataGridRow}/DataGridRow.test.d.ts +0 -0
  376. /package/dist/cjs/src/components/{Notifications/Snackbar/SnackbarContainer/SnackbarContainer.test.d.ts → DataGrid/DataGridFilters/DataGridFilterTag.test.d.ts} +0 -0
  377. /package/dist/cjs/src/components/{Notifications/Snackbar/SnackbarItem/SnackbarItem.test.d.ts → DataGrid/DataGridFilters/DataGridToolbar.test.d.ts} +0 -0
  378. /package/dist/cjs/src/{components/Notifications/Snackbar/SnackbarProvider/SnackbarProvider.test.d.ts → hooks/useFullHeightCollapse.test.d.ts} +0 -0
  379. /package/dist/esm/DataGrid/DataGridBody/{DataGridCell.module.esm.js.map → DataGridCell/DataGridCell.module.esm.js.map} +0 -0
  380. /package/dist/esm/DataGrid/DataGridBody/{DataGridRow.module.esm.js.map → DataGridRow/DataGridRow.module.esm.js.map} +0 -0
  381. /package/dist/esm/src/components/DataGrid/DataGridBody/{DataGridCell.d.ts → DataGridCell/DataGridCell.d.ts} +0 -0
  382. /package/dist/esm/src/components/DataGrid/DataGridBody/{DataGridCell.test.d.ts → DataGridCell/DataGridCell.test.d.ts} +0 -0
  383. /package/dist/{cjs/src/components/Notifications/Snackbar/useSnackbar.test.d.ts → esm/src/components/DataGrid/DataGridBody/DataGridDrawer/DataGridDrawerItem.test.d.ts} +0 -0
  384. /package/dist/{cjs/src/components/StatusIndicator/StatusIndicator.test.d.ts → esm/src/components/DataGrid/DataGridBody/DataGridRow/DataGridRow.test.d.ts} +0 -0
  385. /package/dist/{cjs/src/components/Wizard/BaseWizardSteps/BaseWizardSteps.test.d.ts → esm/src/components/DataGrid/DataGridFilters/DataGridFilterTag.test.d.ts} +0 -0
  386. /package/dist/{cjs/src/components/Wizard/Wizard.test.d.ts → esm/src/components/DataGrid/DataGridFilters/DataGridToolbar.test.d.ts} +0 -0
  387. /package/dist/{cjs/src/components/Wizard/WizardActions/WizardActions.test.d.ts → esm/src/hooks/useFullHeightCollapse.test.d.ts} +0 -0
@@ -1,161 +0,0 @@
1
- /*
2
- * Copyright 2022 OneWelcome B.V.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import React, { useContext, useEffect, useRef } from "react";
18
- import { IconButton } from "../../../Button/IconButton";
19
- import { Icon, Icons } from "../../../Icon/Icon";
20
- import { Variant, Actions } from "../interfaces";
21
- import classes from "./SnackbarItem.module.scss";
22
- import readyclasses from "../../../../readyclasses.module.scss";
23
- import { useAnimation } from "../../../../hooks/useAnimation";
24
- import { Typography } from "../../../Typography/Typography";
25
- import { SnackbarContext } from "../SnackbarProvider/SnackbarStateProvider";
26
-
27
- const textColor = "var(--snackbar-text-color)";
28
-
29
- /**
30
- * @deprecated
31
- */
32
- export interface Props {
33
- id: string;
34
- title?: string;
35
- duration: number;
36
- variant: Variant;
37
- className?: string;
38
- onClose: (key: string) => void;
39
- closeButtonTitle: string;
40
- content?: string;
41
- actions?: Actions;
42
- }
43
-
44
- const useRegisterSnackbarHeight = (
45
- singleSnackbarRef: React.RefObject<HTMLDivElement>,
46
- snackbarId: string
47
- ) => {
48
- const ctx = useContext(SnackbarContext);
49
-
50
- useEffect(() => {
51
- if (singleSnackbarRef.current) {
52
- ctx.setSnackbarHeight(snackbarId, singleSnackbarRef.current.getBoundingClientRect().height);
53
- }
54
- }, [singleSnackbarRef.current]);
55
- };
56
-
57
- /**
58
- * @deprecated
59
- */
60
- export const SnackbarItem = ({
61
- id,
62
- title,
63
- duration,
64
- variant,
65
- content,
66
- className,
67
- actions = [],
68
- onClose,
69
- closeButtonTitle
70
- }: Props) => {
71
- const timerHandler = useRef<ReturnType<typeof setTimeout>>();
72
- const onAnimationEnd = () => onClose(id);
73
- const { ref, animationStarted, startAnimation } = useAnimation<HTMLDivElement>(onAnimationEnd);
74
- const hasOnlyTitle = !content && !!title;
75
- const renderTitle = title && !hasOnlyTitle;
76
- const renderContentOrTitleOnly = content || hasOnlyTitle;
77
-
78
- useRegisterSnackbarHeight(ref, id);
79
-
80
- useEffect(() => {
81
- timerHandler.current = setTimeout(() => startAnimation(), duration);
82
- return () => {
83
- timerHandler.current && clearTimeout(timerHandler.current);
84
- };
85
- }, []);
86
-
87
- const onMouseEnter = () => {
88
- timerHandler.current && clearTimeout(timerHandler.current);
89
- };
90
-
91
- const onMouseLeave = () => {
92
- timerHandler.current = setTimeout(() => startAnimation(), duration);
93
- };
94
-
95
- const getVariantIcon = () => {
96
- if (variant === "error") {
97
- return Icons.Error;
98
- }
99
-
100
- if (variant === "warning") {
101
- return Icons.Warning;
102
- }
103
-
104
- return variant === "success" ? Icons.CheckmarkCircleAlt : Icons.InfoCircle;
105
- };
106
-
107
- const actionButtons = actions.map((actionProp, index) => (
108
- <button
109
- key={index}
110
- {...actionProp}
111
- onClick={e => {
112
- onClose(id);
113
- actionProp.onClick?.(e);
114
- }}
115
- className={classes["action-button"]}
116
- >
117
- {actionProp.label}
118
- </button>
119
- ));
120
-
121
- const snackbarClasses = [
122
- classes["snackbar"],
123
- classes[variant],
124
- animationStarted ? readyclasses["slide-out"] : readyclasses["slide-in"],
125
- className ?? ""
126
- ].join(" ");
127
-
128
- return (
129
- <div
130
- ref={ref}
131
- aria-live="polite"
132
- className={snackbarClasses}
133
- onMouseEnter={onMouseEnter}
134
- onMouseLeave={onMouseLeave}
135
- >
136
- <div className={classes["outer-content-wrapper"]}>
137
- <Icon icon={getVariantIcon()} className={classes["icon"]} />
138
- <div className={classes["content-wrapper"]}>
139
- {renderTitle && (
140
- <Typography className={classes["title"]} variant="body-bold" tag="span">
141
- {title}
142
- </Typography>
143
- )}
144
- {renderContentOrTitleOnly && (
145
- <Typography className={classes["content"]} variant="body">
146
- {hasOnlyTitle ? title : content}
147
- </Typography>
148
- )}
149
- </div>
150
- </div>
151
- {actionButtons.length > 0 && <div className={classes["actions"]}>{actionButtons}</div>}
152
- <IconButton
153
- id={classes["close-btn"]}
154
- onClick={() => startAnimation()}
155
- title={closeButtonTitle}
156
- >
157
- <Icon icon={Icons.Times} color={textColor} />
158
- </IconButton>
159
- </div>
160
- );
161
- };
@@ -1,219 +0,0 @@
1
- /*
2
- * Copyright 2022 OneWelcome B.V.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import React, { ReactNode, useRef, useState } from "react";
18
- import { createPortal } from "react-dom";
19
- import { SnackbarContextProvider } from "./SnackbarStateProvider";
20
- import {
21
- Actions,
22
- EnqueueSnackbarProps,
23
- SnackbarOptionsProps,
24
- Variant,
25
- isNewEnqueueSnackbarInterface
26
- } from "../interfaces";
27
- import { Placement, SnackbarContainer } from "../SnackbarContainer/SnackbarContainer";
28
- import { generateID } from "../../../../util/helper";
29
- import { SnackbarItem } from "../SnackbarItem/SnackbarItem";
30
- import { useGetDomRoot } from "../../../../hooks/useGetDomRoot";
31
-
32
- /** Short msg is when only title is provided. Long one when content or/and actions are provided (or type is error). */
33
- interface Duration {
34
- long: number;
35
- short: number;
36
- }
37
-
38
- /**
39
- * @deprecated
40
- */
41
- export interface Props {
42
- closeButtonTitle: string;
43
- children?: ReactNode;
44
- placement?: Placement;
45
- stackSize?: number;
46
- domRoot?: HTMLElement;
47
- autoHideDuration?: Duration;
48
- className?: string;
49
- }
50
-
51
- /**
52
- * @deprecated
53
- */
54
- export interface Item {
55
- id: string;
56
- title?: string;
57
- duration: number;
58
- className?: string;
59
- height: number;
60
- variant: Variant;
61
- content?: string;
62
- actions?: Actions;
63
- onClose?: () => void;
64
- }
65
-
66
- /**
67
- * @deprecated
68
- */
69
- export const SnackbarProvider = (
70
- {
71
- closeButtonTitle,
72
- placement = { vertical: "bottom", horizontal: "center" },
73
- autoHideDuration = { long: 8000, short: 4000 },
74
- stackSize = 3,
75
- domRoot,
76
- children,
77
- className
78
- }: Props = { closeButtonTitle: "" }
79
- ) => {
80
- const [snackbars, setSnackbars] = useState<Item[]>([]);
81
- const wrappingDivRef = useRef(null);
82
- const { root } = useGetDomRoot(domRoot, wrappingDivRef);
83
-
84
- const addSnackbar = (item: Item) => {
85
- setSnackbars(items => [...items, item]);
86
- };
87
-
88
- const setSnackbarHeight = (id: string, height: number) => {
89
- const newSnackbarsState = snackbars.map(snackbar => {
90
- if (snackbar.id !== id) {
91
- return snackbar;
92
- }
93
-
94
- return { ...snackbar, height };
95
- });
96
-
97
- setSnackbars(newSnackbarsState);
98
- };
99
-
100
- const getDuration = (variant: Variant, actions?: Actions, content?: string) => {
101
- const hasError = variant === "error";
102
- const hasContentOrActions = content ?? actions;
103
- if (hasError || hasContentOrActions) {
104
- return autoHideDuration.long;
105
- }
106
- return autoHideDuration.short;
107
- };
108
-
109
- const enqueueSnackbar = (
110
- propsOrTitle: EnqueueSnackbarProps | string | undefined,
111
- content?: string,
112
- options: SnackbarOptionsProps = {}
113
- ): void => {
114
- const newInterface = isNewEnqueueSnackbarInterface(propsOrTitle);
115
- const props = newInterface ? propsOrTitle : mapToNewInterface(propsOrTitle, content, options);
116
- const {
117
- variant = "info",
118
- actions,
119
- duration = getDuration(variant, actions, props.content),
120
- onClose
121
- } = props;
122
- const item: Item = {
123
- title: props.title,
124
- content: props.content,
125
- variant,
126
- className: props.className,
127
- actions,
128
- duration,
129
- height: 0,
130
- id: generateID(15, props.title),
131
- onClose
132
- };
133
- addSnackbar(item);
134
- };
135
-
136
- const mapToNewInterface = (
137
- title?: string,
138
- content?: string,
139
- options: SnackbarOptionsProps = {}
140
- ): EnqueueSnackbarProps => {
141
- return {
142
- title,
143
- content,
144
- ...options
145
- };
146
- };
147
-
148
- const enqueueSuccessSnackbar = (
149
- propsOrTitle: EnqueueSnackbarProps | string | undefined,
150
- content?: string,
151
- options: SnackbarOptionsProps = {}
152
- ): void => {
153
- const newInterface = isNewEnqueueSnackbarInterface(propsOrTitle);
154
- const props = newInterface ? propsOrTitle : mapToNewInterface(propsOrTitle, content, options);
155
- enqueueSnackbar({ ...props, variant: "success" });
156
- };
157
-
158
- const enqueueErrorSnackbar = (
159
- propsOrTitle: EnqueueSnackbarProps | string | undefined,
160
- content?: string,
161
- options: SnackbarOptionsProps = {}
162
- ): void => {
163
- const newInterface = isNewEnqueueSnackbarInterface(propsOrTitle);
164
- const props = newInterface ? propsOrTitle : mapToNewInterface(propsOrTitle, content, options);
165
- enqueueSnackbar({ ...props, variant: "error" });
166
- };
167
-
168
- const enqueueWarningSnackbar = (
169
- propsOrTitle: EnqueueSnackbarProps | string | undefined,
170
- content?: string,
171
- options: SnackbarOptionsProps = {}
172
- ): void => {
173
- const newInterface = isNewEnqueueSnackbarInterface(propsOrTitle);
174
- const props = newInterface ? propsOrTitle : mapToNewInterface(propsOrTitle, content, options);
175
- enqueueSnackbar({ ...props, variant: "warning" });
176
- };
177
-
178
- const onItemClosed = (id: string) => {
179
- setSnackbars(items => [...items].filter(item => item.id !== id));
180
- };
181
-
182
- const snackbarList = snackbars.map((item, index) =>
183
- index < stackSize ? (
184
- <SnackbarItem
185
- {...item}
186
- key={item.id}
187
- className={item.className}
188
- onClose={() => {
189
- onItemClosed(item.id);
190
- item.onClose?.();
191
- }}
192
- closeButtonTitle={closeButtonTitle}
193
- />
194
- ) : null
195
- );
196
-
197
- const snackbarPortal = createPortal(
198
- <SnackbarContainer placement={placement} className={className}>
199
- {snackbarList}
200
- </SnackbarContainer>,
201
- root
202
- );
203
-
204
- return (
205
- <SnackbarContextProvider
206
- initialState={{
207
- enqueueSnackbar,
208
- enqueueSuccessSnackbar,
209
- enqueueErrorSnackbar,
210
- enqueueWarningSnackbar,
211
- setSnackbarHeight,
212
- snackbars
213
- }}
214
- >
215
- {children}
216
- <div ref={wrappingDivRef}>{snackbarPortal}</div>
217
- </SnackbarContextProvider>
218
- );
219
- };
@@ -1,57 +0,0 @@
1
- /*
2
- * Copyright 2022 OneWelcome B.V.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import React, { createContext } from "react";
18
- import { DeprecatedEnqueueSnackbarType } from "../interfaces";
19
- import { Item } from "./SnackbarProvider";
20
-
21
- /**
22
- * @deprecated
23
- */
24
- interface SnackbarContextProps {
25
- enqueueSnackbar: DeprecatedEnqueueSnackbarType;
26
- enqueueSuccessSnackbar: DeprecatedEnqueueSnackbarType;
27
- enqueueWarningSnackbar: DeprecatedEnqueueSnackbarType;
28
- enqueueErrorSnackbar: DeprecatedEnqueueSnackbarType;
29
- setSnackbarHeight: (id: string, height: number) => void;
30
- snackbars: Item[];
31
- }
32
-
33
- /**
34
- * @deprecated
35
- */
36
- const SnackbarContext = createContext<SnackbarContextProps>({
37
- enqueueSnackbar: () => null,
38
- enqueueSuccessSnackbar: () => null,
39
- enqueueErrorSnackbar: () => null,
40
- enqueueWarningSnackbar: () => null,
41
- setSnackbarHeight: () => null,
42
- snackbars: []
43
- });
44
-
45
- interface Props {
46
- initialState: SnackbarContextProps;
47
- children?: React.ReactNode;
48
- }
49
-
50
- /**
51
- * @deprecated
52
- */
53
- const SnackbarContextProvider = ({ children, initialState }: Props) => {
54
- return <SnackbarContext.Provider value={initialState}>{children}</SnackbarContext.Provider>;
55
- };
56
-
57
- export { SnackbarContextProvider, SnackbarContext, SnackbarContextProps };
@@ -1,62 +0,0 @@
1
- /*
2
- * Copyright 2022 OneWelcome B.V.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import { ButtonHTMLAttributes } from "react";
18
-
19
- /**
20
- * @deprecated
21
- */
22
- export type Variant = "info" | "success" | "error" | "warning";
23
-
24
- /**
25
- * @deprecated
26
- */
27
- export type Actions = (ButtonHTMLAttributes<HTMLButtonElement> & { label: string })[];
28
-
29
- /**
30
- * @deprecated
31
- */
32
- export interface SnackbarOptionsProps {
33
- actions?: Actions;
34
- className?: string;
35
- variant?: Variant;
36
- duration?: number;
37
- onClose?: () => void;
38
- }
39
-
40
- /**
41
- * @deprecated
42
- */
43
- export interface EnqueueSnackbarProps extends SnackbarOptionsProps {
44
- title?: string;
45
- content?: string;
46
- }
47
-
48
- /**
49
- * @deprecated
50
- */
51
- export type DeprecatedEnqueueSnackbarType = (
52
- propsOrTitle: EnqueueSnackbarProps | string | undefined,
53
- content?: string,
54
- options?: SnackbarOptionsProps
55
- ) => void;
56
-
57
- /**
58
- * @deprecated
59
- */
60
- export function isNewEnqueueSnackbarInterface(args: unknown): args is EnqueueSnackbarProps {
61
- return args !== null && typeof args === "object" && ("title" in args || "content" in args);
62
- }
@@ -1,43 +0,0 @@
1
- /*!
2
- * Copyright 2022 OneWelcome B.V.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- .status-indicator {
18
- display: flex;
19
- align-items: center;
20
- }
21
-
22
- .status-badge {
23
- width: 0.75rem;
24
- height: 0.75rem;
25
- margin-right: 0.5rem;
26
- border-radius: 50%;
27
- }
28
-
29
- .active {
30
- background-color: var(--success);
31
- }
32
-
33
- .error {
34
- background-color: var(--error);
35
- }
36
-
37
- .neutral {
38
- background-color: var(--greyed-out);
39
- }
40
-
41
- .warning {
42
- background-color: var(--warning);
43
- }
@@ -1,44 +0,0 @@
1
- /*
2
- * Copyright 2022 OneWelcome B.V.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import React, { ForwardRefRenderFunction, ComponentPropsWithRef, ReactNode } from "react";
18
- import { Typography, Props as TypographyProps } from "../Typography/Typography";
19
- import classes from "./StatusIndicator.module.scss";
20
-
21
- export interface Props extends ComponentPropsWithRef<"div"> {
22
- children?: ReactNode;
23
- status: "active" | "error" | "neutral" | "warning";
24
- badgeProps?: ComponentPropsWithRef<"div">;
25
- typographyProps?: TypographyProps;
26
- }
27
-
28
- const StatusIndicatorComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
29
- { children, status, badgeProps, typographyProps, ...rest }: Props,
30
- ref
31
- ) => {
32
- return (
33
- <div {...rest} className={classes["status-indicator"]} ref={ref}>
34
- <div
35
- className={`${classes["status-badge"]} ${classes[status]} ${badgeProps?.className ?? ""}`}
36
- />
37
- <Typography {...typographyProps} spacing={{ margin: "0" }} variant="body" tag="div">
38
- {typographyProps?.children ?? children}
39
- </Typography>
40
- </div>
41
- );
42
- };
43
-
44
- export const StatusIndicator = React.forwardRef(StatusIndicatorComponent);