@decisiv/ui-components 2.0.0 → 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 (319) hide show
  1. package/lib/atoms/BaseButton/index.d.ts.map +1 -1
  2. package/lib/atoms/BaseButton/index.js +1 -1
  3. package/lib/atoms/BooleanInput/elements.d.ts.map +1 -1
  4. package/lib/atoms/BooleanInput/elements.js +8 -3
  5. package/lib/atoms/BooleanInput/index.d.ts.map +1 -1
  6. package/lib/atoms/BooleanInput/index.js +26 -5
  7. package/lib/atoms/BooleanInput/index.test.js +17 -6
  8. package/lib/atoms/BooleanInput/types.d.ts +4 -0
  9. package/lib/atoms/BooleanInput/types.d.ts.map +1 -1
  10. package/lib/atoms/BooleanInput/types.js +5 -1
  11. package/lib/atoms/Calendar/hooks/useCalendar/index.d.ts.map +1 -1
  12. package/lib/atoms/Calendar/hooks/useCalendar/index.js +2 -1
  13. package/lib/atoms/Calendar/hooks/useCalendar/index.test.js +5 -6
  14. package/lib/atoms/Calendar/index.d.ts.map +1 -1
  15. package/lib/atoms/Calendar/index.js +8 -1
  16. package/lib/atoms/Calendar/index.test.js +70 -40
  17. package/lib/atoms/Calendar/types.js +5 -1
  18. package/lib/atoms/InputField/Containers.d.ts +11 -6
  19. package/lib/atoms/InputField/Containers.d.ts.map +1 -1
  20. package/lib/atoms/InputField/Containers.js +6 -6
  21. package/lib/atoms/InputField/InputLabel.d.ts +1 -0
  22. package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
  23. package/lib/atoms/InputField/InputLabel.js +2 -1
  24. package/lib/atoms/InputField/index.d.ts +5 -0
  25. package/lib/atoms/InputField/index.d.ts.map +1 -1
  26. package/lib/atoms/InputField/index.js +21 -7
  27. package/lib/atoms/InputField/index.test.js +91 -0
  28. package/lib/atoms/InputField/schema.d.ts.map +1 -1
  29. package/lib/atoms/InputField/schema.js +1 -0
  30. package/lib/atoms/OptionsList/Category.d.ts +1 -1
  31. package/lib/atoms/OptionsList/Category.d.ts.map +1 -1
  32. package/lib/atoms/OptionsList/Category.js +4 -2
  33. package/lib/atoms/OptionsList/Footer.d.ts +8 -0
  34. package/lib/atoms/OptionsList/Footer.d.ts.map +1 -0
  35. package/lib/atoms/OptionsList/Footer.js +72 -0
  36. package/lib/atoms/OptionsList/Option.d.ts.map +1 -1
  37. package/lib/atoms/OptionsList/Option.js +8 -5
  38. package/lib/atoms/OptionsList/index.d.ts.map +1 -1
  39. package/lib/atoms/OptionsList/index.js +43 -16
  40. package/lib/atoms/OptionsList/index.test.js +107 -11
  41. package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
  42. package/lib/atoms/OptionsList/schema.js +4 -0
  43. package/lib/atoms/OptionsList/types.d.ts +14 -0
  44. package/lib/atoms/OptionsList/types.d.ts.map +1 -1
  45. package/lib/atoms/OptionsList/types.js +5 -1
  46. package/lib/atoms/RequiredIcon.d.ts +9 -0
  47. package/lib/atoms/RequiredIcon.d.ts.map +1 -0
  48. package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
  49. package/lib/components/Accordion/types.js +5 -1
  50. package/lib/components/Accordion/useAccordion/types.js +5 -1
  51. package/lib/components/Alert/Container.d.ts +201 -0
  52. package/lib/components/Alert/Container.d.ts.map +1 -0
  53. package/lib/components/Alert/Container.js +26 -0
  54. package/lib/components/Alert/StyledButton.d.ts +5 -0
  55. package/lib/components/Alert/StyledButton.d.ts.map +1 -0
  56. package/lib/components/Alert/StyledButton.js +23 -0
  57. package/lib/components/Alert/index.d.ts +27 -0
  58. package/lib/components/Alert/index.d.ts.map +1 -0
  59. package/lib/components/Alert/index.js +112 -0
  60. package/lib/components/Alert/index.test.js +79 -0
  61. package/lib/components/Alert/intents.d.ts +13 -0
  62. package/lib/components/Alert/intents.d.ts.map +1 -0
  63. package/lib/components/Alert/intents.js +72 -0
  64. package/lib/components/Alert/schema.d.ts +3 -0
  65. package/lib/components/Alert/schema.d.ts.map +1 -0
  66. package/lib/components/Alert/schema.js +25 -0
  67. package/lib/components/Alert/types.d.ts +36 -0
  68. package/lib/components/Alert/types.d.ts.map +1 -0
  69. package/lib/components/Alert/types.js +32 -0
  70. package/lib/components/Avatar/types.js +5 -1
  71. package/lib/components/Badge/constants.d.ts +2 -0
  72. package/lib/components/Badge/constants.d.ts.map +1 -0
  73. package/lib/components/Badge/constants.js +29 -0
  74. package/lib/components/Badge/index.d.ts.map +1 -1
  75. package/lib/components/Badge/index.js +12 -23
  76. package/lib/components/Badge/index.test.js +51 -8
  77. package/lib/components/Badge/schema.js +1 -1
  78. package/lib/components/Badge/types.d.ts +1 -1
  79. package/lib/components/Badge/types.d.ts.map +1 -1
  80. package/lib/components/Badge/types.js +7 -3
  81. package/lib/components/Breadcrumbs/types.js +5 -1
  82. package/lib/components/Button/schema.d.ts +6 -1
  83. package/lib/components/Button/schema.d.ts.map +1 -1
  84. package/lib/components/Button/schema.js +9 -4
  85. package/lib/components/Button/types.js +5 -1
  86. package/lib/components/Checkbox/index.d.ts.map +1 -1
  87. package/lib/components/Checkbox/index.js +3 -1
  88. package/lib/components/Checkbox/schema.d.ts.map +1 -1
  89. package/lib/components/Checkbox/schema.js +2 -0
  90. package/lib/components/Combobox/Target.d.ts.map +1 -1
  91. package/lib/components/Combobox/Target.js +45 -14
  92. package/lib/components/Combobox/index.d.ts.map +1 -1
  93. package/lib/components/Combobox/index.js +193 -65
  94. package/lib/components/Combobox/index.test.js +358 -135
  95. package/lib/components/Combobox/schema.d.ts.map +1 -1
  96. package/lib/components/Combobox/schema.js +9 -2
  97. package/lib/components/Combobox/types.d.ts +12 -3
  98. package/lib/components/Combobox/types.d.ts.map +1 -1
  99. package/lib/components/Combobox/types.js +5 -1
  100. package/lib/components/DropdownList/index.d.ts +4 -0
  101. package/lib/components/DropdownList/index.d.ts.map +1 -1
  102. package/lib/components/DropdownList/index.js +76 -11
  103. package/lib/components/DropdownList/propTypes.d.ts +4 -0
  104. package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
  105. package/lib/components/DropdownList/propTypes.js +42 -0
  106. package/lib/components/DropdownList/schema.d.ts.map +1 -1
  107. package/lib/components/DropdownList/schema.js +5 -0
  108. package/lib/components/DropdownList/types.d.ts +4 -1
  109. package/lib/components/DropdownList/types.d.ts.map +1 -1
  110. package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
  111. package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
  112. package/lib/components/Filter/IconWrapper/index.js +35 -0
  113. package/lib/components/Filter/SimplePrimary/index.d.ts +31 -0
  114. package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
  115. package/lib/components/Filter/SimplePrimary/index.js +58 -0
  116. package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
  117. package/lib/components/Filter/StyledFilter.d.ts +4 -0
  118. package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
  119. package/lib/components/Filter/StyledFilter.js +39 -0
  120. package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
  121. package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
  122. package/lib/components/Filter/StyledLabel/index.js +30 -0
  123. package/lib/components/Filter/index.d.ts +27 -0
  124. package/lib/components/Filter/index.d.ts.map +1 -0
  125. package/lib/components/Filter/index.js +95 -0
  126. package/lib/components/Filter/index.test.js +41 -0
  127. package/lib/components/Filter/kind.d.ts +6 -0
  128. package/lib/components/Filter/kind.d.ts.map +1 -0
  129. package/lib/components/Filter/kind.js +45 -0
  130. package/lib/components/Filter/schema.d.ts +9 -0
  131. package/lib/components/Filter/schema.d.ts.map +1 -0
  132. package/lib/components/Filter/schema.js +32 -0
  133. package/lib/components/Filter/types.d.ts +17 -0
  134. package/lib/components/Filter/types.d.ts.map +1 -0
  135. package/lib/components/Filter/types.js +5 -0
  136. package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
  137. package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
  138. package/lib/components/JumpTo/JumpToMenu.js +3 -3
  139. package/lib/components/JumpTo/types.js +5 -1
  140. package/lib/components/LeftNav/Item/ClickArea.d.ts.map +1 -1
  141. package/lib/components/LeftNav/Item/ClickArea.js +2 -2
  142. package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
  143. package/lib/components/LeftNav/Item/ItemWrapper.js +3 -3
  144. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
  145. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
  146. package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
  147. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
  148. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
  149. package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
  150. package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
  151. package/lib/components/LeftNav/Item/types.d.ts +1 -1
  152. package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
  153. package/lib/components/LeftNav/Item/types.js +5 -1
  154. package/lib/components/LeftNav/index.test.js +13 -3
  155. package/lib/components/LeftNav/schema.d.ts.map +1 -1
  156. package/lib/components/LeftNav/schema.js +2 -0
  157. package/lib/components/LeftNav/types.d.ts +1 -0
  158. package/lib/components/LeftNav/types.d.ts.map +1 -1
  159. package/lib/components/LeftNav/types.js +5 -1
  160. package/lib/components/Link/index.d.ts +2 -2
  161. package/lib/components/Link/index.d.ts.map +1 -1
  162. package/lib/components/Link/index.js +1 -1
  163. package/lib/components/Link/index.test.js +8 -0
  164. package/lib/components/Link/schema.d.ts.map +1 -1
  165. package/lib/components/Link/schema.js +1 -1
  166. package/lib/components/Menu/index.d.ts.map +1 -1
  167. package/lib/components/Menu/index.js +3 -1
  168. package/lib/components/Menu/types.d.ts +2 -0
  169. package/lib/components/Menu/types.d.ts.map +1 -1
  170. package/lib/components/Menu/types.js +5 -1
  171. package/lib/components/Modal/components.d.ts +2 -2
  172. package/lib/components/Modal/index.d.ts.map +1 -1
  173. package/lib/components/Modal/index.js +5 -5
  174. package/lib/components/Modal/index.test.js +32 -0
  175. package/lib/components/Modal/schema.d.ts.map +1 -1
  176. package/lib/components/Modal/schema.js +2 -2
  177. package/lib/components/Modal/types.d.ts +2 -2
  178. package/lib/components/Modal/types.d.ts.map +1 -1
  179. package/lib/components/Modal/types.js +5 -1
  180. package/lib/components/Notifications/Notification/components.d.ts +3 -3
  181. package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
  182. package/lib/components/Notifications/Notification/components.js +12 -6
  183. package/lib/components/Notifications/Notification/index.d.ts +3 -6
  184. package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
  185. package/lib/components/Notifications/Notification/index.js +19 -12
  186. package/lib/components/Notifications/Notification/index.test.js +38 -19
  187. package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
  188. package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
  189. package/lib/components/Notifications/NotificationsPanel/index.js +44 -21
  190. package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
  191. package/lib/components/Notifications/Notifier.test.js +79 -10
  192. package/lib/components/Notifications/constants.d.ts +2 -0
  193. package/lib/components/Notifications/constants.d.ts.map +1 -0
  194. package/lib/components/Notifications/constants.js +16 -0
  195. package/lib/components/Notifications/schema.d.ts.map +1 -1
  196. package/lib/components/Notifications/schema.js +2 -1
  197. package/lib/components/Notifications/useNotifications.d.ts +1 -0
  198. package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
  199. package/lib/components/Notifications/useNotifications.js +3 -3
  200. package/lib/components/Notifications/useNotifications.test.js +7 -4
  201. package/lib/components/Pagination/Pagination.d.ts +1 -1
  202. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  203. package/lib/components/Pagination/Pagination.js +1 -0
  204. package/lib/components/Pagination/Pagination.test.js +9 -0
  205. package/lib/components/Pagination/types.js +5 -1
  206. package/lib/components/Select/Target.js +1 -1
  207. package/lib/components/Select/index.d.ts.map +1 -1
  208. package/lib/components/Select/index.js +37 -1
  209. package/lib/components/Select/index.test.js +82 -23
  210. package/lib/components/Select/schema.d.ts.map +1 -1
  211. package/lib/components/Select/schema.js +7 -0
  212. package/lib/components/Select/types.d.ts +4 -1
  213. package/lib/components/Select/types.d.ts.map +1 -1
  214. package/lib/components/Select/types.js +5 -1
  215. package/lib/components/SelectDate/Target.js +1 -1
  216. package/lib/components/SelectDate/index.d.ts.map +1 -1
  217. package/lib/components/SelectDate/index.js +28 -1
  218. package/lib/components/SelectDate/index.test.js +108 -51
  219. package/lib/components/SelectDate/schema.d.ts.map +1 -1
  220. package/lib/components/SelectDate/schema.js +2 -0
  221. package/lib/components/SelectDate/types.d.ts +2 -0
  222. package/lib/components/SelectDate/types.d.ts.map +1 -1
  223. package/lib/components/SelectDate/types.js +5 -1
  224. package/lib/components/SelectDateRange/index.d.ts.map +1 -1
  225. package/lib/components/SelectDateRange/index.js +28 -1
  226. package/lib/components/SelectDateRange/index.test.js +115 -58
  227. package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
  228. package/lib/components/SelectDateRange/schema.js +2 -0
  229. package/lib/components/SelectDateRange/types.js +5 -1
  230. package/lib/components/SelectMenu/index.d.ts +5 -0
  231. package/lib/components/SelectMenu/index.d.ts.map +1 -1
  232. package/lib/components/SelectMenu/index.js +27 -3
  233. package/lib/components/SelectMenu/schema.d.ts.map +1 -1
  234. package/lib/components/SelectMenu/schema.js +4 -0
  235. package/lib/components/Table/Body.d.ts.map +1 -1
  236. package/lib/components/Table/Body.js +182 -38
  237. package/lib/components/Table/Container.d.ts.map +1 -1
  238. package/lib/components/Table/Container.js +3 -3
  239. package/lib/components/Table/DataRow.d.ts.map +1 -1
  240. package/lib/components/Table/DataRow.js +54 -10
  241. package/lib/components/Table/DraggableWrapper.d.ts +5 -0
  242. package/lib/components/Table/DraggableWrapper.d.ts.map +1 -0
  243. package/lib/components/Table/DraggableWrapper.js +38 -0
  244. package/lib/components/Table/Grip.d.ts +4 -0
  245. package/lib/components/Table/Grip.d.ts.map +1 -0
  246. package/lib/components/Table/Grip.js +30 -0
  247. package/lib/components/Table/Head.d.ts +1 -1
  248. package/lib/components/Table/Head.d.ts.map +1 -1
  249. package/lib/components/Table/Head.js +12 -9
  250. package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
  251. package/lib/components/Table/HeaderCell/index.js +57 -4
  252. package/lib/components/Table/HeaderCell/types.d.ts +6 -0
  253. package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
  254. package/lib/components/Table/HeaderCell/types.js +5 -1
  255. package/lib/components/Table/Provider.d.ts +18 -3
  256. package/lib/components/Table/Provider.d.ts.map +1 -1
  257. package/lib/components/Table/Provider.js +50 -4
  258. package/lib/components/Table/index.d.ts.map +1 -1
  259. package/lib/components/Table/index.js +167 -21
  260. package/lib/components/Table/index.test.js +335 -64
  261. package/lib/components/Table/schema.columns.d.ts.map +1 -1
  262. package/lib/components/Table/schema.columns.js +7 -4
  263. package/lib/components/Table/schema.d.ts.map +1 -1
  264. package/lib/components/Table/schema.js +8 -6
  265. package/lib/components/Table/types.d.ts +34 -3
  266. package/lib/components/Table/types.d.ts.map +1 -1
  267. package/lib/components/Table/utils.d.ts +4 -1
  268. package/lib/components/Table/utils.d.ts.map +1 -1
  269. package/lib/components/Table/utils.js +30 -1
  270. package/lib/components/Tabs/types.js +5 -1
  271. package/lib/components/Tag/types.d.ts +1 -1
  272. package/lib/components/Tag/types.d.ts.map +1 -1
  273. package/lib/components/Tag/types.js +5 -1
  274. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  275. package/lib/components/TextArea/TextArea.js +1 -1
  276. package/lib/components/TextArea/index.js +1 -0
  277. package/lib/components/TextArea/index.test.js +5 -0
  278. package/lib/components/TextField/Input.js +1 -1
  279. package/lib/components/TextField/index.test.js +5 -0
  280. package/lib/components/Toggle/index.d.ts.map +1 -1
  281. package/lib/components/Toggle/index.js +4 -0
  282. package/lib/components/Toggle/index.test.js +39 -10
  283. package/lib/components/Toggle/types.js +5 -1
  284. package/lib/components/TopNav/BrandInfo/index.d.ts +2 -1
  285. package/lib/components/TopNav/BrandInfo/index.d.ts.map +1 -1
  286. package/lib/components/TopNav/BrandInfo/index.js +9 -1
  287. package/lib/components/TopNav/BrandInfo/schema.d.ts.map +1 -1
  288. package/lib/components/TopNav/BrandInfo/schema.js +4 -1
  289. package/lib/components/TopNav/index.test.js +28 -0
  290. package/lib/components/Typography/withColors.d.ts +1 -1
  291. package/lib/components/index.d.ts +2 -0
  292. package/lib/components/index.d.ts.map +1 -1
  293. package/lib/components/index.js +25 -0
  294. package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
  295. package/lib/providers/ConfigProvider/index.js +5 -1
  296. package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
  297. package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
  298. package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
  299. package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
  300. package/lib/providers/ConfigProvider/utils/translations.d.ts +5 -1
  301. package/lib/providers/ConfigProvider/utils/translations.d.ts.map +1 -1
  302. package/lib/providers/ConfigProvider/utils/translations.js +5 -1
  303. package/lib/providers/NotificationsProvider/index.d.ts +6 -3
  304. package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
  305. package/lib/providers/NotificationsProvider/index.js +74 -18
  306. package/lib/providers/NotificationsProvider/types.d.ts +4 -1
  307. package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
  308. package/lib/utils/joinClassnames.d.ts +3 -0
  309. package/lib/utils/joinClassnames.d.ts.map +1 -0
  310. package/lib/utils/joinClassnames.js +26 -0
  311. package/lib/utils/useFirstMount.d.ts +2 -0
  312. package/lib/utils/useFirstMount.d.ts.map +1 -0
  313. package/lib/utils/useFirstMount.js +19 -0
  314. package/lib/utils/useUpdateEffect.d.ts +4 -0
  315. package/lib/utils/useUpdateEffect.d.ts.map +1 -0
  316. package/lib/utils/useUpdateEffect.js +28 -0
  317. package/package.json +4 -2
  318. package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
  319. package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
@@ -7,9 +7,13 @@ exports.default = exports.transitions = exports.NotificationsContext = void 0;
7
7
 
8
8
  var _compact = _interopRequireDefault(require("lodash/compact"));
9
9
 
10
+ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
11
+
10
12
  var _uniqueId = _interopRequireDefault(require("lodash/uniqueId"));
11
13
 
12
- var _react = _interopRequireWildcard(require("react"));
14
+ var _noop = _interopRequireDefault(require("lodash/noop"));
15
+
16
+ var React = _interopRequireWildcard(require("react"));
13
17
 
14
18
  var _types = require("./types");
15
19
 
@@ -45,13 +49,11 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
45
49
 
46
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; }
47
51
 
48
- var NotificationsContext = (0, _react.createContext)({
49
- /* istanbul ignore next */
50
- dismissAll: function dismissAll() {},
52
+ var NotificationsContext = React.createContext({
53
+ dismissAll: _noop.default,
54
+ isDismissingAll: false,
51
55
  notifications: [],
52
-
53
- /* istanbul ignore next */
54
- notify: function notify(options, body) {}
56
+ notify: _noop.default
55
57
  });
56
58
  exports.NotificationsContext = NotificationsContext;
57
59
  var transitions = (_transitions = {}, _defineProperty(_transitions, _types.NotificationState.ENTERING, {
@@ -72,10 +74,10 @@ exports.transitions = transitions;
72
74
  function NotificationsProvider(_ref) {
73
75
  var children = _ref.children;
74
76
 
75
- var _useState = (0, _react.useState)([]),
76
- _useState2 = _slicedToArray(_useState, 2),
77
- notifications = _useState2[0],
78
- 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];
79
81
  /**
80
82
  * Advances a notification to either the specified state or the next state for the current state
81
83
  */
@@ -108,6 +110,16 @@ function NotificationsProvider(_ref) {
108
110
  })];
109
111
  }
110
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
+
111
123
  return undefined;
112
124
  }
113
125
 
@@ -130,13 +142,47 @@ function NotificationsProvider(_ref) {
130
142
  });
131
143
  };
132
144
 
133
- var notify = (0, _react.useCallback)(function (options, body) {
134
- var notificationID = (0, _uniqueId.default)("notification-".concat(options.id, "-"));
145
+ var notify = React.useCallback(function () {
146
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
147
+ args[_key] = arguments[_key];
148
+ }
149
+
135
150
  setNotifications(function (oldNotifications) {
151
+ var options;
152
+ var body;
153
+
154
+ if (typeof args[0] === 'function') {
155
+ // A notify handler callback may return void, indicating there should be no new
156
+ // notification dispatched.
157
+ var newNotificationParams = args[0](oldNotifications);
158
+
159
+ if (!newNotificationParams) {
160
+ // In the scenario where a callback arg is provided but returns void,
161
+ // block the rest of the logic and move on. There should be no change.
162
+ return oldNotifications;
163
+ }
164
+
165
+ var _newNotificationParam = _slicedToArray(newNotificationParams, 2);
166
+
167
+ options = _newNotificationParam[0];
168
+ body = _newNotificationParam[1];
169
+ } else {
170
+ var _ref6 = args;
171
+
172
+ var _ref7 = _slicedToArray(_ref6, 2);
173
+
174
+ options = _ref7[0];
175
+ body = _ref7[1];
176
+ }
177
+
178
+ var notificationID = (0, _uniqueId.default)("notification-".concat(options.id, "-"));
136
179
  var duration = transitions[_types.NotificationState.ENTERING].duration;
137
180
  setTimeout(function () {
138
181
  transition(notificationID);
139
182
  }, duration);
183
+ var autoDismiss = options.duration && setTimeout(function () {
184
+ transition(notificationID, _types.NotificationState.COLLAPSING);
185
+ }, duration + options.duration);
140
186
 
141
187
  var closeNotificationAfter = function closeNotificationAfter(callback) {
142
188
  return function (event) {
@@ -148,9 +194,13 @@ function NotificationsProvider(_ref) {
148
194
  };
149
195
  };
150
196
 
151
- var actions = options.actions && options.actions.map(function (_ref6) {
152
- var onClick = _ref6.onClick,
153
- rest = _objectWithoutProperties(_ref6, ["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"]);
154
204
 
155
205
  return _objectSpread({
156
206
  onClick: closeNotificationAfter(onClick)
@@ -159,7 +209,9 @@ function NotificationsProvider(_ref) {
159
209
  return [[_objectSpread({}, options, {
160
210
  actions: actions,
161
211
  id: options.id || notificationID,
162
- onClose: closeNotificationAfter(options.onClose)
212
+ onClose: options.onClose && closeNotificationAfter(options.onClose),
213
+ onFocus: suspendAutoDismiss,
214
+ onHover: suspendAutoDismiss
163
215
  }), body, {
164
216
  notificationID: notificationID,
165
217
  state: _types.NotificationState.ENTERING
@@ -167,9 +219,13 @@ function NotificationsProvider(_ref) {
167
219
  });
168
220
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
169
221
  [setNotifications]);
170
- 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, {
171
226
  value: {
172
227
  dismissAll: dismissAll,
228
+ isDismissingAll: isDismissingAll,
173
229
  notifications: notifications,
174
230
  notify: notify
175
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": "2.0.0",
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",
@@ -25,6 +25,7 @@
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",
@@ -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": "5dba08ac3e79b244923ba7683927210aeb5a7861"
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"}