@mailstep/design-system 0.8.52 → 0.9.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 (294) hide show
  1. package/package.json +22 -6
  2. package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +1 -1
  3. package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.d.ts +0 -1
  4. package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +1 -1
  5. package/ui/Blocks/CommonGrid/store/index.js +1 -2
  6. package/ui/Blocks/Header/components/UserMenu/index.js +1 -1
  7. package/ui/Blocks/Header/styles.js +1 -1
  8. package/ui/Elements/Avatar/Avatar.js +1 -1
  9. package/ui/Elements/Avatar/styles.js +1 -1
  10. package/ui/Elements/Button/styles.js +1 -1
  11. package/ui/Elements/DropdownMenu/components/MenuItem.js +16 -29
  12. package/ui/Elements/DropdownMenu/types.d.ts +0 -2
  13. package/ui/Modules/Dashboard/Hoc/LoadingBoundary.d.ts +8 -0
  14. package/ui/Modules/Dashboard/Hoc/LoadingBoundary.js +11 -0
  15. package/ui/Modules/Dashboard/Hoc/index.d.ts +3 -0
  16. package/ui/Modules/Dashboard/Hoc/index.js +4 -0
  17. package/ui/Modules/Dashboard/Hoc/storybook/withReduxProvider.d.ts +4 -0
  18. package/ui/Modules/Dashboard/Hoc/storybook/withReduxProvider.js +14 -0
  19. package/ui/Modules/Dashboard/Hoc/withConfig.d.ts +7 -0
  20. package/ui/Modules/Dashboard/Hoc/withConfig.js +22 -0
  21. package/ui/Modules/Dashboard/Hoc/withFetch.d.ts +26 -0
  22. package/ui/Modules/Dashboard/Hoc/withFetch.js +50 -0
  23. package/ui/Modules/Dashboard/Hoc/withProps.d.ts +4 -0
  24. package/ui/Modules/Dashboard/Hoc/withProps.js +25 -0
  25. package/ui/Modules/Dashboard/assets/BarChartPreview.png +0 -0
  26. package/ui/Modules/Dashboard/assets/ColorBoxPreview.png +0 -0
  27. package/ui/Modules/Dashboard/assets/HorizontalBarPreview.png +0 -0
  28. package/ui/Modules/Dashboard/assets/NumberBoxPreview.png +0 -0
  29. package/ui/Modules/Dashboard/assets/PieChartPreview.png +0 -0
  30. package/ui/Modules/Dashboard/assets/TablePreview.png +0 -0
  31. package/ui/Modules/Dashboard/assets/TextBoxPreview.png +0 -0
  32. package/ui/Modules/Dashboard/assets/move.svg +18 -0
  33. package/ui/Modules/Dashboard/components/Config/MultiConfig.d.ts +6 -0
  34. package/ui/Modules/Dashboard/components/Config/MultiConfig.js +51 -0
  35. package/ui/Modules/Dashboard/components/Config/components/CommonConfig.d.ts +4 -0
  36. package/ui/Modules/Dashboard/components/Config/components/CommonConfig.js +20 -0
  37. package/ui/Modules/Dashboard/components/Config/components/InputConfig.d.ts +5 -0
  38. package/ui/Modules/Dashboard/components/Config/components/InputConfig.js +104 -0
  39. package/ui/Modules/Dashboard/components/Config/types.d.ts +1 -0
  40. package/ui/Modules/Dashboard/components/Config/types.js +1 -0
  41. package/ui/Modules/Dashboard/components/Dashboard/Dashboard.d.ts +9 -0
  42. package/ui/Modules/Dashboard/components/Dashboard/Dashboard.js +16 -0
  43. package/ui/Modules/Dashboard/components/Dashboard/DashboardContainer.d.ts +4 -0
  44. package/ui/Modules/Dashboard/components/Dashboard/DashboardContainer.js +31 -0
  45. package/ui/Modules/Dashboard/components/Dashboard/components/Body.d.ts +7 -0
  46. package/ui/Modules/Dashboard/components/Dashboard/components/Body.js +7 -0
  47. package/ui/Modules/Dashboard/components/Dashboard/components/HandleChange.d.ts +6 -0
  48. package/ui/Modules/Dashboard/components/Dashboard/components/HandleChange.js +25 -0
  49. package/ui/Modules/Dashboard/components/Dashboard/components/LayoutErrorBoundary.d.ts +13 -0
  50. package/ui/Modules/Dashboard/components/Dashboard/components/LayoutErrorBoundary.js +19 -0
  51. package/ui/Modules/Dashboard/components/Dashboard/dashboard2.css +124 -0
  52. package/ui/Modules/Dashboard/components/Dashboard/index.d.ts +2 -0
  53. package/ui/Modules/Dashboard/components/Dashboard/index.js +5 -0
  54. package/ui/Modules/Dashboard/components/Header/Header.d.ts +8 -0
  55. package/ui/Modules/Dashboard/components/Header/Header.js +9 -0
  56. package/ui/Modules/Dashboard/components/Header/index.d.ts +2 -0
  57. package/ui/Modules/Dashboard/components/Header/index.js +5 -0
  58. package/ui/Modules/Dashboard/components/Layout/Layout.d.ts +18 -0
  59. package/ui/Modules/Dashboard/components/Layout/Layout.js +39 -0
  60. package/ui/Modules/Dashboard/components/Layout/LayoutContainer.d.ts +7 -0
  61. package/ui/Modules/Dashboard/components/Layout/LayoutContainer.js +40 -0
  62. package/ui/Modules/Dashboard/components/Layout/components/Item/Item.d.ts +18 -0
  63. package/ui/Modules/Dashboard/components/Layout/components/Item/Item.js +79 -0
  64. package/ui/Modules/Dashboard/components/Layout/components/Item/ItemContainer.d.ts +11 -0
  65. package/ui/Modules/Dashboard/components/Layout/components/Item/ItemContainer.js +64 -0
  66. package/ui/Modules/Dashboard/components/Layout/components/Item/WidgetErrorBoundary.d.ts +14 -0
  67. package/ui/Modules/Dashboard/components/Layout/components/Item/WidgetErrorBoundary.js +28 -0
  68. package/ui/Modules/Dashboard/components/Layout/components/Item/index.d.ts +2 -0
  69. package/ui/Modules/Dashboard/components/Layout/components/Item/index.js +5 -0
  70. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfig.d.ts +13 -0
  71. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfig.js +18 -0
  72. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfigControls.d.ts +8 -0
  73. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/ItemConfigControls.js +31 -0
  74. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/index.d.ts +2 -0
  75. package/ui/Modules/Dashboard/components/Layout/components/ItemConfig/index.js +5 -0
  76. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/ItemHeader.d.ts +12 -0
  77. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/ItemHeader.js +27 -0
  78. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/index.d.ts +2 -0
  79. package/ui/Modules/Dashboard/components/Layout/components/ItemHeader/index.js +5 -0
  80. package/ui/Modules/Dashboard/components/Layout/index.d.ts +2 -0
  81. package/ui/Modules/Dashboard/components/Layout/index.js +5 -0
  82. package/ui/Modules/Dashboard/components/NoData/NoData.d.ts +2 -0
  83. package/ui/Modules/Dashboard/components/NoData/NoData.js +14 -0
  84. package/ui/Modules/Dashboard/components/NoData/index.d.ts +2 -0
  85. package/ui/Modules/Dashboard/components/NoData/index.js +5 -0
  86. package/ui/Modules/Dashboard/components/Picker/Picker.d.ts +8 -0
  87. package/ui/Modules/Dashboard/components/Picker/Picker.js +38 -0
  88. package/ui/Modules/Dashboard/components/Picker/PickerContainer.d.ts +7 -0
  89. package/ui/Modules/Dashboard/components/Picker/PickerContainer.js +38 -0
  90. package/ui/Modules/Dashboard/components/Picker/components/PickerItem.d.ts +8 -0
  91. package/ui/Modules/Dashboard/components/Picker/components/PickerItem.js +25 -0
  92. package/ui/Modules/Dashboard/components/Picker/index.d.ts +2 -0
  93. package/ui/Modules/Dashboard/components/Picker/index.js +5 -0
  94. package/ui/Modules/Dashboard/components/Text/Text.d.ts +7 -0
  95. package/ui/Modules/Dashboard/components/Text/Text.js +14 -0
  96. package/ui/Modules/Dashboard/components/Text/index.d.ts +1 -0
  97. package/ui/Modules/Dashboard/components/Text/index.js +2 -0
  98. package/ui/Modules/Dashboard/components/Widgets/BarChart/BarChart.d.ts +19 -0
  99. package/ui/Modules/Dashboard/components/Widgets/BarChart/BarChart.js +52 -0
  100. package/ui/Modules/Dashboard/components/Widgets/BarChart/Config.d.ts +1 -0
  101. package/ui/Modules/Dashboard/components/Widgets/BarChart/Config.js +5 -0
  102. package/ui/Modules/Dashboard/components/Widgets/BarChart/index.d.ts +4 -0
  103. package/ui/Modules/Dashboard/components/Widgets/BarChart/index.js +6 -0
  104. package/ui/Modules/Dashboard/components/Widgets/BarChart/styles.d.ts +12 -0
  105. package/ui/Modules/Dashboard/components/Widgets/BarChart/styles.js +39 -0
  106. package/ui/Modules/Dashboard/components/Widgets/ColorBox/ColorBox.d.ts +7 -0
  107. package/ui/Modules/Dashboard/components/Widgets/ColorBox/ColorBox.js +21 -0
  108. package/ui/Modules/Dashboard/components/Widgets/ColorBox/Config.d.ts +3 -0
  109. package/ui/Modules/Dashboard/components/Widgets/ColorBox/Config.js +23 -0
  110. package/ui/Modules/Dashboard/components/Widgets/ColorBox/index.d.ts +4 -0
  111. package/ui/Modules/Dashboard/components/Widgets/ColorBox/index.js +6 -0
  112. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/EmptyWidget.d.ts +7 -0
  113. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/EmptyWidget.js +10 -0
  114. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/index.d.ts +2 -0
  115. package/ui/Modules/Dashboard/components/Widgets/EmptyWidget/index.js +5 -0
  116. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/Config.d.ts +1 -0
  117. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/Config.js +5 -0
  118. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/HorizontalBar.d.ts +4 -0
  119. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/HorizontalBar.js +38 -0
  120. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.d.ts +8 -0
  121. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.js +14 -0
  122. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/ProgressLine.d.ts +7 -0
  123. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/ProgressLine.js +14 -0
  124. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/index.d.ts +4 -0
  125. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/index.js +6 -0
  126. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/storybook.sample.d.ts +2 -0
  127. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/storybook.sample.js +33 -0
  128. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/styles.d.ts +18 -0
  129. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/styles.js +58 -0
  130. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/types.d.ts +13 -0
  131. package/ui/Modules/Dashboard/components/Widgets/HorizontalBar/types.js +1 -0
  132. package/ui/Modules/Dashboard/components/Widgets/NumberBox/Config.d.ts +4 -0
  133. package/ui/Modules/Dashboard/components/Widgets/NumberBox/Config.js +38 -0
  134. package/ui/Modules/Dashboard/components/Widgets/NumberBox/NumberBox.d.ts +5 -0
  135. package/ui/Modules/Dashboard/components/Widgets/NumberBox/NumberBox.js +38 -0
  136. package/ui/Modules/Dashboard/components/Widgets/NumberBox/index.d.ts +4 -0
  137. package/ui/Modules/Dashboard/components/Widgets/NumberBox/index.js +6 -0
  138. package/ui/Modules/Dashboard/components/Widgets/NumberBox/styles.d.ts +4 -0
  139. package/ui/Modules/Dashboard/components/Widgets/NumberBox/styles.js +25 -0
  140. package/ui/Modules/Dashboard/components/Widgets/PieChart/Config.d.ts +1 -0
  141. package/ui/Modules/Dashboard/components/Widgets/PieChart/Config.js +5 -0
  142. package/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.d.ts +21 -0
  143. package/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.js +59 -0
  144. package/ui/Modules/Dashboard/components/Widgets/PieChart/components/CenteredMetric.d.ts +10 -0
  145. package/ui/Modules/Dashboard/components/Widgets/PieChart/components/CenteredMetric.js +24 -0
  146. package/ui/Modules/Dashboard/components/Widgets/PieChart/index.d.ts +4 -0
  147. package/ui/Modules/Dashboard/components/Widgets/PieChart/index.js +6 -0
  148. package/ui/Modules/Dashboard/components/Widgets/PieChart/styles.d.ts +14 -0
  149. package/ui/Modules/Dashboard/components/Widgets/PieChart/styles.js +47 -0
  150. package/ui/Modules/Dashboard/components/Widgets/Table/Config.d.ts +9 -0
  151. package/ui/Modules/Dashboard/components/Widgets/Table/Config.js +87 -0
  152. package/ui/Modules/Dashboard/components/Widgets/Table/Table.d.ts +4 -0
  153. package/ui/Modules/Dashboard/components/Widgets/Table/Table.js +93 -0
  154. package/ui/Modules/Dashboard/components/Widgets/Table/components/IconLabelCell.d.ts +8 -0
  155. package/ui/Modules/Dashboard/components/Widgets/Table/components/IconLabelCell.js +19 -0
  156. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorList.d.ts +9 -0
  157. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorList.js +31 -0
  158. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorLocation.d.ts +8 -0
  159. package/ui/Modules/Dashboard/components/Widgets/Table/components/PaginatorLocation.js +15 -0
  160. package/ui/Modules/Dashboard/components/Widgets/Table/components/TableCell.d.ts +6 -0
  161. package/ui/Modules/Dashboard/components/Widgets/Table/components/TableCell.js +33 -0
  162. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useCondition.d.ts +10 -0
  163. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useCondition.js +27 -0
  164. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/usePages.d.ts +17 -0
  165. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/usePages.js +27 -0
  166. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useSort.d.ts +10 -0
  167. package/ui/Modules/Dashboard/components/Widgets/Table/hooks/useSort.js +31 -0
  168. package/ui/Modules/Dashboard/components/Widgets/Table/index.d.ts +5 -0
  169. package/ui/Modules/Dashboard/components/Widgets/Table/index.js +7 -0
  170. package/ui/Modules/Dashboard/components/Widgets/Table/storybook.sample.d.ts +73 -0
  171. package/ui/Modules/Dashboard/components/Widgets/Table/storybook.sample.js +211 -0
  172. package/ui/Modules/Dashboard/components/Widgets/Table/styles.d.ts +23 -0
  173. package/ui/Modules/Dashboard/components/Widgets/Table/styles.js +69 -0
  174. package/ui/Modules/Dashboard/components/Widgets/Table/types.d.ts +52 -0
  175. package/ui/Modules/Dashboard/components/Widgets/Table/types.js +1 -0
  176. package/ui/Modules/Dashboard/components/Widgets/TextBox/TextBox.d.ts +10 -0
  177. package/ui/Modules/Dashboard/components/Widgets/TextBox/TextBox.js +12 -0
  178. package/ui/Modules/Dashboard/components/Widgets/TextBox/index.d.ts +3 -0
  179. package/ui/Modules/Dashboard/components/Widgets/TextBox/index.js +5 -0
  180. package/ui/Modules/Dashboard/components/Widgets/index.d.ts +11 -0
  181. package/ui/Modules/Dashboard/components/Widgets/index.js +108 -0
  182. package/ui/Modules/Dashboard/components/Widgets/utils/generic.d.ts +5 -0
  183. package/ui/Modules/Dashboard/components/Widgets/utils/generic.js +20 -0
  184. package/ui/Modules/Dashboard/components/Widgets/utils/helpers.d.ts +3 -0
  185. package/ui/Modules/Dashboard/components/Widgets/utils/helpers.js +25 -0
  186. package/ui/Modules/Dashboard/components/Widgets/utils/legends.d.ts +20 -0
  187. package/ui/Modules/Dashboard/components/Widgets/utils/legends.js +57 -0
  188. package/ui/Modules/Dashboard/context/ComponentContext.d.ts +5 -0
  189. package/ui/Modules/Dashboard/context/ComponentContext.js +15 -0
  190. package/ui/Modules/Dashboard/context/LangContext.d.ts +3 -0
  191. package/ui/Modules/Dashboard/context/LangContext.js +5 -0
  192. package/ui/Modules/Dashboard/errors/ErrorMessage.d.ts +7 -0
  193. package/ui/Modules/Dashboard/errors/ErrorMessage.js +12 -0
  194. package/ui/Modules/Dashboard/errors/WidgetError.d.ts +5 -0
  195. package/ui/Modules/Dashboard/errors/WidgetError.js +10 -0
  196. package/ui/Modules/Dashboard/hooks/usePrevious.d.ts +5 -0
  197. package/ui/Modules/Dashboard/hooks/usePrevious.js +14 -0
  198. package/ui/Modules/Dashboard/hooks/useRefWithCallback.d.ts +2 -0
  199. package/ui/Modules/Dashboard/hooks/useRefWithCallback.js +16 -0
  200. package/ui/Modules/Dashboard/hooks/useResize.d.ts +6 -0
  201. package/ui/Modules/Dashboard/hooks/useResize.js +19 -0
  202. package/ui/Modules/Dashboard/index.d.ts +7 -0
  203. package/ui/Modules/Dashboard/index.js +12 -0
  204. package/ui/Modules/Dashboard/locale/cs.d.ts +24 -0
  205. package/ui/Modules/Dashboard/locale/cs.js +26 -0
  206. package/ui/Modules/Dashboard/locale/en.d.ts +24 -0
  207. package/ui/Modules/Dashboard/locale/en.js +26 -0
  208. package/ui/Modules/Dashboard/locale/index.d.ts +4 -0
  209. package/ui/Modules/Dashboard/locale/index.js +13 -0
  210. package/ui/Modules/Dashboard/locale/it.d.ts +24 -0
  211. package/ui/Modules/Dashboard/locale/it.js +26 -0
  212. package/ui/Modules/Dashboard/locale/uk.d.ts +24 -0
  213. package/ui/Modules/Dashboard/locale/uk.js +26 -0
  214. package/ui/Modules/Dashboard/store/reducers/index.d.ts +9 -0
  215. package/ui/Modules/Dashboard/store/reducers/index.js +6 -0
  216. package/ui/Modules/Dashboard/store/reducers/widgetListReducer.d.ts +41 -0
  217. package/ui/Modules/Dashboard/store/reducers/widgetListReducer.js +76 -0
  218. package/ui/Modules/Dashboard/stories/storybook.sample.d.ts +50 -0
  219. package/ui/Modules/Dashboard/stories/storybook.sample.js +237 -0
  220. package/ui/Modules/Dashboard/styles.d.ts +63 -0
  221. package/ui/Modules/Dashboard/styles.js +358 -0
  222. package/ui/Modules/Dashboard/types.d.ts +185 -0
  223. package/ui/Modules/Dashboard/types.js +1 -0
  224. package/ui/Modules/index.d.ts +1 -0
  225. package/ui/Modules/index.js +8 -0
  226. package/ui/ThemeProvider/themes/index.d.ts +224 -0
  227. package/ui/ThemeProvider/themes/index.js +3 -1
  228. package/ui/ThemeProvider/themes/mailwiseDark.d.ts +225 -0
  229. package/ui/ThemeProvider/themes/mailwiseDark.js +16 -0
  230. package/ui/ThemeProvider/types.d.ts +1 -1
  231. package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.d.ts +0 -41
  232. package/ui/Blocks/CommonGrid/storybook/stories/default.stories.d.ts +0 -6
  233. package/ui/Blocks/CommonGrid/storybook/stories/gridStates.stories.d.ts +0 -8
  234. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.d.ts +0 -10
  235. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.d.ts +0 -10
  236. package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.d.ts +0 -6
  237. package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.d.ts +0 -10
  238. package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.d.ts +0 -14
  239. package/ui/Blocks/CommonGrid/storybook/stories/withQuickFilter.stories.d.ts +0 -11
  240. package/ui/Blocks/CornerDialog/stories/CornerDialog.stories.d.ts +0 -13
  241. package/ui/Blocks/Header/stories/Header.stories.d.ts +0 -52
  242. package/ui/Blocks/HidePrint/stories/HidePrint.stories.d.ts +0 -12
  243. package/ui/Blocks/ImageList/stories/ImageList.stories.d.ts +0 -14
  244. package/ui/Blocks/LanguageSwitch/stories/LanguageSwith.stories.d.ts +0 -10
  245. package/ui/Blocks/LightBox/stories/LightBox.stories.d.ts +0 -10
  246. package/ui/Blocks/LoginPage/stories/LoginPage.stories.d.ts +0 -10
  247. package/ui/Blocks/Modal/stories/Modal.stories.d.ts +0 -28
  248. package/ui/Blocks/Popover/stories/Popover.stories.d.ts +0 -16
  249. package/ui/Blocks/Scheduler/stories/Scheduler.stories.d.ts +0 -7
  250. package/ui/Blocks/SideMenu/stories/SideMenu.stories.d.ts +0 -11
  251. package/ui/Blocks/Stepper/stories/Stepper.stories.d.ts +0 -9
  252. package/ui/Blocks/Table/stories/Table.stories.d.ts +0 -12
  253. package/ui/Blocks/Tabs/stories/Tabs.stories.d.ts +0 -12
  254. package/ui/Elements/Alert/stories/Alert.stories.d.ts +0 -17
  255. package/ui/Elements/AsyncSelect/stories/AsyncSelect.stories.d.ts +0 -10
  256. package/ui/Elements/Avatar/stories/Avatar.stories.d.ts +0 -11
  257. package/ui/Elements/Badge/stories/Badge.stories.d.ts +0 -12
  258. package/ui/Elements/BarChartSymbol/stories/BarChartSymbol.stories.d.ts +0 -12
  259. package/ui/Elements/BorderedBox/stories/BorderedBox.stories.d.ts +0 -10
  260. package/ui/Elements/Button/stories/Button.stories.d.ts +0 -28
  261. package/ui/Elements/Card/stories/Card.stories.d.ts +0 -13
  262. package/ui/Elements/CheckedCircle/storries/CheckedCircle.stories.d.ts +0 -16
  263. package/ui/Elements/DatePicker/stories/DatePicker.stories.d.ts +0 -11
  264. package/ui/Elements/Dropdown/stories/Dropdown.stories.d.ts +0 -10
  265. package/ui/Elements/DropdownMenu/stories/DropdownMenu.stories.d.ts +0 -10
  266. package/ui/Elements/DropdownSelect/stories/DropdownSelect.stories.d.ts +0 -22
  267. package/ui/Elements/ErrorMessage/stories/ErrorMessage.stories.d.ts +0 -11
  268. package/ui/Elements/HighlightBox/stories/HighlightBox.stories.d.ts +0 -31
  269. package/ui/Elements/Icon/stories/BadgeIcon.stories.d.ts +0 -28
  270. package/ui/Elements/Icon/stories/Icon.stories.d.ts +0 -15
  271. package/ui/Elements/Image/stories/Image.stories.d.ts +0 -13
  272. package/ui/Elements/Label/stories/Label.stories.d.ts +0 -13
  273. package/ui/Elements/Line/stories/Line.stories.d.ts +0 -16
  274. package/ui/Elements/Link/stories/Link.stories.d.ts +0 -30
  275. package/ui/Elements/Logo/stories/Logo.stories.d.ts +0 -37
  276. package/ui/Elements/Pagination/stories/Pagination.stories.d.ts +0 -13
  277. package/ui/Elements/Portal/stories/Portal.stories.d.ts +0 -11
  278. package/ui/Elements/ProgressBar/stories/ProgressBar.stories.d.ts +0 -18
  279. package/ui/Elements/Select/stories/Select.stories.d.ts +0 -9
  280. package/ui/Elements/SimpleLink/stories/SimpleLink.stories.d.ts +0 -13
  281. package/ui/Elements/SingleSelect/stories/SingleSelect.stories.d.ts +0 -10
  282. package/ui/Elements/SpaceAround/stories/SpaceAround.stories.d.ts +0 -11
  283. package/ui/Elements/Spinner/stories/Spinner.stories.d.ts +0 -19
  284. package/ui/Elements/Table/stories/Table.stories.d.ts +0 -8
  285. package/ui/Elements/Tag/stories/Tag.stories.d.ts +0 -19
  286. package/ui/Elements/Text/stories/Text.stories.d.ts +0 -15
  287. package/ui/Elements/Toast/stories/Toast.stories.d.ts +0 -13
  288. package/ui/Elements/Toggle/stories/Toggle.stories.d.ts +0 -16
  289. package/ui/Elements/Tooltip/stories/Tooltip.stories.d.ts +0 -10
  290. package/ui/Elements/Typography/stories/Typography.stories.d.ts +0 -20
  291. package/ui/Forms/Checkbox/stories/Checkbox.stories.d.ts +0 -13
  292. package/ui/Forms/Input/stories/Input.stories.d.ts +0 -18
  293. package/ui/Forms/RadioButton/stories/RadioButton.stories.d.ts +0 -13
  294. package/ui/utils/KeyPress/KeyPress.stories.d.ts +0 -10
@@ -0,0 +1,211 @@
1
+ import { IconLabelCell } from "./components/IconLabelCell.js";
2
+ import "./index.js";
3
+ import { withProps } from "../../../Hoc/withProps.js";
4
+ //#region packages/ui/Modules/Dashboard/components/Widgets/Table/storybook.sample.ts
5
+ const tableData = [
6
+ {
7
+ id: "1",
8
+ company: {
9
+ icon: "🎸",
10
+ label: "Dixons",
11
+ value: "Dixons",
12
+ text: "meguc@ruj.io"
13
+ },
14
+ category: {
15
+ icon: "📕",
16
+ label: "Technology",
17
+ value: "Technology"
18
+ },
19
+ views: {
20
+ label: "23.5k",
21
+ value: 23500,
22
+ text: "in 24 hours"
23
+ },
24
+ revenue: {
25
+ label: "$891.2",
26
+ value: 891.2
27
+ },
28
+ sales: {
29
+ icon: "📈",
30
+ label: "68%",
31
+ value: 68
32
+ }
33
+ },
34
+ {
35
+ id: "2",
36
+ company: {
37
+ icon: "🧯",
38
+ label: "Motels",
39
+ value: "Motels",
40
+ text: "vaxav@hodzi.co.uk"
41
+ },
42
+ category: {
43
+ icon: "📗",
44
+ label: "Technology",
45
+ value: "Technology"
46
+ },
47
+ views: {
48
+ label: "78k",
49
+ value: 78e3,
50
+ text: "in 2 days"
51
+ },
52
+ revenue: {
53
+ label: "$668.51",
54
+ value: 668.51
55
+ },
56
+ sales: {
57
+ icon: "📉",
58
+ label: "68%",
59
+ value: 68
60
+ }
61
+ },
62
+ {
63
+ id: "3",
64
+ company: {
65
+ icon: "🪆",
66
+ label: "Zipcar",
67
+ value: "Zipcar",
68
+ text: "davcilse@is.gov"
69
+ },
70
+ category: {
71
+ icon: "📘",
72
+ label: "Technology",
73
+ value: "Technology"
74
+ },
75
+ views: {
76
+ label: "162",
77
+ value: 162,
78
+ text: "in 5 days"
79
+ },
80
+ revenue: {
81
+ label: "$422.29",
82
+ value: 422.29
83
+ },
84
+ sales: {
85
+ icon: "📉",
86
+ label: "68%",
87
+ value: 68
88
+ }
89
+ },
90
+ {
91
+ id: "4",
92
+ company: {
93
+ icon: "🧸",
94
+ label: "Owning",
95
+ value: "Owning",
96
+ text: "us@cuhil.gov"
97
+ },
98
+ category: {
99
+ icon: "📕",
100
+ label: "Technology",
101
+ value: "Technology"
102
+ },
103
+ views: {
104
+ label: "214",
105
+ value: 214,
106
+ text: "in 24 hours"
107
+ },
108
+ revenue: {
109
+ label: "$291.01",
110
+ value: 291.01
111
+ },
112
+ sales: {
113
+ icon: "📉",
114
+ label: "68%",
115
+ value: 68
116
+ }
117
+ }
118
+ ];
119
+ const tableBigData = Array.from({ length: 101 }, (i, k) => {
120
+ const company = [
121
+ "Google",
122
+ "Dixons",
123
+ "Motels",
124
+ "Owning",
125
+ "Zipcar"
126
+ ][Math.round(Math.random() * 4)];
127
+ const category = [
128
+ "Tea",
129
+ "Coffee",
130
+ "Beer",
131
+ "Water",
132
+ "Milk"
133
+ ][Math.round(Math.random() * 4)];
134
+ const views = Math.round(Math.random() * 240);
135
+ const revenue = Math.round(Math.random() * 540);
136
+ const sales = Math.round(Math.random() * 100);
137
+ return {
138
+ id: k,
139
+ readableId: { text: k },
140
+ company: {
141
+ icon: [
142
+ "🧸",
143
+ "🪆",
144
+ "🧯",
145
+ "🎸",
146
+ "📕"
147
+ ][Math.round(Math.random() * 4)],
148
+ label: company,
149
+ value: company,
150
+ text: "us@cuhil.gov"
151
+ },
152
+ category: {
153
+ icon: [
154
+ "🧸",
155
+ "🪆",
156
+ "🧯",
157
+ "🎸",
158
+ "📕"
159
+ ][Math.round(Math.random() * 4)],
160
+ label: category,
161
+ value: category
162
+ },
163
+ views: {
164
+ label: views,
165
+ value: views,
166
+ text: "in 24 hours"
167
+ },
168
+ revenue: {
169
+ label: `${revenue}`,
170
+ value: revenue
171
+ },
172
+ sales: {
173
+ icon: "📉",
174
+ label: `${sales}%`,
175
+ value: sales
176
+ }
177
+ };
178
+ });
179
+ const tableColumns = [
180
+ {
181
+ key: "readableId",
182
+ label: "id"
183
+ },
184
+ {
185
+ key: "company",
186
+ label: "COMPANY",
187
+ component: IconLabelCell
188
+ },
189
+ {
190
+ key: "category",
191
+ label: "CATEGORY",
192
+ component: IconLabelCell
193
+ },
194
+ {
195
+ key: "views",
196
+ label: "VIEWS",
197
+ component: IconLabelCell
198
+ },
199
+ {
200
+ key: "revenue",
201
+ label: "REVENUE",
202
+ component: IconLabelCell
203
+ },
204
+ {
205
+ key: "sales",
206
+ label: "SALES",
207
+ component: withProps({ iconRight: true })(IconLabelCell)
208
+ }
209
+ ];
210
+ //#endregion
211
+ export { tableBigData, tableColumns, tableData };
@@ -0,0 +1,23 @@
1
+ declare const _default: {
2
+ Table: import("styled-components").StyledComponent<"table", import("@xstyled/styled-components").Theme, {}, never>;
3
+ Th: import("styled-components").StyledComponent<"th", import("@xstyled/styled-components").Theme, {
4
+ onClick?: any;
5
+ sort?: "asc" | "desc";
6
+ }, never>;
7
+ Td: import("styled-components").StyledComponent<"td", import("@xstyled/styled-components").Theme, {
8
+ onClick?: () => void;
9
+ color?: string;
10
+ }, never>;
11
+ Tr: import("styled-components").StyledComponent<"tr", import("@xstyled/styled-components").Theme, {}, never>;
12
+ IconLabelCell: import("styled-components").StyledComponent<"div", import("@xstyled/styled-components").Theme, {}, never>;
13
+ CellIcon: import("styled-components").StyledComponent<"div", import("@xstyled/styled-components").Theme, {
14
+ iconRight: boolean;
15
+ }, never>;
16
+ CellLabel: import("styled-components").StyledComponent<"div", import("@xstyled/styled-components").Theme, {}, never>;
17
+ CellText: import("styled-components").StyledComponent<"div", import("@xstyled/styled-components").Theme, {}, never>;
18
+ Paginator: import("styled-components").StyledComponent<"div", import("@xstyled/styled-components").Theme, {}, never>;
19
+ PaginatorItem: import("styled-components").StyledComponent<"span", import("@xstyled/styled-components").Theme, {
20
+ selected?: boolean;
21
+ }, never>;
22
+ };
23
+ export default _default;
@@ -0,0 +1,69 @@
1
+ import styled$1 from "@xstyled/styled-components";
2
+ //#region packages/ui/Modules/Dashboard/components/Widgets/Table/styles.ts
3
+ var styles_default = {
4
+ Table: styled$1.table`
5
+ border: 1px solid;
6
+ border-color: bgLightGray2;
7
+ width: 100%;
8
+ white-space: nowrap;
9
+ text-overflow: ellipsis;
10
+ `,
11
+ Th: styled$1.th`
12
+ padding: 10px;
13
+ background-color: lightGray6;
14
+ text-align: left;
15
+ &:hover {
16
+ background-color: ${({ onClick }) => onClick ? "#e1e1e3" : "auto"};
17
+ cursor: ${({ onClick }) => onClick ? "pointer" : "auto"};
18
+ }
19
+ &:after {
20
+ content: ' ${({ sort }) => sort === "asc" ? "⇣" : sort === "desc" && "⇡" || ""}';
21
+ }
22
+ `,
23
+ Td: styled$1.td`
24
+ padding: 10px;
25
+ border-bottom: 1px solid #f3f2f7;
26
+ background-color: ${({ color }) => color || "auto"};
27
+ &:hover {
28
+ background-color: ${({ onClick }) => onClick ? "#f3f2f7" : "auto"};
29
+ cursor: ${({ onClick }) => onClick ? "pointer" : "auto"};
30
+ }
31
+ `,
32
+ Tr: styled$1.tr``,
33
+ IconLabelCell: styled$1.div`
34
+ display: flex;
35
+ align-items: center;
36
+ `,
37
+ CellIcon: styled$1.div`
38
+ font-size: 18px;
39
+ margin-right: ${({ iconRight }) => iconRight ? "0" : "20px"};
40
+ margin-left: ${({ iconRight }) => iconRight ? "20px" : "0"};
41
+ `,
42
+ CellLabel: styled$1.div`
43
+ color: #666;
44
+ font-size: 16px;
45
+ `,
46
+ CellText: styled$1.div`
47
+ color: #999;
48
+ font-size: 15px;
49
+ `,
50
+ Paginator: styled$1.div`
51
+ display: flex;
52
+ justify-content: space-between;
53
+ padding: 10px 10px 0;
54
+ color: gray5;
55
+ height: 27px;
56
+ `,
57
+ PaginatorItem: styled$1.span`
58
+ cursor: pointer;
59
+ font-weight: ${({ selected }) => selected ? "700" : "400"};
60
+ color: gray5;
61
+ display: inline-block;
62
+ padding: 0 5px;
63
+ &::selection {
64
+ background-color: white;
65
+ }
66
+ `
67
+ };
68
+ //#endregion
69
+ export { styles_default as default };
@@ -0,0 +1,52 @@
1
+ import React, { RefObject } from 'react';
2
+ import { WidgetComponentProps, TableClickCallback } from '../../../types';
3
+ export type TableColumn = {
4
+ key: string;
5
+ label: string;
6
+ component?: React.ComponentType<any>;
7
+ };
8
+ export type TableRowData = string | number | {
9
+ label: string;
10
+ value: string;
11
+ } | {
12
+ [key: string]: string | number;
13
+ };
14
+ export type TableRow = {
15
+ id: string;
16
+ [key: string]: TableRowData;
17
+ };
18
+ export interface TableProps extends WidgetComponentProps<TableRow[], TableClickCallback> {
19
+ columns?: TableColumn[];
20
+ hasPages?: boolean;
21
+ hasSorting?: boolean;
22
+ hasServerSorting?: boolean;
23
+ minRows?: number;
24
+ returnWidgetWithPaginationHeight?: (height: number) => void;
25
+ onChange?: OnChangeCallback;
26
+ onSaveConfigProps?: (props: Record<string, any>) => void;
27
+ serverTotal?: number;
28
+ innerRef?: RefObject<HTMLDivElement> | ((node: HTMLDivElement) => void);
29
+ components?: {
30
+ pagination?: React.ElementType;
31
+ };
32
+ }
33
+ export interface TableCellProps {
34
+ component?: React.ComponentType<any>;
35
+ data: Record<string, any>;
36
+ }
37
+ export type TableCondition = {
38
+ column: string;
39
+ comparator: '>' | '<' | '=';
40
+ color: string;
41
+ value: string;
42
+ };
43
+ export type WidgetSort = Record<string, 'asc' | 'desc'>;
44
+ export type WidgetPagination = {
45
+ page: number;
46
+ from: number;
47
+ to: number;
48
+ perPage: number;
49
+ };
50
+ export interface OnChangeCallback {
51
+ (sort: WidgetSort | null, pagination: WidgetPagination | null): void | Promise<void>;
52
+ }
@@ -0,0 +1,10 @@
1
+ import type { JSX } from 'react';
2
+ import { WidgetComponentProps } from '../../../types';
3
+ export type Props = WidgetComponentProps & {
4
+ text?: string;
5
+ };
6
+ /**
7
+ * This is only example of widget
8
+ */
9
+ declare const TextBox: ({ text, innerRef }: Props) => JSX.Element;
10
+ export default TextBox;
@@ -0,0 +1,12 @@
1
+ import "react";
2
+ import { jsxs } from "react/jsx-runtime";
3
+ //#region packages/ui/Modules/Dashboard/components/Widgets/TextBox/TextBox.tsx
4
+ /**
5
+ * This is only example of widget
6
+ */
7
+ const TextBox = ({ text, innerRef }) => /* @__PURE__ */ jsxs("div", {
8
+ ref: innerRef,
9
+ children: ["BTC: 17% ↑ ", text]
10
+ });
11
+ //#endregion
12
+ export { TextBox as default };
@@ -0,0 +1,3 @@
1
+ import TextBox from './TextBox';
2
+ export * from './TextBox';
3
+ export default TextBox;
@@ -0,0 +1,5 @@
1
+ import TextBox from "./TextBox.js";
2
+ //#region packages/ui/Modules/Dashboard/components/Widgets/TextBox/index.tsx
3
+ var TextBox_default = TextBox;
4
+ //#endregion
5
+ export { TextBox_default as default };
@@ -0,0 +1,11 @@
1
+ import type { WidgetDefinition } from '../../types';
2
+ import { components as WidgetTableComponents } from './Table';
3
+ export declare const ColorBox: WidgetDefinition;
4
+ export declare const TextBox: WidgetDefinition;
5
+ export declare const PieChart: WidgetDefinition;
6
+ export declare const BarChart: WidgetDefinition;
7
+ export declare const Table: WidgetDefinition;
8
+ export { WidgetTableComponents };
9
+ export declare const NumberBox: WidgetDefinition;
10
+ export declare const HorizontalBar: WidgetDefinition;
11
+ export declare const NoWidget: WidgetDefinition;
@@ -0,0 +1,108 @@
1
+ import { Config } from "./ColorBox/Config.js";
2
+ import ColorBox_default from "./ColorBox/index.js";
3
+ import { Config as Config$1 } from "./NumberBox/Config.js";
4
+ import NumberBox_default from "./NumberBox/index.js";
5
+ import TextBox_default from "./TextBox/index.js";
6
+ import { Config as Config$2 } from "./PieChart/Config.js";
7
+ import PieChart_default from "./PieChart/index.js";
8
+ import { Config as Config$3 } from "./BarChart/Config.js";
9
+ import BarChart_default from "./BarChart/index.js";
10
+ import { IconLabelCell_exports } from "./Table/components/IconLabelCell.js";
11
+ import { Config as Config$4 } from "./Table/Config.js";
12
+ import Table_default from "./Table/index.js";
13
+ import { Config as Config$5 } from "./HorizontalBar/Config.js";
14
+ import HorizontalBar_default from "./HorizontalBar/index.js";
15
+ import EmptyWidget_default from "./EmptyWidget/index.js";
16
+ import ColorPreview from "../../assets/ColorBoxPreview.png";
17
+ import TextPreview from "../../assets/TextBoxPreview.png";
18
+ import ChartPreview from "../../assets/PieChartPreview.png";
19
+ import BarPreview from "../../assets/BarChartPreview.png";
20
+ import TablePreview from "../../assets/TablePreview.png";
21
+ import NumberBoxPreview from "../../assets/NumberBoxPreview.png";
22
+ import HorizontalBarPreview from "../../assets/HorizontalBarPreview.png";
23
+ //#region packages/ui/Modules/Dashboard/components/Widgets/index.ts
24
+ const dimensions = (minWidth, minHeight, maxWidth, maxHeight, initWidth, initHeight) => ({
25
+ minWidth,
26
+ minHeight,
27
+ maxWidth,
28
+ maxHeight,
29
+ initWidth,
30
+ initHeight
31
+ });
32
+ const ColorBox = {
33
+ name: "Color Box Widget",
34
+ code: "ColorBox",
35
+ description: "Lorem ipsum dolor sit amet, consectetur adipiscing lorem.",
36
+ preview: ColorPreview,
37
+ component: ColorBox_default,
38
+ configComponent: Config,
39
+ ...dimensions(3, 3, 12, 12, 3, 3)
40
+ };
41
+ const TextBox = {
42
+ name: "Text box Widget",
43
+ code: "text",
44
+ description: "Lorem ipsum dolor sit amet, consectetur adipiscing lorem.",
45
+ preview: TextPreview,
46
+ component: TextBox_default,
47
+ ...dimensions(2, 2, 12, 12, 3, 3)
48
+ };
49
+ const PieChart = {
50
+ name: "Pie Chart",
51
+ code: "chart",
52
+ description: "A pie chart in which you can compare multiple values retrieved from different sources. The source can be selected in the widget configuration.",
53
+ preview: ChartPreview,
54
+ component: PieChart_default,
55
+ configComponent: Config$2,
56
+ ...dimensions(6, 3, 12, 12, 6, 3)
57
+ };
58
+ const BarChart = {
59
+ name: "Bar Chart",
60
+ code: "bar-chart",
61
+ description: "A bar chart in which you can compare multiple values retrieved from different sources. The source can be selected in the widget configuration.",
62
+ preview: BarPreview,
63
+ component: BarChart_default,
64
+ configComponent: Config$3,
65
+ ...dimensions(3, 1, 12, 12, 4, 2)
66
+ };
67
+ const Table = {
68
+ name: "Spreadsheet",
69
+ code: "table",
70
+ description: "Use this widget to view data sources in a spreadsheet. In the widget settings, you can select which source you want to view.",
71
+ preview: TablePreview,
72
+ component: Table_default,
73
+ configComponent: Config$4,
74
+ ...dimensions(2, 2, 12, 12, 5, 2)
75
+ };
76
+ const NumberBox = {
77
+ name: "Big Number",
78
+ code: "number",
79
+ description: "Allows you to display a number representing the sum or status of a resource. The source can be selected in the widget configuration.",
80
+ preview: NumberBoxPreview,
81
+ component: NumberBox_default,
82
+ configComponent: Config$1,
83
+ ...dimensions(1, 1, 12, 12, 3, 2)
84
+ };
85
+ const HorizontalBar = {
86
+ name: "Horizontal bar",
87
+ code: "horizontalBar",
88
+ description: "Displays lines representing percentage based progress.",
89
+ preview: HorizontalBarPreview,
90
+ component: HorizontalBar_default,
91
+ configComponent: Config$5,
92
+ ...dimensions(1, 1, 12, 12, 3, 2)
93
+ };
94
+ const NoWidget = {
95
+ name: "error",
96
+ code: "",
97
+ description: "",
98
+ preview: "",
99
+ minWidth: 0,
100
+ maxWidth: 2,
101
+ minHeight: 0,
102
+ maxHeight: 2,
103
+ initWidth: 2,
104
+ initHeight: 2,
105
+ component: EmptyWidget_default
106
+ };
107
+ //#endregion
108
+ export { BarChart, ColorBox, HorizontalBar, NoWidget, NumberBox, PieChart, Table, TextBox, IconLabelCell_exports as WidgetTableComponents };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns an array of theme colors based on range:
3
+ * [ pieChartColor1, pieChartColor2, ... pieChartColor5]
4
+ */
5
+ export declare const createWidgetColors: (colorBaseName: string, rangeOfColors: number) => string[];
@@ -0,0 +1,20 @@
1
+ //#region packages/ui/Modules/Dashboard/components/Widgets/utils/generic.ts
2
+ const colors = {
3
+ pieChartColor1: "#60ceba",
4
+ pieChartColor2: "#e7c19e",
5
+ pieChartColor3: "#f47561",
6
+ pieChartColor4: "#f0e15b",
7
+ pieChartColor5: "#e8a738",
8
+ barChartColor1: "#60ceba",
9
+ barChartColor2: "#e7c19e",
10
+ barChartColor3: "#f47561",
11
+ barChartColor4: "#f0e15b",
12
+ barChartColor5: "#e8a738"
13
+ };
14
+ /**
15
+ * Returns an array of theme colors based on range:
16
+ * [ pieChartColor1, pieChartColor2, ... pieChartColor5]
17
+ */
18
+ const createWidgetColors = (colorBaseName, rangeOfColors) => new Array(rangeOfColors).fill(colorBaseName).map((colorBaseName, index) => colors[`${colorBaseName}${index + 1}`]);
19
+ //#endregion
20
+ export { createWidgetColors };
@@ -0,0 +1,3 @@
1
+ import { OrdinalColorScaleConfigScheme } from '@nivo/colors';
2
+ export type Colors = OrdinalColorScaleConfigScheme | string[];
3
+ export declare function getColorStringArray(colors: Colors): string[];
@@ -0,0 +1,25 @@
1
+ import { colorSchemes } from "@nivo/colors";
2
+ //#region packages/ui/Modules/Dashboard/components/Widgets/utils/helpers.ts
3
+ function isOrdinalColorScaleConfigScheme(value) {
4
+ return "scheme" in value;
5
+ }
6
+ function is1DStringArray(value) {
7
+ if (Array.isArray(value)) {
8
+ let somethingIsNotString = false;
9
+ value.forEach(function(item) {
10
+ if (typeof item !== "string") somethingIsNotString = true;
11
+ });
12
+ return !somethingIsNotString;
13
+ }
14
+ return false;
15
+ }
16
+ function getColorStringArray(colors) {
17
+ if (isOrdinalColorScaleConfigScheme(colors)) {
18
+ const colorScheme = colorSchemes[colors.scheme];
19
+ if (is1DStringArray(colorScheme)) return [...colorScheme];
20
+ return Array.from(colorScheme[colorScheme.length - 1]);
21
+ }
22
+ return colors;
23
+ }
24
+ //#endregion
25
+ export { getColorStringArray };
@@ -0,0 +1,20 @@
1
+ import { LegendProps } from '@nivo/legends';
2
+ interface NivoWidgetDataEntity {
3
+ id: string | number;
4
+ value: number;
5
+ label?: string;
6
+ }
7
+ interface CreateLegendOptions {
8
+ translateX?: number;
9
+ translateY?: number;
10
+ }
11
+ /**
12
+ * Helper to create multi-row legend for nivo widgets
13
+ * @param data widget data
14
+ * @param colors widget colors
15
+ * @param maxRowLength maximum length (of entities) which a single row can have
16
+ * @param options legend specific options
17
+ * @returns compatible legends prop which can be passed into nivo components
18
+ */
19
+ export declare const createLegendData: (data: NivoWidgetDataEntity[], colors: string[], maxRowLength: number, options?: CreateLegendOptions) => LegendProps[];
20
+ export {};
@@ -0,0 +1,57 @@
1
+ //#region packages/ui/Modules/Dashboard/components/Widgets/utils/legends.ts
2
+ const getLongestProperty = (obj) => {
3
+ const lengths = Object.values(obj).map((e) => String(e)?.length || 0);
4
+ return Math.max(...lengths);
5
+ };
6
+ const calculateItemWidth = (data) => {
7
+ const lengths = data.map(getLongestProperty);
8
+ const maxCharLength = Math.max(...lengths);
9
+ if (maxCharLength < 5) return 50;
10
+ if (maxCharLength < 10) return 100;
11
+ if (maxCharLength < 15) return 150;
12
+ return 200;
13
+ };
14
+ const getBaseLegendProps = (itemWidth, translateX) => ({
15
+ anchor: "bottom",
16
+ direction: "row",
17
+ translateX,
18
+ itemWidth,
19
+ itemHeight: 26,
20
+ itemsSpacing: 25,
21
+ itemTextColor: "#999",
22
+ symbolSize: 10,
23
+ symbolShape: "circle"
24
+ });
25
+ const createColorRange = (baseColors, requiredLength) => new Array(requiredLength).fill("").map((_, index) => baseColors[index % baseColors.length]);
26
+ /**
27
+ * Helper to create multi-row legend for nivo widgets
28
+ * @param data widget data
29
+ * @param colors widget colors
30
+ * @param maxRowLength maximum length (of entities) which a single row can have
31
+ * @param options legend specific options
32
+ * @returns compatible legends prop which can be passed into nivo components
33
+ */
34
+ const createLegendData = (data, colors, maxRowLength, options = {}) => {
35
+ const { translateX = 0, translateY = 50 } = options;
36
+ const legendProps = getBaseLegendProps(calculateItemWidth(data), translateX);
37
+ const colorRange = createColorRange(colors, data.length);
38
+ const numberOfRows = Math.ceil(data.length / maxRowLength);
39
+ const splitData = [];
40
+ for (let row = 0; row < numberOfRows; row++) {
41
+ const rowData = data.slice(row * maxRowLength, (row + 1) * maxRowLength);
42
+ const rowColors = colorRange.slice(row * maxRowLength, (row + 1) * maxRowLength);
43
+ const newRow = {
44
+ ...legendProps,
45
+ translateY: translateY + row * legendProps.itemHeight,
46
+ data: rowData.map((curr, index) => ({
47
+ id: curr.id,
48
+ label: curr.id,
49
+ color: rowColors[index]
50
+ }))
51
+ };
52
+ splitData.push(newRow);
53
+ }
54
+ return splitData;
55
+ };
56
+ //#endregion
57
+ export { createLegendData };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { CustomComponents } from '../types';
3
+ export declare const defaultComponents: Required<CustomComponents>;
4
+ declare const ComponentContext: React.Context<Required<CustomComponents>>;
5
+ export default ComponentContext;
@@ -0,0 +1,15 @@
1
+ import Button_default from "../../../Elements/Button/index.js";
2
+ import DashboardPicker from "../components/Picker/Picker.js";
3
+ import ItemConfigControls from "../components/Layout/components/ItemConfig/ItemConfigControls.js";
4
+ import ItemHeader from "../components/Layout/components/ItemHeader/ItemHeader.js";
5
+ import React from "react";
6
+ //#region packages/ui/Modules/Dashboard/context/ComponentContext.ts
7
+ const defaultComponents = {
8
+ Button: Button_default,
9
+ Picker: DashboardPicker,
10
+ ItemConfigControls,
11
+ ItemHeader
12
+ };
13
+ const ComponentContext = React.createContext(defaultComponents);
14
+ //#endregion
15
+ export { ComponentContext as default, defaultComponents };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const LangContext: React.Context<string>;
3
+ export default LangContext;