@decisiv/ui-components 2.0.1-alpha.8 → 2.0.1-alpha.97

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 (297) 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/index.d.ts.map +1 -1
  4. package/lib/atoms/BooleanInput/index.js +19 -2
  5. package/lib/atoms/BooleanInput/index.test.js +17 -6
  6. package/lib/atoms/BooleanInput/types.d.ts +2 -0
  7. package/lib/atoms/BooleanInput/types.d.ts.map +1 -1
  8. package/lib/atoms/BooleanInput/types.js +5 -1
  9. package/lib/atoms/Calendar/hooks/useCalendar/index.d.ts.map +1 -1
  10. package/lib/atoms/Calendar/hooks/useCalendar/index.js +2 -1
  11. package/lib/atoms/Calendar/hooks/useCalendar/index.test.js +5 -6
  12. package/lib/atoms/Calendar/index.d.ts.map +1 -1
  13. package/lib/atoms/Calendar/index.js +8 -1
  14. package/lib/atoms/Calendar/index.test.js +70 -40
  15. package/lib/atoms/Calendar/types.js +5 -1
  16. package/lib/atoms/InputField/Containers.d.ts +11 -6
  17. package/lib/atoms/InputField/Containers.d.ts.map +1 -1
  18. package/lib/atoms/InputField/Containers.js +6 -6
  19. package/lib/atoms/InputField/InputLabel.d.ts +1 -0
  20. package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
  21. package/lib/atoms/InputField/InputLabel.js +2 -1
  22. package/lib/atoms/InputField/index.d.ts +5 -0
  23. package/lib/atoms/InputField/index.d.ts.map +1 -1
  24. package/lib/atoms/InputField/index.js +21 -7
  25. package/lib/atoms/InputField/index.test.js +91 -0
  26. package/lib/atoms/InputField/schema.d.ts.map +1 -1
  27. package/lib/atoms/InputField/schema.js +1 -0
  28. package/lib/atoms/OptionsList/Category.d.ts +1 -1
  29. package/lib/atoms/OptionsList/Category.d.ts.map +1 -1
  30. package/lib/atoms/OptionsList/Category.js +4 -2
  31. package/lib/atoms/OptionsList/Footer.d.ts +8 -0
  32. package/lib/atoms/OptionsList/Footer.d.ts.map +1 -0
  33. package/lib/atoms/OptionsList/Footer.js +72 -0
  34. package/lib/atoms/OptionsList/Option.d.ts.map +1 -1
  35. package/lib/atoms/OptionsList/Option.js +8 -5
  36. package/lib/atoms/OptionsList/index.d.ts.map +1 -1
  37. package/lib/atoms/OptionsList/index.js +43 -16
  38. package/lib/atoms/OptionsList/index.test.js +107 -11
  39. package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
  40. package/lib/atoms/OptionsList/schema.js +4 -0
  41. package/lib/atoms/OptionsList/types.d.ts +14 -0
  42. package/lib/atoms/OptionsList/types.d.ts.map +1 -1
  43. package/lib/atoms/OptionsList/types.js +5 -1
  44. package/lib/atoms/RequiredIcon.d.ts +9 -0
  45. package/lib/atoms/RequiredIcon.d.ts.map +1 -0
  46. package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
  47. package/lib/components/Accordion/types.js +5 -1
  48. package/lib/components/Accordion/useAccordion/types.js +5 -1
  49. package/lib/components/Avatar/types.js +5 -1
  50. package/lib/components/Badge/constants.d.ts +2 -0
  51. package/lib/components/Badge/constants.d.ts.map +1 -0
  52. package/lib/components/Badge/constants.js +29 -0
  53. package/lib/components/Badge/index.d.ts.map +1 -1
  54. package/lib/components/Badge/index.js +12 -23
  55. package/lib/components/Badge/index.test.js +51 -8
  56. package/lib/components/Badge/schema.js +1 -1
  57. package/lib/components/Badge/types.d.ts +1 -1
  58. package/lib/components/Badge/types.d.ts.map +1 -1
  59. package/lib/components/Badge/types.js +7 -3
  60. package/lib/components/Breadcrumbs/types.js +5 -1
  61. package/lib/components/Button/schema.d.ts +6 -1
  62. package/lib/components/Button/schema.d.ts.map +1 -1
  63. package/lib/components/Button/schema.js +9 -4
  64. package/lib/components/Button/types.js +5 -1
  65. package/lib/components/Checkbox/index.d.ts.map +1 -1
  66. package/lib/components/Checkbox/index.js +3 -1
  67. package/lib/components/Checkbox/schema.d.ts.map +1 -1
  68. package/lib/components/Checkbox/schema.js +2 -0
  69. package/lib/components/Combobox/Target.d.ts.map +1 -1
  70. package/lib/components/Combobox/Target.js +45 -14
  71. package/lib/components/Combobox/index.d.ts.map +1 -1
  72. package/lib/components/Combobox/index.js +193 -65
  73. package/lib/components/Combobox/index.test.js +358 -135
  74. package/lib/components/Combobox/schema.d.ts.map +1 -1
  75. package/lib/components/Combobox/schema.js +9 -2
  76. package/lib/components/Combobox/types.d.ts +12 -3
  77. package/lib/components/Combobox/types.d.ts.map +1 -1
  78. package/lib/components/Combobox/types.js +5 -1
  79. package/lib/components/DropdownList/index.d.ts +4 -0
  80. package/lib/components/DropdownList/index.d.ts.map +1 -1
  81. package/lib/components/DropdownList/index.js +76 -11
  82. package/lib/components/DropdownList/propTypes.d.ts +4 -0
  83. package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
  84. package/lib/components/DropdownList/propTypes.js +42 -0
  85. package/lib/components/DropdownList/schema.d.ts.map +1 -1
  86. package/lib/components/DropdownList/schema.js +5 -0
  87. package/lib/components/DropdownList/types.d.ts +4 -1
  88. package/lib/components/DropdownList/types.d.ts.map +1 -1
  89. package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
  90. package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
  91. package/lib/components/Filter/IconWrapper/index.js +35 -0
  92. package/lib/components/Filter/SimplePrimary/index.d.ts +31 -0
  93. package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
  94. package/lib/components/Filter/SimplePrimary/index.js +58 -0
  95. package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
  96. package/lib/components/Filter/StyledFilter.d.ts +4 -0
  97. package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
  98. package/lib/components/Filter/StyledFilter.js +39 -0
  99. package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
  100. package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
  101. package/lib/components/Filter/StyledLabel/index.js +30 -0
  102. package/lib/components/Filter/index.d.ts +27 -0
  103. package/lib/components/Filter/index.d.ts.map +1 -0
  104. package/lib/components/Filter/index.js +95 -0
  105. package/lib/components/Filter/index.test.js +41 -0
  106. package/lib/components/Filter/kind.d.ts +6 -0
  107. package/lib/components/Filter/kind.d.ts.map +1 -0
  108. package/lib/components/Filter/kind.js +45 -0
  109. package/lib/components/Filter/schema.d.ts +9 -0
  110. package/lib/components/Filter/schema.d.ts.map +1 -0
  111. package/lib/components/Filter/schema.js +32 -0
  112. package/lib/components/Filter/types.d.ts +17 -0
  113. package/lib/components/Filter/types.d.ts.map +1 -0
  114. package/lib/components/Filter/types.js +5 -0
  115. package/lib/components/JumpTo/JumpToMenu.d.ts +2 -2
  116. package/lib/components/JumpTo/JumpToMenu.d.ts.map +1 -1
  117. package/lib/components/JumpTo/JumpToMenu.js +3 -3
  118. package/lib/components/JumpTo/types.js +5 -1
  119. package/lib/components/LeftNav/Item/ClickArea.d.ts.map +1 -1
  120. package/lib/components/LeftNav/Item/ClickArea.js +2 -2
  121. package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
  122. package/lib/components/LeftNav/Item/ItemWrapper.js +3 -3
  123. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
  124. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
  125. package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
  126. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
  127. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
  128. package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
  129. package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
  130. package/lib/components/LeftNav/Item/types.d.ts +1 -1
  131. package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
  132. package/lib/components/LeftNav/Item/types.js +5 -1
  133. package/lib/components/LeftNav/index.test.js +13 -3
  134. package/lib/components/LeftNav/schema.d.ts.map +1 -1
  135. package/lib/components/LeftNav/schema.js +2 -0
  136. package/lib/components/LeftNav/types.d.ts +1 -0
  137. package/lib/components/LeftNav/types.d.ts.map +1 -1
  138. package/lib/components/LeftNav/types.js +5 -1
  139. package/lib/components/Link/index.d.ts +2 -2
  140. package/lib/components/Link/index.d.ts.map +1 -1
  141. package/lib/components/Link/index.js +1 -1
  142. package/lib/components/Link/index.test.js +8 -0
  143. package/lib/components/Link/schema.d.ts.map +1 -1
  144. package/lib/components/Link/schema.js +1 -1
  145. package/lib/components/Menu/index.d.ts.map +1 -1
  146. package/lib/components/Menu/index.js +3 -1
  147. package/lib/components/Menu/types.d.ts +2 -0
  148. package/lib/components/Menu/types.d.ts.map +1 -1
  149. package/lib/components/Menu/types.js +5 -1
  150. package/lib/components/Modal/components.d.ts +2 -2
  151. package/lib/components/Modal/index.d.ts.map +1 -1
  152. package/lib/components/Modal/index.js +5 -5
  153. package/lib/components/Modal/index.test.js +32 -0
  154. package/lib/components/Modal/schema.d.ts.map +1 -1
  155. package/lib/components/Modal/schema.js +2 -2
  156. package/lib/components/Modal/types.d.ts +2 -2
  157. package/lib/components/Modal/types.d.ts.map +1 -1
  158. package/lib/components/Modal/types.js +5 -1
  159. package/lib/components/Notifications/Notification/components.d.ts +3 -3
  160. package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
  161. package/lib/components/Notifications/Notification/components.js +12 -6
  162. package/lib/components/Notifications/Notification/index.d.ts +3 -6
  163. package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
  164. package/lib/components/Notifications/Notification/index.js +19 -12
  165. package/lib/components/Notifications/Notification/index.test.js +38 -19
  166. package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
  167. package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
  168. package/lib/components/Notifications/NotificationsPanel/index.js +44 -21
  169. package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
  170. package/lib/components/Notifications/Notifier.test.js +79 -10
  171. package/lib/components/Notifications/constants.d.ts +2 -0
  172. package/lib/components/Notifications/constants.d.ts.map +1 -0
  173. package/lib/components/Notifications/constants.js +16 -0
  174. package/lib/components/Notifications/schema.d.ts.map +1 -1
  175. package/lib/components/Notifications/schema.js +2 -1
  176. package/lib/components/Notifications/useNotifications.d.ts +1 -0
  177. package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
  178. package/lib/components/Notifications/useNotifications.js +3 -3
  179. package/lib/components/Notifications/useNotifications.test.js +7 -4
  180. package/lib/components/Pagination/Pagination.d.ts +1 -1
  181. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  182. package/lib/components/Pagination/Pagination.js +1 -0
  183. package/lib/components/Pagination/Pagination.test.js +9 -0
  184. package/lib/components/Pagination/types.js +5 -1
  185. package/lib/components/Popover/utils.d.ts +1 -1
  186. package/lib/components/Select/Target.js +1 -1
  187. package/lib/components/Select/index.d.ts.map +1 -1
  188. package/lib/components/Select/index.js +37 -1
  189. package/lib/components/Select/index.test.js +82 -23
  190. package/lib/components/Select/schema.d.ts.map +1 -1
  191. package/lib/components/Select/schema.js +7 -0
  192. package/lib/components/Select/types.d.ts +4 -1
  193. package/lib/components/Select/types.d.ts.map +1 -1
  194. package/lib/components/Select/types.js +5 -1
  195. package/lib/components/SelectDate/Target.js +1 -1
  196. package/lib/components/SelectDate/index.d.ts.map +1 -1
  197. package/lib/components/SelectDate/index.js +28 -1
  198. package/lib/components/SelectDate/index.test.js +108 -51
  199. package/lib/components/SelectDate/schema.d.ts.map +1 -1
  200. package/lib/components/SelectDate/schema.js +2 -0
  201. package/lib/components/SelectDate/types.d.ts +2 -0
  202. package/lib/components/SelectDate/types.d.ts.map +1 -1
  203. package/lib/components/SelectDate/types.js +5 -1
  204. package/lib/components/SelectDateRange/index.d.ts.map +1 -1
  205. package/lib/components/SelectDateRange/index.js +28 -1
  206. package/lib/components/SelectDateRange/index.test.js +115 -58
  207. package/lib/components/SelectDateRange/schema.d.ts.map +1 -1
  208. package/lib/components/SelectDateRange/schema.js +2 -0
  209. package/lib/components/SelectDateRange/types.js +5 -1
  210. package/lib/components/SelectMenu/index.d.ts +5 -0
  211. package/lib/components/SelectMenu/index.d.ts.map +1 -1
  212. package/lib/components/SelectMenu/index.js +27 -3
  213. package/lib/components/SelectMenu/schema.d.ts.map +1 -1
  214. package/lib/components/SelectMenu/schema.js +4 -0
  215. package/lib/components/Table/Body.d.ts.map +1 -1
  216. package/lib/components/Table/Body.js +182 -38
  217. package/lib/components/Table/Container.d.ts.map +1 -1
  218. package/lib/components/Table/Container.js +2 -2
  219. package/lib/components/Table/DataRow.d.ts.map +1 -1
  220. package/lib/components/Table/DataRow.js +43 -16
  221. package/lib/components/Table/DraggableWrapper.d.ts +5 -0
  222. package/lib/components/Table/DraggableWrapper.d.ts.map +1 -0
  223. package/lib/components/Table/DraggableWrapper.js +38 -0
  224. package/lib/components/Table/Grip.d.ts +4 -0
  225. package/lib/components/Table/Grip.d.ts.map +1 -0
  226. package/lib/components/Table/Grip.js +30 -0
  227. package/lib/components/Table/Head.d.ts +1 -1
  228. package/lib/components/Table/Head.d.ts.map +1 -1
  229. package/lib/components/Table/Head.js +11 -5
  230. package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
  231. package/lib/components/Table/HeaderCell/index.js +22 -8
  232. package/lib/components/Table/HeaderCell/types.d.ts +6 -1
  233. package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
  234. package/lib/components/Table/HeaderCell/types.js +5 -1
  235. package/lib/components/Table/Provider.d.ts +13 -4
  236. package/lib/components/Table/Provider.d.ts.map +1 -1
  237. package/lib/components/Table/Provider.js +45 -5
  238. package/lib/components/Table/index.d.ts.map +1 -1
  239. package/lib/components/Table/index.js +112 -18
  240. package/lib/components/Table/index.test.js +330 -84
  241. package/lib/components/Table/schema.columns.d.ts.map +1 -1
  242. package/lib/components/Table/schema.columns.js +6 -4
  243. package/lib/components/Table/schema.d.ts.map +1 -1
  244. package/lib/components/Table/schema.js +8 -6
  245. package/lib/components/Table/types.d.ts +34 -4
  246. package/lib/components/Table/types.d.ts.map +1 -1
  247. package/lib/components/Table/utils.d.ts +2 -8
  248. package/lib/components/Table/utils.d.ts.map +1 -1
  249. package/lib/components/Table/utils.js +21 -20
  250. package/lib/components/Tabs/types.js +5 -1
  251. package/lib/components/Tag/types.d.ts +1 -1
  252. package/lib/components/Tag/types.d.ts.map +1 -1
  253. package/lib/components/Tag/types.js +5 -1
  254. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  255. package/lib/components/TextArea/TextArea.js +1 -1
  256. package/lib/components/TextArea/index.js +1 -0
  257. package/lib/components/TextArea/index.test.js +5 -0
  258. package/lib/components/TextField/Input.js +1 -1
  259. package/lib/components/TextField/index.test.js +5 -0
  260. package/lib/components/Toggle/index.d.ts.map +1 -1
  261. package/lib/components/Toggle/index.js +4 -0
  262. package/lib/components/Toggle/index.test.js +39 -10
  263. package/lib/components/Toggle/types.js +5 -1
  264. package/lib/components/TopNav/BrandInfo/index.d.ts +2 -1
  265. package/lib/components/TopNav/BrandInfo/index.d.ts.map +1 -1
  266. package/lib/components/TopNav/BrandInfo/index.js +9 -1
  267. package/lib/components/TopNav/BrandInfo/schema.d.ts.map +1 -1
  268. package/lib/components/TopNav/BrandInfo/schema.js +4 -1
  269. package/lib/components/TopNav/index.test.js +28 -0
  270. package/lib/components/index.d.ts +1 -0
  271. package/lib/components/index.d.ts.map +1 -1
  272. package/lib/components/index.js +9 -0
  273. package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
  274. package/lib/providers/ConfigProvider/index.js +5 -1
  275. package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
  276. package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
  277. package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
  278. package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
  279. package/lib/providers/ConfigProvider/utils/translations.d.ts +1 -1
  280. package/lib/providers/ConfigProvider/utils/translations.js +1 -1
  281. package/lib/providers/NotificationsProvider/index.d.ts +6 -5
  282. package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
  283. package/lib/providers/NotificationsProvider/index.js +47 -28
  284. package/lib/providers/NotificationsProvider/types.d.ts +4 -1
  285. package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
  286. package/lib/utils/joinClassnames.d.ts +3 -0
  287. package/lib/utils/joinClassnames.d.ts.map +1 -0
  288. package/lib/utils/joinClassnames.js +26 -0
  289. package/lib/utils/useFirstMount.d.ts +2 -0
  290. package/lib/utils/useFirstMount.d.ts.map +1 -0
  291. package/lib/utils/useFirstMount.js +19 -0
  292. package/lib/utils/useUpdateEffect.d.ts +4 -0
  293. package/lib/utils/useUpdateEffect.d.ts.map +1 -0
  294. package/lib/utils/useUpdateEffect.js +28 -0
  295. package/package.json +4 -2
  296. package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
  297. 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": "2.0.1-alpha.8+745bb8f",
3
+ "version": "2.0.1-alpha.97+e8c90c8",
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": "745bb8f3cd6436890812e958787c5f8709bd5295"
74
+ "gitHead": "e8c90c851847fdda5d1dbc8339d962d4bf79d185"
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"}