@bigbinary/neetoui 6.5.10 → 6.5.11-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/dist/Accordion.js +152 -0
  2. package/dist/Accordion.js.map +1 -0
  3. package/dist/ActionDropdown.js +75 -0
  4. package/dist/ActionDropdown.js.map +1 -0
  5. package/dist/Alert.js +112 -0
  6. package/dist/Alert.js.map +1 -0
  7. package/dist/Avatar.js +97 -0
  8. package/dist/Avatar.js.map +1 -0
  9. package/dist/Button.js +219 -0
  10. package/dist/Button.js.map +1 -0
  11. package/dist/Callout.js +39 -0
  12. package/dist/Callout.js.map +1 -0
  13. package/dist/Checkbox.js +65 -0
  14. package/dist/Checkbox.js.map +1 -0
  15. package/dist/ColorPicker.js +1408 -0
  16. package/dist/ColorPicker.js.map +1 -0
  17. package/dist/DatePicker.js +290 -0
  18. package/dist/DatePicker.js.map +1 -0
  19. package/dist/DateTimePicker.js +163 -0
  20. package/dist/DateTimePicker.js.map +1 -0
  21. package/dist/Dropdown.js +303 -0
  22. package/dist/Dropdown.js.map +1 -0
  23. package/dist/Input.js +158 -0
  24. package/dist/Input.js.map +1 -0
  25. package/dist/Kbd.js +24 -0
  26. package/dist/Kbd.js.map +1 -0
  27. package/dist/Label.js +46 -0
  28. package/dist/Label.js.map +1 -0
  29. package/dist/Modal.js +166 -0
  30. package/dist/Modal.js.map +1 -0
  31. package/dist/MultiEmailInput.js +307 -0
  32. package/dist/MultiEmailInput.js.map +1 -0
  33. package/dist/NoData.js +81 -0
  34. package/dist/NoData.js.map +1 -0
  35. package/dist/Pagination.js +178 -0
  36. package/dist/Pagination.js.map +1 -0
  37. package/dist/Pane.js +160 -0
  38. package/dist/Pane.js.map +1 -0
  39. package/dist/Popover.js +44 -0
  40. package/dist/Popover.js.map +1 -0
  41. package/dist/Radio.js +100 -0
  42. package/dist/Radio.js.map +1 -0
  43. package/dist/Select.js +281 -0
  44. package/dist/Select.js.map +1 -0
  45. package/dist/Sidebar.js +378 -0
  46. package/dist/Sidebar.js.map +1 -0
  47. package/dist/Slider.js +110 -0
  48. package/dist/Slider.js.map +1 -0
  49. package/dist/Spinner.js +36 -0
  50. package/dist/Spinner.js.map +1 -0
  51. package/dist/Stepper.js +35 -0
  52. package/dist/Stepper.js.map +1 -0
  53. package/dist/Switch.js +84 -0
  54. package/dist/Switch.js.map +1 -0
  55. package/dist/Tab.js +74 -0
  56. package/dist/Tab.js.map +1 -0
  57. package/dist/Table.js +887 -0
  58. package/dist/Table.js.map +1 -0
  59. package/dist/Tag.js +89 -0
  60. package/dist/Tag.js.map +1 -0
  61. package/dist/Textarea.js +143 -0
  62. package/dist/Textarea.js.map +1 -0
  63. package/dist/TimePicker.js +174 -0
  64. package/dist/TimePicker.js.map +1 -0
  65. package/dist/TimePickerInput.js +25 -0
  66. package/dist/TimePickerInput.js.map +1 -0
  67. package/dist/Toastr.js +393 -0
  68. package/dist/Toastr.js.map +1 -0
  69. package/dist/Tooltip.js +8 -0
  70. package/dist/Tooltip.js.map +1 -0
  71. package/dist/Tree.js +48 -0
  72. package/dist/Tree.js.map +1 -0
  73. package/dist/TreeSelect.js +108 -0
  74. package/dist/TreeSelect.js.map +1 -0
  75. package/dist/Typography.js +142 -0
  76. package/dist/Typography.js.map +1 -0
  77. package/dist/cjs/Accordion.js +158 -0
  78. package/dist/cjs/Accordion.js.map +1 -0
  79. package/dist/cjs/ActionDropdown.js +81 -0
  80. package/dist/cjs/ActionDropdown.js.map +1 -0
  81. package/dist/cjs/Alert.js +118 -0
  82. package/dist/cjs/Alert.js.map +1 -0
  83. package/dist/cjs/Avatar.js +104 -0
  84. package/dist/cjs/Avatar.js.map +1 -0
  85. package/dist/cjs/Button.js +225 -0
  86. package/dist/cjs/Button.js.map +1 -0
  87. package/dist/cjs/Callout.js +45 -0
  88. package/dist/cjs/Callout.js.map +1 -0
  89. package/dist/cjs/Checkbox.js +71 -0
  90. package/dist/cjs/Checkbox.js.map +1 -0
  91. package/dist/cjs/ColorPicker.js +1414 -0
  92. package/dist/cjs/ColorPicker.js.map +1 -0
  93. package/dist/cjs/DatePicker.js +298 -0
  94. package/dist/cjs/DatePicker.js.map +1 -0
  95. package/dist/cjs/DateTimePicker.js +169 -0
  96. package/dist/cjs/DateTimePicker.js.map +1 -0
  97. package/dist/cjs/Dropdown.js +309 -0
  98. package/dist/cjs/Dropdown.js.map +1 -0
  99. package/dist/cjs/Input.js +164 -0
  100. package/dist/cjs/Input.js.map +1 -0
  101. package/dist/cjs/Kbd.js +30 -0
  102. package/dist/cjs/Kbd.js.map +1 -0
  103. package/dist/cjs/Label.js +52 -0
  104. package/dist/cjs/Label.js.map +1 -0
  105. package/dist/cjs/Modal.js +172 -0
  106. package/dist/cjs/Modal.js.map +1 -0
  107. package/dist/cjs/MultiEmailInput.js +314 -0
  108. package/dist/cjs/MultiEmailInput.js.map +1 -0
  109. package/dist/cjs/NoData.js +87 -0
  110. package/dist/cjs/NoData.js.map +1 -0
  111. package/dist/cjs/Pagination.js +184 -0
  112. package/dist/cjs/Pagination.js.map +1 -0
  113. package/dist/cjs/Pane.js +166 -0
  114. package/dist/cjs/Pane.js.map +1 -0
  115. package/dist/cjs/Popover.js +50 -0
  116. package/dist/cjs/Popover.js.map +1 -0
  117. package/dist/cjs/Radio.js +106 -0
  118. package/dist/cjs/Radio.js.map +1 -0
  119. package/dist/cjs/Select.js +291 -0
  120. package/dist/cjs/Select.js.map +1 -0
  121. package/dist/cjs/Sidebar.js +384 -0
  122. package/dist/cjs/Sidebar.js.map +1 -0
  123. package/dist/cjs/Slider.js +118 -0
  124. package/dist/cjs/Slider.js.map +1 -0
  125. package/dist/cjs/Spinner.js +42 -0
  126. package/dist/cjs/Spinner.js.map +1 -0
  127. package/dist/cjs/Stepper.js +41 -0
  128. package/dist/cjs/Stepper.js.map +1 -0
  129. package/dist/cjs/Switch.js +90 -0
  130. package/dist/cjs/Switch.js.map +1 -0
  131. package/dist/cjs/Tab.js +80 -0
  132. package/dist/cjs/Tab.js.map +1 -0
  133. package/dist/cjs/Table.js +896 -0
  134. package/dist/cjs/Table.js.map +1 -0
  135. package/dist/cjs/Tag.js +95 -0
  136. package/dist/cjs/Tag.js.map +1 -0
  137. package/dist/cjs/Textarea.js +149 -0
  138. package/dist/cjs/Textarea.js.map +1 -0
  139. package/dist/cjs/TimePicker.js +182 -0
  140. package/dist/cjs/TimePicker.js.map +1 -0
  141. package/dist/cjs/TimePickerInput.js +31 -0
  142. package/dist/cjs/TimePickerInput.js.map +1 -0
  143. package/dist/cjs/Toastr.js +417 -0
  144. package/dist/cjs/Toastr.js.map +1 -0
  145. package/dist/cjs/Tooltip.js +14 -0
  146. package/dist/cjs/Tooltip.js.map +1 -0
  147. package/dist/cjs/Tree.js +56 -0
  148. package/dist/cjs/Tree.js.map +1 -0
  149. package/dist/cjs/TreeSelect.js +116 -0
  150. package/dist/cjs/TreeSelect.js.map +1 -0
  151. package/dist/cjs/Typography.js +148 -0
  152. package/dist/cjs/Typography.js.map +1 -0
  153. package/dist/cjs/createClass-80e17c6a.js +31 -0
  154. package/dist/cjs/createClass-80e17c6a.js.map +1 -0
  155. package/dist/cjs/defineProperty-ee86604b.js +21 -0
  156. package/dist/cjs/defineProperty-ee86604b.js.map +1 -0
  157. package/dist/cjs/extends-1b35a664.js +19 -0
  158. package/dist/cjs/extends-1b35a664.js.map +1 -0
  159. package/dist/cjs/formik/ActionBlock.js +58 -0
  160. package/dist/cjs/formik/ActionBlock.js.map +1 -0
  161. package/dist/cjs/formik/BlockNavigation.js +127 -0
  162. package/dist/cjs/formik/BlockNavigation.js.map +1 -0
  163. package/dist/cjs/formik/Button.js +44 -0
  164. package/dist/cjs/formik/Button.js.map +1 -0
  165. package/dist/cjs/formik/Checkbox.js +61 -0
  166. package/dist/cjs/formik/Checkbox.js.map +1 -0
  167. package/dist/cjs/formik/Form.js +197 -0
  168. package/dist/cjs/formik/Form.js.map +1 -0
  169. package/dist/cjs/formik/Input.js +59 -0
  170. package/dist/cjs/formik/Input.js.map +1 -0
  171. package/dist/cjs/formik/MultiEmailInput.js +58 -0
  172. package/dist/cjs/formik/MultiEmailInput.js.map +1 -0
  173. package/dist/cjs/formik/Radio.js +61 -0
  174. package/dist/cjs/formik/Radio.js.map +1 -0
  175. package/dist/cjs/formik/Select.js +106 -0
  176. package/dist/cjs/formik/Select.js.map +1 -0
  177. package/dist/cjs/formik/Slider.js +64 -0
  178. package/dist/cjs/formik/Slider.js.map +1 -0
  179. package/dist/cjs/formik/Switch.js +52 -0
  180. package/dist/cjs/formik/Switch.js.map +1 -0
  181. package/dist/cjs/formik/Textarea.js +60 -0
  182. package/dist/cjs/formik/Textarea.js.map +1 -0
  183. package/dist/cjs/formik/TreeSelect.js +56 -0
  184. package/dist/cjs/formik/TreeSelect.js.map +1 -0
  185. package/dist/cjs/formik/index.js +84 -0
  186. package/dist/cjs/formik/index.js.map +1 -0
  187. package/dist/cjs/index-302c3d37.js +58 -0
  188. package/dist/cjs/index-302c3d37.js.map +1 -0
  189. package/dist/cjs/index-5d74cfeb.js +375 -0
  190. package/dist/cjs/index-5d74cfeb.js.map +1 -0
  191. package/dist/cjs/index-63580e68.js +92 -0
  192. package/dist/cjs/index-63580e68.js.map +1 -0
  193. package/dist/cjs/index-6e09c7bc.js +2211 -0
  194. package/dist/cjs/index-6e09c7bc.js.map +1 -0
  195. package/dist/cjs/index-773961dd.js +453 -0
  196. package/dist/cjs/index-773961dd.js.map +1 -0
  197. package/dist/cjs/index-a8cc581e.js +2383 -0
  198. package/dist/cjs/index-a8cc581e.js.map +1 -0
  199. package/dist/cjs/index-b1ac86d6.js +258 -0
  200. package/dist/cjs/index-b1ac86d6.js.map +1 -0
  201. package/dist/cjs/index.js +99 -13808
  202. package/dist/cjs/index.js.map +1 -1
  203. package/dist/cjs/layouts.js +19 -363
  204. package/dist/cjs/layouts.js.map +1 -1
  205. package/dist/cjs/managers.js +3 -2
  206. package/dist/cjs/managers.js.map +1 -1
  207. package/dist/cjs/objectWithoutProperties-2fed2d7d.js +33 -0
  208. package/dist/cjs/objectWithoutProperties-2fed2d7d.js.map +1 -0
  209. package/dist/cjs/{overlayManager-a0827ae7.js → overlayManager.js} +5 -2
  210. package/dist/cjs/overlayManager.js.map +1 -0
  211. package/dist/cjs/slicedToArray-732a2048.js +63 -0
  212. package/dist/cjs/slicedToArray-732a2048.js.map +1 -0
  213. package/dist/cjs/toConsumableArray-418424fc.js +23 -0
  214. package/dist/cjs/toConsumableArray-418424fc.js.map +1 -0
  215. package/dist/cjs/{createClass-ca103cfb.js → toPropertyKey-bfa2e465.js} +1 -27
  216. package/dist/cjs/toPropertyKey-bfa2e465.js.map +1 -0
  217. package/dist/cjs/useId-4e3deb5c.js +11 -0
  218. package/dist/cjs/useId-4e3deb5c.js.map +1 -0
  219. package/dist/cjs/useOverlayManager-359ed795.js +1602 -0
  220. package/dist/cjs/useOverlayManager-359ed795.js.map +1 -0
  221. package/dist/cjs/useQueryParams-14f054b3.js +18 -0
  222. package/dist/cjs/useQueryParams-14f054b3.js.map +1 -0
  223. package/dist/cjs/useSyncedRef-9c3dcd03.js +19 -0
  224. package/dist/cjs/useSyncedRef-9c3dcd03.js.map +1 -0
  225. package/dist/createClass-601a36b2.js +28 -0
  226. package/dist/createClass-601a36b2.js.map +1 -0
  227. package/dist/defineProperty-e5245270.js +19 -0
  228. package/dist/defineProperty-e5245270.js.map +1 -0
  229. package/dist/extends-093996c9.js +17 -0
  230. package/dist/extends-093996c9.js.map +1 -0
  231. package/dist/formik/ActionBlock.js +52 -0
  232. package/dist/formik/ActionBlock.js.map +1 -0
  233. package/dist/formik/BlockNavigation.js +121 -0
  234. package/dist/formik/BlockNavigation.js.map +1 -0
  235. package/dist/formik/Button.js +38 -0
  236. package/dist/formik/Button.js.map +1 -0
  237. package/dist/formik/Checkbox.js +55 -0
  238. package/dist/formik/Checkbox.js.map +1 -0
  239. package/dist/formik/Form.js +191 -0
  240. package/dist/formik/Form.js.map +1 -0
  241. package/dist/formik/Input.js +53 -0
  242. package/dist/formik/Input.js.map +1 -0
  243. package/dist/formik/MultiEmailInput.js +52 -0
  244. package/dist/formik/MultiEmailInput.js.map +1 -0
  245. package/dist/formik/Radio.js +55 -0
  246. package/dist/formik/Radio.js.map +1 -0
  247. package/dist/formik/Select.js +100 -0
  248. package/dist/formik/Select.js.map +1 -0
  249. package/dist/formik/Slider.js +58 -0
  250. package/dist/formik/Slider.js.map +1 -0
  251. package/dist/formik/Switch.js +46 -0
  252. package/dist/formik/Switch.js.map +1 -0
  253. package/dist/formik/Textarea.js +54 -0
  254. package/dist/formik/Textarea.js.map +1 -0
  255. package/dist/formik/TreeSelect.js +50 -0
  256. package/dist/formik/TreeSelect.js.map +1 -0
  257. package/dist/formik/index.js +64 -0
  258. package/dist/formik/index.js.map +1 -0
  259. package/dist/index-283bc6a6.js +90 -0
  260. package/dist/index-283bc6a6.js.map +1 -0
  261. package/dist/index-34956d66.js +372 -0
  262. package/dist/index-34956d66.js.map +1 -0
  263. package/dist/index-3659771d.js +56 -0
  264. package/dist/index-3659771d.js.map +1 -0
  265. package/dist/index-7fae3611.js +2381 -0
  266. package/dist/index-7fae3611.js.map +1 -0
  267. package/dist/index-b3a8dd29.js +249 -0
  268. package/dist/index-b3a8dd29.js.map +1 -0
  269. package/dist/index-c442518b.js +445 -0
  270. package/dist/index-c442518b.js.map +1 -0
  271. package/dist/index-c8d9113c.js +2193 -0
  272. package/dist/index-c8d9113c.js.map +1 -0
  273. package/dist/index.js +79 -13767
  274. package/dist/index.js.map +1 -1
  275. package/dist/layouts.js +19 -363
  276. package/dist/layouts.js.map +1 -1
  277. package/dist/managers.js +3 -2
  278. package/dist/managers.js.map +1 -1
  279. package/dist/objectWithoutProperties-a0edb288.js +31 -0
  280. package/dist/objectWithoutProperties-a0edb288.js.map +1 -0
  281. package/dist/{overlayManager-4d5be56b.js → overlayManager.js} +4 -3
  282. package/dist/overlayManager.js.map +1 -0
  283. package/dist/slicedToArray-45fa766e.js +57 -0
  284. package/dist/slicedToArray-45fa766e.js.map +1 -0
  285. package/dist/toConsumableArray-1186e144.js +20 -0
  286. package/dist/toConsumableArray-1186e144.js.map +1 -0
  287. package/dist/toPropertyKey-bdc24cb9.js +28 -0
  288. package/dist/toPropertyKey-bdc24cb9.js.map +1 -0
  289. package/dist/useId-c1d20bba.js +9 -0
  290. package/dist/useId-c1d20bba.js.map +1 -0
  291. package/dist/useOverlayManager-95a474d5.js +1591 -0
  292. package/dist/useOverlayManager-95a474d5.js.map +1 -0
  293. package/dist/useQueryParams-4e7ddcf8.js +16 -0
  294. package/dist/useQueryParams-4e7ddcf8.js.map +1 -0
  295. package/dist/useSyncedRef-226a3dbc.js +17 -0
  296. package/dist/useSyncedRef-226a3dbc.js.map +1 -0
  297. package/formik.d.ts +26 -51
  298. package/index.d.ts +75 -834
  299. package/package.json +26 -4
  300. package/types/Accordion.d.ts +26 -0
  301. package/types/ActionDropdown.d.ts +21 -0
  302. package/types/Alert.d.ts +23 -0
  303. package/types/Avatar.d.ts +17 -0
  304. package/types/Button.d.ts +32 -0
  305. package/types/Callout.d.ts +13 -0
  306. package/types/Checkbox.d.ts +18 -0
  307. package/types/ColorPicker.d.ts +21 -0
  308. package/types/DatePicker.d.ts +30 -0
  309. package/types/DateTimePicker.d.ts +26 -0
  310. package/types/Dropdown.d.ts +77 -0
  311. package/types/Input.d.ts +27 -0
  312. package/types/Kbd.d.ts +11 -0
  313. package/types/Label.d.ts +19 -0
  314. package/types/Modal.d.ts +10 -0
  315. package/types/MultiEmailInput.d.ts +25 -0
  316. package/types/NoData.d.ts +14 -0
  317. package/types/Pagination.d.ts +11 -0
  318. package/types/Pane.d.ts +11 -0
  319. package/types/Popover.d.ts +32 -0
  320. package/types/Popup.d.ts +17 -0
  321. package/types/Radio.d.ts +24 -0
  322. package/types/Select.d.ts +27 -0
  323. package/types/Slider.d.ts +12 -0
  324. package/types/Spinner.d.ts +9 -0
  325. package/types/Stepper.d.ts +10 -0
  326. package/types/Switch.d.ts +20 -0
  327. package/types/Tab.d.ts +24 -0
  328. package/types/Table.d.ts +41 -0
  329. package/types/Tag.d.ts +27 -0
  330. package/types/Textarea.d.ts +22 -0
  331. package/types/TimePicker.d.ts +28 -0
  332. package/types/TimePickerInput.d.ts +22 -0
  333. package/types/Toastr.d.ts +20 -0
  334. package/types/Tooltip.d.ts +31 -0
  335. package/types/Tree.d.ts +62 -0
  336. package/types/TreeSelect.d.ts +40 -0
  337. package/types/Typography.d.ts +64 -0
  338. package/types/formik/ActionBlock.d.ts +11 -0
  339. package/types/formik/BlockNavigation.d.ts +9 -0
  340. package/types/formik/Button.d.ts +1 -0
  341. package/types/formik/Checkbox.d.ts +1 -0
  342. package/types/formik/Form.d.ts +13 -0
  343. package/types/formik/Input.d.ts +1 -0
  344. package/types/formik/MultiEmailInput.d.ts +1 -0
  345. package/types/formik/Radio.d.ts +1 -0
  346. package/types/formik/Select.d.ts +1 -0
  347. package/types/formik/Slider.d.ts +1 -0
  348. package/types/formik/Switch.d.ts +1 -0
  349. package/types/formik/Textarea.d.ts +1 -0
  350. package/types/formik/TreeSelect.d.ts +1 -0
  351. package/dist/TreeSelect-54c59138.js +0 -22106
  352. package/dist/TreeSelect-54c59138.js.map +0 -1
  353. package/dist/Typography-6b2170d4.js +0 -6439
  354. package/dist/Typography-6b2170d4.js.map +0 -1
  355. package/dist/cjs/TreeSelect-40898804.js +0 -22161
  356. package/dist/cjs/TreeSelect-40898804.js.map +0 -1
  357. package/dist/cjs/Typography-3f90f925.js +0 -6472
  358. package/dist/cjs/Typography-3f90f925.js.map +0 -1
  359. package/dist/cjs/createClass-ca103cfb.js.map +0 -1
  360. package/dist/cjs/formik.js +0 -624
  361. package/dist/cjs/formik.js.map +0 -1
  362. package/dist/cjs/index-099304bb.js +0 -104
  363. package/dist/cjs/index-099304bb.js.map +0 -1
  364. package/dist/cjs/overlayManager-a0827ae7.js.map +0 -1
  365. package/dist/createClass-27bd48bc.js +0 -52
  366. package/dist/createClass-27bd48bc.js.map +0 -1
  367. package/dist/formik.js +0 -604
  368. package/dist/formik.js.map +0 -1
  369. package/dist/index-ed90c85d.js +0 -98
  370. package/dist/index-ed90c85d.js.map +0 -1
  371. package/dist/overlayManager-4d5be56b.js.map +0 -1
@@ -0,0 +1,1602 @@
1
+ 'use strict';
2
+
3
+ require('./index-63580e68.js');
4
+ var React = require('react');
5
+ var ReactDOM = require('react-dom');
6
+ var _extends$1 = require('./extends-1b35a664.js');
7
+ var objectWithoutProperties = require('./objectWithoutProperties-2fed2d7d.js');
8
+ var ramda = require('ramda');
9
+ var index = require('./index-a8cc581e.js');
10
+ var overlayManager = require('./overlayManager.js');
11
+ var index$1 = require('./index-6e09c7bc.js');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
+ var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
17
+
18
+ function _extends() {
19
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
20
+ for (var i = 1; i < arguments.length; i++) {
21
+ var source = arguments[i];
22
+ for (var key in source) {
23
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
24
+ target[key] = source[key];
25
+ }
26
+ }
27
+ }
28
+ return target;
29
+ };
30
+ return _extends.apply(this, arguments);
31
+ }
32
+
33
+ function _objectWithoutPropertiesLoose(source, excluded) {
34
+ if (source == null) return {};
35
+ var target = {};
36
+ var sourceKeys = Object.keys(source);
37
+ var key, i;
38
+ for (i = 0; i < sourceKeys.length; i++) {
39
+ key = sourceKeys[i];
40
+ if (excluded.indexOf(key) >= 0) continue;
41
+ target[key] = source[key];
42
+ }
43
+ return target;
44
+ }
45
+
46
+ function _setPrototypeOf(o, p) {
47
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
48
+ o.__proto__ = p;
49
+ return o;
50
+ };
51
+ return _setPrototypeOf(o, p);
52
+ }
53
+
54
+ function _inheritsLoose(subClass, superClass) {
55
+ subClass.prototype = Object.create(superClass.prototype);
56
+ subClass.prototype.constructor = subClass;
57
+ _setPrototypeOf(subClass, superClass);
58
+ }
59
+
60
+ /**
61
+ * Checks if a given element has a CSS class.
62
+ *
63
+ * @param element the element
64
+ * @param className the CSS class name
65
+ */
66
+ function hasClass(element, className) {
67
+ if (element.classList) return !!className && element.classList.contains(className);
68
+ return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
69
+ }
70
+
71
+ /**
72
+ * Adds a CSS class to a given element.
73
+ *
74
+ * @param element the element
75
+ * @param className the CSS class name
76
+ */
77
+
78
+ function addClass(element, className) {
79
+ if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + " " + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + " " + className);
80
+ }
81
+
82
+ function replaceClassName(origClass, classToRemove) {
83
+ return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
84
+ }
85
+ /**
86
+ * Removes a CSS class from a given element.
87
+ *
88
+ * @param element the element
89
+ * @param className the CSS class name
90
+ */
91
+
92
+
93
+ function removeClass$1(element, className) {
94
+ if (element.classList) {
95
+ element.classList.remove(className);
96
+ } else if (typeof element.className === 'string') {
97
+ element.className = replaceClassName(element.className, className);
98
+ } else {
99
+ element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
100
+ }
101
+ }
102
+
103
+ var config = {
104
+ disabled: false
105
+ };
106
+
107
+ var TransitionGroupContext = React__default["default"].createContext(null);
108
+
109
+ var forceReflow = function forceReflow(node) {
110
+ return node.scrollTop;
111
+ };
112
+
113
+ var UNMOUNTED = 'unmounted';
114
+ var EXITED = 'exited';
115
+ var ENTERING = 'entering';
116
+ var ENTERED = 'entered';
117
+ var EXITING = 'exiting';
118
+ /**
119
+ * The Transition component lets you describe a transition from one component
120
+ * state to another _over time_ with a simple declarative API. Most commonly
121
+ * it's used to animate the mounting and unmounting of a component, but can also
122
+ * be used to describe in-place transition states as well.
123
+ *
124
+ * ---
125
+ *
126
+ * **Note**: `Transition` is a platform-agnostic base component. If you're using
127
+ * transitions in CSS, you'll probably want to use
128
+ * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
129
+ * instead. It inherits all the features of `Transition`, but contains
130
+ * additional features necessary to play nice with CSS transitions (hence the
131
+ * name of the component).
132
+ *
133
+ * ---
134
+ *
135
+ * By default the `Transition` component does not alter the behavior of the
136
+ * component it renders, it only tracks "enter" and "exit" states for the
137
+ * components. It's up to you to give meaning and effect to those states. For
138
+ * example we can add styles to a component when it enters or exits:
139
+ *
140
+ * ```jsx
141
+ * import { Transition } from 'react-transition-group';
142
+ *
143
+ * const duration = 300;
144
+ *
145
+ * const defaultStyle = {
146
+ * transition: `opacity ${duration}ms ease-in-out`,
147
+ * opacity: 0,
148
+ * }
149
+ *
150
+ * const transitionStyles = {
151
+ * entering: { opacity: 1 },
152
+ * entered: { opacity: 1 },
153
+ * exiting: { opacity: 0 },
154
+ * exited: { opacity: 0 },
155
+ * };
156
+ *
157
+ * const Fade = ({ in: inProp }) => (
158
+ * <Transition in={inProp} timeout={duration}>
159
+ * {state => (
160
+ * <div style={{
161
+ * ...defaultStyle,
162
+ * ...transitionStyles[state]
163
+ * }}>
164
+ * I'm a fade Transition!
165
+ * </div>
166
+ * )}
167
+ * </Transition>
168
+ * );
169
+ * ```
170
+ *
171
+ * There are 4 main states a Transition can be in:
172
+ * - `'entering'`
173
+ * - `'entered'`
174
+ * - `'exiting'`
175
+ * - `'exited'`
176
+ *
177
+ * Transition state is toggled via the `in` prop. When `true` the component
178
+ * begins the "Enter" stage. During this stage, the component will shift from
179
+ * its current transition state, to `'entering'` for the duration of the
180
+ * transition and then to the `'entered'` stage once it's complete. Let's take
181
+ * the following example (we'll use the
182
+ * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
183
+ *
184
+ * ```jsx
185
+ * function App() {
186
+ * const [inProp, setInProp] = useState(false);
187
+ * return (
188
+ * <div>
189
+ * <Transition in={inProp} timeout={500}>
190
+ * {state => (
191
+ * // ...
192
+ * )}
193
+ * </Transition>
194
+ * <button onClick={() => setInProp(true)}>
195
+ * Click to Enter
196
+ * </button>
197
+ * </div>
198
+ * );
199
+ * }
200
+ * ```
201
+ *
202
+ * When the button is clicked the component will shift to the `'entering'` state
203
+ * and stay there for 500ms (the value of `timeout`) before it finally switches
204
+ * to `'entered'`.
205
+ *
206
+ * When `in` is `false` the same thing happens except the state moves from
207
+ * `'exiting'` to `'exited'`.
208
+ */
209
+
210
+ var Transition = /*#__PURE__*/function (_React$Component) {
211
+ _inheritsLoose(Transition, _React$Component);
212
+
213
+ function Transition(props, context) {
214
+ var _this;
215
+
216
+ _this = _React$Component.call(this, props, context) || this;
217
+ var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
218
+
219
+ var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
220
+ var initialStatus;
221
+ _this.appearStatus = null;
222
+
223
+ if (props.in) {
224
+ if (appear) {
225
+ initialStatus = EXITED;
226
+ _this.appearStatus = ENTERING;
227
+ } else {
228
+ initialStatus = ENTERED;
229
+ }
230
+ } else {
231
+ if (props.unmountOnExit || props.mountOnEnter) {
232
+ initialStatus = UNMOUNTED;
233
+ } else {
234
+ initialStatus = EXITED;
235
+ }
236
+ }
237
+
238
+ _this.state = {
239
+ status: initialStatus
240
+ };
241
+ _this.nextCallback = null;
242
+ return _this;
243
+ }
244
+
245
+ Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
246
+ var nextIn = _ref.in;
247
+
248
+ if (nextIn && prevState.status === UNMOUNTED) {
249
+ return {
250
+ status: EXITED
251
+ };
252
+ }
253
+
254
+ return null;
255
+ } // getSnapshotBeforeUpdate(prevProps) {
256
+ // let nextStatus = null
257
+ // if (prevProps !== this.props) {
258
+ // const { status } = this.state
259
+ // if (this.props.in) {
260
+ // if (status !== ENTERING && status !== ENTERED) {
261
+ // nextStatus = ENTERING
262
+ // }
263
+ // } else {
264
+ // if (status === ENTERING || status === ENTERED) {
265
+ // nextStatus = EXITING
266
+ // }
267
+ // }
268
+ // }
269
+ // return { nextStatus }
270
+ // }
271
+ ;
272
+
273
+ var _proto = Transition.prototype;
274
+
275
+ _proto.componentDidMount = function componentDidMount() {
276
+ this.updateStatus(true, this.appearStatus);
277
+ };
278
+
279
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
280
+ var nextStatus = null;
281
+
282
+ if (prevProps !== this.props) {
283
+ var status = this.state.status;
284
+
285
+ if (this.props.in) {
286
+ if (status !== ENTERING && status !== ENTERED) {
287
+ nextStatus = ENTERING;
288
+ }
289
+ } else {
290
+ if (status === ENTERING || status === ENTERED) {
291
+ nextStatus = EXITING;
292
+ }
293
+ }
294
+ }
295
+
296
+ this.updateStatus(false, nextStatus);
297
+ };
298
+
299
+ _proto.componentWillUnmount = function componentWillUnmount() {
300
+ this.cancelNextCallback();
301
+ };
302
+
303
+ _proto.getTimeouts = function getTimeouts() {
304
+ var timeout = this.props.timeout;
305
+ var exit, enter, appear;
306
+ exit = enter = appear = timeout;
307
+
308
+ if (timeout != null && typeof timeout !== 'number') {
309
+ exit = timeout.exit;
310
+ enter = timeout.enter; // TODO: remove fallback for next major
311
+
312
+ appear = timeout.appear !== undefined ? timeout.appear : enter;
313
+ }
314
+
315
+ return {
316
+ exit: exit,
317
+ enter: enter,
318
+ appear: appear
319
+ };
320
+ };
321
+
322
+ _proto.updateStatus = function updateStatus(mounting, nextStatus) {
323
+ if (mounting === void 0) {
324
+ mounting = false;
325
+ }
326
+
327
+ if (nextStatus !== null) {
328
+ // nextStatus will always be ENTERING or EXITING.
329
+ this.cancelNextCallback();
330
+
331
+ if (nextStatus === ENTERING) {
332
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
333
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default["default"].findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749
334
+ // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
335
+ // To make the animation happen, we have to separate each rendering and avoid being processed as batched.
336
+
337
+ if (node) forceReflow(node);
338
+ }
339
+
340
+ this.performEnter(mounting);
341
+ } else {
342
+ this.performExit();
343
+ }
344
+ } else if (this.props.unmountOnExit && this.state.status === EXITED) {
345
+ this.setState({
346
+ status: UNMOUNTED
347
+ });
348
+ }
349
+ };
350
+
351
+ _proto.performEnter = function performEnter(mounting) {
352
+ var _this2 = this;
353
+
354
+ var enter = this.props.enter;
355
+ var appearing = this.context ? this.context.isMounting : mounting;
356
+
357
+ var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM__default["default"].findDOMNode(this), appearing],
358
+ maybeNode = _ref2[0],
359
+ maybeAppearing = _ref2[1];
360
+
361
+ var timeouts = this.getTimeouts();
362
+ var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
363
+ // if we are mounting and running this it means appear _must_ be set
364
+
365
+ if (!mounting && !enter || config.disabled) {
366
+ this.safeSetState({
367
+ status: ENTERED
368
+ }, function () {
369
+ _this2.props.onEntered(maybeNode);
370
+ });
371
+ return;
372
+ }
373
+
374
+ this.props.onEnter(maybeNode, maybeAppearing);
375
+ this.safeSetState({
376
+ status: ENTERING
377
+ }, function () {
378
+ _this2.props.onEntering(maybeNode, maybeAppearing);
379
+
380
+ _this2.onTransitionEnd(enterTimeout, function () {
381
+ _this2.safeSetState({
382
+ status: ENTERED
383
+ }, function () {
384
+ _this2.props.onEntered(maybeNode, maybeAppearing);
385
+ });
386
+ });
387
+ });
388
+ };
389
+
390
+ _proto.performExit = function performExit() {
391
+ var _this3 = this;
392
+
393
+ var exit = this.props.exit;
394
+ var timeouts = this.getTimeouts();
395
+ var maybeNode = this.props.nodeRef ? undefined : ReactDOM__default["default"].findDOMNode(this); // no exit animation skip right to EXITED
396
+
397
+ if (!exit || config.disabled) {
398
+ this.safeSetState({
399
+ status: EXITED
400
+ }, function () {
401
+ _this3.props.onExited(maybeNode);
402
+ });
403
+ return;
404
+ }
405
+
406
+ this.props.onExit(maybeNode);
407
+ this.safeSetState({
408
+ status: EXITING
409
+ }, function () {
410
+ _this3.props.onExiting(maybeNode);
411
+
412
+ _this3.onTransitionEnd(timeouts.exit, function () {
413
+ _this3.safeSetState({
414
+ status: EXITED
415
+ }, function () {
416
+ _this3.props.onExited(maybeNode);
417
+ });
418
+ });
419
+ });
420
+ };
421
+
422
+ _proto.cancelNextCallback = function cancelNextCallback() {
423
+ if (this.nextCallback !== null) {
424
+ this.nextCallback.cancel();
425
+ this.nextCallback = null;
426
+ }
427
+ };
428
+
429
+ _proto.safeSetState = function safeSetState(nextState, callback) {
430
+ // This shouldn't be necessary, but there are weird race conditions with
431
+ // setState callbacks and unmounting in testing, so always make sure that
432
+ // we can cancel any pending setState callbacks after we unmount.
433
+ callback = this.setNextCallback(callback);
434
+ this.setState(nextState, callback);
435
+ };
436
+
437
+ _proto.setNextCallback = function setNextCallback(callback) {
438
+ var _this4 = this;
439
+
440
+ var active = true;
441
+
442
+ this.nextCallback = function (event) {
443
+ if (active) {
444
+ active = false;
445
+ _this4.nextCallback = null;
446
+ callback(event);
447
+ }
448
+ };
449
+
450
+ this.nextCallback.cancel = function () {
451
+ active = false;
452
+ };
453
+
454
+ return this.nextCallback;
455
+ };
456
+
457
+ _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
458
+ this.setNextCallback(handler);
459
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default["default"].findDOMNode(this);
460
+ var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
461
+
462
+ if (!node || doesNotHaveTimeoutOrListener) {
463
+ setTimeout(this.nextCallback, 0);
464
+ return;
465
+ }
466
+
467
+ if (this.props.addEndListener) {
468
+ var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
469
+ maybeNode = _ref3[0],
470
+ maybeNextCallback = _ref3[1];
471
+
472
+ this.props.addEndListener(maybeNode, maybeNextCallback);
473
+ }
474
+
475
+ if (timeout != null) {
476
+ setTimeout(this.nextCallback, timeout);
477
+ }
478
+ };
479
+
480
+ _proto.render = function render() {
481
+ var status = this.state.status;
482
+
483
+ if (status === UNMOUNTED) {
484
+ return null;
485
+ }
486
+
487
+ var _this$props = this.props,
488
+ children = _this$props.children;
489
+ _this$props.in;
490
+ _this$props.mountOnEnter;
491
+ _this$props.unmountOnExit;
492
+ _this$props.appear;
493
+ _this$props.enter;
494
+ _this$props.exit;
495
+ _this$props.timeout;
496
+ _this$props.addEndListener;
497
+ _this$props.onEnter;
498
+ _this$props.onEntering;
499
+ _this$props.onEntered;
500
+ _this$props.onExit;
501
+ _this$props.onExiting;
502
+ _this$props.onExited;
503
+ _this$props.nodeRef;
504
+ var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
505
+
506
+ return (
507
+ /*#__PURE__*/
508
+ // allows for nested Transitions
509
+ React__default["default"].createElement(TransitionGroupContext.Provider, {
510
+ value: null
511
+ }, typeof children === 'function' ? children(status, childProps) : React__default["default"].cloneElement(React__default["default"].Children.only(children), childProps))
512
+ );
513
+ };
514
+
515
+ return Transition;
516
+ }(React__default["default"].Component);
517
+
518
+ Transition.contextType = TransitionGroupContext;
519
+ Transition.propTypes = {}; // Name the function so it is clearer in the documentation
520
+
521
+ function noop() {}
522
+
523
+ Transition.defaultProps = {
524
+ in: false,
525
+ mountOnEnter: false,
526
+ unmountOnExit: false,
527
+ appear: false,
528
+ enter: true,
529
+ exit: true,
530
+ onEnter: noop,
531
+ onEntering: noop,
532
+ onEntered: noop,
533
+ onExit: noop,
534
+ onExiting: noop,
535
+ onExited: noop
536
+ };
537
+ Transition.UNMOUNTED = UNMOUNTED;
538
+ Transition.EXITED = EXITED;
539
+ Transition.ENTERING = ENTERING;
540
+ Transition.ENTERED = ENTERED;
541
+ Transition.EXITING = EXITING;
542
+
543
+ var _addClass = function addClass$1(node, classes) {
544
+ return node && classes && classes.split(' ').forEach(function (c) {
545
+ return addClass(node, c);
546
+ });
547
+ };
548
+
549
+ var removeClass = function removeClass(node, classes) {
550
+ return node && classes && classes.split(' ').forEach(function (c) {
551
+ return removeClass$1(node, c);
552
+ });
553
+ };
554
+ /**
555
+ * A transition component inspired by the excellent
556
+ * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
557
+ * use it if you're using CSS transitions or animations. It's built upon the
558
+ * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
559
+ * component, so it inherits all of its props.
560
+ *
561
+ * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
562
+ * and `exit` states of the transition. The first class is applied and then a
563
+ * second `*-active` class in order to activate the CSS transition. After the
564
+ * transition, matching `*-done` class names are applied to persist the
565
+ * transition state.
566
+ *
567
+ * ```jsx
568
+ * function App() {
569
+ * const [inProp, setInProp] = useState(false);
570
+ * return (
571
+ * <div>
572
+ * <CSSTransition in={inProp} timeout={200} classNames="my-node">
573
+ * <div>
574
+ * {"I'll receive my-node-* classes"}
575
+ * </div>
576
+ * </CSSTransition>
577
+ * <button type="button" onClick={() => setInProp(true)}>
578
+ * Click to Enter
579
+ * </button>
580
+ * </div>
581
+ * );
582
+ * }
583
+ * ```
584
+ *
585
+ * When the `in` prop is set to `true`, the child component will first receive
586
+ * the class `example-enter`, then the `example-enter-active` will be added in
587
+ * the next tick. `CSSTransition` [forces a
588
+ * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
589
+ * between before adding the `example-enter-active`. This is an important trick
590
+ * because it allows us to transition between `example-enter` and
591
+ * `example-enter-active` even though they were added immediately one after
592
+ * another. Most notably, this is what makes it possible for us to animate
593
+ * _appearance_.
594
+ *
595
+ * ```css
596
+ * .my-node-enter {
597
+ * opacity: 0;
598
+ * }
599
+ * .my-node-enter-active {
600
+ * opacity: 1;
601
+ * transition: opacity 200ms;
602
+ * }
603
+ * .my-node-exit {
604
+ * opacity: 1;
605
+ * }
606
+ * .my-node-exit-active {
607
+ * opacity: 0;
608
+ * transition: opacity 200ms;
609
+ * }
610
+ * ```
611
+ *
612
+ * `*-active` classes represent which styles you want to animate **to**, so it's
613
+ * important to add `transition` declaration only to them, otherwise transitions
614
+ * might not behave as intended! This might not be obvious when the transitions
615
+ * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
616
+ * the example above (minus `transition`), but it becomes apparent in more
617
+ * complex transitions.
618
+ *
619
+ * **Note**: If you're using the
620
+ * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
621
+ * prop, make sure to define styles for `.appear-*` classes as well.
622
+ */
623
+
624
+
625
+ var CSSTransition = /*#__PURE__*/function (_React$Component) {
626
+ _inheritsLoose(CSSTransition, _React$Component);
627
+
628
+ function CSSTransition() {
629
+ var _this;
630
+
631
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
632
+ args[_key] = arguments[_key];
633
+ }
634
+
635
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
636
+ _this.appliedClasses = {
637
+ appear: {},
638
+ enter: {},
639
+ exit: {}
640
+ };
641
+
642
+ _this.onEnter = function (maybeNode, maybeAppearing) {
643
+ var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
644
+ node = _this$resolveArgument[0],
645
+ appearing = _this$resolveArgument[1];
646
+
647
+ _this.removeClasses(node, 'exit');
648
+
649
+ _this.addClass(node, appearing ? 'appear' : 'enter', 'base');
650
+
651
+ if (_this.props.onEnter) {
652
+ _this.props.onEnter(maybeNode, maybeAppearing);
653
+ }
654
+ };
655
+
656
+ _this.onEntering = function (maybeNode, maybeAppearing) {
657
+ var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
658
+ node = _this$resolveArgument2[0],
659
+ appearing = _this$resolveArgument2[1];
660
+
661
+ var type = appearing ? 'appear' : 'enter';
662
+
663
+ _this.addClass(node, type, 'active');
664
+
665
+ if (_this.props.onEntering) {
666
+ _this.props.onEntering(maybeNode, maybeAppearing);
667
+ }
668
+ };
669
+
670
+ _this.onEntered = function (maybeNode, maybeAppearing) {
671
+ var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
672
+ node = _this$resolveArgument3[0],
673
+ appearing = _this$resolveArgument3[1];
674
+
675
+ var type = appearing ? 'appear' : 'enter';
676
+
677
+ _this.removeClasses(node, type);
678
+
679
+ _this.addClass(node, type, 'done');
680
+
681
+ if (_this.props.onEntered) {
682
+ _this.props.onEntered(maybeNode, maybeAppearing);
683
+ }
684
+ };
685
+
686
+ _this.onExit = function (maybeNode) {
687
+ var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
688
+ node = _this$resolveArgument4[0];
689
+
690
+ _this.removeClasses(node, 'appear');
691
+
692
+ _this.removeClasses(node, 'enter');
693
+
694
+ _this.addClass(node, 'exit', 'base');
695
+
696
+ if (_this.props.onExit) {
697
+ _this.props.onExit(maybeNode);
698
+ }
699
+ };
700
+
701
+ _this.onExiting = function (maybeNode) {
702
+ var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
703
+ node = _this$resolveArgument5[0];
704
+
705
+ _this.addClass(node, 'exit', 'active');
706
+
707
+ if (_this.props.onExiting) {
708
+ _this.props.onExiting(maybeNode);
709
+ }
710
+ };
711
+
712
+ _this.onExited = function (maybeNode) {
713
+ var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
714
+ node = _this$resolveArgument6[0];
715
+
716
+ _this.removeClasses(node, 'exit');
717
+
718
+ _this.addClass(node, 'exit', 'done');
719
+
720
+ if (_this.props.onExited) {
721
+ _this.props.onExited(maybeNode);
722
+ }
723
+ };
724
+
725
+ _this.resolveArguments = function (maybeNode, maybeAppearing) {
726
+ return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
727
+ : [maybeNode, maybeAppearing];
728
+ };
729
+
730
+ _this.getClassNames = function (type) {
731
+ var classNames = _this.props.classNames;
732
+ var isStringClassNames = typeof classNames === 'string';
733
+ var prefix = isStringClassNames && classNames ? classNames + "-" : '';
734
+ var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
735
+ var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
736
+ var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
737
+ return {
738
+ baseClassName: baseClassName,
739
+ activeClassName: activeClassName,
740
+ doneClassName: doneClassName
741
+ };
742
+ };
743
+
744
+ return _this;
745
+ }
746
+
747
+ var _proto = CSSTransition.prototype;
748
+
749
+ _proto.addClass = function addClass(node, type, phase) {
750
+ var className = this.getClassNames(type)[phase + "ClassName"];
751
+
752
+ var _this$getClassNames = this.getClassNames('enter'),
753
+ doneClassName = _this$getClassNames.doneClassName;
754
+
755
+ if (type === 'appear' && phase === 'done' && doneClassName) {
756
+ className += " " + doneClassName;
757
+ } // This is to force a repaint,
758
+ // which is necessary in order to transition styles when adding a class name.
759
+
760
+
761
+ if (phase === 'active') {
762
+ if (node) forceReflow(node);
763
+ }
764
+
765
+ if (className) {
766
+ this.appliedClasses[type][phase] = className;
767
+
768
+ _addClass(node, className);
769
+ }
770
+ };
771
+
772
+ _proto.removeClasses = function removeClasses(node, type) {
773
+ var _this$appliedClasses$ = this.appliedClasses[type],
774
+ baseClassName = _this$appliedClasses$.base,
775
+ activeClassName = _this$appliedClasses$.active,
776
+ doneClassName = _this$appliedClasses$.done;
777
+ this.appliedClasses[type] = {};
778
+
779
+ if (baseClassName) {
780
+ removeClass(node, baseClassName);
781
+ }
782
+
783
+ if (activeClassName) {
784
+ removeClass(node, activeClassName);
785
+ }
786
+
787
+ if (doneClassName) {
788
+ removeClass(node, doneClassName);
789
+ }
790
+ };
791
+
792
+ _proto.render = function render() {
793
+ var _this$props = this.props;
794
+ _this$props.classNames;
795
+ var props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
796
+
797
+ return /*#__PURE__*/React__default["default"].createElement(Transition, _extends({}, props, {
798
+ onEnter: this.onEnter,
799
+ onEntered: this.onEntered,
800
+ onEntering: this.onEntering,
801
+ onExit: this.onExit,
802
+ onExiting: this.onExiting,
803
+ onExited: this.onExited
804
+ }));
805
+ };
806
+
807
+ return CSSTransition;
808
+ }(React__default["default"].Component);
809
+
810
+ CSSTransition.defaultProps = {
811
+ classNames: ''
812
+ };
813
+ CSSTransition.propTypes = {};
814
+
815
+ function _assertThisInitialized(self) {
816
+ if (self === void 0) {
817
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
818
+ }
819
+ return self;
820
+ }
821
+
822
+ /**
823
+ * Given `this.props.children`, return an object mapping key to child.
824
+ *
825
+ * @param {*} children `this.props.children`
826
+ * @return {object} Mapping of key to child
827
+ */
828
+
829
+ function getChildMapping(children, mapFn) {
830
+ var mapper = function mapper(child) {
831
+ return mapFn && React.isValidElement(child) ? mapFn(child) : child;
832
+ };
833
+
834
+ var result = Object.create(null);
835
+ if (children) React.Children.map(children, function (c) {
836
+ return c;
837
+ }).forEach(function (child) {
838
+ // run the map function here instead so that the key is the computed one
839
+ result[child.key] = mapper(child);
840
+ });
841
+ return result;
842
+ }
843
+ /**
844
+ * When you're adding or removing children some may be added or removed in the
845
+ * same render pass. We want to show *both* since we want to simultaneously
846
+ * animate elements in and out. This function takes a previous set of keys
847
+ * and a new set of keys and merges them with its best guess of the correct
848
+ * ordering. In the future we may expose some of the utilities in
849
+ * ReactMultiChild to make this easy, but for now React itself does not
850
+ * directly have this concept of the union of prevChildren and nextChildren
851
+ * so we implement it here.
852
+ *
853
+ * @param {object} prev prev children as returned from
854
+ * `ReactTransitionChildMapping.getChildMapping()`.
855
+ * @param {object} next next children as returned from
856
+ * `ReactTransitionChildMapping.getChildMapping()`.
857
+ * @return {object} a key set that contains all keys in `prev` and all keys
858
+ * in `next` in a reasonable order.
859
+ */
860
+
861
+ function mergeChildMappings(prev, next) {
862
+ prev = prev || {};
863
+ next = next || {};
864
+
865
+ function getValueForKey(key) {
866
+ return key in next ? next[key] : prev[key];
867
+ } // For each key of `next`, the list of keys to insert before that key in
868
+ // the combined list
869
+
870
+
871
+ var nextKeysPending = Object.create(null);
872
+ var pendingKeys = [];
873
+
874
+ for (var prevKey in prev) {
875
+ if (prevKey in next) {
876
+ if (pendingKeys.length) {
877
+ nextKeysPending[prevKey] = pendingKeys;
878
+ pendingKeys = [];
879
+ }
880
+ } else {
881
+ pendingKeys.push(prevKey);
882
+ }
883
+ }
884
+
885
+ var i;
886
+ var childMapping = {};
887
+
888
+ for (var nextKey in next) {
889
+ if (nextKeysPending[nextKey]) {
890
+ for (i = 0; i < nextKeysPending[nextKey].length; i++) {
891
+ var pendingNextKey = nextKeysPending[nextKey][i];
892
+ childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
893
+ }
894
+ }
895
+
896
+ childMapping[nextKey] = getValueForKey(nextKey);
897
+ } // Finally, add the keys which didn't appear before any key in `next`
898
+
899
+
900
+ for (i = 0; i < pendingKeys.length; i++) {
901
+ childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
902
+ }
903
+
904
+ return childMapping;
905
+ }
906
+
907
+ function getProp(child, prop, props) {
908
+ return props[prop] != null ? props[prop] : child.props[prop];
909
+ }
910
+
911
+ function getInitialChildMapping(props, onExited) {
912
+ return getChildMapping(props.children, function (child) {
913
+ return React.cloneElement(child, {
914
+ onExited: onExited.bind(null, child),
915
+ in: true,
916
+ appear: getProp(child, 'appear', props),
917
+ enter: getProp(child, 'enter', props),
918
+ exit: getProp(child, 'exit', props)
919
+ });
920
+ });
921
+ }
922
+ function getNextChildMapping(nextProps, prevChildMapping, onExited) {
923
+ var nextChildMapping = getChildMapping(nextProps.children);
924
+ var children = mergeChildMappings(prevChildMapping, nextChildMapping);
925
+ Object.keys(children).forEach(function (key) {
926
+ var child = children[key];
927
+ if (!React.isValidElement(child)) return;
928
+ var hasPrev = (key in prevChildMapping);
929
+ var hasNext = (key in nextChildMapping);
930
+ var prevChild = prevChildMapping[key];
931
+ var isLeaving = React.isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)
932
+
933
+ if (hasNext && (!hasPrev || isLeaving)) {
934
+ // console.log('entering', key)
935
+ children[key] = React.cloneElement(child, {
936
+ onExited: onExited.bind(null, child),
937
+ in: true,
938
+ exit: getProp(child, 'exit', nextProps),
939
+ enter: getProp(child, 'enter', nextProps)
940
+ });
941
+ } else if (!hasNext && hasPrev && !isLeaving) {
942
+ // item is old (exiting)
943
+ // console.log('leaving', key)
944
+ children[key] = React.cloneElement(child, {
945
+ in: false
946
+ });
947
+ } else if (hasNext && hasPrev && React.isValidElement(prevChild)) {
948
+ // item hasn't changed transition states
949
+ // copy over the last transition props;
950
+ // console.log('unchanged', key)
951
+ children[key] = React.cloneElement(child, {
952
+ onExited: onExited.bind(null, child),
953
+ in: prevChild.props.in,
954
+ exit: getProp(child, 'exit', nextProps),
955
+ enter: getProp(child, 'enter', nextProps)
956
+ });
957
+ }
958
+ });
959
+ return children;
960
+ }
961
+
962
+ var values = Object.values || function (obj) {
963
+ return Object.keys(obj).map(function (k) {
964
+ return obj[k];
965
+ });
966
+ };
967
+
968
+ var defaultProps = {
969
+ component: 'div',
970
+ childFactory: function childFactory(child) {
971
+ return child;
972
+ }
973
+ };
974
+ /**
975
+ * The `<TransitionGroup>` component manages a set of transition components
976
+ * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
977
+ * components, `<TransitionGroup>` is a state machine for managing the mounting
978
+ * and unmounting of components over time.
979
+ *
980
+ * Consider the example below. As items are removed or added to the TodoList the
981
+ * `in` prop is toggled automatically by the `<TransitionGroup>`.
982
+ *
983
+ * Note that `<TransitionGroup>` does not define any animation behavior!
984
+ * Exactly _how_ a list item animates is up to the individual transition
985
+ * component. This means you can mix and match animations across different list
986
+ * items.
987
+ */
988
+
989
+ var TransitionGroup = /*#__PURE__*/function (_React$Component) {
990
+ _inheritsLoose(TransitionGroup, _React$Component);
991
+
992
+ function TransitionGroup(props, context) {
993
+ var _this;
994
+
995
+ _this = _React$Component.call(this, props, context) || this;
996
+
997
+ var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear
998
+
999
+
1000
+ _this.state = {
1001
+ contextValue: {
1002
+ isMounting: true
1003
+ },
1004
+ handleExited: handleExited,
1005
+ firstRender: true
1006
+ };
1007
+ return _this;
1008
+ }
1009
+
1010
+ var _proto = TransitionGroup.prototype;
1011
+
1012
+ _proto.componentDidMount = function componentDidMount() {
1013
+ this.mounted = true;
1014
+ this.setState({
1015
+ contextValue: {
1016
+ isMounting: false
1017
+ }
1018
+ });
1019
+ };
1020
+
1021
+ _proto.componentWillUnmount = function componentWillUnmount() {
1022
+ this.mounted = false;
1023
+ };
1024
+
1025
+ TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
1026
+ var prevChildMapping = _ref.children,
1027
+ handleExited = _ref.handleExited,
1028
+ firstRender = _ref.firstRender;
1029
+ return {
1030
+ children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
1031
+ firstRender: false
1032
+ };
1033
+ } // node is `undefined` when user provided `nodeRef` prop
1034
+ ;
1035
+
1036
+ _proto.handleExited = function handleExited(child, node) {
1037
+ var currentChildMapping = getChildMapping(this.props.children);
1038
+ if (child.key in currentChildMapping) return;
1039
+
1040
+ if (child.props.onExited) {
1041
+ child.props.onExited(node);
1042
+ }
1043
+
1044
+ if (this.mounted) {
1045
+ this.setState(function (state) {
1046
+ var children = _extends({}, state.children);
1047
+
1048
+ delete children[child.key];
1049
+ return {
1050
+ children: children
1051
+ };
1052
+ });
1053
+ }
1054
+ };
1055
+
1056
+ _proto.render = function render() {
1057
+ var _this$props = this.props,
1058
+ Component = _this$props.component,
1059
+ childFactory = _this$props.childFactory,
1060
+ props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
1061
+
1062
+ var contextValue = this.state.contextValue;
1063
+ var children = values(this.state.children).map(childFactory);
1064
+ delete props.appear;
1065
+ delete props.enter;
1066
+ delete props.exit;
1067
+
1068
+ if (Component === null) {
1069
+ return /*#__PURE__*/React__default["default"].createElement(TransitionGroupContext.Provider, {
1070
+ value: contextValue
1071
+ }, children);
1072
+ }
1073
+
1074
+ return /*#__PURE__*/React__default["default"].createElement(TransitionGroupContext.Provider, {
1075
+ value: contextValue
1076
+ }, /*#__PURE__*/React__default["default"].createElement(Component, props, children));
1077
+ };
1078
+
1079
+ return TransitionGroup;
1080
+ }(React__default["default"].Component);
1081
+
1082
+ TransitionGroup.propTypes = {};
1083
+ TransitionGroup.defaultProps = defaultProps;
1084
+
1085
+ /**
1086
+ * The `<ReplaceTransition>` component is a specialized `Transition` component
1087
+ * that animates between two children.
1088
+ *
1089
+ * ```jsx
1090
+ * <ReplaceTransition in>
1091
+ * <Fade><div>I appear first</div></Fade>
1092
+ * <Fade><div>I replace the above</div></Fade>
1093
+ * </ReplaceTransition>
1094
+ * ```
1095
+ */
1096
+
1097
+ var ReplaceTransition = /*#__PURE__*/function (_React$Component) {
1098
+ _inheritsLoose(ReplaceTransition, _React$Component);
1099
+
1100
+ function ReplaceTransition() {
1101
+ var _this;
1102
+
1103
+ for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
1104
+ _args[_key] = arguments[_key];
1105
+ }
1106
+
1107
+ _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
1108
+
1109
+ _this.handleEnter = function () {
1110
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1111
+ args[_key2] = arguments[_key2];
1112
+ }
1113
+
1114
+ return _this.handleLifecycle('onEnter', 0, args);
1115
+ };
1116
+
1117
+ _this.handleEntering = function () {
1118
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1119
+ args[_key3] = arguments[_key3];
1120
+ }
1121
+
1122
+ return _this.handleLifecycle('onEntering', 0, args);
1123
+ };
1124
+
1125
+ _this.handleEntered = function () {
1126
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1127
+ args[_key4] = arguments[_key4];
1128
+ }
1129
+
1130
+ return _this.handleLifecycle('onEntered', 0, args);
1131
+ };
1132
+
1133
+ _this.handleExit = function () {
1134
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
1135
+ args[_key5] = arguments[_key5];
1136
+ }
1137
+
1138
+ return _this.handleLifecycle('onExit', 1, args);
1139
+ };
1140
+
1141
+ _this.handleExiting = function () {
1142
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
1143
+ args[_key6] = arguments[_key6];
1144
+ }
1145
+
1146
+ return _this.handleLifecycle('onExiting', 1, args);
1147
+ };
1148
+
1149
+ _this.handleExited = function () {
1150
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
1151
+ args[_key7] = arguments[_key7];
1152
+ }
1153
+
1154
+ return _this.handleLifecycle('onExited', 1, args);
1155
+ };
1156
+
1157
+ return _this;
1158
+ }
1159
+
1160
+ var _proto = ReplaceTransition.prototype;
1161
+
1162
+ _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
1163
+ var _child$props;
1164
+
1165
+ var children = this.props.children;
1166
+ var child = React__default["default"].Children.toArray(children)[idx];
1167
+ if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
1168
+
1169
+ if (this.props[handler]) {
1170
+ var maybeNode = child.props.nodeRef ? undefined : ReactDOM__default["default"].findDOMNode(this);
1171
+ this.props[handler](maybeNode);
1172
+ }
1173
+ };
1174
+
1175
+ _proto.render = function render() {
1176
+ var _this$props = this.props,
1177
+ children = _this$props.children,
1178
+ inProp = _this$props.in,
1179
+ props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
1180
+
1181
+ var _React$Children$toArr = React__default["default"].Children.toArray(children),
1182
+ first = _React$Children$toArr[0],
1183
+ second = _React$Children$toArr[1];
1184
+
1185
+ delete props.onEnter;
1186
+ delete props.onEntering;
1187
+ delete props.onEntered;
1188
+ delete props.onExit;
1189
+ delete props.onExiting;
1190
+ delete props.onExited;
1191
+ return /*#__PURE__*/React__default["default"].createElement(TransitionGroup, props, inProp ? React__default["default"].cloneElement(first, {
1192
+ key: 'first',
1193
+ onEnter: this.handleEnter,
1194
+ onEntering: this.handleEntering,
1195
+ onEntered: this.handleEntered
1196
+ }) : React__default["default"].cloneElement(second, {
1197
+ key: 'second',
1198
+ onEnter: this.handleExit,
1199
+ onEntering: this.handleExiting,
1200
+ onEntered: this.handleExited
1201
+ }));
1202
+ };
1203
+
1204
+ return ReplaceTransition;
1205
+ }(React__default["default"].Component);
1206
+
1207
+ ReplaceTransition.propTypes = {};
1208
+
1209
+ var _leaveRenders, _enterRenders;
1210
+
1211
+ function areChildrenDifferent(oldChildren, newChildren) {
1212
+ if (oldChildren === newChildren) return false;
1213
+
1214
+ if (React__default["default"].isValidElement(oldChildren) && React__default["default"].isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {
1215
+ return false;
1216
+ }
1217
+
1218
+ return true;
1219
+ }
1220
+ /**
1221
+ * Enum of modes for SwitchTransition component
1222
+ * @enum { string }
1223
+ */
1224
+
1225
+
1226
+ var modes = {
1227
+ out: 'out-in',
1228
+ in: 'in-out'
1229
+ };
1230
+
1231
+ var callHook = function callHook(element, name, cb) {
1232
+ return function () {
1233
+ var _element$props;
1234
+
1235
+ element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);
1236
+ cb();
1237
+ };
1238
+ };
1239
+
1240
+ var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {
1241
+ var current = _ref.current,
1242
+ changeState = _ref.changeState;
1243
+ return React__default["default"].cloneElement(current, {
1244
+ in: false,
1245
+ onExited: callHook(current, 'onExited', function () {
1246
+ changeState(ENTERING, null);
1247
+ })
1248
+ });
1249
+ }, _leaveRenders[modes.in] = function (_ref2) {
1250
+ var current = _ref2.current,
1251
+ changeState = _ref2.changeState,
1252
+ children = _ref2.children;
1253
+ return [current, React__default["default"].cloneElement(children, {
1254
+ in: true,
1255
+ onEntered: callHook(children, 'onEntered', function () {
1256
+ changeState(ENTERING);
1257
+ })
1258
+ })];
1259
+ }, _leaveRenders);
1260
+ var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {
1261
+ var children = _ref3.children,
1262
+ changeState = _ref3.changeState;
1263
+ return React__default["default"].cloneElement(children, {
1264
+ in: true,
1265
+ onEntered: callHook(children, 'onEntered', function () {
1266
+ changeState(ENTERED, React__default["default"].cloneElement(children, {
1267
+ in: true
1268
+ }));
1269
+ })
1270
+ });
1271
+ }, _enterRenders[modes.in] = function (_ref4) {
1272
+ var current = _ref4.current,
1273
+ children = _ref4.children,
1274
+ changeState = _ref4.changeState;
1275
+ return [React__default["default"].cloneElement(current, {
1276
+ in: false,
1277
+ onExited: callHook(current, 'onExited', function () {
1278
+ changeState(ENTERED, React__default["default"].cloneElement(children, {
1279
+ in: true
1280
+ }));
1281
+ })
1282
+ }), React__default["default"].cloneElement(children, {
1283
+ in: true
1284
+ })];
1285
+ }, _enterRenders);
1286
+ /**
1287
+ * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).
1288
+ * You can use it when you want to control the render between state transitions.
1289
+ * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.
1290
+ *
1291
+ * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.
1292
+ * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.
1293
+ *
1294
+ * **Note**: If you want the animation to happen simultaneously
1295
+ * (that is, to have the old child removed and a new child inserted **at the same time**),
1296
+ * you should use
1297
+ * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)
1298
+ * instead.
1299
+ *
1300
+ * ```jsx
1301
+ * function App() {
1302
+ * const [state, setState] = useState(false);
1303
+ * return (
1304
+ * <SwitchTransition>
1305
+ * <CSSTransition
1306
+ * key={state ? "Goodbye, world!" : "Hello, world!"}
1307
+ * addEndListener={(node, done) => node.addEventListener("transitionend", done, false)}
1308
+ * classNames='fade'
1309
+ * >
1310
+ * <button onClick={() => setState(state => !state)}>
1311
+ * {state ? "Goodbye, world!" : "Hello, world!"}
1312
+ * </button>
1313
+ * </CSSTransition>
1314
+ * </SwitchTransition>
1315
+ * );
1316
+ * }
1317
+ * ```
1318
+ *
1319
+ * ```css
1320
+ * .fade-enter{
1321
+ * opacity: 0;
1322
+ * }
1323
+ * .fade-exit{
1324
+ * opacity: 1;
1325
+ * }
1326
+ * .fade-enter-active{
1327
+ * opacity: 1;
1328
+ * }
1329
+ * .fade-exit-active{
1330
+ * opacity: 0;
1331
+ * }
1332
+ * .fade-enter-active,
1333
+ * .fade-exit-active{
1334
+ * transition: opacity 500ms;
1335
+ * }
1336
+ * ```
1337
+ */
1338
+
1339
+ var SwitchTransition = /*#__PURE__*/function (_React$Component) {
1340
+ _inheritsLoose(SwitchTransition, _React$Component);
1341
+
1342
+ function SwitchTransition() {
1343
+ var _this;
1344
+
1345
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1346
+ args[_key] = arguments[_key];
1347
+ }
1348
+
1349
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
1350
+ _this.state = {
1351
+ status: ENTERED,
1352
+ current: null
1353
+ };
1354
+ _this.appeared = false;
1355
+
1356
+ _this.changeState = function (status, current) {
1357
+ if (current === void 0) {
1358
+ current = _this.state.current;
1359
+ }
1360
+
1361
+ _this.setState({
1362
+ status: status,
1363
+ current: current
1364
+ });
1365
+ };
1366
+
1367
+ return _this;
1368
+ }
1369
+
1370
+ var _proto = SwitchTransition.prototype;
1371
+
1372
+ _proto.componentDidMount = function componentDidMount() {
1373
+ this.appeared = true;
1374
+ };
1375
+
1376
+ SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
1377
+ if (props.children == null) {
1378
+ return {
1379
+ current: null
1380
+ };
1381
+ }
1382
+
1383
+ if (state.status === ENTERING && props.mode === modes.in) {
1384
+ return {
1385
+ status: ENTERING
1386
+ };
1387
+ }
1388
+
1389
+ if (state.current && areChildrenDifferent(state.current, props.children)) {
1390
+ return {
1391
+ status: EXITING
1392
+ };
1393
+ }
1394
+
1395
+ return {
1396
+ current: React__default["default"].cloneElement(props.children, {
1397
+ in: true
1398
+ })
1399
+ };
1400
+ };
1401
+
1402
+ _proto.render = function render() {
1403
+ var _this$props = this.props,
1404
+ children = _this$props.children,
1405
+ mode = _this$props.mode,
1406
+ _this$state = this.state,
1407
+ status = _this$state.status,
1408
+ current = _this$state.current;
1409
+ var data = {
1410
+ children: children,
1411
+ current: current,
1412
+ changeState: this.changeState,
1413
+ status: status
1414
+ };
1415
+ var component;
1416
+
1417
+ switch (status) {
1418
+ case ENTERING:
1419
+ component = enterRenders[mode](data);
1420
+ break;
1421
+
1422
+ case EXITING:
1423
+ component = leaveRenders[mode](data);
1424
+ break;
1425
+
1426
+ case ENTERED:
1427
+ component = current;
1428
+ }
1429
+
1430
+ return /*#__PURE__*/React__default["default"].createElement(TransitionGroupContext.Provider, {
1431
+ value: {
1432
+ isMounting: !this.appeared
1433
+ }
1434
+ }, component);
1435
+ };
1436
+
1437
+ return SwitchTransition;
1438
+ }(React__default["default"].Component);
1439
+
1440
+ SwitchTransition.propTypes = {};
1441
+ SwitchTransition.defaultProps = {
1442
+ mode: modes.out
1443
+ };
1444
+
1445
+ var _excluded = ["children"];
1446
+ var Portal$1 = function Portal(_ref, ref) {
1447
+ var children = _ref.children,
1448
+ otherProps = objectWithoutProperties._objectWithoutProperties(_ref, _excluded);
1449
+ return /*#__PURE__*/React__default["default"].createElement("div", _extends$1._extends({
1450
+ "data-cy": "neeto-backdrop",
1451
+ "data-testid": "neeto-backdrop",
1452
+ ref: ref
1453
+ }, otherProps), children);
1454
+ };
1455
+ var Backdrop = /*#__PURE__*/React.forwardRef(Portal$1);
1456
+
1457
+ var Portal = function Portal(_ref) {
1458
+ var children = _ref.children,
1459
+ _ref$rootId = _ref.rootId,
1460
+ rootId = _ref$rootId === void 0 ? "root-portal" : _ref$rootId,
1461
+ _ref$el = _ref.el,
1462
+ el = _ref$el === void 0 ? "div" : _ref$el;
1463
+ var target = React.useRef(null);
1464
+ React.useEffect(function () {
1465
+ var container = document.getElementById(rootId);
1466
+ if (!container) {
1467
+ container = document.createElement(el);
1468
+ container.setAttribute("id", rootId);
1469
+ document.body.appendChild(container);
1470
+ }
1471
+ container.appendChild(target.current);
1472
+ return function () {
1473
+ target.current.remove();
1474
+ if (ramda.isEmpty(container.childNodes)) {
1475
+ container.remove();
1476
+ }
1477
+ };
1478
+ }, [rootId]);
1479
+ if (!target.current) {
1480
+ target.current = document.createElement(el);
1481
+ }
1482
+ return /*#__PURE__*/ReactDOM.createPortal(children, target.current);
1483
+ };
1484
+
1485
+ var useOnClickOutside = function useOnClickOutside(insideRef, outsideRef, handler) {
1486
+ React.useEffect(function () {
1487
+ var listener = function listener(event) {
1488
+ // Do nothing if clicking ref's element or descendent elements
1489
+ if (!insideRef.current || insideRef.current.contains(event.target)) {
1490
+ return;
1491
+ }
1492
+ if (outsideRef.current) {
1493
+ // If Outside ref exists, trigger the handler if it contains the event target.
1494
+ if (outsideRef.current.contains(event.target)) {
1495
+ handler(event);
1496
+ }
1497
+ return;
1498
+ }
1499
+ handler(event);
1500
+ };
1501
+ document.addEventListener("mousedown", listener);
1502
+ document.addEventListener("touchstart", listener);
1503
+ return function () {
1504
+ document.removeEventListener("mousedown", listener);
1505
+ document.removeEventListener("touchstart", listener);
1506
+ };
1507
+ }, [insideRef, outsideRef, handler]);
1508
+ };
1509
+
1510
+ var useOverlay = function useOverlay(_ref) {
1511
+ var isOpen = _ref.isOpen,
1512
+ initialFocusRef = _ref.initialFocusRef,
1513
+ finalFocusRef = _ref.finalFocusRef,
1514
+ overlayWrapper = _ref.overlayWrapper,
1515
+ onClose = _ref.onClose,
1516
+ backdropRef = _ref.backdropRef,
1517
+ closeOnOutsideClick = _ref.closeOnOutsideClick,
1518
+ closeOnEsc = _ref.closeOnEsc,
1519
+ blockScrollOnMount = _ref.blockScrollOnMount,
1520
+ hasTransitionCompleted = _ref.hasTransitionCompleted;
1521
+ var elementToFocusRef = React.useRef(null);
1522
+ var bodyHeight = document.body.offsetHeight;
1523
+ var windowHeight = window.innerHeight;
1524
+ var hasScroll = bodyHeight > windowHeight;
1525
+ var shouldHideScrollAndAddMargin = hasScroll && blockScrollOnMount && overlayManager.manager.hasOverlays();
1526
+ var returnFocusToPreviousActiveElement = function returnFocusToPreviousActiveElement() {
1527
+ elementToFocusRef.current = overlayManager.manager.getFinalFocusInOverlay();
1528
+ if (!(finalFocusRef !== null && finalFocusRef !== void 0 && finalFocusRef.current)) {
1529
+ var _elementToFocusRef$cu;
1530
+ elementToFocusRef === null || elementToFocusRef === void 0 || (_elementToFocusRef$cu = elementToFocusRef.current) === null || _elementToFocusRef$cu === void 0 || _elementToFocusRef$cu.focus();
1531
+ } else {
1532
+ finalFocusRef.current.focus();
1533
+ }
1534
+ };
1535
+ var focusRequiredElementInOverlay = function focusRequiredElementInOverlay() {
1536
+ var _initialFocusRef;
1537
+ if (!hasTransitionCompleted) return;
1538
+ if ((_initialFocusRef = initialFocusRef) !== null && _initialFocusRef !== void 0 && _initialFocusRef.current) {
1539
+ var _initialFocusRef2;
1540
+ (_initialFocusRef2 = initialFocusRef) === null || _initialFocusRef2 === void 0 || (_initialFocusRef2 = _initialFocusRef2.current) === null || _initialFocusRef2 === void 0 || _initialFocusRef2.focus();
1541
+ } else {
1542
+ index$1.focusFirstFocusableElement(overlayWrapper);
1543
+ }
1544
+ };
1545
+ var handleOverlayClose = React.useCallback(function () {
1546
+ if (!overlayManager.manager.isTopOverlay(overlayWrapper)) return;
1547
+ returnFocusToPreviousActiveElement();
1548
+ onClose === null || onClose === void 0 || onClose();
1549
+ }, [onClose]);
1550
+ useOnClickOutside(overlayWrapper, backdropRef, closeOnOutsideClick ? handleOverlayClose : index$1.noop);
1551
+ var isTopOverlay = React.useSyncExternalStore(overlayManager.manager.subscribe, function () {
1552
+ return overlayManager.manager.isTopOverlay(overlayWrapper);
1553
+ });
1554
+ index.useHotKeys("escape", handleOverlayClose, {
1555
+ enabled: closeOnEsc
1556
+ });
1557
+ React.useEffect(function () {
1558
+ var cleanUp = index$1.noop;
1559
+ if (isOpen) {
1560
+ if (hasTransitionCompleted && isTopOverlay) {
1561
+ focusRequiredElementInOverlay();
1562
+ // Enable focus trap only for the topmost overlay
1563
+ cleanUp = index$1.trapFocusOnFocusableElements(overlayWrapper);
1564
+ }
1565
+ if (shouldHideScrollAndAddMargin) index$1.hideScrollAndAddMargin();
1566
+ }
1567
+ return function () {
1568
+ if (!overlayManager.manager.hasOverlays()) index$1.showScrollAndRemoveMargin();
1569
+ cleanUp();
1570
+ };
1571
+ }, [isOpen, hasTransitionCompleted, isTopOverlay]);
1572
+ var setFocusField = function setFocusField(fieldRef) {
1573
+ if (!fieldRef) return;
1574
+ initialFocusRef = {
1575
+ current: fieldRef
1576
+ };
1577
+ if (hasTransitionCompleted) focusRequiredElementInOverlay();
1578
+ };
1579
+ return {
1580
+ handleOverlayClose: handleOverlayClose,
1581
+ setFocusField: setFocusField
1582
+ };
1583
+ };
1584
+
1585
+ var useOverlayManager = function useOverlayManager(ref, isOpen) {
1586
+ var elementToFocus = document.activeElement;
1587
+ React.useEffect(function () {
1588
+ if (isOpen) {
1589
+ overlayManager.manager.add(ref, elementToFocus);
1590
+ }
1591
+ return function () {
1592
+ overlayManager.manager.remove(ref, elementToFocus);
1593
+ };
1594
+ }, [isOpen, ref]);
1595
+ };
1596
+
1597
+ exports.Backdrop = Backdrop;
1598
+ exports.CSSTransition = CSSTransition;
1599
+ exports.Portal = Portal;
1600
+ exports.useOverlay = useOverlay;
1601
+ exports.useOverlayManager = useOverlayManager;
1602
+ //# sourceMappingURL=useOverlayManager-359ed795.js.map