@mailstep/design-system 0.8.52 → 0.9.1

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 (290) hide show
  1. package/package.json +22 -6
  2. package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +1 -1
  3. package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +1 -1
  4. package/ui/Blocks/Header/components/UserMenu/index.js +1 -1
  5. package/ui/Blocks/Header/styles.js +1 -1
  6. package/ui/Elements/Avatar/Avatar.js +1 -1
  7. package/ui/Elements/Avatar/styles.js +1 -1
  8. package/ui/Elements/Button/styles.js +1 -1
  9. package/ui/Modules/Dashboard/Hoc/LoadingBoundary.d.ts +8 -0
  10. package/ui/Modules/Dashboard/Hoc/LoadingBoundary.js +11 -0
  11. package/ui/Modules/Dashboard/Hoc/index.d.ts +3 -0
  12. package/ui/Modules/Dashboard/Hoc/index.js +4 -0
  13. package/ui/Modules/Dashboard/Hoc/storybook/withReduxProvider.d.ts +4 -0
  14. package/ui/Modules/Dashboard/Hoc/storybook/withReduxProvider.js +14 -0
  15. package/ui/Modules/Dashboard/Hoc/withConfig.d.ts +7 -0
  16. package/ui/Modules/Dashboard/Hoc/withConfig.js +22 -0
  17. package/ui/Modules/Dashboard/Hoc/withFetch.d.ts +26 -0
  18. package/ui/Modules/Dashboard/Hoc/withFetch.js +50 -0
  19. package/ui/Modules/Dashboard/Hoc/withProps.d.ts +4 -0
  20. package/ui/Modules/Dashboard/Hoc/withProps.js +25 -0
  21. package/ui/Modules/Dashboard/assets/BarChartPreview.png +0 -0
  22. package/ui/Modules/Dashboard/assets/ColorBoxPreview.png +0 -0
  23. package/ui/Modules/Dashboard/assets/HorizontalBarPreview.png +0 -0
  24. package/ui/Modules/Dashboard/assets/NumberBoxPreview.png +0 -0
  25. package/ui/Modules/Dashboard/assets/PieChartPreview.png +0 -0
  26. package/ui/Modules/Dashboard/assets/TablePreview.png +0 -0
  27. package/ui/Modules/Dashboard/assets/TextBoxPreview.png +0 -0
  28. package/ui/Modules/Dashboard/assets/move.svg +18 -0
  29. package/ui/Modules/Dashboard/components/Config/MultiConfig.d.ts +6 -0
  30. package/ui/Modules/Dashboard/components/Config/MultiConfig.js +51 -0
  31. package/ui/Modules/Dashboard/components/Config/components/CommonConfig.d.ts +4 -0
  32. package/ui/Modules/Dashboard/components/Config/components/CommonConfig.js +20 -0
  33. package/ui/Modules/Dashboard/components/Config/components/InputConfig.d.ts +5 -0
  34. package/ui/Modules/Dashboard/components/Config/components/InputConfig.js +104 -0
  35. package/ui/Modules/Dashboard/components/Config/types.d.ts +1 -0
  36. package/ui/Modules/Dashboard/components/Config/types.js +1 -0
  37. package/ui/Modules/Dashboard/components/Dashboard/Dashboard.d.ts +9 -0
  38. package/ui/Modules/Dashboard/components/Dashboard/Dashboard.js +16 -0
  39. package/ui/Modules/Dashboard/components/Dashboard/DashboardContainer.d.ts +4 -0
  40. package/ui/Modules/Dashboard/components/Dashboard/DashboardContainer.js +31 -0
  41. package/ui/Modules/Dashboard/components/Dashboard/components/Body.d.ts +7 -0
  42. package/ui/Modules/Dashboard/components/Dashboard/components/Body.js +7 -0
  43. package/ui/Modules/Dashboard/components/Dashboard/components/HandleChange.d.ts +6 -0
  44. package/ui/Modules/Dashboard/components/Dashboard/components/HandleChange.js +25 -0
  45. package/ui/Modules/Dashboard/components/Dashboard/components/LayoutErrorBoundary.d.ts +13 -0
  46. package/ui/Modules/Dashboard/components/Dashboard/components/LayoutErrorBoundary.js +19 -0
  47. package/ui/Modules/Dashboard/components/Dashboard/dashboard2.css +124 -0
  48. package/ui/Modules/Dashboard/components/Dashboard/index.d.ts +2 -0
  49. package/ui/Modules/Dashboard/components/Dashboard/index.js +5 -0
  50. package/ui/Modules/Dashboard/components/Header/Header.d.ts +8 -0
  51. package/ui/Modules/Dashboard/components/Header/Header.js +9 -0
  52. package/ui/Modules/Dashboard/components/Header/index.d.ts +2 -0
  53. package/ui/Modules/Dashboard/components/Header/index.js +5 -0
  54. package/ui/Modules/Dashboard/components/Layout/Layout.d.ts +18 -0
  55. package/ui/Modules/Dashboard/components/Layout/Layout.js +39 -0
  56. package/ui/Modules/Dashboard/components/Layout/LayoutContainer.d.ts +7 -0
  57. package/ui/Modules/Dashboard/components/Layout/LayoutContainer.js +40 -0
  58. package/ui/Modules/Dashboard/components/Layout/components/Item/Item.d.ts +18 -0
  59. package/ui/Modules/Dashboard/components/Layout/components/Item/Item.js +79 -0
  60. package/ui/Modules/Dashboard/components/Layout/components/Item/ItemContainer.d.ts +11 -0
  61. package/ui/Modules/Dashboard/components/Layout/components/Item/ItemContainer.js +64 -0
  62. package/ui/Modules/Dashboard/components/Layout/components/Item/WidgetErrorBoundary.d.ts +14 -0
  63. package/ui/Modules/Dashboard/components/Layout/components/Item/WidgetErrorBoundary.js +28 -0
  64. package/ui/Modules/Dashboard/components/Layout/components/Item/index.d.ts +2 -0
  65. package/ui/Modules/Dashboard/components/Layout/components/Item/index.js +5 -0
  66. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfig.d.ts +13 -0
  67. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfig.js +18 -0
  68. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfigControls.d.ts +8 -0
  69. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfigControls.js +31 -0
  70. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/index.d.ts +2 -0
  71. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/index.js +5 -0
  72. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/ItemHeader.d.ts +12 -0
  73. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/ItemHeader.js +27 -0
  74. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/index.d.ts +2 -0
  75. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/index.js +5 -0
  76. package/ui/Modules/Dashboard/components/Layout/index.d.ts +2 -0
  77. package/ui/Modules/Dashboard/components/Layout/index.js +5 -0
  78. package/ui/Modules/Dashboard/components/NoData/NoData.d.ts +2 -0
  79. package/ui/Modules/Dashboard/components/NoData/NoData.js +14 -0
  80. package/ui/Modules/Dashboard/components/NoData/index.d.ts +2 -0
  81. package/ui/Modules/Dashboard/components/NoData/index.js +5 -0
  82. package/ui/Modules/Dashboard/components/Picker/Picker.d.ts +8 -0
  83. package/ui/Modules/Dashboard/components/Picker/Picker.js +38 -0
  84. package/ui/Modules/Dashboard/components/Picker/PickerContainer.d.ts +7 -0
  85. package/ui/Modules/Dashboard/components/Picker/PickerContainer.js +38 -0
  86. package/ui/Modules/Dashboard/components/Picker/components/PickerItem.d.ts +8 -0
  87. package/ui/Modules/Dashboard/components/Picker/components/PickerItem.js +25 -0
  88. package/ui/Modules/Dashboard/components/Picker/index.d.ts +2 -0
  89. package/ui/Modules/Dashboard/components/Picker/index.js +5 -0
  90. package/ui/Modules/Dashboard/components/Text/Text.d.ts +7 -0
  91. package/ui/Modules/Dashboard/components/Text/Text.js +14 -0
  92. package/ui/Modules/Dashboard/components/Text/index.d.ts +1 -0
  93. package/ui/Modules/Dashboard/components/Text/index.js +2 -0
  94. package/ui/Modules/Dashboard/components/Widgets/BarChart/BarChart.d.ts +19 -0
  95. package/ui/Modules/Dashboard/components/Widgets/BarChart/BarChart.js +52 -0
  96. package/ui/Modules/Dashboard/components/Widgets/BarChart/Config.d.ts +1 -0
  97. package/ui/Modules/Dashboard/components/Widgets/BarChart/Config.js +5 -0
  98. package/ui/Modules/Dashboard/components/Widgets/BarChart/index.d.ts +4 -0
  99. package/ui/Modules/Dashboard/components/Widgets/BarChart/index.js +6 -0
  100. package/ui/Modules/Dashboard/components/Widgets/BarChart/styles.d.ts +12 -0
  101. package/ui/Modules/Dashboard/components/Widgets/BarChart/styles.js +39 -0
  102. package/ui/Modules/Dashboard/components/Widgets/ColorBox/ColorBox.d.ts +7 -0
  103. package/ui/Modules/Dashboard/components/Widgets/ColorBox/ColorBox.js +21 -0
  104. package/ui/Modules/Dashboard/components/Widgets/ColorBox/Config.d.ts +3 -0
  105. package/ui/Modules/Dashboard/components/Widgets/ColorBox/Config.js +23 -0
  106. package/ui/Modules/Dashboard/components/Widgets/ColorBox/index.d.ts +4 -0
  107. package/ui/Modules/Dashboard/components/Widgets/ColorBox/index.js +6 -0
  108. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/EmptyWidget.d.ts +7 -0
  109. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/EmptyWidget.js +10 -0
  110. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/index.d.ts +2 -0
  111. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/index.js +5 -0
  112. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/Config.d.ts +1 -0
  113. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/Config.js +5 -0
  114. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/HorizontalBar.d.ts +4 -0
  115. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/HorizontalBar.js +38 -0
  116. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.d.ts +8 -0
  117. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.js +14 -0
  118. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/ProgressLine.d.ts +7 -0
  119. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/ProgressLine.js +14 -0
  120. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/index.d.ts +4 -0
  121. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/index.js +6 -0
  122. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/storybook.sample.d.ts +2 -0
  123. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/storybook.sample.js +33 -0
  124. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/styles.d.ts +18 -0
  125. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/styles.js +58 -0
  126. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/types.d.ts +13 -0
  127. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/types.js +1 -0
  128. package/ui/Modules/Dashboard/components/Widgets/NumberBox/Config.d.ts +4 -0
  129. package/ui/Modules/Dashboard/components/Widgets/NumberBox/Config.js +38 -0
  130. package/ui/Modules/Dashboard/components/Widgets/NumberBox/NumberBox.d.ts +5 -0
  131. package/ui/Modules/Dashboard/components/Widgets/NumberBox/NumberBox.js +38 -0
  132. package/ui/Modules/Dashboard/components/Widgets/NumberBox/index.d.ts +4 -0
  133. package/ui/Modules/Dashboard/components/Widgets/NumberBox/index.js +6 -0
  134. package/ui/Modules/Dashboard/components/Widgets/NumberBox/styles.d.ts +4 -0
  135. package/ui/Modules/Dashboard/components/Widgets/NumberBox/styles.js +25 -0
  136. package/ui/Modules/Dashboard/components/Widgets/PieChart/Config.d.ts +1 -0
  137. package/ui/Modules/Dashboard/components/Widgets/PieChart/Config.js +5 -0
  138. package/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.d.ts +21 -0
  139. package/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.js +59 -0
  140. package/ui/Modules/Dashboard/components/Widgets/PieChart/components/CenteredMetric.d.ts +10 -0
  141. package/ui/Modules/Dashboard/components/Widgets/PieChart/components/CenteredMetric.js +24 -0
  142. package/ui/Modules/Dashboard/components/Widgets/PieChart/index.d.ts +4 -0
  143. package/ui/Modules/Dashboard/components/Widgets/PieChart/index.js +6 -0
  144. package/ui/Modules/Dashboard/components/Widgets/PieChart/styles.d.ts +14 -0
  145. package/ui/Modules/Dashboard/components/Widgets/PieChart/styles.js +47 -0
  146. package/ui/Modules/Dashboard/components/Widgets/Table/Config.d.ts +9 -0
  147. package/ui/Modules/Dashboard/components/Widgets/Table/Config.js +87 -0
  148. package/ui/Modules/Dashboard/components/Widgets/Table/Table.d.ts +4 -0
  149. package/ui/Modules/Dashboard/components/Widgets/Table/Table.js +93 -0
  150. package/ui/Modules/Dashboard/components/Widgets/Table/components/IconLabelCell.d.ts +8 -0
  151. package/ui/Modules/Dashboard/components/Widgets/Table/components/IconLabelCell.js +19 -0
  152. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorList.d.ts +9 -0
  153. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorList.js +31 -0
  154. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorLocation.d.ts +8 -0
  155. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorLocation.js +15 -0
  156. package/ui/Modules/Dashboard/components/Widgets/Table/components/TableCell.d.ts +6 -0
  157. package/ui/Modules/Dashboard/components/Widgets/Table/components/TableCell.js +33 -0
  158. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useCondition.d.ts +10 -0
  159. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useCondition.js +27 -0
  160. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/usePages.d.ts +17 -0
  161. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/usePages.js +27 -0
  162. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useSort.d.ts +10 -0
  163. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useSort.js +31 -0
  164. package/ui/Modules/Dashboard/components/Widgets/Table/index.d.ts +5 -0
  165. package/ui/Modules/Dashboard/components/Widgets/Table/index.js +7 -0
  166. package/ui/Modules/Dashboard/components/Widgets/Table/storybook.sample.d.ts +73 -0
  167. package/ui/Modules/Dashboard/components/Widgets/Table/storybook.sample.js +211 -0
  168. package/ui/Modules/Dashboard/components/Widgets/Table/styles.d.ts +23 -0
  169. package/ui/Modules/Dashboard/components/Widgets/Table/styles.js +69 -0
  170. package/ui/Modules/Dashboard/components/Widgets/Table/types.d.ts +52 -0
  171. package/ui/Modules/Dashboard/components/Widgets/Table/types.js +1 -0
  172. package/ui/Modules/Dashboard/components/Widgets/TextBox/TextBox.d.ts +10 -0
  173. package/ui/Modules/Dashboard/components/Widgets/TextBox/TextBox.js +12 -0
  174. package/ui/Modules/Dashboard/components/Widgets/TextBox/index.d.ts +3 -0
  175. package/ui/Modules/Dashboard/components/Widgets/TextBox/index.js +5 -0
  176. package/ui/Modules/Dashboard/components/Widgets/index.d.ts +11 -0
  177. package/ui/Modules/Dashboard/components/Widgets/index.js +108 -0
  178. package/ui/Modules/Dashboard/components/Widgets/utils/generic.d.ts +5 -0
  179. package/ui/Modules/Dashboard/components/Widgets/utils/generic.js +20 -0
  180. package/ui/Modules/Dashboard/components/Widgets/utils/helpers.d.ts +3 -0
  181. package/ui/Modules/Dashboard/components/Widgets/utils/helpers.js +25 -0
  182. package/ui/Modules/Dashboard/components/Widgets/utils/legends.d.ts +20 -0
  183. package/ui/Modules/Dashboard/components/Widgets/utils/legends.js +57 -0
  184. package/ui/Modules/Dashboard/context/ComponentContext.d.ts +5 -0
  185. package/ui/Modules/Dashboard/context/ComponentContext.js +15 -0
  186. package/ui/Modules/Dashboard/context/LangContext.d.ts +3 -0
  187. package/ui/Modules/Dashboard/context/LangContext.js +5 -0
  188. package/ui/Modules/Dashboard/errors/ErrorMessage.d.ts +7 -0
  189. package/ui/Modules/Dashboard/errors/ErrorMessage.js +12 -0
  190. package/ui/Modules/Dashboard/errors/WidgetError.d.ts +5 -0
  191. package/ui/Modules/Dashboard/errors/WidgetError.js +10 -0
  192. package/ui/Modules/Dashboard/hooks/usePrevious.d.ts +5 -0
  193. package/ui/Modules/Dashboard/hooks/usePrevious.js +14 -0
  194. package/ui/Modules/Dashboard/hooks/useRefWithCallback.d.ts +2 -0
  195. package/ui/Modules/Dashboard/hooks/useRefWithCallback.js +16 -0
  196. package/ui/Modules/Dashboard/hooks/useResize.d.ts +6 -0
  197. package/ui/Modules/Dashboard/hooks/useResize.js +19 -0
  198. package/ui/Modules/Dashboard/index.d.ts +7 -0
  199. package/ui/Modules/Dashboard/index.js +12 -0
  200. package/ui/Modules/Dashboard/locale/cs.d.ts +24 -0
  201. package/ui/Modules/Dashboard/locale/cs.js +26 -0
  202. package/ui/Modules/Dashboard/locale/en.d.ts +24 -0
  203. package/ui/Modules/Dashboard/locale/en.js +26 -0
  204. package/ui/Modules/Dashboard/locale/index.d.ts +4 -0
  205. package/ui/Modules/Dashboard/locale/index.js +13 -0
  206. package/ui/Modules/Dashboard/locale/it.d.ts +24 -0
  207. package/ui/Modules/Dashboard/locale/it.js +26 -0
  208. package/ui/Modules/Dashboard/locale/uk.d.ts +24 -0
  209. package/ui/Modules/Dashboard/locale/uk.js +26 -0
  210. package/ui/Modules/Dashboard/store/reducers/index.d.ts +9 -0
  211. package/ui/Modules/Dashboard/store/reducers/index.js +6 -0
  212. package/ui/Modules/Dashboard/store/reducers/widgetListReducer.d.ts +41 -0
  213. package/ui/Modules/Dashboard/store/reducers/widgetListReducer.js +76 -0
  214. package/ui/Modules/Dashboard/stories/storybook.sample.d.ts +50 -0
  215. package/ui/Modules/Dashboard/stories/storybook.sample.js +237 -0
  216. package/ui/Modules/Dashboard/styles.d.ts +63 -0
  217. package/ui/Modules/Dashboard/styles.js +358 -0
  218. package/ui/Modules/Dashboard/types.d.ts +185 -0
  219. package/ui/Modules/Dashboard/types.js +1 -0
  220. package/ui/Modules/index.d.ts +1 -0
  221. package/ui/Modules/index.js +8 -0
  222. package/ui/ThemeProvider/themes/index.d.ts +224 -0
  223. package/ui/ThemeProvider/themes/index.js +3 -1
  224. package/ui/ThemeProvider/themes/mailwiseDark.d.ts +225 -0
  225. package/ui/ThemeProvider/themes/mailwiseDark.js +16 -0
  226. package/ui/ThemeProvider/types.d.ts +1 -1
  227. package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.d.ts +0 -41
  228. package/ui/Blocks/CommonGrid/storybook/stories/default.stories.d.ts +0 -6
  229. package/ui/Blocks/CommonGrid/storybook/stories/gridStates.stories.d.ts +0 -8
  230. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.d.ts +0 -10
  231. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.d.ts +0 -10
  232. package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.d.ts +0 -6
  233. package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.d.ts +0 -10
  234. package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.d.ts +0 -14
  235. package/ui/Blocks/CommonGrid/storybook/stories/withQuickFilter.stories.d.ts +0 -11
  236. package/ui/Blocks/CornerDialog/stories/CornerDialog.stories.d.ts +0 -13
  237. package/ui/Blocks/Header/stories/Header.stories.d.ts +0 -52
  238. package/ui/Blocks/HidePrint/stories/HidePrint.stories.d.ts +0 -12
  239. package/ui/Blocks/ImageList/stories/ImageList.stories.d.ts +0 -14
  240. package/ui/Blocks/LanguageSwitch/stories/LanguageSwith.stories.d.ts +0 -10
  241. package/ui/Blocks/LightBox/stories/LightBox.stories.d.ts +0 -10
  242. package/ui/Blocks/LoginPage/stories/LoginPage.stories.d.ts +0 -10
  243. package/ui/Blocks/Modal/stories/Modal.stories.d.ts +0 -28
  244. package/ui/Blocks/Popover/stories/Popover.stories.d.ts +0 -16
  245. package/ui/Blocks/Scheduler/stories/Scheduler.stories.d.ts +0 -7
  246. package/ui/Blocks/SideMenu/stories/SideMenu.stories.d.ts +0 -11
  247. package/ui/Blocks/Stepper/stories/Stepper.stories.d.ts +0 -9
  248. package/ui/Blocks/Table/stories/Table.stories.d.ts +0 -12
  249. package/ui/Blocks/Tabs/stories/Tabs.stories.d.ts +0 -12
  250. package/ui/Elements/Alert/stories/Alert.stories.d.ts +0 -17
  251. package/ui/Elements/AsyncSelect/stories/AsyncSelect.stories.d.ts +0 -10
  252. package/ui/Elements/Avatar/stories/Avatar.stories.d.ts +0 -11
  253. package/ui/Elements/Badge/stories/Badge.stories.d.ts +0 -12
  254. package/ui/Elements/BarChartSymbol/stories/BarChartSymbol.stories.d.ts +0 -12
  255. package/ui/Elements/BorderedBox/stories/BorderedBox.stories.d.ts +0 -10
  256. package/ui/Elements/Button/stories/Button.stories.d.ts +0 -28
  257. package/ui/Elements/Card/stories/Card.stories.d.ts +0 -13
  258. package/ui/Elements/CheckedCircle/storries/CheckedCircle.stories.d.ts +0 -16
  259. package/ui/Elements/DatePicker/stories/DatePicker.stories.d.ts +0 -11
  260. package/ui/Elements/Dropdown/stories/Dropdown.stories.d.ts +0 -10
  261. package/ui/Elements/DropdownMenu/stories/DropdownMenu.stories.d.ts +0 -10
  262. package/ui/Elements/DropdownSelect/stories/DropdownSelect.stories.d.ts +0 -22
  263. package/ui/Elements/ErrorMessage/stories/ErrorMessage.stories.d.ts +0 -11
  264. package/ui/Elements/HighlightBox/stories/HighlightBox.stories.d.ts +0 -31
  265. package/ui/Elements/Icon/stories/BadgeIcon.stories.d.ts +0 -28
  266. package/ui/Elements/Icon/stories/Icon.stories.d.ts +0 -15
  267. package/ui/Elements/Image/stories/Image.stories.d.ts +0 -13
  268. package/ui/Elements/Label/stories/Label.stories.d.ts +0 -13
  269. package/ui/Elements/Line/stories/Line.stories.d.ts +0 -16
  270. package/ui/Elements/Link/stories/Link.stories.d.ts +0 -30
  271. package/ui/Elements/Logo/stories/Logo.stories.d.ts +0 -37
  272. package/ui/Elements/Pagination/stories/Pagination.stories.d.ts +0 -13
  273. package/ui/Elements/Portal/stories/Portal.stories.d.ts +0 -11
  274. package/ui/Elements/ProgressBar/stories/ProgressBar.stories.d.ts +0 -18
  275. package/ui/Elements/Select/stories/Select.stories.d.ts +0 -9
  276. package/ui/Elements/SimpleLink/stories/SimpleLink.stories.d.ts +0 -13
  277. package/ui/Elements/SingleSelect/stories/SingleSelect.stories.d.ts +0 -10
  278. package/ui/Elements/SpaceAround/stories/SpaceAround.stories.d.ts +0 -11
  279. package/ui/Elements/Spinner/stories/Spinner.stories.d.ts +0 -19
  280. package/ui/Elements/Table/stories/Table.stories.d.ts +0 -8
  281. package/ui/Elements/Tag/stories/Tag.stories.d.ts +0 -19
  282. package/ui/Elements/Text/stories/Text.stories.d.ts +0 -15
  283. package/ui/Elements/Toast/stories/Toast.stories.d.ts +0 -13
  284. package/ui/Elements/Toggle/stories/Toggle.stories.d.ts +0 -16
  285. package/ui/Elements/Tooltip/stories/Tooltip.stories.d.ts +0 -10
  286. package/ui/Elements/Typography/stories/Typography.stories.d.ts +0 -20
  287. package/ui/Forms/Checkbox/stories/Checkbox.stories.d.ts +0 -13
  288. package/ui/Forms/Input/stories/Input.stories.d.ts +0 -18
  289. package/ui/Forms/RadioButton/stories/RadioButton.stories.d.ts +0 -13
  290. package/ui/utils/KeyPress/KeyPress.stories.d.ts +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.8.52",
3
+ "version": "0.9.1",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -39,14 +39,20 @@
39
39
  "@fortawesome/react-fontawesome": "^0.2.0",
40
40
  "@lingui/core": "^5.0.0",
41
41
  "@lingui/react": "^5.0.0",
42
+ "@nivo/bar": "^0.79.1",
43
+ "@nivo/colors": "^0.73.0",
44
+ "@nivo/core": "^0.73.0",
45
+ "@nivo/legends": "^0.73.0",
46
+ "@nivo/pie": "^0.73.0",
42
47
  "@popperjs/core": "^2.11.8",
43
48
  "@storybook/addon-designs": "^11.1.3",
44
- "@storybook/addon-docs": "10.4.2",
45
- "@storybook/addon-links": "10.4.2",
46
- "@storybook/react-webpack5": "10.4.2",
49
+ "@storybook/addon-docs": "10.4.6",
50
+ "@storybook/addon-links": "10.4.6",
51
+ "@storybook/react-webpack5": "10.4.6",
47
52
  "@svgr/rollup": "^8.0.1",
48
53
  "@swc/core": "^1.15.30",
49
54
  "@trivago/prettier-plugin-sort-imports": "^4.3.0",
55
+ "@tsdown/css": "^0.22.3",
50
56
  "@types/faker": "^4.1.11",
51
57
  "@types/lodash": "^4.17.13",
52
58
  "@types/luxon": "^3.4.2",
@@ -54,6 +60,7 @@
54
60
  "@types/react": "^19.2.2",
55
61
  "@types/react-beautiful-dnd": "^13.1.2",
56
62
  "@types/react-dom": "^19.2.2",
63
+ "@types/react-grid-layout": "^1",
57
64
  "@types/react-helmet": "^6.1.11",
58
65
  "@types/react-router": "^5.1.20",
59
66
  "@types/react-router-dom": "^5.3.3",
@@ -73,7 +80,7 @@
73
80
  "eslint-plugin-react": "^7.35.0",
74
81
  "eslint-plugin-react-hooks": "^4.6.2",
75
82
  "eslint-plugin-react-perf": "^3.3.2",
76
- "eslint-plugin-storybook": "10.4.2",
83
+ "eslint-plugin-storybook": "10.4.6",
77
84
  "faker": "^5.1.0",
78
85
  "husky": "^9.1.7",
79
86
  "immer": "^9.0.19",
@@ -84,11 +91,13 @@
84
91
  "prettier": "2.8.8",
85
92
  "react": "^19.2.0",
86
93
  "react-dom": "^19.2.0",
94
+ "react-grid-layout": "^1.2.5",
87
95
  "react-helmet": "^6.1.0",
88
96
  "react-image": "^4.1.0",
89
97
  "react-onclickoutside": "^6.13.0",
90
98
  "react-popper": "^2.3.0",
91
99
  "react-redux": "*",
100
+ "react-resizable": "^3.0.4",
92
101
  "react-router": "^5.1.2",
93
102
  "react-router-dom": "^5.1.2",
94
103
  "react-script": "^2.0.5",
@@ -96,7 +105,7 @@
96
105
  "react-use-draggable-scroll": "^0.4.7",
97
106
  "redux": ">=4.0.5",
98
107
  "reselect": "5.0.0-alpha.2",
99
- "storybook": "10.4.2",
108
+ "storybook": "10.4.6",
100
109
  "string-width": "6.1.0",
101
110
  "styled-components": "^5.3.10",
102
111
  "swiper": "^11.0.3",
@@ -118,6 +127,11 @@
118
127
  "@fortawesome/react-fontawesome": "^0.2.0",
119
128
  "@lingui/core": "^5.0.0",
120
129
  "@lingui/react": "^5.0.0",
130
+ "@nivo/bar": "^0.79.1",
131
+ "@nivo/colors": "^0.73.0",
132
+ "@nivo/core": "^0.73.0",
133
+ "@nivo/legends": "^0.73.0",
134
+ "@nivo/pie": "^0.73.0",
121
135
  "@popperjs/core": "^2.11.8",
122
136
  "@xstyled/styled-components": "^3.8.0",
123
137
  "@xstyled/system": "^3.8.0",
@@ -127,11 +141,13 @@
127
141
  "moment": "^2.30.1",
128
142
  "react": "^19.2.0",
129
143
  "react-dom": "^19.2.0",
144
+ "react-grid-layout": "^1.2.5",
130
145
  "react-helmet": "^6.1.0",
131
146
  "react-image": "^4.1.0",
132
147
  "react-onclickoutside": "^6.13.0",
133
148
  "react-popper": "^2.3.0",
134
149
  "react-redux": ">=4.0.5",
150
+ "react-resizable": "^3.0.4",
135
151
  "react-router": "^5.1.2",
136
152
  "react-router-dom": "^5.1.2",
137
153
  "react-select": "^5.10.0",
@@ -33,7 +33,7 @@ const ActionsWrap = styled$1.div`
33
33
  const StyledText = styled$1.span`
34
34
  font-size: 14px;
35
35
  line-height: 18px;
36
- color: blue2;
36
+ color: textPrimary;
37
37
  font-weight: 600;
38
38
  `;
39
39
  const ContentWrap = styled$1.div`
@@ -4,7 +4,7 @@ import { useCallback, useEffect, useMemo, useState } from "react";
4
4
  const useManageColumn = ({ columns, gridSelectors, gridActions, onClose }) => {
5
5
  const { resetGrid, setColumnConfig, setColumnsOrder } = gridActions;
6
6
  const { columnConfig, columnsOrder } = gridSelectors;
7
- const initialColumnsOrder = useMemo(() => columns?.map((col) => col.name), [columns]);
7
+ const initialColumnsOrder = useMemo(() => columns?.map?.((col) => col.name), [columns]);
8
8
  const columnsOrderValue = columnsOrder?.length ? columnsOrder : initialColumnsOrder;
9
9
  const [columnsConfigOptions, setColumnsConfigOptions] = useState({ ...columnConfig ?? {} });
10
10
  const [updatedColumnsOrder, setUpdatedColumnsOrder] = useState(columnsOrderValue);
@@ -23,7 +23,7 @@ const UserMenu = ({ user, onLogout, hasUserMenu, userMenuOverride, withInitials,
23
23
  ref: parentRef,
24
24
  children: [/* @__PURE__ */ jsx(Avatar_default, {
25
25
  user,
26
- colorFront: withInitials ? th.color("white")({ theme }) : th.color("blue2")({ theme }),
26
+ colorFront: withInitials ? "#ffffff" : th.color("blue2")({ theme }),
27
27
  colorBack: withInitials ? th.color("red1")({ theme }) : isDropdownOpen ? th.color("lightGray7")({ theme }) : th.color("neutral20")({ theme }),
28
28
  hoverColorBack: withInitials ? "" : th.color("lightGray7")({ theme }),
29
29
  size: 34,
@@ -14,7 +14,7 @@ const Container = styled$1.header`
14
14
  border-bottom: 1px solid ${th.color("lightGray7")};
15
15
  ${({ $variant }) => $variant === "dark" && css`
16
16
  background-color: ${th.color("blue3")};
17
- color: white;
17
+ color: #fff;
18
18
  `}
19
19
 
20
20
  @media (min-width: 768px) {
@@ -32,7 +32,7 @@ const Avatar = ({ user, src, size = 34, colorFront, colorBack, className, hoverC
32
32
  /* @__PURE__ */ jsxs("div", { children: [withName && user?.username, children] }),
33
33
  withChevron && /* @__PURE__ */ jsx(Chevron, { children: /* @__PURE__ */ jsx(Icon, {
34
34
  icon: "goDown",
35
- fill: "white",
35
+ fill: "#ffffff",
36
36
  size: 10
37
37
  }) })
38
38
  ]
@@ -19,7 +19,7 @@ const StyledAvatarWrap = styled$1.div`
19
19
  overflow: hidden;
20
20
  font-size: 14px;
21
21
  white-space: nowrap;
22
- color: ${(props) => props.$colorFront ? th.color(props.$colorFront) : th.color("blue2")};
22
+ color: ${(props) => props.$colorFront ? th.color(props.$colorFront) : th.color("typoPrimary")};
23
23
  background-color: ${(props) => props.$colorBack ? th.color(props.$colorBack) : ""};
24
24
  width: ${(props) => `${props.size}px`};
25
25
  height: ${(props) => `${props.size}px`};
@@ -80,7 +80,7 @@ const StyledButton = styled$1.button`
80
80
 
81
81
  &[data-variant='success'] {
82
82
  background-color: successColor;
83
- color: white;
83
+ color: #ffffff;
84
84
 
85
85
  @media (hover: hover) {
86
86
  :hover {
@@ -0,0 +1,8 @@
1
+ import type { JSX } from 'react';
2
+ export type Props = {
3
+ error?: boolean;
4
+ isLoading?: boolean;
5
+ children: JSX.Element;
6
+ };
7
+ declare const LoadingBoundary: ({ error, isLoading, children }: Props) => JSX.Element;
8
+ export default LoadingBoundary;
@@ -0,0 +1,11 @@
1
+ import Spinner_default from "../../../Elements/Spinner/index.js";
2
+ import ErrorMessage from "../errors/ErrorMessage.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region packages/ui/Modules/Dashboard/Hoc/LoadingBoundary.tsx
5
+ const LoadingBoundary = ({ error, isLoading, children }) => {
6
+ if (isLoading) return /* @__PURE__ */ jsx(Spinner_default, {});
7
+ if (error) return /* @__PURE__ */ jsx(ErrorMessage, { children: "An error occured while loading." });
8
+ return children;
9
+ };
10
+ //#endregion
11
+ export { LoadingBoundary as default };
@@ -0,0 +1,3 @@
1
+ export * from './withConfig';
2
+ export * from './withFetch';
3
+ export * from './withProps';
@@ -0,0 +1,4 @@
1
+ import { withConfig } from "./withConfig.js";
2
+ import { withFetch } from "./withFetch.js";
3
+ import { withProps, withPropsWDefinition } from "./withProps.js";
4
+ export { withConfig, withFetch, withProps, withPropsWDefinition };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { JSX } from 'react';
3
+ export declare const withProvider: (initialState?: Record<string, any>) => (Story: React.ComponentType) => JSX.Element;
4
+ export default withProvider;
@@ -0,0 +1,14 @@
1
+ import dashboardReducer from "../../store/reducers/index.js";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { Provider } from "react-redux";
5
+ import { combineReducers, createStore } from "redux";
6
+ //#region packages/ui/Modules/Dashboard/Hoc/storybook/withReduxProvider.tsx
7
+ const withProvider = (initialState = {}) => (Story) => {
8
+ return /* @__PURE__ */ jsx(Provider, {
9
+ store: createStore(combineReducers({ dashboard: dashboardReducer }), initialState),
10
+ children: /* @__PURE__ */ jsx(Story, {})
11
+ });
12
+ };
13
+ //#endregion
14
+ export { withProvider as default, withProvider };
@@ -0,0 +1,7 @@
1
+ import { WidgetConfig, WidgetDefinition } from '../types';
2
+ type ConfigHOC = (config?: WidgetConfig) => (widget: WidgetDefinition) => WidgetDefinition;
3
+ /**
4
+ * Add to widget config component additional props
5
+ */
6
+ export declare const withConfig: ConfigHOC;
7
+ export {};
@@ -0,0 +1,22 @@
1
+ import "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region packages/ui/Modules/Dashboard/Hoc/withConfig.tsx
4
+ /**
5
+ * Add to widget config component additional props
6
+ */
7
+ const withConfig = (config) => (widget) => {
8
+ const WithConfigComponent = (props) => {
9
+ if (!widget.configComponent) return null;
10
+ const Configcomponent = widget.configComponent;
11
+ return /* @__PURE__ */ jsx(Configcomponent, {
12
+ ...props,
13
+ ...config
14
+ });
15
+ };
16
+ return {
17
+ ...widget,
18
+ configComponent: WithConfigComponent
19
+ };
20
+ };
21
+ //#endregion
22
+ export { withConfig };
@@ -0,0 +1,26 @@
1
+ import { WidgetConfig, WidgetDefinition } from '../types';
2
+ type FetchHOC = (fetch: (config?: WidgetConfig) => Promise<any>) => (widget: WidgetDefinition) => WidgetDefinition;
3
+ /**
4
+ * Replaces the origin component with an enhanced one
5
+ * ~ having data, loading state, fetch errors & optionally other custom props.
6
+ *
7
+ * Lifecycle:
8
+ * ~ Data is fetched on mount and then on every widget config change
9
+ *
10
+ * Note:
11
+ * Passed fetch function should return a promise
12
+ * ~ The data payload can either be:
13
+ * 1) Raw widget data - will result in a passed prop - data={data}
14
+ * Example:
15
+ * [
16
+ * { id: 1, label: 'Delivered', value: 206 },
17
+ * { id: 2, label: 'Returned', value: 64 },
18
+ * ]
19
+ *
20
+ * 2) Object with explicitely named data property
21
+ * This method allows you to pass other custom fetched props
22
+ * Example:
23
+ * { data: [YOUR_DATA], fetchedProp1: 'whatever', fetchedProp2: 23123 }
24
+ */
25
+ export declare const withFetch: FetchHOC;
26
+ export {};
@@ -0,0 +1,50 @@
1
+ import React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region packages/ui/Modules/Dashboard/Hoc/withFetch.tsx
4
+ /**
5
+ * Replaces the origin component with an enhanced one
6
+ * ~ having data, loading state, fetch errors & optionally other custom props.
7
+ *
8
+ * Lifecycle:
9
+ * ~ Data is fetched on mount and then on every widget config change
10
+ *
11
+ * Note:
12
+ * Passed fetch function should return a promise
13
+ * ~ The data payload can either be:
14
+ * 1) Raw widget data - will result in a passed prop - data={data}
15
+ * Example:
16
+ * [
17
+ * { id: 1, label: 'Delivered', value: 206 },
18
+ * { id: 2, label: 'Returned', value: 64 },
19
+ * ]
20
+ *
21
+ * 2) Object with explicitely named data property
22
+ * This method allows you to pass other custom fetched props
23
+ * Example:
24
+ * { data: [YOUR_DATA], fetchedProp1: 'whatever', fetchedProp2: 23123 }
25
+ */
26
+ const withFetch = (fetch) => (widget) => {
27
+ const WithDataComponent = (props) => {
28
+ const [data, setData] = React.useState([]);
29
+ const [isLoading, setIsLoading] = React.useState(false);
30
+ const [error, setError] = React.useState(false);
31
+ React.useEffect(() => {
32
+ setIsLoading(true);
33
+ fetch(props.config).then(setData).then(() => setIsLoading(false)).catch(setError);
34
+ }, [JSON.stringify(props.config)]);
35
+ const dataProps = React.useMemo(() => data?.data ? { ...data } : { data }, [data]);
36
+ const Component = widget.component;
37
+ return /* @__PURE__ */ jsx(Component, {
38
+ ...props,
39
+ ...dataProps,
40
+ isLoading,
41
+ error
42
+ });
43
+ };
44
+ return {
45
+ ...widget,
46
+ component: WithDataComponent
47
+ };
48
+ };
49
+ //#endregion
50
+ export { withFetch };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { WidgetDefinition } from '../types';
3
+ export declare const withProps: (extraProps: any) => <P extends object>(Component: React.ComponentType<P>) => React.ComponentType<P>;
4
+ export declare const withPropsWDefinition: (extraProps: any) => (widget: WidgetDefinition) => WidgetDefinition;
@@ -0,0 +1,25 @@
1
+ import "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region packages/ui/Modules/Dashboard/Hoc/withProps.tsx
4
+ const withProps = (extraProps) => (Component) => function ComponentWithProps(props) {
5
+ return /* @__PURE__ */ jsx(Component, {
6
+ ...props,
7
+ ...extraProps
8
+ });
9
+ };
10
+ const withPropsWDefinition = (extraProps) => (widget) => {
11
+ const Component = widget.component;
12
+ function ComponentWithProps(props) {
13
+ const additional = typeof extraProps === "function" ? extraProps(props) : extraProps;
14
+ return /* @__PURE__ */ jsx(Component, {
15
+ ...props,
16
+ ...additional
17
+ });
18
+ }
19
+ return {
20
+ ...widget,
21
+ component: ComponentWithProps
22
+ };
23
+ };
24
+ //#endregion
25
+ export { withProps, withPropsWDefinition };
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 512.006 512.006" style="enable-background:new 0 0 512.006 512.006;" xml:space="preserve">
5
+ <g>
6
+ <g>
7
+ <path d="M508.247,246.756l-72.457-72.465c-5.009-5.009-13.107-5.009-18.116,0c-5.009,5.009-5.009,13.107,0,18.116l50.594,50.594
8
+ H268.811V43.748l50.594,50.594c5.009,5.009,13.107,5.009,18.116,0c5.009-5.009,5.009-13.107,0-18.116L265.056,3.761
9
+ c-5.001-5.009-13.107-5.009-18.116,0l-72.457,72.457c-5.009,5.009-5.009,13.107,0,18.116c5.001,5.009,13.107,5.009,18.116,0
10
+ l50.594-50.594v199.27H43.744l50.594-50.594c5.009-5.009,5.009-13.107,0-18.116c-5.009-5.009-13.107-5.009-18.116,0L3.757,246.756
11
+ c-5.009,5.001-5.009,13.107,0,18.116l72.465,72.457c5.009,5.009,13.107,5.009,18.116,0c5.009-5.001,5.009-13.107,0-18.116
12
+ l-50.594-50.594h199.458v199.646l-50.594-50.594c-5.009-5.001-13.107-5.001-18.116,0c-5.009,5.009-5.009,13.107,0,18.116
13
+ l72.457,72.465c5,5,13.107,5,18.116,0l72.465-72.457c5.009-5.009,5.009-13.107,0-18.116c-5.009-5-13.107-5-18.116,0
14
+ l-50.594,50.594V268.627h199.458l-50.594,50.594c-5.009,5.009-5.009,13.107,0,18.116s13.107,5.009,18.116,0l72.465-72.457
15
+ C513.257,259.872,513.257,251.765,508.247,246.756z"/>
16
+ </g>
17
+ </g>
18
+ </svg>
@@ -0,0 +1,6 @@
1
+ import type { JSX } from 'react';
2
+ import { ConfigProps, Source } from '../../types';
3
+ export type MultiConfigProps = ConfigProps & {
4
+ sources?: Source[];
5
+ };
6
+ export declare const MultiConfig: ({ onChange, config, sources }: MultiConfigProps) => JSX.Element;
@@ -0,0 +1,51 @@
1
+ import { useText } from "../Text/Text.js";
2
+ import CommonConfig from "./components/CommonConfig.js";
3
+ import InputConfig from "./components/InputConfig.js";
4
+ import { useCallback, useMemo } from "react";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { omit } from "lodash";
7
+ //#region packages/ui/Modules/Dashboard/components/Config/MultiConfig.tsx
8
+ const defaultSources = [];
9
+ const MultiConfig = ({ onChange, config, sources = defaultSources }) => {
10
+ const labelSelectSource = useText("widgets.selectSource");
11
+ const filters = useMemo(() => sources.find((source) => source.value === config?.source), [sources, config])?.filters || [];
12
+ const hasFilters = filters.length !== 0;
13
+ const onChangeInput = useCallback((updatedConfig) => onChange(updatedConfig), [onChange]);
14
+ const onSourceInput = useCallback((processed) => {
15
+ const filterNames = filters.map((filter) => filter.name);
16
+ const filterLabels = filterNames.map((name) => `${name}Label`);
17
+ return onChange(omit(processed, [
18
+ ...filterNames,
19
+ ...filterLabels,
20
+ "sort"
21
+ ]));
22
+ }, [filters, onChange]);
23
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
24
+ /* @__PURE__ */ jsx(CommonConfig, {
25
+ onChange: onChangeInput,
26
+ config
27
+ }),
28
+ /* @__PURE__ */ jsx(InputConfig, {
29
+ label: labelSelectSource,
30
+ name: "source",
31
+ onChange: onSourceInput,
32
+ config,
33
+ options: sources
34
+ }),
35
+ hasFilters && filters.map((filter) => {
36
+ const { name, label, placeholder, input, options, isMulti } = filter;
37
+ return /* @__PURE__ */ jsx(InputConfig, {
38
+ name,
39
+ label,
40
+ placeholder,
41
+ input,
42
+ options,
43
+ isMulti,
44
+ onChange,
45
+ config
46
+ }, name);
47
+ })
48
+ ] });
49
+ };
50
+ //#endregion
51
+ export { MultiConfig };
@@ -0,0 +1,4 @@
1
+ import type { JSX } from 'react';
2
+ import { ConfigProps } from '../../../types';
3
+ declare const CommonConfig: ({ onChange, config }: ConfigProps) => JSX.Element;
4
+ export default CommonConfig;
@@ -0,0 +1,20 @@
1
+ import styles_default from "../../../styles.js";
2
+ import Text from "../../Text/Text.js";
3
+ import "react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ //#region packages/ui/Modules/Dashboard/components/Config/components/CommonConfig.tsx
6
+ const CommonConfig = ({ onChange, config }) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(styles_default.ConfigRow, { children: [/* @__PURE__ */ jsxs(styles_default.ConfigLabel, { children: [
7
+ /* @__PURE__ */ jsx(Text, { code: "widgets.name" }),
8
+ ":",
9
+ " "
10
+ ] }), /* @__PURE__ */ jsx(styles_default.ConfigInput, { children: /* @__PURE__ */ jsx(styles_default.Input, {
11
+ name: "name",
12
+ onChange: (e) => onChange({
13
+ ...config,
14
+ [e.target.name]: e.target.value
15
+ }),
16
+ defaultValue: config?.name || "",
17
+ type: "text"
18
+ }) })] }) });
19
+ //#endregion
20
+ export { CommonConfig as default };
@@ -0,0 +1,5 @@
1
+ import type { JSX } from 'react';
2
+ import { ConfigProps, LayoutWidgetFilter } from '../../../types';
3
+ type InputConfigProps = ConfigProps & LayoutWidgetFilter;
4
+ declare const InputConfig: ({ onChange, config, label, name, input, isMulti, options, placeholder }: InputConfigProps) => JSX.Element;
5
+ export default InputConfig;
@@ -0,0 +1,104 @@
1
+ import Button_default from "../../../../../Elements/Button/index.js";
2
+ import styles_default from "../../../styles.js";
3
+ import { useText } from "../../Text/Text.js";
4
+ import { useCallback } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import omit from "lodash/omit";
7
+ //#region packages/ui/Modules/Dashboard/components/Config/components/InputConfig.tsx
8
+ const getSelectValue = (currentValue, targetValue, isMulti, isChecked = false) => {
9
+ if (isMulti) {
10
+ const asserted = currentValue ?? [];
11
+ if (isChecked) return asserted.concat(targetValue);
12
+ return asserted.filter((val) => val !== targetValue);
13
+ }
14
+ return targetValue;
15
+ };
16
+ const createConfigField = (fieldName, value, label) => ({
17
+ [fieldName]: value,
18
+ ...label && { [`${fieldName}Label`]: label }
19
+ });
20
+ const InputConfig = ({ onChange, config, label, name, input, isMulti = false, options = [], placeholder }) => {
21
+ const none = useText("widgets.none");
22
+ const clear = useText("widgets.clear");
23
+ const selectAll = useText("widgets.selectAll");
24
+ const value = config?.[name];
25
+ const handleChange = useCallback((e) => {
26
+ const selectOption = options.find((option) => option.value === e.target.value);
27
+ const selectValue = getSelectValue(value, selectOption?.value || "", isMulti, e.target.checked);
28
+ const configField = createConfigField(name, input ? e.target.value : selectValue, input ? void 0 : selectOption?.label);
29
+ onChange({
30
+ ...config,
31
+ ...configField
32
+ });
33
+ }, [
34
+ name,
35
+ options,
36
+ onChange,
37
+ value,
38
+ isMulti,
39
+ config,
40
+ input
41
+ ]);
42
+ const handleSelectAll = useCallback(() => {
43
+ const configFields = createConfigField(name, options.map((opt) => opt.value));
44
+ onChange({
45
+ ...config,
46
+ ...configFields
47
+ });
48
+ }, [
49
+ name,
50
+ options,
51
+ config,
52
+ onChange
53
+ ]);
54
+ const handleRemoveAll = useCallback(() => {
55
+ onChange({ ...omit(config, name) });
56
+ }, [
57
+ name,
58
+ config,
59
+ onChange
60
+ ]);
61
+ return /* @__PURE__ */ jsxs(styles_default.ConfigRow, {
62
+ isBlock: isMulti,
63
+ children: [/* @__PURE__ */ jsxs(styles_default.ConfigLabel, { children: [label, ": "] }), /* @__PURE__ */ jsx(styles_default.ConfigInput, { children: input ? /* @__PURE__ */ jsx(styles_default.Input, {
64
+ type: input,
65
+ defaultValue: value || "",
66
+ onChange: handleChange
67
+ }) : isMulti ? /* @__PURE__ */ jsxs(styles_default.CheckboxContent, { children: [/* @__PURE__ */ jsxs(styles_default.CheckboxControls, { children: [
68
+ /* @__PURE__ */ jsx(Button_default, {
69
+ onClick: handleSelectAll,
70
+ children: selectAll
71
+ }),
72
+ " ",
73
+ /* @__PURE__ */ jsx(Button_default, {
74
+ appearance: "secondary",
75
+ onClick: handleRemoveAll,
76
+ children: clear
77
+ })
78
+ ] }), options.map((option) => {
79
+ const isChecked = (value || []).includes(option.value);
80
+ return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("input", {
81
+ id: option.value,
82
+ type: "checkbox",
83
+ value: option.value,
84
+ onChange: handleChange,
85
+ checked: isChecked
86
+ }), /* @__PURE__ */ jsx("label", {
87
+ htmlFor: option.value,
88
+ children: option.label
89
+ })] }, option.value);
90
+ })] }) : /* @__PURE__ */ jsxs(styles_default.Select, {
91
+ onChange: handleChange,
92
+ value: value || "",
93
+ children: [/* @__PURE__ */ jsx("option", {
94
+ value: "",
95
+ children: placeholder || none
96
+ }), options.map((option) => /* @__PURE__ */ jsx("option", {
97
+ value: option.value,
98
+ children: option.label
99
+ }, option.value))]
100
+ }) })]
101
+ });
102
+ };
103
+ //#endregion
104
+ export { InputConfig as default };
@@ -0,0 +1 @@
1
+ export type { MultiConfigProps } from './MultiConfig';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { JSX } from 'react';
2
+ import type { DashboardProps } from '../../types';
3
+ import './dashboard.css';
4
+ type Props = {
5
+ title?: DashboardProps['title'];
6
+ widgetDefinitions: DashboardProps['widgetDefinitions'];
7
+ };
8
+ declare const DashboardComponent: ({ title, widgetDefinitions }: Props) => JSX.Element;
9
+ export default DashboardComponent;
@@ -0,0 +1,16 @@
1
+ import styles_default from "../../styles.js";
2
+ import Header_default from "../Header/index.js";
3
+ import Layout_default from "../Layout/index.js";
4
+ import DashboardBody from "./components/Body.js";
5
+ import LayoutErrorBoundary from "./components/LayoutErrorBoundary.js";
6
+ /* empty css */
7
+ import "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ //#region packages/ui/Modules/Dashboard/components/Dashboard/Dashboard.tsx
10
+ const emptyWidgetDefinitions = [];
11
+ const DashboardComponent = ({ title, widgetDefinitions = emptyWidgetDefinitions }) => /* @__PURE__ */ jsxs(styles_default.Wrapper, { children: [/* @__PURE__ */ jsx(Header_default, {
12
+ title,
13
+ widgetDefinitions
14
+ }), /* @__PURE__ */ jsx(DashboardBody, { children: /* @__PURE__ */ jsx(LayoutErrorBoundary, { children: /* @__PURE__ */ jsx(Layout_default, { widgetDefinitions }) }) })] });
15
+ //#endregion
16
+ export { DashboardComponent as default };
@@ -0,0 +1,4 @@
1
+ import type { JSX } from 'react';
2
+ import type { DashboardProps } from '../../types';
3
+ declare const DashboardContainer: ({ initialWidgets, onChange, lang, components, ...rest }: DashboardProps) => JSX.Element;
4
+ export default DashboardContainer;