@mailstep/design-system 0.8.51 → 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.d.ts +2 -2
  5. package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +6 -7
  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,21 @@
1
+ import React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region packages/ui/Modules/Dashboard/components/Widgets/ColorBox/ColorBox.tsx
4
+ /**
5
+ * This is only example of widget
6
+ */
7
+ const ColorBox = ({ config = {}, innerRef }) => {
8
+ return /* @__PURE__ */ jsx("div", {
9
+ style: React.useMemo(() => ({
10
+ backgroundColor: config?.color || "transparent",
11
+ border: "1px solid #ccc",
12
+ width: 50,
13
+ height: 50,
14
+ borderRadius: "100%"
15
+ }), [config]),
16
+ ref: innerRef,
17
+ children: config?.name
18
+ });
19
+ };
20
+ //#endregion
21
+ export { ColorBox as default };
@@ -0,0 +1,3 @@
1
+ import type { JSX } from 'react';
2
+ import { ConfigProps } from '../../../types';
3
+ export declare const Config: ({ onChange, config }: ConfigProps) => JSX.Element;
@@ -0,0 +1,23 @@
1
+ import styles_default from "../../../styles.js";
2
+ import { useCallback } from "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ //#region packages/ui/Modules/Dashboard/components/Widgets/ColorBox/Config.tsx
5
+ const Config = ({ onChange, config }) => {
6
+ const onChangeInput = useCallback((e) => onChange({
7
+ ...config,
8
+ [e.target.name]: e.target.value
9
+ }), [onChange, config]);
10
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(styles_default.ConfigRow, { children: [/* @__PURE__ */ jsx(styles_default.ConfigLabel, { children: "Name: " }), /* @__PURE__ */ jsx(styles_default.ConfigInput, { children: /* @__PURE__ */ jsx("input", {
11
+ name: "name",
12
+ type: "text",
13
+ onChange: onChangeInput,
14
+ value: config?.name || ""
15
+ }) })] }), /* @__PURE__ */ jsxs(styles_default.ConfigRow, { children: [/* @__PURE__ */ jsx(styles_default.ConfigLabel, { children: "Color: " }), /* @__PURE__ */ jsx(styles_default.ConfigInput, { children: /* @__PURE__ */ jsx("input", {
16
+ name: "color",
17
+ type: "color",
18
+ onChange: onChangeInput,
19
+ value: config?.color || ""
20
+ }) })] })] });
21
+ };
22
+ //#endregion
23
+ export { Config };
@@ -0,0 +1,4 @@
1
+ import ColorBox from './ColorBox';
2
+ export * from './ColorBox';
3
+ export * from './Config';
4
+ export default ColorBox;
@@ -0,0 +1,6 @@
1
+ import ColorBox from "./ColorBox.js";
2
+ import { Config } from "./Config.js";
3
+ //#region packages/ui/Modules/Dashboard/components/Widgets/ColorBox/index.tsx
4
+ var ColorBox_default = ColorBox;
5
+ //#endregion
6
+ export { Config, ColorBox_default as default };
@@ -0,0 +1,7 @@
1
+ import type { JSX } from 'react';
2
+ /**
3
+ * Empty widget
4
+ * This is only for error case, invalid widget definition etc...
5
+ */
6
+ declare const EmptyWidget: () => JSX.Element;
7
+ export default EmptyWidget;
@@ -0,0 +1,10 @@
1
+ import "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region packages/ui/Modules/Dashboard/components/Widgets/EmptyWidget/EmptyWidget.tsx
4
+ /**
5
+ * Empty widget
6
+ * This is only for error case, invalid widget definition etc...
7
+ */
8
+ const EmptyWidget = () => /* @__PURE__ */ jsx("span", { children: "Error" });
9
+ //#endregion
10
+ export { EmptyWidget as default };
@@ -0,0 +1,2 @@
1
+ import EmptyWidget from './EmptyWidget';
2
+ export default EmptyWidget;
@@ -0,0 +1,5 @@
1
+ import EmptyWidget from "./EmptyWidget.js";
2
+ //#region packages/ui/Modules/Dashboard/components/Widgets/EmptyWidget/index.ts
3
+ var EmptyWidget_default = EmptyWidget;
4
+ //#endregion
5
+ export { EmptyWidget_default as default };
@@ -0,0 +1 @@
1
+ export declare const Config: ({ onChange, config, sources }: import("../../..").MultiConfigProps) => import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { MultiConfig } from "../../Config/MultiConfig.js";
2
+ //#region packages/ui/Modules/Dashboard/components/Widgets/HorizontalBar/Config.tsx
3
+ const Config = MultiConfig;
4
+ //#endregion
5
+ export { Config };
@@ -0,0 +1,4 @@
1
+ import type { JSX } from 'react';
2
+ import { HorizontalBarProps } from './types';
3
+ declare const HorizontalBar: ({ data, title, description, isLoading, error, innerRef }: HorizontalBarProps) => JSX.Element;
4
+ export default HorizontalBar;
@@ -0,0 +1,38 @@
1
+ import styles_default from "../../../styles.js";
2
+ import LoadingBoundary from "../../../Hoc/LoadingBoundary.js";
3
+ import NoData_default from "../../NoData/index.js";
4
+ import styles_default$1 from "./styles.js";
5
+ import { ProgressLine } from "./components/ProgressLine.js";
6
+ import { LabelsLine } from "./components/LabelsLine.js";
7
+ import React from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ //#region packages/ui/Modules/Dashboard/components/Widgets/HorizontalBar/HorizontalBar.tsx
10
+ const fallbackFillColor = "#000";
11
+ const fallbackBgColor = "#ebedf2";
12
+ const HorizontalBar = ({ data = [], title, description, isLoading, error, innerRef }) => /* @__PURE__ */ jsx(LoadingBoundary, {
13
+ isLoading,
14
+ error,
15
+ children: /* @__PURE__ */ jsx(styles_default.ItemContent, { children: /* @__PURE__ */ jsxs("div", {
16
+ ref: innerRef,
17
+ children: [
18
+ title && /* @__PURE__ */ jsx(styles_default$1.Title, { children: title }),
19
+ description && /* @__PURE__ */ jsx(styles_default$1.Description, { children: description }),
20
+ (!data || data.length === 0) && /* @__PURE__ */ jsx(NoData_default, {}),
21
+ data.map((row) => {
22
+ const { id, label, percent, value, color = fallbackFillColor, backgroundColor = fallbackBgColor } = row;
23
+ const validPercent = percent >= 0 && percent <= 100 ? percent : 0;
24
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx(LabelsLine, {
25
+ value,
26
+ label,
27
+ color
28
+ }), /* @__PURE__ */ jsx(ProgressLine, {
29
+ percent: validPercent,
30
+ color,
31
+ backgroundColor
32
+ })] }, id);
33
+ })
34
+ ]
35
+ }) })
36
+ });
37
+ //#endregion
38
+ export { HorizontalBar as default };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { JSX } from 'react';
3
+ export interface LabelsLineProps {
4
+ label: React.ReactNode;
5
+ value: number | string;
6
+ color: string;
7
+ }
8
+ export declare const LabelsLine: ({ label, value, color }: LabelsLineProps) => JSX.Element;
@@ -0,0 +1,14 @@
1
+ import styles_default from "../styles.js";
2
+ import "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import styled from "styled-components";
5
+ //#region packages/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/LabelsLine.tsx
6
+ const BoldSpan = styled.span`
7
+ font-weight: bold;
8
+ `;
9
+ const LabelsLine = ({ label, value, color }) => /* @__PURE__ */ jsxs(styles_default.LabelsContainer, {
10
+ color,
11
+ children: [/* @__PURE__ */ jsx(BoldSpan, { children: label }), /* @__PURE__ */ jsx("span", { children: value })]
12
+ });
13
+ //#endregion
14
+ export { LabelsLine };
@@ -0,0 +1,7 @@
1
+ import type { JSX } from 'react';
2
+ export interface ProgressLineProps {
3
+ percent: number;
4
+ color: string;
5
+ backgroundColor: string;
6
+ }
7
+ export declare const ProgressLine: ({ percent, color, backgroundColor }: ProgressLineProps) => JSX.Element;
@@ -0,0 +1,14 @@
1
+ import styles_default from "../styles.js";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region packages/ui/Modules/Dashboard/components/Widgets/HorizontalBar/components/ProgressLine.tsx
5
+ const ProgressLine = ({ percent, color, backgroundColor }) => /* @__PURE__ */ jsx(styles_default.ProgressContainer, {
6
+ bgColor: backgroundColor,
7
+ children: /* @__PURE__ */ jsx(styles_default.Progress, {
8
+ color,
9
+ percent,
10
+ children: /* @__PURE__ */ jsx(styles_default.Circle, { color })
11
+ })
12
+ });
13
+ //#endregion
14
+ export { ProgressLine };
@@ -0,0 +1,4 @@
1
+ import HorizontalBar from './HorizontalBar';
2
+ export * from './HorizontalBar';
3
+ export * from './Config';
4
+ export default HorizontalBar;
@@ -0,0 +1,6 @@
1
+ import HorizontalBar from "./HorizontalBar.js";
2
+ import { Config } from "./Config.js";
3
+ //#region packages/ui/Modules/Dashboard/components/Widgets/HorizontalBar/index.tsx
4
+ var HorizontalBar_default = HorizontalBar;
5
+ //#endregion
6
+ export { Config, HorizontalBar_default as default };
@@ -0,0 +1,2 @@
1
+ import { HorizontalBarProps } from './types';
2
+ export declare const horizontalBarData: HorizontalBarProps['data'];
@@ -0,0 +1,33 @@
1
+ //#region packages/ui/Modules/Dashboard/components/Widgets/HorizontalBar/storybook.sample.ts
2
+ const horizontalBarData = [
3
+ {
4
+ id: "1",
5
+ label: "Resolved",
6
+ percent: 70,
7
+ value: 69e3,
8
+ color: "linear-gradient(90deg, rgba(60,186,146,1) 0%, rgba(13,164,98,1) 100%)"
9
+ },
10
+ {
11
+ id: "2",
12
+ label: "In progress",
13
+ percent: 30,
14
+ value: 2500,
15
+ color: "linear-gradient(90deg, rgba(119,119,255,1) 0%, rgba(92,26,195,1) 100%)"
16
+ },
17
+ {
18
+ id: "3",
19
+ label: "Pending",
20
+ percent: 20,
21
+ value: 8500,
22
+ color: "linear-gradient(90deg, rgba(226,160,63,1) 0%, rgba(250,108,69,1) 100%)"
23
+ },
24
+ {
25
+ id: "4",
26
+ label: "Others",
27
+ percent: 9,
28
+ value: 500,
29
+ color: "green"
30
+ }
31
+ ];
32
+ //#endregion
33
+ export { horizontalBarData };
@@ -0,0 +1,18 @@
1
+ declare const _default: {
2
+ Title: import("styled-components").StyledComponent<"h2", any, {}, never>;
3
+ Description: import("styled-components").StyledComponent<"h3", any, {}, never>;
4
+ LabelsContainer: import("styled-components").StyledComponent<"div", any, {
5
+ color: string;
6
+ }, never>;
7
+ ProgressContainer: import("styled-components").StyledComponent<"div", any, {
8
+ bgColor: string;
9
+ }, never>;
10
+ Progress: import("styled-components").StyledComponent<"div", any, {
11
+ percent: number;
12
+ color: string;
13
+ }, never>;
14
+ Circle: import("styled-components").StyledComponent<"div", any, {
15
+ color: string;
16
+ }, never>;
17
+ };
18
+ export default _default;
@@ -0,0 +1,58 @@
1
+ import styled from "styled-components";
2
+ //#region packages/ui/Modules/Dashboard/components/Widgets/HorizontalBar/styles.ts
3
+ var styles_default = {
4
+ Title: styled.h2`
5
+ padding: 0;
6
+ margin: 0;
7
+ `,
8
+ Description: styled.h3`
9
+ padding: 0;
10
+ margin: 0;
11
+ opacity: 0.8;
12
+ margin-bottom: 25px;
13
+ `,
14
+ LabelsContainer: styled.div`
15
+ width: 100%;
16
+ display: flex;
17
+ justify-content: space-between;
18
+ > * {
19
+ color: ${(props) => props.color};
20
+ background: ${(props) => props.color};
21
+ // Compatibility for gradient colors
22
+ background-clip: text;
23
+ -webkit-background-clip: text;
24
+ -webkit-text-fill-color: transparent;
25
+ }
26
+ `,
27
+ ProgressContainer: styled.div`
28
+ height: 17px;
29
+ width: 100%;
30
+ margin-top: 5px;
31
+ margin-bottom: 15px;
32
+ border-radius: 10px;
33
+ background-color: ${(props) => props.bgColor};
34
+ opacity: 0.9;
35
+ :hover {
36
+ opacity: 1;
37
+ }
38
+ `,
39
+ Progress: styled.div`
40
+ display: flex;
41
+ justify-content: flex-end;
42
+ align-items: center;
43
+ height: 100%;
44
+ width: ${(props) => `${props.percent}%`};
45
+ background: ${(props) => `${props.color}`};
46
+ border-radius: inherit;
47
+ padding-right: 5px;
48
+ `,
49
+ Circle: styled.div`
50
+ background: ${(props) => `${props.color}`};
51
+ border: 3px solid #fff;
52
+ height: 12px;
53
+ width: 12px;
54
+ border-radius: 50%;
55
+ `
56
+ };
57
+ //#endregion
58
+ export { styles_default as default };
@@ -0,0 +1,13 @@
1
+ import { WidgetComponentProps } from '../../../types';
2
+ export type HorizontalBarRow = {
3
+ id: string;
4
+ label: React.ReactNode;
5
+ value: number;
6
+ percent: number;
7
+ color?: string;
8
+ backgroundColor?: string;
9
+ };
10
+ export interface HorizontalBarProps extends WidgetComponentProps<HorizontalBarRow[]> {
11
+ title?: React.ReactNode;
12
+ description?: React.ReactNode;
13
+ }
@@ -0,0 +1,4 @@
1
+ import type { JSX } from 'react';
2
+ import { MultiConfigProps } from '../../Config/MultiConfig';
3
+ export type NumberBoxConfigProps = MultiConfigProps;
4
+ export declare const Config: ({ sources, ...configProps }: NumberBoxConfigProps) => JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { useText } from "../../Text/Text.js";
2
+ import { MultiConfig } from "../../Config/MultiConfig.js";
3
+ import { useMemo } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region packages/ui/Modules/Dashboard/components/Widgets/NumberBox/Config.tsx
6
+ const unitOptions = [
7
+ "%",
8
+ "ks",
9
+ "$",
10
+ "h",
11
+ "m"
12
+ ].map((unit) => ({
13
+ label: unit,
14
+ value: unit
15
+ }));
16
+ const defaultSources = [];
17
+ const Config = ({ sources = defaultSources, ...configProps }) => {
18
+ const labelSelectUnit = useText("widgets.selectUnit");
19
+ return /* @__PURE__ */ jsx(MultiConfig, {
20
+ sources: useMemo(() => {
21
+ const unitFilter = {
22
+ name: "unit",
23
+ label: labelSelectUnit,
24
+ options: unitOptions
25
+ };
26
+ return sources.map((source) => {
27
+ const { filters = [], ...rest } = source;
28
+ return {
29
+ filters: [unitFilter].concat(filters),
30
+ ...rest
31
+ };
32
+ });
33
+ }, [labelSelectUnit, sources]),
34
+ ...configProps
35
+ });
36
+ };
37
+ //#endregion
38
+ export { Config };
@@ -0,0 +1,5 @@
1
+ import type { JSX } from 'react';
2
+ import { WidgetComponentProps, NumberClickCallback } from '../../../types';
3
+ export type Props = WidgetComponentProps<number, NumberClickCallback>;
4
+ declare const NumberBox: ({ data, isLoading, error, onValueClick, config, innerRef }: Props) => JSX.Element;
5
+ export default NumberBox;
@@ -0,0 +1,38 @@
1
+ import styles_default from "../../../styles.js";
2
+ import Text from "../../Text/Text.js";
3
+ import LoadingBoundary from "../../../Hoc/LoadingBoundary.js";
4
+ import NoData_default from "../../NoData/index.js";
5
+ import { StyledNumberBox, StyledNumberBoxNumber } from "./styles.js";
6
+ import React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region packages/ui/Modules/Dashboard/components/Widgets/NumberBox/NumberBox.tsx
9
+ const NumberBox = ({ data, isLoading, error, onValueClick, config = {}, innerRef }) => {
10
+ const formatedNumber = String(data).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
11
+ const unit = config?.unit || "";
12
+ const onClick = React.useCallback(() => onValueClick?.(data, config), [
13
+ onValueClick,
14
+ data,
15
+ config
16
+ ]);
17
+ return /* @__PURE__ */ jsx(LoadingBoundary, {
18
+ isLoading,
19
+ error,
20
+ children: /* @__PURE__ */ jsxs(styles_default.ItemContent, {
21
+ ref: innerRef,
22
+ children: [!data && data != 0 && /* @__PURE__ */ jsx(NoData_default, {}), /* @__PURE__ */ jsx(StyledNumberBox, { children: /* @__PURE__ */ jsxs(StyledNumberBoxNumber, {
23
+ onClick: onValueClick && onClick,
24
+ children: [/* @__PURE__ */ jsx("svg", {
25
+ height: "50%",
26
+ viewBox: `0 0 ${(String(data).length + unit.length) * 12 || "12"} 17`,
27
+ children: /* @__PURE__ */ jsxs("foreignObject", { children: [data || data === 0 ? formatedNumber : "?", unit] })
28
+ }), /* @__PURE__ */ jsx("svg", {
29
+ height: "30%",
30
+ viewBox: `0 0 ${String(config?.sourceLabel?.length * 12 || "100")} 17`,
31
+ children: /* @__PURE__ */ jsx("foreignObject", { children: config?.sourceLabel || /* @__PURE__ */ jsx(Text, { code: "widgets.selectSource" }) })
32
+ })]
33
+ }) })]
34
+ })
35
+ });
36
+ };
37
+ //#endregion
38
+ export { NumberBox as default };
@@ -0,0 +1,4 @@
1
+ import NumberBox from './NumberBox';
2
+ export * from './NumberBox';
3
+ export * from './Config';
4
+ export default NumberBox;
@@ -0,0 +1,6 @@
1
+ import NumberBox from "./NumberBox.js";
2
+ import { Config } from "./Config.js";
3
+ //#region packages/ui/Modules/Dashboard/components/Widgets/NumberBox/index.ts
4
+ var NumberBox_default = NumberBox;
5
+ //#endregion
6
+ export { Config, NumberBox_default as default };
@@ -0,0 +1,4 @@
1
+ export declare const StyledNumberBox: import("styled-components").StyledComponent<"div", import("@xstyled/styled-components").Theme, {}, never>;
2
+ export declare const StyledNumberBoxNumber: import("styled-components").StyledComponent<"div", import("@xstyled/styled-components").Theme, {
3
+ onClick?: () => void;
4
+ }, never>;
@@ -0,0 +1,25 @@
1
+ import styled$1 from "@xstyled/styled-components";
2
+ //#region packages/ui/Modules/Dashboard/components/Widgets/NumberBox/styles.ts
3
+ const StyledNumberBox = styled$1.div`
4
+ width: 100%;
5
+ height: 100%;
6
+ `;
7
+ const StyledNumberBoxNumber = styled$1.div`
8
+ height: 100%;
9
+ text-align: center;
10
+ color: black;
11
+ cursor: ${(props) => props.onClick ? "pointer" : "auto"};
12
+ &:hover{
13
+ opacity: ${(props) => props.onClick ? "0.5" : "1"};
14
+ }
15
+ &>svg {
16
+ width: 100%;
17
+ & > foreignObject {
18
+ width: 100%;
19
+ height: 100%;
20
+
21
+ }
22
+ }
23
+ `;
24
+ //#endregion
25
+ export { StyledNumberBox, StyledNumberBoxNumber };
@@ -0,0 +1 @@
1
+ export declare const Config: ({ onChange, config, sources }: import("../../..").MultiConfigProps) => import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { MultiConfig } from "../../Config/MultiConfig.js";
2
+ //#region packages/ui/Modules/Dashboard/components/Widgets/PieChart/Config.tsx
3
+ const Config = MultiConfig;
4
+ //#endregion
5
+ export { Config };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { JSX } from 'react';
3
+ import { DefaultRawDatum } from '@nivo/pie';
4
+ import { WidgetComponentProps } from '../../../types';
5
+ import { Colors } from '../utils/helpers';
6
+ import { CenteredMetricProps } from './components/CenteredMetric';
7
+ interface PieDataRow extends DefaultRawDatum {
8
+ label: string;
9
+ }
10
+ export type Props = WidgetComponentProps<PieDataRow[]> & {
11
+ centeredMetric?: (props: CenteredMetricProps) => JSX.Element;
12
+ title?: string;
13
+ subtitle?: string;
14
+ description?: string;
15
+ text?: string;
16
+ hasLegend?: boolean;
17
+ legendRowMaxLength?: number;
18
+ colors?: Colors;
19
+ };
20
+ declare const _default: React.MemoExoticComponent<({ data, isLoading, error, title, subtitle, description, text, hasLegend, legendRowMaxLength, centeredMetric, colors, innerRef, }: Props) => JSX.Element>;
21
+ export default _default;
@@ -0,0 +1,59 @@
1
+ import styles_default from "../../../styles.js";
2
+ import LoadingBoundary from "../../../Hoc/LoadingBoundary.js";
3
+ import NoData_default from "../../NoData/index.js";
4
+ import { createLegendData } from "../utils/legends.js";
5
+ import { createWidgetColors } from "../utils/generic.js";
6
+ import { getColorStringArray } from "../utils/helpers.js";
7
+ import { Description, OtherText, Subtitle, Title, Wrapper, WrapperText, layers, margin } from "./styles.js";
8
+ import React from "react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ import { useTheme } from "styled-components";
11
+ import { ResponsivePie } from "@nivo/pie";
12
+ //#region packages/ui/Modules/Dashboard/components/Widgets/PieChart/PieChart.tsx
13
+ const defaultLegendRowMaxLength = 4;
14
+ const Pie = ({ data = [], isLoading, error, title, subtitle, description, text, hasLegend = true, legendRowMaxLength = defaultLegendRowMaxLength, centeredMetric, colors, innerRef }) => {
15
+ const theme = useTheme();
16
+ const colorStringArray = React.useMemo(() => colors ? getColorStringArray(colors) : createWidgetColors("pieChartColor", 5), [theme, colors]);
17
+ const hasText = title || subtitle || description || text;
18
+ const legends = React.useMemo(() => {
19
+ if (!hasLegend) return void 0;
20
+ return createLegendData(data, colorStringArray, legendRowMaxLength);
21
+ }, [
22
+ hasLegend,
23
+ data,
24
+ colorStringArray
25
+ ]);
26
+ return /* @__PURE__ */ jsx(LoadingBoundary, {
27
+ isLoading,
28
+ error,
29
+ children: /* @__PURE__ */ jsx(styles_default.ItemContent, {
30
+ ref: innerRef,
31
+ children: /* @__PURE__ */ jsxs(Wrapper, { children: [
32
+ hasText && /* @__PURE__ */ jsxs(WrapperText, { children: [
33
+ /* @__PURE__ */ jsx(Title, { children: title }),
34
+ /* @__PURE__ */ jsx(Subtitle, { children: subtitle }),
35
+ /* @__PURE__ */ jsx(Description, { children: description }),
36
+ /* @__PURE__ */ jsx(OtherText, { children: text })
37
+ ] }),
38
+ (!data || data.length === 0) && /* @__PURE__ */ jsx(NoData_default, {}),
39
+ data && data.length > 0 && /* @__PURE__ */ jsx(ResponsivePie, {
40
+ data,
41
+ innerRadius: .55,
42
+ arcLinkLabelsThickness: 2,
43
+ activeOuterRadiusOffset: 6,
44
+ padAngle: 1,
45
+ sortByValue: true,
46
+ isInteractive: true,
47
+ animate: true,
48
+ margin,
49
+ colors: colorStringArray,
50
+ legends,
51
+ layers: layers(centeredMetric)
52
+ })
53
+ ] })
54
+ })
55
+ });
56
+ };
57
+ var PieChart_default = React.memo(Pie);
58
+ //#endregion
59
+ export { PieChart_default as default };
@@ -0,0 +1,10 @@
1
+ import type { JSX } from 'react';
2
+ export interface CenteredMetricProps {
3
+ dataWithArc: {
4
+ value: number;
5
+ }[];
6
+ centerX: number;
7
+ centerY: number;
8
+ }
9
+ declare const CenteredMetric: ({ dataWithArc, centerX, centerY }: CenteredMetricProps) => JSX.Element;
10
+ export default CenteredMetric;
@@ -0,0 +1,24 @@
1
+ import "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region packages/ui/Modules/Dashboard/components/Widgets/PieChart/components/CenteredMetric.tsx
4
+ const style = {
5
+ fontSize: "40px",
6
+ fontWeight: 600,
7
+ color: "#333"
8
+ };
9
+ const CenteredMetric = ({ dataWithArc, centerX, centerY }) => {
10
+ let total = 0;
11
+ dataWithArc.forEach((datum) => {
12
+ total += datum.value;
13
+ });
14
+ return /* @__PURE__ */ jsx("text", {
15
+ x: centerX,
16
+ y: centerY,
17
+ textAnchor: "middle",
18
+ dominantBaseline: "central",
19
+ style,
20
+ children: total
21
+ });
22
+ };
23
+ //#endregion
24
+ export { CenteredMetric as default };
@@ -0,0 +1,4 @@
1
+ import PieChart from './PieChart';
2
+ export * from './PieChart';
3
+ export * from './Config';
4
+ export default PieChart;
@@ -0,0 +1,6 @@
1
+ import PieChart_default$1 from "./PieChart.js";
2
+ import { Config } from "./Config.js";
3
+ //#region packages/ui/Modules/Dashboard/components/Widgets/PieChart/index.tsx
4
+ var PieChart_default = PieChart_default$1;
5
+ //#endregion
6
+ export { Config, PieChart_default as default };