@decisiv/ui-components 1.36.1-alpha.3 → 2.0.1-alpha.100

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 (323) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/lib/atoms/BaseButton/index.d.ts.map +1 -1
  3. package/lib/atoms/BaseButton/index.js +1 -1
  4. package/lib/atoms/BooleanInput/elements.d.ts.map +1 -1
  5. package/lib/atoms/BooleanInput/elements.js +8 -3
  6. package/lib/atoms/BooleanInput/index.d.ts.map +1 -1
  7. package/lib/atoms/BooleanInput/index.js +26 -5
  8. package/lib/atoms/BooleanInput/index.test.js +17 -6
  9. package/lib/atoms/BooleanInput/types.d.ts +4 -0
  10. package/lib/atoms/BooleanInput/types.d.ts.map +1 -1
  11. package/lib/atoms/BooleanInput/types.js +5 -1
  12. package/lib/atoms/Calendar/hooks/useCalendar/index.d.ts.map +1 -1
  13. package/lib/atoms/Calendar/hooks/useCalendar/index.js +2 -1
  14. package/lib/atoms/Calendar/hooks/useCalendar/index.test.js +5 -6
  15. package/lib/atoms/Calendar/index.d.ts.map +1 -1
  16. package/lib/atoms/Calendar/index.js +8 -1
  17. package/lib/atoms/Calendar/index.test.js +70 -40
  18. package/lib/atoms/Calendar/types.js +5 -1
  19. package/lib/atoms/InputField/Containers.d.ts +11 -6
  20. package/lib/atoms/InputField/Containers.d.ts.map +1 -1
  21. package/lib/atoms/InputField/Containers.js +6 -6
  22. package/lib/atoms/InputField/InputLabel.d.ts +1 -0
  23. package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
  24. package/lib/atoms/InputField/InputLabel.js +2 -1
  25. package/lib/atoms/InputField/index.d.ts +5 -0
  26. package/lib/atoms/InputField/index.d.ts.map +1 -1
  27. package/lib/atoms/InputField/index.js +21 -7
  28. package/lib/atoms/InputField/index.test.js +91 -0
  29. package/lib/atoms/InputField/schema.d.ts.map +1 -1
  30. package/lib/atoms/InputField/schema.js +1 -0
  31. package/lib/atoms/OptionsList/Category.d.ts +1 -1
  32. package/lib/atoms/OptionsList/Category.d.ts.map +1 -1
  33. package/lib/atoms/OptionsList/Category.js +4 -2
  34. package/lib/atoms/OptionsList/Footer.d.ts +8 -0
  35. package/lib/atoms/OptionsList/Footer.d.ts.map +1 -0
  36. package/lib/atoms/OptionsList/Footer.js +72 -0
  37. package/lib/atoms/OptionsList/Option.d.ts.map +1 -1
  38. package/lib/atoms/OptionsList/Option.js +8 -5
  39. package/lib/atoms/OptionsList/index.d.ts.map +1 -1
  40. package/lib/atoms/OptionsList/index.js +43 -16
  41. package/lib/atoms/OptionsList/index.test.js +107 -11
  42. package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
  43. package/lib/atoms/OptionsList/schema.js +4 -0
  44. package/lib/atoms/OptionsList/types.d.ts +14 -0
  45. package/lib/atoms/OptionsList/types.d.ts.map +1 -1
  46. package/lib/atoms/OptionsList/types.js +5 -1
  47. package/lib/atoms/OptionsList/useListSelectionKeyboardActions.d.ts.map +1 -1
  48. package/lib/atoms/OptionsList/useListSelectionKeyboardActions.js +9 -4
  49. package/lib/atoms/RequiredIcon.d.ts +9 -0
  50. package/lib/atoms/RequiredIcon.d.ts.map +1 -0
  51. package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
  52. package/lib/components/Accordion/types.js +5 -1
  53. package/lib/components/Accordion/useAccordion/types.js +5 -1
  54. package/lib/components/Alert/Container.d.ts +201 -0
  55. package/lib/components/Alert/Container.d.ts.map +1 -0
  56. package/lib/components/Alert/Container.js +26 -0
  57. package/lib/components/Alert/StyledButton.d.ts +5 -0
  58. package/lib/components/Alert/StyledButton.d.ts.map +1 -0
  59. package/lib/components/Alert/StyledButton.js +23 -0
  60. package/lib/components/Alert/index.d.ts +27 -0
  61. package/lib/components/Alert/index.d.ts.map +1 -0
  62. package/lib/components/Alert/index.js +112 -0
  63. package/lib/components/Alert/index.test.js +79 -0
  64. package/lib/components/Alert/intents.d.ts +13 -0
  65. package/lib/components/Alert/intents.d.ts.map +1 -0
  66. package/lib/components/Alert/intents.js +72 -0
  67. package/lib/components/Alert/schema.d.ts +3 -0
  68. package/lib/components/Alert/schema.d.ts.map +1 -0
  69. package/lib/components/Alert/schema.js +25 -0
  70. package/lib/components/Alert/types.d.ts +36 -0
  71. package/lib/components/Alert/types.d.ts.map +1 -0
  72. package/lib/components/Alert/types.js +32 -0
  73. package/lib/components/Avatar/types.js +5 -1
  74. package/lib/components/Badge/constants.d.ts +2 -0
  75. package/lib/components/Badge/constants.d.ts.map +1 -0
  76. package/lib/components/Badge/constants.js +29 -0
  77. package/lib/components/Badge/index.d.ts.map +1 -1
  78. package/lib/components/Badge/index.js +12 -23
  79. package/lib/components/Badge/index.test.js +51 -8
  80. package/lib/components/Badge/schema.js +1 -1
  81. package/lib/components/Badge/types.d.ts +1 -1
  82. package/lib/components/Badge/types.d.ts.map +1 -1
  83. package/lib/components/Badge/types.js +7 -3
  84. package/lib/components/Breadcrumbs/types.js +5 -1
  85. package/lib/components/Button/schema.d.ts +6 -1
  86. package/lib/components/Button/schema.d.ts.map +1 -1
  87. package/lib/components/Button/schema.js +9 -4
  88. package/lib/components/Button/types.js +5 -1
  89. package/lib/components/Checkbox/index.d.ts.map +1 -1
  90. package/lib/components/Checkbox/index.js +3 -1
  91. package/lib/components/Checkbox/schema.d.ts.map +1 -1
  92. package/lib/components/Checkbox/schema.js +2 -0
  93. package/lib/components/Combobox/Target.d.ts.map +1 -1
  94. package/lib/components/Combobox/Target.js +45 -14
  95. package/lib/components/Combobox/index.d.ts.map +1 -1
  96. package/lib/components/Combobox/index.js +193 -65
  97. package/lib/components/Combobox/index.test.js +358 -135
  98. package/lib/components/Combobox/schema.d.ts.map +1 -1
  99. package/lib/components/Combobox/schema.js +9 -2
  100. package/lib/components/Combobox/types.d.ts +12 -3
  101. package/lib/components/Combobox/types.d.ts.map +1 -1
  102. package/lib/components/Combobox/types.js +5 -1
  103. package/lib/components/DropdownList/index.d.ts +4 -0
  104. package/lib/components/DropdownList/index.d.ts.map +1 -1
  105. package/lib/components/DropdownList/index.js +76 -11
  106. package/lib/components/DropdownList/propTypes.d.ts +4 -0
  107. package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
  108. package/lib/components/DropdownList/propTypes.js +42 -0
  109. package/lib/components/DropdownList/schema.d.ts.map +1 -1
  110. package/lib/components/DropdownList/schema.js +5 -0
  111. package/lib/components/DropdownList/types.d.ts +4 -1
  112. package/lib/components/DropdownList/types.d.ts.map +1 -1
  113. package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
  114. package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
  115. package/lib/components/Filter/IconWrapper/index.js +35 -0
  116. package/lib/components/Filter/SimplePrimary/index.d.ts +31 -0
  117. package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
  118. package/lib/components/Filter/SimplePrimary/index.js +58 -0
  119. package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
  120. package/lib/components/Filter/StyledFilter.d.ts +4 -0
  121. package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
  122. package/lib/components/Filter/StyledFilter.js +39 -0
  123. package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
  124. package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
  125. package/lib/components/Filter/StyledLabel/index.js +30 -0
  126. package/lib/components/Filter/index.d.ts +27 -0
  127. package/lib/components/Filter/index.d.ts.map +1 -0
  128. package/lib/components/Filter/index.js +95 -0
  129. package/lib/components/Filter/index.test.js +41 -0
  130. package/lib/components/Filter/kind.d.ts +6 -0
  131. package/lib/components/Filter/kind.d.ts.map +1 -0
  132. package/lib/components/Filter/kind.js +45 -0
  133. package/lib/components/Filter/schema.d.ts +9 -0
  134. package/lib/components/Filter/schema.d.ts.map +1 -0
  135. package/lib/components/Filter/schema.js +32 -0
  136. package/lib/components/Filter/types.d.ts +17 -0
  137. package/lib/components/Filter/types.d.ts.map +1 -0
  138. package/lib/components/Filter/types.js +5 -0
  139. package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
  140. package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
  141. package/lib/components/JumpTo/JumpToMenu.js +3 -3
  142. package/lib/components/JumpTo/types.js +5 -1
  143. package/lib/components/LeftNav/Item/ClickArea.d.ts.map +1 -1
  144. package/lib/components/LeftNav/Item/ClickArea.js +2 -2
  145. package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
  146. package/lib/components/LeftNav/Item/ItemWrapper.js +3 -3
  147. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
  148. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
  149. package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
  150. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
  151. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
  152. package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
  153. package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
  154. package/lib/components/LeftNav/Item/types.d.ts +1 -1
  155. package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
  156. package/lib/components/LeftNav/Item/types.js +5 -1
  157. package/lib/components/LeftNav/index.test.js +13 -3
  158. package/lib/components/LeftNav/schema.d.ts.map +1 -1
  159. package/lib/components/LeftNav/schema.js +2 -0
  160. package/lib/components/LeftNav/types.d.ts +1 -0
  161. package/lib/components/LeftNav/types.d.ts.map +1 -1
  162. package/lib/components/LeftNav/types.js +5 -1
  163. package/lib/components/Link/index.d.ts +2 -2
  164. package/lib/components/Link/index.d.ts.map +1 -1
  165. package/lib/components/Link/index.js +1 -1
  166. package/lib/components/Link/index.test.js +8 -0
  167. package/lib/components/Link/schema.d.ts.map +1 -1
  168. package/lib/components/Link/schema.js +1 -1
  169. package/lib/components/Menu/index.d.ts.map +1 -1
  170. package/lib/components/Menu/index.js +3 -1
  171. package/lib/components/Menu/types.d.ts +2 -0
  172. package/lib/components/Menu/types.d.ts.map +1 -1
  173. package/lib/components/Menu/types.js +5 -1
  174. package/lib/components/Modal/components.d.ts +2 -2
  175. package/lib/components/Modal/index.d.ts.map +1 -1
  176. package/lib/components/Modal/index.js +5 -5
  177. package/lib/components/Modal/index.test.js +32 -0
  178. package/lib/components/Modal/schema.d.ts.map +1 -1
  179. package/lib/components/Modal/schema.js +2 -2
  180. package/lib/components/Modal/types.d.ts +2 -2
  181. package/lib/components/Modal/types.d.ts.map +1 -1
  182. package/lib/components/Modal/types.js +5 -1
  183. package/lib/components/Notifications/Notification/components.d.ts +3 -3
  184. package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
  185. package/lib/components/Notifications/Notification/components.js +12 -6
  186. package/lib/components/Notifications/Notification/index.d.ts +3 -6
  187. package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
  188. package/lib/components/Notifications/Notification/index.js +19 -12
  189. package/lib/components/Notifications/Notification/index.test.js +38 -19
  190. package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
  191. package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
  192. package/lib/components/Notifications/NotificationsPanel/index.js +44 -21
  193. package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
  194. package/lib/components/Notifications/Notifier.test.js +79 -10
  195. package/lib/components/Notifications/constants.d.ts +2 -0
  196. package/lib/components/Notifications/constants.d.ts.map +1 -0
  197. package/lib/components/Notifications/constants.js +16 -0
  198. package/lib/components/Notifications/schema.d.ts.map +1 -1
  199. package/lib/components/Notifications/schema.js +2 -1
  200. package/lib/components/Notifications/useNotifications.d.ts +1 -0
  201. package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
  202. package/lib/components/Notifications/useNotifications.js +3 -3
  203. package/lib/components/Notifications/useNotifications.test.js +7 -4
  204. package/lib/components/Pagination/Pagination.d.ts +1 -1
  205. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  206. package/lib/components/Pagination/Pagination.js +1 -0
  207. package/lib/components/Pagination/Pagination.test.js +9 -0
  208. package/lib/components/Pagination/types.js +5 -1
  209. package/lib/components/Select/Target.js +1 -1
  210. package/lib/components/Select/index.d.ts.map +1 -1
  211. package/lib/components/Select/index.js +37 -1
  212. package/lib/components/Select/index.test.js +82 -23
  213. package/lib/components/Select/schema.d.ts.map +1 -1
  214. package/lib/components/Select/schema.js +7 -0
  215. package/lib/components/Select/types.d.ts +4 -1
  216. package/lib/components/Select/types.d.ts.map +1 -1
  217. package/lib/components/Select/types.js +5 -1
  218. package/lib/components/SelectDate/Target.js +1 -1
  219. package/lib/components/SelectDate/index.d.ts.map +1 -1
  220. package/lib/components/SelectDate/index.js +28 -1
  221. package/lib/components/SelectDate/index.test.js +108 -51
  222. package/lib/components/SelectDate/schema.d.ts.map +1 -1
  223. package/lib/components/SelectDate/schema.js +2 -0
  224. package/lib/components/SelectDate/types.d.ts +2 -0
  225. package/lib/components/SelectDate/types.d.ts.map +1 -1
  226. package/lib/components/SelectDate/types.js +5 -1
  227. package/lib/components/SelectDateRange/index.d.ts.map +1 -1
  228. package/lib/components/SelectDateRange/index.js +28 -1
  229. package/lib/components/SelectDateRange/index.test.js +115 -58
  230. package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
  231. package/lib/components/SelectDateRange/schema.js +2 -0
  232. package/lib/components/SelectDateRange/types.js +5 -1
  233. package/lib/components/SelectMenu/index.d.ts +5 -0
  234. package/lib/components/SelectMenu/index.d.ts.map +1 -1
  235. package/lib/components/SelectMenu/index.js +27 -3
  236. package/lib/components/SelectMenu/schema.d.ts.map +1 -1
  237. package/lib/components/SelectMenu/schema.js +4 -0
  238. package/lib/components/Table/Body.d.ts.map +1 -1
  239. package/lib/components/Table/Body.js +182 -38
  240. package/lib/components/Table/Container.d.ts.map +1 -1
  241. package/lib/components/Table/Container.js +3 -3
  242. package/lib/components/Table/DataRow.d.ts.map +1 -1
  243. package/lib/components/Table/DataRow.js +54 -10
  244. package/lib/components/Table/DraggableWrapper.d.ts +5 -0
  245. package/lib/components/Table/DraggableWrapper.d.ts.map +1 -0
  246. package/lib/components/Table/DraggableWrapper.js +38 -0
  247. package/lib/components/Table/Grip.d.ts +4 -0
  248. package/lib/components/Table/Grip.d.ts.map +1 -0
  249. package/lib/components/Table/Grip.js +30 -0
  250. package/lib/components/Table/Head.d.ts +1 -1
  251. package/lib/components/Table/Head.d.ts.map +1 -1
  252. package/lib/components/Table/Head.js +12 -9
  253. package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
  254. package/lib/components/Table/HeaderCell/index.js +57 -4
  255. package/lib/components/Table/HeaderCell/types.d.ts +6 -0
  256. package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
  257. package/lib/components/Table/HeaderCell/types.js +5 -1
  258. package/lib/components/Table/Provider.d.ts +18 -3
  259. package/lib/components/Table/Provider.d.ts.map +1 -1
  260. package/lib/components/Table/Provider.js +50 -4
  261. package/lib/components/Table/index.d.ts.map +1 -1
  262. package/lib/components/Table/index.js +167 -21
  263. package/lib/components/Table/index.test.js +335 -64
  264. package/lib/components/Table/schema.columns.d.ts.map +1 -1
  265. package/lib/components/Table/schema.columns.js +7 -4
  266. package/lib/components/Table/schema.d.ts.map +1 -1
  267. package/lib/components/Table/schema.js +8 -6
  268. package/lib/components/Table/types.d.ts +34 -3
  269. package/lib/components/Table/types.d.ts.map +1 -1
  270. package/lib/components/Table/utils.d.ts +4 -1
  271. package/lib/components/Table/utils.d.ts.map +1 -1
  272. package/lib/components/Table/utils.js +30 -1
  273. package/lib/components/Tabs/types.js +5 -1
  274. package/lib/components/Tag/types.d.ts +1 -1
  275. package/lib/components/Tag/types.d.ts.map +1 -1
  276. package/lib/components/Tag/types.js +5 -1
  277. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  278. package/lib/components/TextArea/TextArea.js +1 -1
  279. package/lib/components/TextArea/index.js +1 -0
  280. package/lib/components/TextArea/index.test.js +5 -0
  281. package/lib/components/TextField/Input.js +1 -1
  282. package/lib/components/TextField/index.test.js +5 -0
  283. package/lib/components/Toggle/index.d.ts.map +1 -1
  284. package/lib/components/Toggle/index.js +4 -0
  285. package/lib/components/Toggle/index.test.js +39 -10
  286. package/lib/components/Toggle/types.js +5 -1
  287. package/lib/components/TopNav/BrandInfo/index.d.ts +2 -1
  288. package/lib/components/TopNav/BrandInfo/index.d.ts.map +1 -1
  289. package/lib/components/TopNav/BrandInfo/index.js +9 -1
  290. package/lib/components/TopNav/BrandInfo/schema.d.ts.map +1 -1
  291. package/lib/components/TopNav/BrandInfo/schema.js +4 -1
  292. package/lib/components/TopNav/index.test.js +28 -0
  293. package/lib/components/Typography/withColors.d.ts +1 -1
  294. package/lib/components/Typography/withColors.js +2 -2
  295. package/lib/components/index.d.ts +2 -0
  296. package/lib/components/index.d.ts.map +1 -1
  297. package/lib/components/index.js +25 -0
  298. package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
  299. package/lib/providers/ConfigProvider/index.js +5 -1
  300. package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
  301. package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
  302. package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
  303. package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
  304. package/lib/providers/ConfigProvider/utils/translations.d.ts +5 -1
  305. package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
  306. package/lib/providers/ConfigProvider/utils/translations.js +5 -1
  307. package/lib/providers/NotificationsProvider/index.d.ts +6 -5
  308. package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
  309. package/lib/providers/NotificationsProvider/index.js +47 -28
  310. package/lib/providers/NotificationsProvider/types.d.ts +4 -1
  311. package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
  312. package/lib/utils/joinClassnames.d.ts +3 -0
  313. package/lib/utils/joinClassnames.d.ts.map +1 -0
  314. package/lib/utils/joinClassnames.js +26 -0
  315. package/lib/utils/useFirstMount.d.ts +2 -0
  316. package/lib/utils/useFirstMount.d.ts.map +1 -0
  317. package/lib/utils/useFirstMount.js +19 -0
  318. package/lib/utils/useUpdateEffect.d.ts +4 -0
  319. package/lib/utils/useUpdateEffect.d.ts.map +1 -0
  320. package/lib/utils/useUpdateEffect.js +28 -0
  321. package/package.json +9 -7
  322. package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
  323. package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
@@ -11,7 +11,9 @@ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
11
11
 
12
12
  var _uniqueId = _interopRequireDefault(require("lodash/uniqueId"));
13
13
 
14
- var _react = _interopRequireWildcard(require("react"));
14
+ var _noop = _interopRequireDefault(require("lodash/noop"));
15
+
16
+ var React = _interopRequireWildcard(require("react"));
15
17
 
16
18
  var _types = require("./types");
17
19
 
@@ -47,15 +49,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
47
49
 
48
50
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
49
51
 
50
- var notifyCB;
51
- var notifyHandler;
52
- var NotificationsContext = (0, _react.createContext)({
53
- /* istanbul ignore next */
54
- dismissAll: function dismissAll() {},
52
+ var NotificationsContext = React.createContext({
53
+ dismissAll: _noop.default,
54
+ isDismissingAll: false,
55
55
  notifications: [],
56
-
57
- /* istanbul ignore next */
58
- notify: function notify() {}
56
+ notify: _noop.default
59
57
  });
60
58
  exports.NotificationsContext = NotificationsContext;
61
59
  var transitions = (_transitions = {}, _defineProperty(_transitions, _types.NotificationState.ENTERING, {
@@ -76,10 +74,10 @@ exports.transitions = transitions;
76
74
  function NotificationsProvider(_ref) {
77
75
  var children = _ref.children;
78
76
 
79
- var _useState = (0, _react.useState)([]),
80
- _useState2 = _slicedToArray(_useState, 2),
81
- notifications = _useState2[0],
82
- setNotifications = _useState2[1];
77
+ var _React$useState = React.useState([]),
78
+ _React$useState2 = _slicedToArray(_React$useState, 2),
79
+ notifications = _React$useState2[0],
80
+ setNotifications = _React$useState2[1];
83
81
  /**
84
82
  * Advances a notification to either the specified state or the next state for the current state
85
83
  */
@@ -112,6 +110,16 @@ function NotificationsProvider(_ref) {
112
110
  })];
113
111
  }
114
112
 
113
+ if (meta.state === _types.NotificationState.COLLAPSING_ALL && props.onClose) {
114
+ try {
115
+ props.onClose(new MouseEvent('click'));
116
+ } catch (_unused) {
117
+ // IE doesn't support MouseEvent. If you support IE, you must verify or mock
118
+ // attributes required by this event handler.
119
+ props.onClose({});
120
+ }
121
+ }
122
+
115
123
  return undefined;
116
124
  }
117
125
 
@@ -134,7 +142,7 @@ function NotificationsProvider(_ref) {
134
142
  });
135
143
  };
136
144
 
137
- var notify = (0, _react.useCallback)(function () {
145
+ var notify = React.useCallback(function () {
138
146
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
139
147
  args[_key] = arguments[_key];
140
148
  }
@@ -148,25 +156,23 @@ function NotificationsProvider(_ref) {
148
156
  // notification dispatched.
149
157
  var newNotificationParams = args[0](oldNotifications);
150
158
 
151
- if ((0, _isEmpty.default)(newNotificationParams)) {
159
+ if (!newNotificationParams) {
152
160
  // In the scenario where a callback arg is provided but returns void,
153
161
  // block the rest of the logic and move on. There should be no change.
154
162
  return oldNotifications;
155
163
  }
156
164
 
157
- var _ref6 = newNotificationParams;
165
+ var _newNotificationParam = _slicedToArray(newNotificationParams, 2);
166
+
167
+ options = _newNotificationParam[0];
168
+ body = _newNotificationParam[1];
169
+ } else {
170
+ var _ref6 = args;
158
171
 
159
172
  var _ref7 = _slicedToArray(_ref6, 2);
160
173
 
161
174
  options = _ref7[0];
162
175
  body = _ref7[1];
163
- } else {
164
- var _ref8 = args;
165
-
166
- var _ref9 = _slicedToArray(_ref8, 2);
167
-
168
- options = _ref9[0];
169
- body = _ref9[1];
170
176
  }
171
177
 
172
178
  var notificationID = (0, _uniqueId.default)("notification-".concat(options.id, "-"));
@@ -174,6 +180,9 @@ function NotificationsProvider(_ref) {
174
180
  setTimeout(function () {
175
181
  transition(notificationID);
176
182
  }, duration);
183
+ var autoDismiss = options.duration && setTimeout(function () {
184
+ transition(notificationID, _types.NotificationState.COLLAPSING);
185
+ }, duration + options.duration);
177
186
 
178
187
  var closeNotificationAfter = function closeNotificationAfter(callback) {
179
188
  return function (event) {
@@ -185,9 +194,13 @@ function NotificationsProvider(_ref) {
185
194
  };
186
195
  };
187
196
 
188
- var actions = options.actions && options.actions.map(function (_ref10) {
189
- var onClick = _ref10.onClick,
190
- rest = _objectWithoutProperties(_ref10, ["onClick"]);
197
+ var suspendAutoDismiss = function suspendAutoDismiss() {
198
+ clearTimeout(autoDismiss);
199
+ };
200
+
201
+ var actions = options.actions && options.actions.map(function (_ref8) {
202
+ var onClick = _ref8.onClick,
203
+ rest = _objectWithoutProperties(_ref8, ["onClick"]);
191
204
 
192
205
  return _objectSpread({
193
206
  onClick: closeNotificationAfter(onClick)
@@ -196,7 +209,9 @@ function NotificationsProvider(_ref) {
196
209
  return [[_objectSpread({}, options, {
197
210
  actions: actions,
198
211
  id: options.id || notificationID,
199
- onClose: closeNotificationAfter(options.onClose)
212
+ onClose: options.onClose && closeNotificationAfter(options.onClose),
213
+ onFocus: suspendAutoDismiss,
214
+ onHover: suspendAutoDismiss
200
215
  }), body, {
201
216
  notificationID: notificationID,
202
217
  state: _types.NotificationState.ENTERING
@@ -204,9 +219,13 @@ function NotificationsProvider(_ref) {
204
219
  });
205
220
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
206
221
  [setNotifications]);
207
- return _react.default.createElement(NotificationsContext.Provider, {
222
+ var isDismissingAll = React.useMemo(function () {
223
+ return !(0, _isEmpty.default)(notifications) && notifications[0][2].state === _types.NotificationState.COLLAPSING_ALL;
224
+ }, [notifications]);
225
+ return React.createElement(NotificationsContext.Provider, {
208
226
  value: {
209
227
  dismissAll: dismissAll,
228
+ isDismissingAll: isDismissingAll,
210
229
  notifications: notifications,
211
230
  notify: notify
212
231
  }
@@ -11,13 +11,16 @@ export interface TActionProps {
11
11
  }
12
12
  export interface TNotificationProps {
13
13
  actions?: [TActionProps] | [TActionProps, TActionProps];
14
+ duration?: number;
14
15
  children?: React.ReactNode;
15
16
  closeHint?: string;
16
17
  color?: StatusColorsKeys;
17
18
  icon?: IconComponent;
18
19
  id: string;
19
20
  intent?: keyof typeof intents;
20
- onClose: React.MouseEventHandler;
21
+ onClose?: React.MouseEventHandler;
22
+ onFocus?: React.FocusEventHandler;
23
+ onHover?: React.MouseEventHandler;
21
24
  title: string;
22
25
  }
23
26
  export declare type TNotificationOptions = TNotificationProps;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/NotificationsProvider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,aAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAEvD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC9B,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,oBAAoB,GAAG,kBAAkB,CAAC;AAEtD,oBAAY,iBAAiB;IAC3B,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,cAAc,mBAAmB;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,oBAAY,aAAa,GAAG,CAC1B,oBAAoB,EACpB,GAAG,CAAC,OAAO,GAAG,SAAS,EACvB,iBAAiB,CAClB,CAAC;AACF,oBAAY,cAAc,GAAG,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/providers/NotificationsProvider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,aAAK,aAAa,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAEvD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,OAAO,OAAO,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,oBAAoB,GAAG,kBAAkB,CAAC;AAEtD,oBAAY,iBAAiB;IAC3B,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,cAAc,mBAAmB;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,oBAAY,aAAa,GAAG,CAC1B,oBAAoB,EACpB,GAAG,CAAC,OAAO,GAAG,SAAS,EACvB,iBAAiB,CAClB,CAAC;AACF,oBAAY,cAAc,GAAG,aAAa,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare function joinClassNames(...classnames: (string | undefined)[]): string | undefined;
2
+ export default joinClassNames;
3
+ //# sourceMappingURL=joinClassnames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joinClassnames.d.ts","sourceRoot":"","sources":["../../src/utils/joinClassnames.ts"],"names":[],"mappings":"AAMA,iBAAS,cAAc,CACrB,GAAG,UAAU,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GACpC,MAAM,GAAG,SAAS,CAIpB;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _compact = _interopRequireDefault(require("lodash/compact"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ /**
13
+ * Join multiple classnames
14
+ * Returns a string of joined classnames omitting falsy values, undefined when resulting string is empty
15
+ */
16
+ function joinClassNames() {
17
+ for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) {
18
+ classnames[_key] = arguments[_key];
19
+ }
20
+
21
+ var result = (0, _compact.default)(classnames).join(' ');
22
+ return result || undefined;
23
+ }
24
+
25
+ var _default = joinClassNames;
26
+ exports.default = _default;
@@ -0,0 +1,2 @@
1
+ export default function useFirstMountState(): boolean;
2
+ //# sourceMappingURL=useFirstMount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFirstMount.d.ts","sourceRoot":"","sources":["../../src/utils/useFirstMount.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,kBAAkB,IAAI,OAAO,CAUpD"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = useFirstMountState;
7
+
8
+ var _react = require("react");
9
+
10
+ function useFirstMountState() {
11
+ var isFirst = (0, _react.useRef)(true);
12
+
13
+ if (isFirst.current) {
14
+ isFirst.current = false;
15
+ return true;
16
+ }
17
+
18
+ return isFirst.current;
19
+ }
@@ -0,0 +1,4 @@
1
+ import { useEffect } from 'react';
2
+ declare const useUpdateEffect: typeof useEffect;
3
+ export default useUpdateEffect;
4
+ //# sourceMappingURL=useUpdateEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpdateEffect.d.ts","sourceRoot":"","sources":["../../src/utils/useUpdateEffect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAC;AAGlE,QAAA,MAAM,eAAe,EAAE,OAAO,SAY7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _useFirstMount = _interopRequireDefault(require("./useFirstMount"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ /* eslint-disable react-hooks/exhaustive-deps */
15
+ var useUpdateEffect = function useUpdateEffect(effect) {
16
+ var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
17
+ var isFirstMount = (0, _useFirstMount.default)();
18
+ (0, _react.useEffect)(function () {
19
+ if (!isFirstMount) {
20
+ return effect();
21
+ }
22
+
23
+ return undefined;
24
+ }, deps);
25
+ };
26
+
27
+ var _default = useUpdateEffect;
28
+ exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decisiv/ui-components",
3
- "version": "1.36.1-alpha.3+c4f1434",
3
+ "version": "2.0.1-alpha.100+2ee0ae7",
4
4
  "description": "Decisiv's design system React components",
5
5
  "author": "Decisiv UI Development Team",
6
6
  "license": "MIT",
@@ -15,16 +15,17 @@
15
15
  "test": "nps --no-scripts --silent test"
16
16
  },
17
17
  "dependencies": {
18
- "@decisiv/breakpoint-observer": "^1.8.9-alpha.3+c4f1434",
18
+ "@decisiv/breakpoint-observer": "^1.8.8",
19
19
  "@decisiv/design-tokens": "^1.8.8",
20
- "@decisiv/iconix": "^1.9.1-alpha.3+c4f1434",
21
- "@decisiv/prop-types": "^1.6.10-alpha.3+c4f1434",
20
+ "@decisiv/iconix": "^2.0.0",
21
+ "@decisiv/prop-types": "^1.6.9",
22
22
  "@seznam/compose-react-refs": "^1.0.2",
23
23
  "csstype": "^2.6.5",
24
24
  "element-closest": "^3.0.2",
25
25
  "lodash": "^4.17.15",
26
26
  "md5": "^2.2.1",
27
27
  "polished": "^3.4.1",
28
+ "react-beautiful-dnd": "^13.0.0",
28
29
  "react-desc": "^4.1.2",
29
30
  "react-popper": "^1.3.3",
30
31
  "styled-components-modifiers": "^1.2.5",
@@ -39,8 +40,8 @@
39
40
  },
40
41
  "devDependencies": {
41
42
  "@babel/plugin-transform-runtime": "^7.5.5",
42
- "@decisiv/babel-plugin-styled-components-references": "^1.3.8-alpha.3+c4f1434",
43
- "@decisiv/styled-components-static-styles": "^1.4.3-alpha.3+c4f1434",
43
+ "@decisiv/babel-plugin-styled-components-references": "^1.3.7",
44
+ "@decisiv/styled-components-static-styles": "^1.4.2",
44
45
  "@testing-library/jest-dom": "^4.2.0",
45
46
  "@testing-library/react": "^8.0.1",
46
47
  "@testing-library/react-hooks": "^3.2.1",
@@ -48,6 +49,7 @@
48
49
  "@types/md5": "^2.1.33",
49
50
  "@types/prop-types": "^15.7.1",
50
51
  "@types/react": "^16.8.22",
52
+ "@types/react-beautiful-dnd": "^13.0.0",
51
53
  "@types/styled-components": "^4.1.15",
52
54
  "@types/styled-theming": "^2.2.2",
53
55
  "babel-plugin-styled-components": "^1.10.6",
@@ -69,5 +71,5 @@
69
71
  "access": "public"
70
72
  },
71
73
  "private": false,
72
- "gitHead": "c4f1434937dda34057839767137af035a660fa72"
74
+ "gitHead": "2ee0ae79efd64111ffae307af42f2a91c965111a"
73
75
  }
@@ -1,4 +0,0 @@
1
- import { RefForwardingComponent, RefAttributes } from 'react';
2
- declare const RequiredIcon: RefForwardingComponent<HTMLDivElement, RefAttributes<HTMLDivElement>>;
3
- export default RequiredIcon;
4
- //# sourceMappingURL=RequiredIcon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RequiredIcon.d.ts","sourceRoot":"","sources":["../../../src/atoms/InputField/RequiredIcon.tsx"],"names":[],"mappings":"AACA,OAAc,EAEZ,sBAAsB,EAEtB,aAAa,EACd,MAAM,OAAO,CAAC;AAWf,QAAA,MAAM,YAAY,EAAE,sBAAsB,CACxC,cAAc,EACd,aAAa,CAAC,cAAc,CAAC,CAU9B,CAAC;AAEF,eAAe,YAAY,CAAC"}