@mailstep/design-system 0.5.1-beta.2 → 0.6.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 (299) hide show
  1. package/package.json +40 -20
  2. package/ui/Blocks/CommonGrid/CommonGrid.d.ts +5 -2
  3. package/ui/Blocks/CommonGrid/CommonGrid.js +12 -22
  4. package/ui/Blocks/CommonGrid/CommonGridContainer.d.ts +3 -0
  5. package/ui/Blocks/CommonGrid/CommonGridContainer.js +66 -0
  6. package/ui/Blocks/CommonGrid/StandardButtons.d.ts +4 -0
  7. package/ui/Blocks/CommonGrid/StandardButtons.js +36 -0
  8. package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.d.ts +12 -0
  9. package/ui/Blocks/CommonGrid/components/ActionHead/ActionHead.js +50 -0
  10. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.d.ts +11 -0
  11. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +18 -0
  12. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.d.ts +12 -0
  13. package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +45 -0
  14. package/ui/Blocks/CommonGrid/components/ActionHead/index.d.ts +2 -0
  15. package/ui/Blocks/CommonGrid/components/ActionHead/index.js +2 -0
  16. package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.d.ts +6 -0
  17. package/ui/Blocks/CommonGrid/components/BooleanSelect/BooleanSelect.js +37 -0
  18. package/ui/Blocks/CommonGrid/components/BooleanSelect/index.d.ts +2 -0
  19. package/ui/Blocks/CommonGrid/components/BooleanSelect/index.js +2 -0
  20. package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.d.ts +13 -0
  21. package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.js +32 -0
  22. package/ui/Blocks/CommonGrid/components/ButtonMore/index.d.ts +2 -0
  23. package/ui/Blocks/CommonGrid/components/ButtonMore/index.js +2 -0
  24. package/ui/Blocks/CommonGrid/components/ColumnFilterCell.js +1 -1
  25. package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.d.ts +5 -0
  26. package/ui/Blocks/CommonGrid/components/ColumnTitle/ColumnTitle.js +58 -0
  27. package/ui/Blocks/CommonGrid/components/ColumnTitle/index.d.ts +2 -0
  28. package/ui/Blocks/CommonGrid/components/ColumnTitle/index.js +2 -0
  29. package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.d.ts +11 -0
  30. package/ui/Blocks/CommonGrid/components/ControlButtons/ControlButtons.js +20 -0
  31. package/ui/Blocks/CommonGrid/components/ControlButtons/index.d.ts +2 -0
  32. package/ui/Blocks/CommonGrid/components/ControlButtons/index.js +2 -0
  33. package/ui/Blocks/CommonGrid/components/DataRow.js +4 -4
  34. package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.d.ts +12 -0
  35. package/ui/Blocks/CommonGrid/components/DatePickerRange/DatePickerRange.js +113 -0
  36. package/ui/Blocks/CommonGrid/components/DatePickerRange/index.d.ts +2 -0
  37. package/ui/Blocks/CommonGrid/components/DatePickerRange/index.js +2 -0
  38. package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.d.ts +1 -0
  39. package/ui/Blocks/CommonGrid/components/DatePickerRange/utils/sameDate.js +3 -0
  40. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.d.ts +8 -0
  41. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +43 -0
  42. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.d.ts +2 -0
  43. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/index.js +2 -0
  44. package/ui/Blocks/CommonGrid/components/FilterRow.js +2 -3
  45. package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.d.ts +7 -0
  46. package/ui/Blocks/CommonGrid/components/FloatingButton/FloatingButton.js +46 -0
  47. package/ui/Blocks/CommonGrid/components/FloatingButton/index.d.ts +2 -0
  48. package/ui/Blocks/CommonGrid/components/FloatingButton/index.js +2 -0
  49. package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.d.ts +10 -0
  50. package/ui/Blocks/CommonGrid/components/GridSelect/GridSelect.js +19 -0
  51. package/ui/Blocks/CommonGrid/components/GridSelect/index.d.ts +2 -0
  52. package/ui/Blocks/CommonGrid/components/GridSelect/index.js +2 -0
  53. package/ui/Blocks/CommonGrid/components/HeadCell.js +1 -4
  54. package/ui/Blocks/CommonGrid/components/IconList/IconList.d.ts +18 -0
  55. package/ui/Blocks/CommonGrid/components/IconList/IconList.js +29 -0
  56. package/ui/Blocks/CommonGrid/components/IconList/index.d.ts +2 -0
  57. package/ui/Blocks/CommonGrid/components/IconList/index.js +2 -0
  58. package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.d.ts +11 -0
  59. package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +20 -0
  60. package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.d.ts +12 -0
  61. package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +47 -0
  62. package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.d.ts +2 -0
  63. package/ui/Blocks/CommonGrid/components/ManageColumnForm/index.js +2 -0
  64. package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.d.ts +3 -0
  65. package/ui/Blocks/CommonGrid/components/NumberRange/NumberRange.js +76 -0
  66. package/ui/Blocks/CommonGrid/components/NumberRange/index.d.ts +2 -0
  67. package/ui/Blocks/CommonGrid/components/NumberRange/index.js +2 -0
  68. package/ui/Blocks/CommonGrid/components/NumberRange/types.d.ts +17 -0
  69. package/ui/Blocks/CommonGrid/components/NumberRange/types.js +1 -0
  70. package/ui/Blocks/CommonGrid/components/OversizedScroll.js +1 -4
  71. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.d.ts +6 -0
  72. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/ReadEditButtonCell.js +26 -0
  73. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.d.ts +2 -0
  74. package/ui/Blocks/CommonGrid/components/ReadEditButtonCell/index.js +2 -0
  75. package/ui/Blocks/CommonGrid/components/Table.d.ts +0 -6
  76. package/ui/Blocks/CommonGrid/components/Table.js +0 -5
  77. package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.d.ts +8 -0
  78. package/ui/Blocks/CommonGrid/components/TablePagination/TablePagination.js +32 -0
  79. package/ui/Blocks/CommonGrid/components/TablePagination/index.d.ts +2 -0
  80. package/ui/Blocks/CommonGrid/components/TablePagination/index.js +2 -0
  81. package/ui/Blocks/CommonGrid/components/TextRange/TextRange.d.ts +4 -0
  82. package/ui/Blocks/CommonGrid/components/TextRange/TextRange.js +89 -0
  83. package/ui/Blocks/CommonGrid/components/TextRange/index.d.ts +2 -0
  84. package/ui/Blocks/CommonGrid/components/TextRange/index.js +2 -0
  85. package/ui/Blocks/CommonGrid/components/TextRange/types.d.ts +21 -0
  86. package/ui/Blocks/CommonGrid/components/TextRange/types.js +1 -0
  87. package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.d.ts +5 -0
  88. package/ui/Blocks/CommonGrid/components/gridCells/BoolIcon.js +22 -0
  89. package/ui/Blocks/CommonGrid/components/gridCells/ButtonInCell.d.ts +4 -0
  90. package/ui/Blocks/CommonGrid/components/{icons/ArrowSimple.js → gridCells/ButtonInCell.js} +4 -2
  91. package/ui/Blocks/CommonGrid/components/gridCells/Date.d.ts +4 -0
  92. package/ui/Blocks/CommonGrid/components/gridCells/Date.js +8 -0
  93. package/ui/Blocks/CommonGrid/components/gridCells/DateTime.d.ts +4 -0
  94. package/ui/Blocks/CommonGrid/components/gridCells/DateTime.js +13 -0
  95. package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.d.ts +9 -0
  96. package/ui/Blocks/CommonGrid/components/gridCells/EnumInCell.js +33 -0
  97. package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.d.ts +4 -0
  98. package/ui/Blocks/CommonGrid/components/gridCells/HoverBubble.js +18 -0
  99. package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.d.ts +9 -0
  100. package/ui/Blocks/CommonGrid/components/gridCells/IconButtonInCell.js +15 -0
  101. package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.d.ts +6 -0
  102. package/ui/Blocks/CommonGrid/components/gridCells/ImageCell.js +23 -0
  103. package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.d.ts +1 -0
  104. package/ui/Blocks/CommonGrid/components/gridCells/LinkInCell.js +8 -0
  105. package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.d.ts +5 -0
  106. package/ui/Blocks/CommonGrid/components/gridCells/RemoveItem.js +24 -0
  107. package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.d.ts +7 -0
  108. package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +30 -0
  109. package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.d.ts +4 -0
  110. package/ui/Blocks/CommonGrid/components/gridCells/StringJoin.js +7 -0
  111. package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.d.ts +2 -0
  112. package/ui/Blocks/CommonGrid/components/gridCells/SwitchInCell.js +16 -0
  113. package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.d.ts +7 -0
  114. package/ui/Blocks/CommonGrid/components/gridCells/ToggleCell.js +30 -0
  115. package/ui/Blocks/CommonGrid/components/gridCells/index.d.ts +14 -0
  116. package/ui/Blocks/CommonGrid/components/gridCells/index.js +14 -0
  117. package/ui/Blocks/CommonGrid/hooks/useAddFilter.d.ts +4 -0
  118. package/ui/Blocks/CommonGrid/hooks/useAddFilter.js +14 -0
  119. package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.d.ts +15 -0
  120. package/ui/Blocks/CommonGrid/hooks/useEditReadAsColumn.js +70 -0
  121. package/ui/Blocks/CommonGrid/hooks/useFloatingButton.d.ts +3 -0
  122. package/ui/Blocks/CommonGrid/hooks/useFloatingButton.js +13 -0
  123. package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.d.ts +7 -0
  124. package/ui/Blocks/CommonGrid/hooks/useGetGridHeight.js +33 -0
  125. package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.d.ts +8 -0
  126. package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.js +25 -0
  127. package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +19 -0
  128. package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +34 -0
  129. package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.d.ts +8 -0
  130. package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.js +15 -0
  131. package/ui/Blocks/CommonGrid/index.d.ts +7 -71
  132. package/ui/Blocks/CommonGrid/index.js +7 -15
  133. package/ui/Blocks/CommonGrid/storybook/stories/complexWithPaginationAndRedux.stories.js +4 -4
  134. package/ui/Blocks/CommonGrid/storybook/stories/default.stories.js +3 -2
  135. package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +3 -2
  136. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +3 -3
  137. package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +3 -3
  138. package/ui/Blocks/CommonGrid/storybook/stories/styledCommonGrid.stories.js +2 -2
  139. package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +3 -3
  140. package/ui/Blocks/CommonGrid/storybook/stories/withForcedCheckboxes.stories.js +2 -1
  141. package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.d.ts +1 -0
  142. package/ui/Blocks/CommonGrid/storybook/utils/linguiContainer.js +8 -0
  143. package/ui/Blocks/CommonGrid/storybook/utils/utils.js +1 -1
  144. package/ui/Blocks/CommonGrid/storybook/utils/withTheme.js +1 -17
  145. package/ui/Blocks/CommonGrid/styles.d.ts +14 -0
  146. package/ui/Blocks/CommonGrid/styles.js +33 -0
  147. package/ui/Blocks/CommonGrid/translations.d.ts +1 -0
  148. package/ui/Blocks/CommonGrid/translations.js +6 -0
  149. package/ui/Blocks/CommonGrid/types.d.ts +29 -15
  150. package/ui/Blocks/CommonGrid/utils/index.d.ts +4 -1
  151. package/ui/Blocks/CommonGrid/utils/index.js +19 -0
  152. package/ui/Blocks/HidePrint/HidePrint.d.ts +6 -0
  153. package/ui/Blocks/HidePrint/HidePrint.js +13 -0
  154. package/ui/Blocks/Modal/Modal.js +2 -2
  155. package/ui/Blocks/Modal/stories/Modal.stories.js +5 -1
  156. package/ui/Blocks/Modal/styles.d.ts +4 -0
  157. package/ui/Blocks/Modal/styles.js +10 -3
  158. package/ui/Blocks/Popover/index.d.ts +12 -0
  159. package/ui/Blocks/Popover/index.js +21 -0
  160. package/ui/Elements/DatePicker/DatePicker.d.ts +20 -0
  161. package/ui/Elements/DatePicker/DatePicker.js +65 -0
  162. package/ui/Elements/DatePicker/Datetime/DateTime.d.ts +95 -0
  163. package/ui/Elements/DatePicker/Datetime/DateTime.js +516 -0
  164. package/ui/Elements/DatePicker/Datetime/components/Timepicker.d.ts +8 -0
  165. package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +57 -0
  166. package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.d.ts +9 -0
  167. package/ui/Elements/DatePicker/Datetime/components/ViewNavigation.js +16 -0
  168. package/ui/Elements/DatePicker/Datetime/types.d.ts +61 -0
  169. package/ui/Elements/DatePicker/Datetime/types.js +7 -0
  170. package/ui/Elements/DatePicker/Datetime/views/DaysView.d.ts +14 -0
  171. package/ui/Elements/DatePicker/Datetime/views/DaysView.js +145 -0
  172. package/ui/Elements/DatePicker/Datetime/views/MonthsView.d.ts +10 -0
  173. package/ui/Elements/DatePicker/Datetime/views/MonthsView.js +111 -0
  174. package/ui/Elements/DatePicker/Datetime/views/YearsView.d.ts +15 -0
  175. package/ui/Elements/DatePicker/Datetime/views/YearsView.js +117 -0
  176. package/ui/Elements/DatePicker/index.d.ts +2 -0
  177. package/ui/Elements/DatePicker/index.js +2 -0
  178. package/ui/Elements/DatePicker/styles.d.ts +2 -0
  179. package/ui/Elements/DatePicker/styles.js +8 -0
  180. package/ui/Elements/DropdownMenu/DropdownMenu.d.ts +2 -0
  181. package/ui/Elements/DropdownMenu/DropdownMenu.js +36 -0
  182. package/ui/Elements/DropdownMenu/components/DefaultItem.d.ts +3 -0
  183. package/ui/Elements/DropdownMenu/components/DefaultItem.js +16 -0
  184. package/ui/Elements/DropdownMenu/components/MenuItem.d.ts +3 -0
  185. package/ui/Elements/DropdownMenu/components/MenuItem.js +51 -0
  186. package/ui/Elements/DropdownMenu/components/MenuList.d.ts +3 -0
  187. package/ui/Elements/DropdownMenu/components/MenuList.js +10 -0
  188. package/ui/Elements/DropdownMenu/index.d.ts +1 -0
  189. package/ui/Elements/DropdownMenu/index.js +1 -0
  190. package/ui/Elements/DropdownMenu/types.d.ts +41 -0
  191. package/ui/Elements/DropdownMenu/types.js +1 -0
  192. package/ui/Elements/DropdownSelect/DropdownSelect.d.ts +21 -0
  193. package/ui/Elements/DropdownSelect/DropdownSelect.js +47 -0
  194. package/ui/Elements/DropdownSelect/index.d.ts +4 -0
  195. package/ui/Elements/DropdownSelect/index.js +3 -0
  196. package/ui/Elements/ErrorMessage/ErrorMessage.js +1 -1
  197. package/ui/Elements/HighlightBox/HighlightBox.d.ts +50 -0
  198. package/ui/Elements/HighlightBox/HighlightBox.js +65 -0
  199. package/ui/Elements/HighlightBox/index.d.ts +2 -0
  200. package/ui/Elements/HighlightBox/index.js +2 -0
  201. package/ui/Elements/Icon/icons/Company.d.ts +3 -0
  202. package/ui/Elements/Icon/icons/Company.js +13 -0
  203. package/ui/Elements/Icon/icons/Integrations.d.ts +3 -0
  204. package/ui/Elements/Icon/icons/Integrations.js +13 -0
  205. package/ui/Elements/Icon/icons/ShoppingBag.d.ts +3 -0
  206. package/ui/Elements/Icon/icons/ShoppingBag.js +13 -0
  207. package/ui/Elements/Icon/icons/Truck.d.ts +3 -0
  208. package/ui/Elements/Icon/icons/Truck.js +13 -0
  209. package/ui/Elements/Icon/icons/TwoUsers.d.ts +3 -0
  210. package/ui/Elements/Icon/icons/TwoUsers.js +13 -0
  211. package/ui/Elements/Icon/icons/index.d.ts +5 -0
  212. package/ui/Elements/Icon/icons/index.js +5 -0
  213. package/ui/Elements/MultiSelect/MultiSelect.d.ts +6 -0
  214. package/ui/Elements/MultiSelect/MultiSelect.js +29 -0
  215. package/ui/Elements/MultiSelect/index.d.ts +2 -0
  216. package/ui/Elements/MultiSelect/index.js +2 -0
  217. package/ui/Elements/Pagination/Pagination.d.ts +4 -3
  218. package/ui/Elements/Pagination/Pagination.js +11 -3
  219. package/ui/Elements/Pagination/stories/Pagination.stories.d.ts +1 -1
  220. package/ui/Elements/Pagination/styled.js +6 -6
  221. package/ui/Elements/Select/Select.d.ts +3 -0
  222. package/ui/Elements/Select/Select.js +69 -0
  223. package/ui/Elements/Select/index.d.ts +2 -0
  224. package/ui/Elements/Select/index.js +2 -0
  225. package/ui/Elements/Select/styles.d.ts +5 -0
  226. package/ui/Elements/Select/styles.js +12 -0
  227. package/ui/Elements/Select/themes/CustomComponents.d.ts +8 -0
  228. package/ui/Elements/Select/themes/CustomComponents.js +125 -0
  229. package/ui/Elements/Select/themes/baseStyles.d.ts +28 -0
  230. package/ui/Elements/Select/themes/baseStyles.js +87 -0
  231. package/ui/Elements/Select/themes/formStyles.d.ts +24 -0
  232. package/ui/Elements/Select/themes/formStyles.js +102 -0
  233. package/ui/Elements/Select/themes/index.d.ts +3 -0
  234. package/ui/Elements/Select/themes/index.js +43 -0
  235. package/ui/Elements/Select/types.d.ts +55 -0
  236. package/ui/Elements/Select/types.js +1 -0
  237. package/ui/Elements/SingleSelect/SingleSelect.d.ts +20 -0
  238. package/ui/Elements/SingleSelect/SingleSelect.js +197 -0
  239. package/ui/Elements/SingleSelect/index.d.ts +2 -0
  240. package/ui/Elements/SingleSelect/index.js +2 -0
  241. package/ui/Elements/Text/types.d.ts +2 -2
  242. package/ui/Elements/Toggle/Toggle.d.ts +1 -1
  243. package/ui/Elements/Toggle/Toggle.js +2 -2
  244. package/ui/Elements/Toggle/stories/Toggle.stories.d.ts +1 -1
  245. package/ui/Elements/Toggle/types.d.ts +1 -0
  246. package/ui/Forms/Checkbox/Checkbox.js +3 -2
  247. package/ui/Forms/Checkbox/stories/Checkbox.stories.js +1 -1
  248. package/ui/Forms/Checkbox/styles.d.ts +1 -1
  249. package/ui/Forms/Checkbox/styles.js +1 -1
  250. package/ui/Forms/Input/types.d.ts +2 -2
  251. package/ui/Forms/RadioButton/RadioButton.js +4 -1
  252. package/ui/Forms/RadioButton/styles.d.ts +1 -1
  253. package/ui/Forms/RadioButton/styles.js +1 -1
  254. package/ui/Forms/TextArea/TextArea.d.ts +20 -0
  255. package/ui/Forms/TextArea/TextArea.js +34 -0
  256. package/ui/Forms/TextArea/index.d.ts +2 -0
  257. package/ui/Forms/TextArea/index.js +2 -0
  258. package/ui/Forms/TextArea/styles.d.ts +12 -0
  259. package/ui/Forms/TextArea/styles.js +31 -0
  260. package/ui/ThemeProvider/ThemeProvider.d.ts +3 -1
  261. package/ui/ThemeProvider/ThemeProvider.js +4 -2
  262. package/ui/ThemeProvider/types.d.ts +1 -0
  263. package/ui/index.d.ts +17 -3
  264. package/ui/index.es.js +42483 -8531
  265. package/ui/index.js +17 -3
  266. package/ui/index.umd.js +1658 -273
  267. package/ui/Blocks/CommonGrid/CommonGridContext.d.ts +0 -12
  268. package/ui/Blocks/CommonGrid/CommonGridContext.js +0 -45
  269. package/ui/Blocks/CommonGrid/components/ActionColumnHead.d.ts +0 -4
  270. package/ui/Blocks/CommonGrid/components/ActionColumnHead.js +0 -16
  271. package/ui/Blocks/CommonGrid/components/ButtonStrip.d.ts +0 -7
  272. package/ui/Blocks/CommonGrid/components/ButtonStrip.js +0 -35
  273. package/ui/Blocks/CommonGrid/components/ConfigForm.d.ts +0 -9
  274. package/ui/Blocks/CommonGrid/components/ConfigForm.js +0 -58
  275. package/ui/Blocks/CommonGrid/components/DefaultPaginator.d.ts +0 -3
  276. package/ui/Blocks/CommonGrid/components/DefaultPaginator.js +0 -11
  277. package/ui/Blocks/CommonGrid/components/Dialog.d.ts +0 -11
  278. package/ui/Blocks/CommonGrid/components/Dialog.js +0 -19
  279. package/ui/Blocks/CommonGrid/components/DropdownMenu.d.ts +0 -21
  280. package/ui/Blocks/CommonGrid/components/DropdownMenu.js +0 -59
  281. package/ui/Blocks/CommonGrid/components/DropdownSelect.d.ts +0 -15
  282. package/ui/Blocks/CommonGrid/components/DropdownSelect.js +0 -35
  283. package/ui/Blocks/CommonGrid/components/FloatingButton.d.ts +0 -6
  284. package/ui/Blocks/CommonGrid/components/FloatingButton.js +0 -13
  285. package/ui/Blocks/CommonGrid/components/icons/ArrowSimple.d.ts +0 -2
  286. package/ui/Blocks/CommonGrid/hooks/useControlButtons.d.ts +0 -10
  287. package/ui/Blocks/CommonGrid/hooks/useControlButtons.js +0 -64
  288. package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.d.ts +0 -13
  289. package/ui/Blocks/CommonGrid/storybook/stories/customControllButtons.stories.js +0 -49
  290. package/ui/Blocks/CommonGrid/storybook/utils/filters.d.ts +0 -2
  291. package/ui/Blocks/CommonGrid/storybook/utils/filters.js +0 -23
  292. package/ui/Blocks/CommonGrid/utils/public.d.ts +0 -16
  293. package/ui/Blocks/CommonGrid/utils/public.js +0 -52
  294. package/ui/Elements/Paragraph/Paragraph.d.ts +0 -2
  295. package/ui/Elements/Paragraph/Paragraph.js +0 -3
  296. package/ui/Elements/Paragraph/index.d.ts +0 -3
  297. package/ui/Elements/Paragraph/index.js +0 -3
  298. package/ui/Elements/Paragraph/stories/Paragraph.stories.d.ts +0 -17
  299. package/ui/Elements/Paragraph/stories/Paragraph.stories.js +0 -34
@@ -0,0 +1,125 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ var __rest = (this && this.__rest) || function (s, e) {
17
+ var t = {};
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
+ t[p] = s[p];
20
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
+ t[p[i]] = s[p[i]];
24
+ }
25
+ return t;
26
+ };
27
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
28
+ import { useCallback, useMemo, memo, useState, useEffect, useRef } from 'react';
29
+ import { components } from 'react-select';
30
+ import styled, { th } from '@xstyled/styled-components';
31
+ import { components as selectComponents } from 'react-select';
32
+ import { Trans } from '@lingui/react';
33
+ import Icon from '../../Icon/Icon';
34
+ import { Paragraph3 } from '../../Typography/Typography';
35
+ import Checkbox from '../../../Forms/Checkbox/Checkbox';
36
+ import Toggle from '../../Toggle/Toggle';
37
+ // Option for big lists
38
+ var SimplifiedOptionInner = function (props) {
39
+ var styles = props.getStyles('option', props);
40
+ var data = props.data, selectOption = props.selectOption, innerProps = props.innerProps;
41
+ var handleClick = useCallback(function () { return selectOption(data); }, [data, selectOption]);
42
+ return (_jsx("div", { style: styles, onClick: handleClick, onMouseOver: innerProps.onMouseOver, onMouseMove: innerProps.onMouseMove, children: props.label }));
43
+ };
44
+ export var SimplifiedOption = memo(SimplifiedOptionInner, function (prevProps, nextProps) { var _a, _b; return prevProps.isFocused === nextProps.isFocused && ((_a = prevProps.data) === null || _a === void 0 ? void 0 : _a.label) === ((_b = nextProps.data) === null || _b === void 0 ? void 0 : _b.label); });
45
+ // Value container with icon
46
+ var IconDiv = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left: 12px;\n align-self: center;\n"], ["\n padding-left: 12px;\n align-self: center;\n"])));
47
+ export var IconValueContainer = function (props) {
48
+ var _a;
49
+ // eslint-disable-next-line react/prop-types
50
+ var children = props.children, rest = __rest(props, ["children"]);
51
+ var icon = (_a = rest.selectProps) === null || _a === void 0 ? void 0 : _a.icon;
52
+ return (_jsxs(_Fragment, { children: [icon && (_jsx(IconDiv, { className: "inputIcon", children: _jsx(Icon, { icon: icon }) })), _jsx(components.ValueContainer, __assign({}, rest, { children: children }))] }));
53
+ };
54
+ // MultiValue container replacement with count of selected options
55
+ export var CountMultiValue = function (props) {
56
+ var _a, _b;
57
+ var selectVal = props.selectProps.value;
58
+ var inputVal = props.selectProps.inputValue;
59
+ var transValues = useMemo(function () { return ({ count: selectVal.length }); }, [selectVal.length]);
60
+ if (!inputVal && ((_a = props.data) === null || _a === void 0 ? void 0 : _a.value) == ((_b = selectVal[0]) === null || _b === void 0 ? void 0 : _b.value)) {
61
+ return (_jsx(selectComponents.SingleValue, __assign({}, props, { children: selectVal.length > 1 ? (_jsx(Trans, { id: "datagrid.filterCell.optionsSelectedLabel", message: '{count} options', values: transValues })) : (props.children) })));
62
+ }
63
+ else {
64
+ return null;
65
+ }
66
+ };
67
+ // Option with chevron form new design
68
+ var ChevronDiv = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-self: center;\n display: flex;\n"], ["\n align-self: center;\n display: flex;\n"])));
69
+ var SelectedIndicator = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding-right: 12px;\n"], ["\n padding-right: 12px;\n"])));
70
+ export var ChevronOption = function (props) {
71
+ var theme = props.theme, isSelected = props.isSelected, selectOption = props.selectOption, children = props.children, data = props.data;
72
+ var showCheckbox = !!(theme.optionVariant == 'checkbox');
73
+ var showToggle = !!(theme.optionVariant == 'toggle');
74
+ return (_jsxs(selectComponents.Option, __assign({}, props, { children: [(showCheckbox || showToggle) && (_jsxs(SelectedIndicator, { children: [showCheckbox && _jsx(Checkbox, { checked: isSelected, size: 2, readOnly: true }), showToggle && _jsx(Toggle, { name: "", onChange: selectOption, checked: isSelected, spaceAround: false, variant: 'grid' })] })), _jsx("span", { className: "label", "data-cy": "dropdownModalOption".concat(data.index), children: children })] })));
75
+ };
76
+ // menu with check all and reset config button
77
+ var SelectAll = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n margin: 4px 18px -10px 8px;\n padding: ", ";\n font-weight: 400;\n background-color: ", ";\n color: blue2;\n border-radius: 6px;\n height: 36px;\n :hover {\n cursor: pointer;\n background-color: bgLightGray1;\n }\n"], ["\n display: flex;\n margin: 4px 18px -10px 8px;\n padding: ", ";\n font-weight: 400;\n background-color: ", ";\n color: blue2;\n border-radius: 6px;\n height: 36px;\n :hover {\n cursor: pointer;\n background-color: bgLightGray1;\n }\n"])), function (_a) {
78
+ var additionalPadding = _a.additionalPadding;
79
+ return (additionalPadding ? '8px 27px 8px 10px' : '8px 10px');
80
+ }, function (_a) {
81
+ var isSelected = _a.isSelected;
82
+ return (isSelected ? th.color('red20') : 'transparent');
83
+ });
84
+ var ConfigWrap = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n text-align: center;\n cursor: pointer;\n color: red1;\n text-decoration: underline;\n margin: 0 30px 0 20px;\n padding-bottom: 7px;\n :first-letter {\n text-transform: capitalize;\n }\n :hover {\n color: red3;\n }\n"], ["\n text-align: center;\n cursor: pointer;\n color: red1;\n text-decoration: underline;\n margin: 0 30px 0 20px;\n padding-bottom: 7px;\n :first-letter {\n text-transform: capitalize;\n }\n :hover {\n color: red3;\n }\n"])));
85
+ export var ConnectedMenu = function (props) {
86
+ var theme = props.theme;
87
+ var _a = props.selectProps, resetGrid = _a.resetGrid, onCustomSelectAll = _a.onCustomSelectAll, onCustomDeselectAll = _a.onCustomDeselectAll, value = _a.value, options = _a.options, resetGridButton = _a.resetGridButton, selectAllButton = _a.selectAllButton, maxMenuHeight = _a.maxMenuHeight;
88
+ var showCheckbox = !!(theme.optionVariant === 'checkbox');
89
+ var showToggle = !!(theme.optionVariant === 'toggle');
90
+ var _b = useState(false), isSelected = _b[0], setIsSelected = _b[1];
91
+ var _c = useState(false), additionalPadding = _c[0], setAdditionalPadding = _c[1];
92
+ var ref = useRef(null);
93
+ useEffect(function () {
94
+ var _a;
95
+ // if the height of all options is higher than maxMenuHeight and the slider is displayed => the indentation needs to be increased
96
+ ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) && setAdditionalPadding(ref.current.offsetHeight * options.length > maxMenuHeight);
97
+ if (value) {
98
+ options.length === value.length && setIsSelected(true);
99
+ options.length !== value.length && setIsSelected(false);
100
+ }
101
+ else
102
+ return;
103
+ }, [additionalPadding, maxMenuHeight, options.length, value]);
104
+ var selectAll = useCallback(function () {
105
+ if (!isSelected) {
106
+ setIsSelected(true);
107
+ onCustomSelectAll();
108
+ }
109
+ else if (isSelected) {
110
+ setIsSelected(false);
111
+ onCustomDeselectAll();
112
+ }
113
+ }, [isSelected, onCustomDeselectAll, onCustomSelectAll]);
114
+ return (_jsxs(selectComponents.Menu, __assign({}, props, { children: [selectAllButton && (_jsxs(SelectAll, { isSelected: isSelected, onClick: selectAll, ref: ref, additionalPadding: additionalPadding, children: [(showCheckbox || showToggle) && (_jsxs(SelectedIndicator, { children: [showCheckbox && _jsx(Checkbox, { checked: isSelected, size: 2, readOnly: true }), showToggle && _jsx(Toggle, { name: "", checked: isSelected, spaceAround: false, variant: 'grid' })] })), _jsx(Trans, { id: "datagrid.filterCell.selectAllLabel", message: 'select all' })] })), props.children, resetGridButton && (_jsx(ConfigWrap, { onClick: resetGrid, children: _jsx(Paragraph3, { variant: "semiBold", children: _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }) }) }))] })));
115
+ };
116
+ export var CustomInput = function (props) {
117
+ var name = props.selectProps.name;
118
+ var value = !!name ? "".concat(name, "Inp") : props.id;
119
+ return _jsx(selectComponents.Input, __assign({}, props, { "data-cy": value }));
120
+ };
121
+ export var DropdownIndicator = function (props) {
122
+ var _a = props.selectProps, menuIsOpen = _a.menuIsOpen, name = _a.name;
123
+ return (_jsx(selectComponents.DropdownIndicator, __assign({}, props, { children: _jsx(ChevronDiv, { className: "chevron", "data-cy": "".concat(name, "ChevronBtn"), children: _jsx(Icon, { icon: menuIsOpen ? 'goUp' : 'goDown', size: '100%' }) }) })));
124
+ };
125
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -0,0 +1,28 @@
1
+ import { SelectProps } from '../types';
2
+ import { ControlProps, CSSObjectWithLabel } from 'react-select';
3
+ export type BaseStylesTheme = {
4
+ colors: {
5
+ primary: string;
6
+ primary50: string;
7
+ primary25: string;
8
+ optionTextColor: string;
9
+ inputDisabledColor: string;
10
+ inputBackgroundColor: string;
11
+ inputBorderColor: string;
12
+ menuBackgroundColor: string;
13
+ inputTextColor: string;
14
+ placeholderTextColor: string;
15
+ };
16
+ height: string | number;
17
+ focusBoxShadow?: string;
18
+ };
19
+ export type BaseState<ThemeType = BaseStylesTheme> = {
20
+ theme: ThemeType;
21
+ isSelected: boolean;
22
+ isFocused: boolean;
23
+ isDisabled: boolean;
24
+ isMulti: boolean;
25
+ selectProps: SelectProps;
26
+ } & ControlProps;
27
+ export type StylesConfig<T = BaseState> = Record<string, (styles: CSSObjectWithLabel, state: T) => CSSObjectWithLabel>;
28
+ export declare const baseStylesConfig: StylesConfig;
@@ -0,0 +1,87 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import createRgba from '../../../utils/CreateRgba/createRgba';
13
+ // style object https://react-select.com/styles
14
+ export var baseStylesConfig = {
15
+ control: function (styles, _a) {
16
+ var _b;
17
+ var selectProps = _a.selectProps, theme = _a.theme, isFocused = _a.isFocused, isDisabled = _a.isDisabled;
18
+ var colors = theme.colors;
19
+ return __assign(__assign({}, styles), { borderColor: selectProps.isInvalid || isFocused ? colors.primary : colors.inputBorderColor, backgroundColor: isDisabled ? colors.inputDisabledColor : colors.inputBackgroundColor, boxShadow: isFocused ? theme.focusBoxShadow : undefined, '&:hover': __assign(__assign({}, ((_b = styles['&:hover']) !== null && _b !== void 0 ? _b : {})), { borderColor: undefined }), minHeight: theme.height, minWidth: selectProps.isMulti ? 'min-content' : 'max-content' });
20
+ },
21
+ option: function (styles, _a) {
22
+ var isSelected = _a.isSelected, theme = _a.theme, isFocused = _a.isFocused;
23
+ return __assign(__assign({}, styles), { color: isSelected ? 'white' : theme.colors.optionTextColor, backgroundColor: isSelected ? theme.colors.primary : isFocused ? theme.colors.primary25 : 'transparent', ':active': __assign(__assign({}, styles[':active']), { backgroundColor: isSelected ? undefined : theme.colors.primary50 }) });
24
+ },
25
+ menu: function (styles, _a) {
26
+ var theme = _a.theme;
27
+ return __assign(__assign({}, styles), { minWidth: 'max-content', backgroundColor: theme.colors.menuBackgroundColor });
28
+ },
29
+ dropdownIndicator: function (styles, _a) {
30
+ var theme = _a.theme;
31
+ return (__assign(__assign({}, styles), { justifyContent: 'center', alignItems: 'center', padding: '0 4px', color: createRgba(theme.colors.inputTextColor, 0.25) }));
32
+ },
33
+ clearIndicator: function (styles, _a) {
34
+ var theme = _a.theme;
35
+ return (__assign(__assign({}, styles), { justifyContent: 'center', alignItems: 'center', padding: '0 4px', color: createRgba(theme.colors.inputTextColor, 0.25) }));
36
+ },
37
+ loadingIndicator: function (styles, _a) {
38
+ var theme = _a.theme;
39
+ return (__assign(__assign({}, styles), { justifyContent: 'center', alignItems: 'center', padding: '0 4px', color: createRgba(theme.colors.inputTextColor, 0.25) }));
40
+ },
41
+ indicatorSeparator: function (styles, _a) {
42
+ var theme = _a.theme;
43
+ return (__assign(__assign({}, styles), { backgroundColor: createRgba(theme.colors.inputTextColor, 0.25) }));
44
+ },
45
+ input: function (styles, _a) {
46
+ var theme = _a.theme;
47
+ return (__assign(__assign({}, styles), { color: theme.colors.inputTextColor }));
48
+ },
49
+ singleValue: function (styles, _a) {
50
+ var selectProps = _a.selectProps, theme = _a.theme;
51
+ return (__assign(__assign({}, styles), { color: selectProps.isInvalid ? theme.colors.primary : theme.colors.inputTextColor }));
52
+ },
53
+ multiValue: function (styles, _a) {
54
+ var theme = _a.theme;
55
+ return (__assign(__assign({}, styles), { color: theme.colors.inputTextColor, backgroundColor: theme.colors.menuBackgroundColor }));
56
+ },
57
+ multiValueLabel: function (styles) { return (__assign(__assign({}, styles), { fontSize: 'unset', padding: '5px' })); },
58
+ placeholder: function (styles, _a) {
59
+ var selectProps = _a.selectProps, theme = _a.theme;
60
+ return (__assign(__assign({}, styles), { textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden', maxWidth: 'calc(100% - 8px)', color: selectProps.isDarkPlaceholderText ? theme.colors.inputTextColor : theme.colors.placeholderTextColor }));
61
+ },
62
+ loadingMessage: function (styles, _a) {
63
+ var theme = _a.theme;
64
+ return (__assign(__assign({}, styles), { color: theme.colors.optionTextColor }));
65
+ },
66
+ noOptionsMessage: function (styles, _a) {
67
+ var theme = _a.theme;
68
+ return (__assign(__assign({}, styles), { color: theme.colors.optionTextColor }));
69
+ },
70
+ menuList: function (styles, _a) {
71
+ var theme = _a.theme;
72
+ return __assign(__assign({}, styles), { margin: '8px 4px 8px 8px', '::-webkit-scrollbar-thumb': {
73
+ border: 'none',
74
+ borderRadius: '4px',
75
+ height: '47px',
76
+ backgroundColor: theme.colors.scrollbarThumbColor,
77
+ '&:hover': {
78
+ backgroundColor: theme.colors.dropdownIndicatorColor,
79
+ },
80
+ }, '::-webkit-scrollbar': {
81
+ width: '10px',
82
+ }, '::-webkit-scrollbar-track': {
83
+ backgroundColor: theme.colors.scrollbarTrackColor,
84
+ borderRadius: '6px',
85
+ } });
86
+ },
87
+ };
@@ -0,0 +1,24 @@
1
+ import { SelectProps } from '../types';
2
+ import { BaseStylesTheme, BaseState, StylesConfig } from './baseStyles';
3
+ type CustomTheme = Omit<BaseStylesTheme, 'colors'> & {
4
+ colors: Omit<BaseStylesTheme['colors'], 'primary50' | 'primary25'> & {
5
+ activeOptionBackground: string;
6
+ valueTextColor: string;
7
+ inputTextColor: string;
8
+ inputBorderHoverColor: string;
9
+ menuHoverBackgroundColor: string;
10
+ dropdownIndicatorColor: string;
11
+ };
12
+ textWeightRegular: string;
13
+ textWeightSemiBold: string;
14
+ textWeightBold: string;
15
+ optionVariant: Required<SelectProps>['optionVariant'];
16
+ borderRadius: string;
17
+ font: string;
18
+ narrowIndicators: boolean;
19
+ };
20
+ type State = BaseState<CustomTheme>;
21
+ export declare const CustomStyles: StylesConfig<State>;
22
+ type ThemeGetter = (theme: any) => CustomTheme;
23
+ export declare const getCustomTheme: (theme: any, optionVariant: Required<SelectProps>['optionVariant'], useFilterSubvariant: boolean) => ThemeGetter;
24
+ export {};
@@ -0,0 +1,102 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { baseStylesConfig } from './baseStyles';
13
+ import { th } from '@xstyled/system';
14
+ // style object https://react-select.com/styles
15
+ export var CustomStyles = __assign(__assign({}, baseStylesConfig), { control: function (styles, _a) {
16
+ var _b;
17
+ var selectProps = _a.selectProps, theme = _a.theme, isFocused = _a.isFocused, isDisabled = _a.isDisabled;
18
+ var colors = theme.colors;
19
+ return __assign(__assign({}, styles), { borderColor: selectProps.isInvalid ? colors.primary : isFocused ? colors.inputTextColor : colors.inputBorderColor, backgroundColor: isDisabled ? colors.inputDisabledColor : colors.inputBackgroundColor, boxShadow: isFocused ? theme.focusBoxShadow : undefined, borderRadius: theme.borderRadius, '& input': {
20
+ fontWeight: theme.textWeightBold,
21
+ fontFamily: theme.font,
22
+ }, '&:hover': __assign(__assign({}, ((_b = styles['&:hover']) !== null && _b !== void 0 ? _b : {})), { borderColor: colors.inputBorderHoverColor }), fontSize: '14px', minHeight: theme.height, minWidth: selectProps.isMulti ? 'min-content' : 'max-content', '.inputIcon': {
23
+ color: isDisabled ? colors.valueTextColor : !!selectProps.value ? colors.inputTextColor : colors.valueTextColor,
24
+ } });
25
+ }, singleValue: function (styles, _a) {
26
+ var selectProps = _a.selectProps, theme = _a.theme, isDisabled = _a.isDisabled;
27
+ return (__assign(__assign({}, styles), { color: selectProps.isInvalid ? theme.colors.primary : isDisabled ? theme.colors.valueTextColor : theme.colors.inputTextColor, fontSize: '14px', fontWeight: selectProps.isDarkPlaceholderText ? '400' : theme.textWeightSemiBold }));
28
+ }, multiValue: function (styles, state) {
29
+ var _a;
30
+ var theme = state.theme;
31
+ var base = (_a = baseStylesConfig.multiValue) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
32
+ return __assign(__assign({}, base), { fontSize: '9px', fontWeight: theme.textWeightSemiBold });
33
+ }, multiValueRemove: function (styles, _a) {
34
+ var _b;
35
+ var theme = _a.theme;
36
+ return (__assign(__assign({}, styles), { color: theme.colors.inputBorderColor, '&:hover': __assign(__assign({}, ((_b = styles['&:hover']) !== null && _b !== void 0 ? _b : {})), { backgroundColor: theme.colors.inputTextColor }) }));
37
+ }, placeholder: function (styles, state) {
38
+ var _a;
39
+ var theme = state.theme;
40
+ var base = (_a = baseStylesConfig.placeholder) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
41
+ return __assign(__assign({}, base), { fontSize: '14px', fontWeight: theme.textWeightSemiBold });
42
+ }, option: function (styles, _a) {
43
+ var isSelected = _a.isSelected, theme = _a.theme, isDisabled = _a.isDisabled, selectProps = _a.selectProps;
44
+ var defaultColor = theme.colors.optionTextColor;
45
+ var disabledColor = theme.colors.placeholderTextColor;
46
+ return {
47
+ color: isSelected ? theme.colors.primary : defaultColor,
48
+ backgroundColor: isSelected ? theme.colors.activeOptionBackground : undefined,
49
+ fontWeight: 400,
50
+ fontSize: '14px',
51
+ cursor: !isDisabled ? 'pointer' : 'default',
52
+ display: 'flex',
53
+ flexDirection: 'row',
54
+ alignItems: 'center',
55
+ padding: '7px 10px',
56
+ height: '36px',
57
+ marginRight: '4px',
58
+ marginBottom: '2px',
59
+ lineHeight: '22px',
60
+ borderRadius: th.radius('ml')({ theme: selectProps === null || selectProps === void 0 ? void 0 : selectProps.systemTheme }),
61
+ '&:hover': { backgroundColor: !isDisabled ? theme.colors.menuHoverBackgroundColor : undefined },
62
+ };
63
+ }, menu: function (styles, state) {
64
+ var _a;
65
+ var base = (_a = baseStylesConfig.menu) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
66
+ return __assign(__assign({}, base), { boxShadow: '0 2px 20px 0 rgba(0, 0, 0, 0.10);', marginTop: '-0', paddingTop: '0', borderRadius: '10px', zIndex: 3 });
67
+ }, dropdownIndicator: function (styles, state) {
68
+ var _a;
69
+ var base = (_a = baseStylesConfig.dropdownIndicator) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
70
+ var theme = state.theme, isFocused = state.isFocused;
71
+ return __assign(__assign({}, base), { color: isFocused ? theme.colors.inputTextColor : theme.colors.dropdownIndicatorColor, padding: '0px 5px 0px 0px', '@media (min-width: 1024px)': {
72
+ padding: '0px 5px 0px 1px',
73
+ } });
74
+ }, clearIndicator: function (styles, state) {
75
+ var _a;
76
+ var base = (_a = baseStylesConfig.clearIndicator) === null || _a === void 0 ? void 0 : _a.call(baseStylesConfig, styles, state);
77
+ var theme = state.theme;
78
+ return __assign(__assign({}, base), { padding: theme.narrowIndicators ? '0px 0px 0px 2px' : '0px 4px' });
79
+ },
80
+ // invisible indicator separator
81
+ indicatorSeparator: function () { return ({ display: 'none' }); } });
82
+ export var getCustomTheme = function (theme, optionVariant, useFilterSubvariant) {
83
+ var inputTextColor = th.color('blue2')({ theme: theme });
84
+ var customColors = {
85
+ primary: th.color('red1')({ theme: theme }),
86
+ inputTextColor: inputTextColor,
87
+ valueTextColor: th.color('gray')({ theme: theme }),
88
+ placeholderTextColor: th.color('lightGray3')({ theme: theme }),
89
+ optionTextColor: th.color('blue2')({ theme: theme }),
90
+ inputDisabledColor: th.color('lightGray1')({ theme: theme }),
91
+ inputBackgroundColor: "white",
92
+ inputBorderColor: th.color('lightGray3')({ theme: theme }),
93
+ inputBorderHoverColor: th.color('gray5')({ theme: theme }),
94
+ activeOptionBackground: th.color('red20')({ theme: theme }),
95
+ menuBackgroundColor: th.color('white')({ theme: theme }),
96
+ menuHoverBackgroundColor: th.color('bgLightGray1')({ theme: theme }),
97
+ dropdownIndicatorColor: th.color('gray1')({ theme: theme }),
98
+ };
99
+ return function (reactSelectTheme) {
100
+ return __assign(__assign({}, reactSelectTheme), { colors: customColors, focusBoxShadow: null, height: useFilterSubvariant ? '32px' : '38px', textWeightRegular: th.fontWeight('regular')({ theme: theme }), textWeightSemiBold: th.fontWeight('semiBold')({ theme: theme }), textWeightBold: th.fontWeight('bold')({ theme: theme }), optionVariant: optionVariant, borderRadius: th.radius('lg')({ theme: theme }), font: th.font('primary')({ theme: theme }), narrowIndicators: !!useFilterSubvariant });
101
+ };
102
+ };
@@ -0,0 +1,3 @@
1
+ import { StylesConfig, SelectComponentsConfig } from 'react-select';
2
+ import { SelectProps } from '../types';
3
+ export declare const useStylesAndComponents: (style: SelectProps['style'], optionVariant: SelectProps['optionVariant'], multiLabelVariant: SelectProps['multiLabelVariant'], containerVariant: SelectProps['containerVariant'], useSimplifiedOptions: SelectProps['useSimplifiedOptions'], showSelectAllButton: SelectProps['showSelectAllButton'], showResetGridButton: SelectProps['showResetGridButton']) => [SelectComponentsConfig<unknown, boolean, any>, any, StylesConfig];
@@ -0,0 +1,43 @@
1
+ import { SimplifiedOption, IconValueContainer, CountMultiValue, ChevronOption, DropdownIndicator, CustomInput, ConnectedMenu, } from './CustomComponents';
2
+ import { getCustomTheme as getFormCustomTheme, CustomStyles as FormCustomStyles } from './formStyles';
3
+ import { useTheme } from '@xstyled/styled-components';
4
+ import { useMemo } from 'react';
5
+ export var useStylesAndComponents = function (style, optionVariant, multiLabelVariant, containerVariant, useSimplifiedOptions, showSelectAllButton, showResetGridButton) {
6
+ if (style === void 0) { style = 'form'; }
7
+ if (optionVariant === void 0) { optionVariant = 'default'; }
8
+ if (multiLabelVariant === void 0) { multiLabelVariant = 'default'; }
9
+ if (containerVariant === void 0) { containerVariant = 'default'; }
10
+ var systemTheme = useTheme();
11
+ return useMemo(function () {
12
+ var components = {
13
+ ValueContainer: IconValueContainer,
14
+ };
15
+ if (multiLabelVariant === 'count') {
16
+ components.MultiValue = CountMultiValue;
17
+ }
18
+ if (containerVariant === 'search') {
19
+ components.DropdownIndicator = null;
20
+ }
21
+ if (showResetGridButton || showSelectAllButton) {
22
+ components.Menu = ConnectedMenu;
23
+ }
24
+ components.Input = CustomInput;
25
+ var themes = getFormCustomTheme(systemTheme, optionVariant, style == 'gridFilter');
26
+ var styles = FormCustomStyles;
27
+ components.Option = ChevronOption;
28
+ components.DropdownIndicator = DropdownIndicator;
29
+ // performance reasons
30
+ if (useSimplifiedOptions)
31
+ components.Option = SimplifiedOption;
32
+ return [components, themes, styles];
33
+ }, [
34
+ multiLabelVariant,
35
+ containerVariant,
36
+ showResetGridButton,
37
+ showSelectAllButton,
38
+ style,
39
+ useSimplifiedOptions,
40
+ systemTheme,
41
+ optionVariant,
42
+ ]);
43
+ };
@@ -0,0 +1,55 @@
1
+ import { RefObject } from 'react';
2
+ import { SpaceAround } from '../SpaceAround/types';
3
+ import { Theme } from 'react-select';
4
+ export type Option<Value = string | number> = {
5
+ value: Value;
6
+ label: string | number;
7
+ isDisabled?: boolean;
8
+ isFixed?: boolean;
9
+ color?: string;
10
+ index?: number;
11
+ inputValue?: string;
12
+ };
13
+ export type ValueType = Option | Option[] | null;
14
+ export type SelectProps = {
15
+ label?: string;
16
+ name?: string;
17
+ value?: number | string | string[] | Option | Option[];
18
+ placeholder?: string;
19
+ loadingMessage?: (inputValue: string) => string | JSX.Element;
20
+ noOptionsMessage?: (inputValue: string) => string | JSX.Element;
21
+ filterOption?: (option: Option) => boolean;
22
+ options?: Option[];
23
+ loadOptions?: (text: string) => Promise<Option[]>;
24
+ defaultOptions?: Option[];
25
+ onChange: (value: ValueType) => void;
26
+ onBlur?: Function;
27
+ error?: string;
28
+ index?: [];
29
+ isInvalid?: boolean;
30
+ isLoading?: boolean;
31
+ spaceAround?: SpaceAround;
32
+ disabled?: boolean;
33
+ onInputChange?: Function;
34
+ useSimplifiedOptions?: boolean;
35
+ showSelectAllButton?: boolean;
36
+ showResetGridButton?: boolean;
37
+ isClearable?: boolean;
38
+ isSearchable?: boolean;
39
+ isMulti?: boolean;
40
+ menuIsOpen?: boolean;
41
+ defaultMenuIsOpen?: boolean;
42
+ isDarkPlaceholderText?: boolean;
43
+ style?: 'form' | 'gridFilter';
44
+ optionVariant?: 'default' | 'checkbox' | 'toggle';
45
+ multiLabelVariant?: 'default' | 'count';
46
+ containerVariant?: 'default' | 'search';
47
+ placeholderIcon?: string;
48
+ innerRef?: RefObject<HTMLElement>;
49
+ className?: string;
50
+ maxMenuHeight?: number;
51
+ resetGrid?: Function;
52
+ getOptionValue?: Function;
53
+ systemTheme?: Theme;
54
+ menuPlacement?: string;
55
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import { SelectProps, Option } from '../Select/types';
2
+ type FieldValueType = string | number | (string | number)[] | null;
3
+ export type Props = Omit<SelectProps, 'onChange' | 'loadOptions'> & {
4
+ onChange: (event: {
5
+ target: {
6
+ [key: string]: FieldValueType;
7
+ };
8
+ }) => void;
9
+ onValueChange?: Function;
10
+ asyncLoadMinChars?: number;
11
+ preload?: boolean;
12
+ isLocked?: boolean;
13
+ lockedText?: string;
14
+ onCreateOption?: (label: string) => Promise<Option<string>>;
15
+ initialOptions?: Option[];
16
+ loadOptions?: (fulltext: string, byId: boolean) => Promise<Option[]>;
17
+ form?: any;
18
+ };
19
+ declare const SingleSelect: (props: Props) => JSX.Element;
20
+ export default SingleSelect;