@vchasno/ui-kit 0.3.34 → 0.4.0

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 (809) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +33 -43
  3. package/dist/{Datepicker/types/components → components}/Alert/Alert.d.ts +5 -4
  4. package/dist/components/Alert/Alert.js +2 -0
  5. package/dist/components/Alert/Alert.js.map +1 -0
  6. package/dist/components/BlackTooltip/BlackTooltip.d.ts +10 -0
  7. package/dist/components/BlackTooltip/BlackTooltip.js +2 -0
  8. package/dist/components/BlackTooltip/BlackTooltip.js.map +1 -0
  9. package/dist/{ProjectsPopover/types/components → components}/BubbleBox/BubbleBox.d.ts +4 -3
  10. package/dist/components/BubbleBox/BubbleBox.js +2 -0
  11. package/dist/components/BubbleBox/BubbleBox.js.map +1 -0
  12. package/dist/components/BubbleBox/utils.d.ts +3 -0
  13. package/dist/components/BubbleBox/utils.js +2 -0
  14. package/dist/components/BubbleBox/utils.js.map +1 -0
  15. package/dist/components/Button/Button.d.ts +13 -0
  16. package/dist/components/Button/Button.js +2 -0
  17. package/dist/components/Button/Button.js.map +1 -0
  18. package/dist/{Menu/types/components → components}/Checkbox/Checkbox.d.ts +5 -4
  19. package/dist/components/Checkbox/Checkbox.js +2 -0
  20. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  21. package/dist/{Menu/types/components → components}/Datepicker/DatePicker.d.ts +6 -5
  22. package/dist/components/Datepicker/DatePicker.js +2 -0
  23. package/dist/components/Datepicker/DatePicker.js.map +1 -0
  24. package/dist/{Datepicker/types/components → components}/FlexBox/FlexBox.d.ts +5 -4
  25. package/dist/components/FlexBox/FlexBox.js +2 -0
  26. package/dist/components/FlexBox/FlexBox.js.map +1 -0
  27. package/dist/{ProjectsPopover/types/components → components}/FollowUs/FollowUs.d.ts +6 -5
  28. package/dist/components/FollowUs/FollowUs.js +2 -0
  29. package/dist/components/FollowUs/FollowUs.js.map +1 -0
  30. package/dist/components/FollowUs/config.d.ts +5 -0
  31. package/dist/components/FollowUs/config.js +2 -0
  32. package/dist/components/FollowUs/config.js.map +1 -0
  33. package/dist/components/FollowUs/images/fb.png.js +2 -0
  34. package/dist/components/FollowUs/images/fb.png.js.map +1 -0
  35. package/dist/components/FollowUs/images/instagram.png.js +2 -0
  36. package/dist/components/FollowUs/images/instagram.png.js.map +1 -0
  37. package/dist/components/FollowUs/images/telegram.png.js +2 -0
  38. package/dist/components/FollowUs/images/telegram.png.js.map +1 -0
  39. package/dist/components/FollowUs/images/tiktok.png.js +2 -0
  40. package/dist/components/FollowUs/images/tiktok.png.js.map +1 -0
  41. package/dist/components/FollowUs/images/youtube.png.js +2 -0
  42. package/dist/components/FollowUs/images/youtube.png.js.map +1 -0
  43. package/dist/components/FollowUs/types.d.ts +3 -0
  44. package/dist/{Menu/types/components → components}/Input/Input.d.ts +6 -5
  45. package/dist/components/Input/Input.js +2 -0
  46. package/dist/components/Input/Input.js.map +1 -0
  47. package/dist/components/InputMeta/InputMeta.d.ts +9 -0
  48. package/dist/components/InputMeta/InputMeta.js +2 -0
  49. package/dist/components/InputMeta/InputMeta.js.map +1 -0
  50. package/dist/{ProjectsPopover/types/components → components}/LabelText/LabelText.d.ts +4 -3
  51. package/dist/components/LabelText/LabelText.js +2 -0
  52. package/dist/components/LabelText/LabelText.js.map +1 -0
  53. package/dist/{ProjectsPopover/types/components → components}/MaskInput/MaskInput.d.ts +6 -5
  54. package/dist/components/MaskInput/MaskInput.js +2 -0
  55. package/dist/components/MaskInput/MaskInput.js.map +1 -0
  56. package/dist/{Menu/index.d.ts → components/Menu/Menu.d.ts} +4 -9
  57. package/dist/components/Menu/Menu.js +2 -0
  58. package/dist/components/Menu/Menu.js.map +1 -0
  59. package/dist/components/MenuButton/MenuButton.d.ts +8 -0
  60. package/dist/components/MenuButton/MenuButton.js +2 -0
  61. package/dist/components/MenuButton/MenuButton.js.map +1 -0
  62. package/dist/components/MenuItem/MenuItem.d.ts +8 -0
  63. package/dist/components/MenuItem/MenuItem.js +2 -0
  64. package/dist/components/MenuItem/MenuItem.js.map +1 -0
  65. package/dist/{Datepicker/types/components → components}/MobileAppLinks/MobileAppLinks.d.ts +7 -6
  66. package/dist/components/MobileAppLinks/MobileAppLinks.js +2 -0
  67. package/dist/components/MobileAppLinks/MobileAppLinks.js.map +1 -0
  68. package/dist/components/MobileAppLinks/config.d.ts +5 -0
  69. package/dist/components/MobileAppLinks/config.js +2 -0
  70. package/dist/components/MobileAppLinks/config.js.map +1 -0
  71. package/dist/components/MobileAppLinks/images/apple.png.js +2 -0
  72. package/dist/components/MobileAppLinks/images/apple.png.js.map +1 -0
  73. package/dist/components/MobileAppLinks/images/google.png.js +2 -0
  74. package/dist/components/MobileAppLinks/images/google.png.js.map +1 -0
  75. package/dist/components/MobileAppLinks/types.d.ts +6 -0
  76. package/dist/{Menu/types/components → components}/Pagination/Pagination.d.ts +4 -3
  77. package/dist/components/Pagination/Pagination.js +2 -0
  78. package/dist/components/Pagination/Pagination.js.map +1 -0
  79. package/dist/components/Pagination/utils.js +2 -0
  80. package/dist/components/Pagination/utils.js.map +1 -0
  81. package/dist/components/Paragraph/Paragraph.d.ts +11 -0
  82. package/dist/components/Paragraph/Paragraph.js +2 -0
  83. package/dist/components/Paragraph/Paragraph.js.map +1 -0
  84. package/dist/{Datepicker/types/components → components}/ProjectsPopover/ProductLink.d.ts +5 -4
  85. package/dist/components/ProjectsPopover/ProductLink.js +2 -0
  86. package/dist/components/ProjectsPopover/ProductLink.js.map +1 -0
  87. package/dist/components/ProjectsPopover/ProjectsPopover.d.ts +14 -0
  88. package/dist/components/ProjectsPopover/ProjectsPopover.js +2 -0
  89. package/dist/components/ProjectsPopover/ProjectsPopover.js.map +1 -0
  90. package/dist/components/ProjectsPopover/mappers.js +2 -0
  91. package/dist/components/ProjectsPopover/mappers.js.map +1 -0
  92. package/dist/components/ProjectsPopover/types.d.ts +7 -0
  93. package/dist/components/ProjectsPopover/types.js +2 -0
  94. package/dist/components/ProjectsPopover/types.js.map +1 -0
  95. package/dist/components/ProjectsPopover/utils.js +2 -0
  96. package/dist/components/ProjectsPopover/utils.js.map +1 -0
  97. package/dist/{ProjectsPopover/types/components → components}/PulseDot/PulseDot.d.ts +4 -3
  98. package/dist/components/PulseDot/PulseDot.js +2 -0
  99. package/dist/components/PulseDot/PulseDot.js.map +1 -0
  100. package/dist/components/Select/Label.js +2 -0
  101. package/dist/components/Select/Label.js.map +1 -0
  102. package/dist/components/Select/Select.d.ts +12 -0
  103. package/dist/components/Select/Select.js +2 -0
  104. package/dist/components/Select/Select.js.map +1 -0
  105. package/dist/components/Select/SelectCreatable.d.ts +13 -0
  106. package/dist/components/Select/SelectCreatable.js +2 -0
  107. package/dist/components/Select/SelectCreatable.js.map +1 -0
  108. package/dist/components/Select/customComponents.js +2 -0
  109. package/dist/components/Select/customComponents.js.map +1 -0
  110. package/dist/components/Select/defaultProps.js +2 -0
  111. package/dist/components/Select/defaultProps.js.map +1 -0
  112. package/dist/components/Select/types.d.ts +6 -0
  113. package/dist/components/Select/utils.js +2 -0
  114. package/dist/components/Select/utils.js.map +1 -0
  115. package/dist/components/Snackbar/ActionButton.d.ts +5 -0
  116. package/dist/components/Snackbar/ActionButton.js +2 -0
  117. package/dist/components/Snackbar/ActionButton.js.map +1 -0
  118. package/dist/{Snackbar/index.d.ts → components/Snackbar/Snackbar.d.ts} +1 -4
  119. package/dist/components/Snackbar/Snackbar.js +2 -0
  120. package/dist/components/Snackbar/Snackbar.js.map +1 -0
  121. package/dist/components/Snackbar/WithAction.js +2 -0
  122. package/dist/components/Snackbar/WithAction.js.map +1 -0
  123. package/dist/{ProjectsPopover/types/components → components}/Spinner/Spinner.d.ts +4 -3
  124. package/dist/components/Spinner/Spinner.js +2 -0
  125. package/dist/components/Spinner/Spinner.js.map +1 -0
  126. package/dist/{ProjectsPopover/types/components → components}/SplashLogo/SplashLogo.d.ts +4 -3
  127. package/dist/components/SplashLogo/SplashLogo.js +2 -0
  128. package/dist/components/SplashLogo/SplashLogo.js.map +1 -0
  129. package/dist/components/SplashLogo/dataUrls.js +2 -0
  130. package/dist/components/SplashLogo/dataUrls.js.map +1 -0
  131. package/dist/{Datepicker/types/components → components}/SvgBorder/SvgBorder.d.ts +4 -3
  132. package/dist/components/SvgBorder/SvgBorder.js +2 -0
  133. package/dist/components/SvgBorder/SvgBorder.js.map +1 -0
  134. package/dist/components/SvgBorder/utils.d.ts +3 -0
  135. package/dist/components/SvgBorder/utils.js +2 -0
  136. package/dist/components/SvgBorder/utils.js.map +1 -0
  137. package/dist/{Menu/types/components → components}/Switch/Switch.d.ts +5 -4
  138. package/dist/components/Switch/Switch.js +2 -0
  139. package/dist/components/Switch/Switch.js.map +1 -0
  140. package/dist/{ProjectsPopover/types/components → components}/Tabs/Tabs.d.ts +5 -4
  141. package/dist/components/Tabs/Tabs.js +2 -0
  142. package/dist/components/Tabs/Tabs.js.map +1 -0
  143. package/dist/{Datepicker/types/components → components}/Text/Text.d.ts +5 -4
  144. package/dist/components/Text/Text.js +2 -0
  145. package/dist/components/Text/Text.js.map +1 -0
  146. package/dist/{Datepicker/types/components → components}/TextAreaInput/TextAreaInput.d.ts +6 -5
  147. package/dist/components/TextAreaInput/TextAreaInput.js +2 -0
  148. package/dist/components/TextAreaInput/TextAreaInput.js.map +1 -0
  149. package/dist/components/TextInput/TextInput.d.ts +11 -0
  150. package/dist/components/TextInput/TextInput.js +2 -0
  151. package/dist/components/TextInput/TextInput.js.map +1 -0
  152. package/dist/components/Title/Title.d.ts +11 -0
  153. package/dist/components/Title/Title.js +2 -0
  154. package/dist/components/Title/Title.js.map +1 -0
  155. package/dist/{Datepicker/types/components → components}/types.d.ts +13 -11
  156. package/dist/css/_theme.css +2 -18
  157. package/dist/css/vchasno-ui.css +1 -0
  158. package/dist/{Datepicker/types/hooks → hooks}/useClientRect.d.ts +4 -1
  159. package/dist/hooks/useClientRect.js +2 -0
  160. package/dist/hooks/useClientRect.js.map +1 -0
  161. package/dist/index.d.ts +35 -319
  162. package/dist/index.js +1 -13396
  163. package/dist/index.js.map +1 -1
  164. package/dist/utils/react.js +2 -0
  165. package/dist/utils/react.js.map +1 -0
  166. package/package.json +12 -54
  167. package/dist/Datepicker/index.cjs.js +0 -15714
  168. package/dist/Datepicker/index.cjs.js.map +0 -1
  169. package/dist/Datepicker/index.d.ts +0 -41
  170. package/dist/Datepicker/index.js +0 -15694
  171. package/dist/Datepicker/index.js.map +0 -1
  172. package/dist/Datepicker/types/components/Alert/index.d.ts +0 -2
  173. package/dist/Datepicker/types/components/BlackTooltip/BlackTooltip.d.ts +0 -5
  174. package/dist/Datepicker/types/components/BlackTooltip/index.d.ts +0 -2
  175. package/dist/Datepicker/types/components/BubbleBox/BubbleBox.d.ts +0 -17
  176. package/dist/Datepicker/types/components/BubbleBox/index.d.ts +0 -3
  177. package/dist/Datepicker/types/components/BubbleBox/utils.d.ts +0 -1
  178. package/dist/Datepicker/types/components/Button/Button.d.ts +0 -12
  179. package/dist/Datepicker/types/components/Button/index.d.ts +0 -2
  180. package/dist/Datepicker/types/components/Checkbox/Checkbox.d.ts +0 -11
  181. package/dist/Datepicker/types/components/Checkbox/index.d.ts +0 -2
  182. package/dist/Datepicker/types/components/Datepicker/DatePicker.d.ts +0 -20
  183. package/dist/Datepicker/types/components/Datepicker/index.d.ts +0 -2
  184. package/dist/Datepicker/types/components/FlexBox/index.d.ts +0 -2
  185. package/dist/Datepicker/types/components/FollowUs/FollowUs.d.ts +0 -14
  186. package/dist/Datepicker/types/components/FollowUs/config.d.ts +0 -4
  187. package/dist/Datepicker/types/components/FollowUs/index.d.ts +0 -2
  188. package/dist/Datepicker/types/components/FollowUs/types.d.ts +0 -1
  189. package/dist/Datepicker/types/components/Input/Input.d.ts +0 -15
  190. package/dist/Datepicker/types/components/Input/index.d.ts +0 -2
  191. package/dist/Datepicker/types/components/InputMeta/InputMeta.d.ts +0 -8
  192. package/dist/Datepicker/types/components/InputMeta/index.d.ts +0 -2
  193. package/dist/Datepicker/types/components/LabelText/LabelText.d.ts +0 -8
  194. package/dist/Datepicker/types/components/LabelText/index.d.ts +0 -1
  195. package/dist/Datepicker/types/components/MaskInput/MaskInput.d.ts +0 -11
  196. package/dist/Datepicker/types/components/MaskInput/index.d.ts +0 -2
  197. package/dist/Datepicker/types/components/Menu/Menu.d.ts +0 -11
  198. package/dist/Datepicker/types/components/Menu/index.d.ts +0 -2
  199. package/dist/Datepicker/types/components/MenuButton/MenuButton.d.ts +0 -7
  200. package/dist/Datepicker/types/components/MenuButton/index.d.ts +0 -2
  201. package/dist/Datepicker/types/components/MenuItem/MenuItem.d.ts +0 -7
  202. package/dist/Datepicker/types/components/MenuItem/index.d.ts +0 -2
  203. package/dist/Datepicker/types/components/MobileAppLinks/config.d.ts +0 -4
  204. package/dist/Datepicker/types/components/MobileAppLinks/index.d.ts +0 -2
  205. package/dist/Datepicker/types/components/MobileAppLinks/types.d.ts +0 -4
  206. package/dist/Datepicker/types/components/Pagination/Pagination.d.ts +0 -16
  207. package/dist/Datepicker/types/components/Pagination/index.d.ts +0 -2
  208. package/dist/Datepicker/types/components/Pagination/utils.d.ts +0 -1
  209. package/dist/Datepicker/types/components/Paragraph/Paragraph.d.ts +0 -11
  210. package/dist/Datepicker/types/components/Paragraph/index.d.ts +0 -2
  211. package/dist/Datepicker/types/components/ProjectsPopover/ProjectsPopover.d.ts +0 -13
  212. package/dist/Datepicker/types/components/ProjectsPopover/index.d.ts +0 -2
  213. package/dist/Datepicker/types/components/ProjectsPopover/mappers.d.ts +0 -7
  214. package/dist/Datepicker/types/components/ProjectsPopover/types.d.ts +0 -8
  215. package/dist/Datepicker/types/components/ProjectsPopover/utils.d.ts +0 -11
  216. package/dist/Datepicker/types/components/PulseDot/PulseDot.d.ts +0 -22
  217. package/dist/Datepicker/types/components/PulseDot/index.d.ts +0 -2
  218. package/dist/Datepicker/types/components/Select/Label.d.ts +0 -6
  219. package/dist/Datepicker/types/components/Select/Select.d.ts +0 -39
  220. package/dist/Datepicker/types/components/Select/SelectCreatable.d.ts +0 -13
  221. package/dist/Datepicker/types/components/Select/customComponents.d.ts +0 -10
  222. package/dist/Datepicker/types/components/Select/defaultProps.d.ts +0 -6
  223. package/dist/Datepicker/types/components/Select/index.d.ts +0 -5
  224. package/dist/Datepicker/types/components/Select/types.d.ts +0 -9
  225. package/dist/Datepicker/types/components/Select/utils.d.ts +0 -2
  226. package/dist/Datepicker/types/components/Snackbar/ActionButton.d.ts +0 -6
  227. package/dist/Datepicker/types/components/Snackbar/Snackbar.d.ts +0 -15
  228. package/dist/Datepicker/types/components/Snackbar/WithAction.d.ts +0 -3
  229. package/dist/Datepicker/types/components/Snackbar/index.d.ts +0 -2
  230. package/dist/Datepicker/types/components/Spinner/Spinner.d.ts +0 -18
  231. package/dist/Datepicker/types/components/Spinner/index.d.ts +0 -2
  232. package/dist/Datepicker/types/components/SplashLogo/SplashLogo.d.ts +0 -12
  233. package/dist/Datepicker/types/components/SplashLogo/dataUrls.d.ts +0 -6
  234. package/dist/Datepicker/types/components/SplashLogo/index.d.ts +0 -2
  235. package/dist/Datepicker/types/components/SvgBorder/index.d.ts +0 -3
  236. package/dist/Datepicker/types/components/SvgBorder/utils.d.ts +0 -1
  237. package/dist/Datepicker/types/components/Switch/Switch.d.ts +0 -14
  238. package/dist/Datepicker/types/components/Switch/index.d.ts +0 -2
  239. package/dist/Datepicker/types/components/Tabs/Tabs.d.ts +0 -19
  240. package/dist/Datepicker/types/components/Tabs/index.d.ts +0 -2
  241. package/dist/Datepicker/types/components/Text/index.d.ts +0 -2
  242. package/dist/Datepicker/types/components/TextAreaInput/index.d.ts +0 -2
  243. package/dist/Datepicker/types/components/TextInput/TextInput.d.ts +0 -10
  244. package/dist/Datepicker/types/components/TextInput/index.d.ts +0 -2
  245. package/dist/Datepicker/types/components/Title/Title.d.ts +0 -11
  246. package/dist/Datepicker/types/components/Title/index.d.ts +0 -2
  247. package/dist/Datepicker/types/components/index.d.ts +0 -46
  248. package/dist/Datepicker/types/index.d.ts +0 -2
  249. package/dist/Datepicker/types/utils/react.d.ts +0 -6
  250. package/dist/Menu/index.cjs.js +0 -2970
  251. package/dist/Menu/index.cjs.js.map +0 -1
  252. package/dist/Menu/index.js +0 -2968
  253. package/dist/Menu/index.js.map +0 -1
  254. package/dist/Menu/types/components/Alert/Alert.d.ts +0 -20
  255. package/dist/Menu/types/components/Alert/index.d.ts +0 -2
  256. package/dist/Menu/types/components/BlackTooltip/BlackTooltip.d.ts +0 -5
  257. package/dist/Menu/types/components/BlackTooltip/index.d.ts +0 -2
  258. package/dist/Menu/types/components/BubbleBox/BubbleBox.d.ts +0 -17
  259. package/dist/Menu/types/components/BubbleBox/index.d.ts +0 -3
  260. package/dist/Menu/types/components/BubbleBox/utils.d.ts +0 -1
  261. package/dist/Menu/types/components/Button/Button.d.ts +0 -12
  262. package/dist/Menu/types/components/Button/index.d.ts +0 -2
  263. package/dist/Menu/types/components/Checkbox/index.d.ts +0 -2
  264. package/dist/Menu/types/components/Datepicker/index.d.ts +0 -2
  265. package/dist/Menu/types/components/FlexBox/FlexBox.d.ts +0 -16
  266. package/dist/Menu/types/components/FlexBox/index.d.ts +0 -2
  267. package/dist/Menu/types/components/FollowUs/FollowUs.d.ts +0 -14
  268. package/dist/Menu/types/components/FollowUs/config.d.ts +0 -4
  269. package/dist/Menu/types/components/FollowUs/index.d.ts +0 -2
  270. package/dist/Menu/types/components/FollowUs/types.d.ts +0 -1
  271. package/dist/Menu/types/components/Input/index.d.ts +0 -2
  272. package/dist/Menu/types/components/InputMeta/InputMeta.d.ts +0 -8
  273. package/dist/Menu/types/components/InputMeta/index.d.ts +0 -2
  274. package/dist/Menu/types/components/LabelText/LabelText.d.ts +0 -8
  275. package/dist/Menu/types/components/LabelText/index.d.ts +0 -1
  276. package/dist/Menu/types/components/MaskInput/MaskInput.d.ts +0 -11
  277. package/dist/Menu/types/components/MaskInput/index.d.ts +0 -2
  278. package/dist/Menu/types/components/Menu/Menu.d.ts +0 -11
  279. package/dist/Menu/types/components/Menu/index.d.ts +0 -2
  280. package/dist/Menu/types/components/MenuButton/MenuButton.d.ts +0 -7
  281. package/dist/Menu/types/components/MenuButton/index.d.ts +0 -2
  282. package/dist/Menu/types/components/MenuItem/MenuItem.d.ts +0 -7
  283. package/dist/Menu/types/components/MenuItem/index.d.ts +0 -2
  284. package/dist/Menu/types/components/MobileAppLinks/MobileAppLinks.d.ts +0 -16
  285. package/dist/Menu/types/components/MobileAppLinks/config.d.ts +0 -4
  286. package/dist/Menu/types/components/MobileAppLinks/index.d.ts +0 -2
  287. package/dist/Menu/types/components/MobileAppLinks/types.d.ts +0 -4
  288. package/dist/Menu/types/components/Pagination/index.d.ts +0 -2
  289. package/dist/Menu/types/components/Pagination/utils.d.ts +0 -1
  290. package/dist/Menu/types/components/Paragraph/Paragraph.d.ts +0 -11
  291. package/dist/Menu/types/components/Paragraph/index.d.ts +0 -2
  292. package/dist/Menu/types/components/ProjectsPopover/ProductLink.d.ts +0 -13
  293. package/dist/Menu/types/components/ProjectsPopover/ProjectsPopover.d.ts +0 -13
  294. package/dist/Menu/types/components/ProjectsPopover/index.d.ts +0 -2
  295. package/dist/Menu/types/components/ProjectsPopover/mappers.d.ts +0 -7
  296. package/dist/Menu/types/components/ProjectsPopover/types.d.ts +0 -8
  297. package/dist/Menu/types/components/ProjectsPopover/utils.d.ts +0 -11
  298. package/dist/Menu/types/components/PulseDot/PulseDot.d.ts +0 -22
  299. package/dist/Menu/types/components/PulseDot/index.d.ts +0 -2
  300. package/dist/Menu/types/components/Select/Label.d.ts +0 -6
  301. package/dist/Menu/types/components/Select/Select.d.ts +0 -39
  302. package/dist/Menu/types/components/Select/SelectCreatable.d.ts +0 -13
  303. package/dist/Menu/types/components/Select/customComponents.d.ts +0 -10
  304. package/dist/Menu/types/components/Select/defaultProps.d.ts +0 -6
  305. package/dist/Menu/types/components/Select/index.d.ts +0 -5
  306. package/dist/Menu/types/components/Select/types.d.ts +0 -9
  307. package/dist/Menu/types/components/Select/utils.d.ts +0 -2
  308. package/dist/Menu/types/components/Snackbar/ActionButton.d.ts +0 -6
  309. package/dist/Menu/types/components/Snackbar/Snackbar.d.ts +0 -15
  310. package/dist/Menu/types/components/Snackbar/WithAction.d.ts +0 -3
  311. package/dist/Menu/types/components/Snackbar/index.d.ts +0 -2
  312. package/dist/Menu/types/components/Spinner/Spinner.d.ts +0 -18
  313. package/dist/Menu/types/components/Spinner/index.d.ts +0 -2
  314. package/dist/Menu/types/components/SplashLogo/SplashLogo.d.ts +0 -12
  315. package/dist/Menu/types/components/SplashLogo/dataUrls.d.ts +0 -6
  316. package/dist/Menu/types/components/SplashLogo/index.d.ts +0 -2
  317. package/dist/Menu/types/components/SvgBorder/SvgBorder.d.ts +0 -18
  318. package/dist/Menu/types/components/SvgBorder/index.d.ts +0 -3
  319. package/dist/Menu/types/components/SvgBorder/utils.d.ts +0 -1
  320. package/dist/Menu/types/components/Switch/index.d.ts +0 -2
  321. package/dist/Menu/types/components/Tabs/Tabs.d.ts +0 -19
  322. package/dist/Menu/types/components/Tabs/index.d.ts +0 -2
  323. package/dist/Menu/types/components/Text/Text.d.ts +0 -14
  324. package/dist/Menu/types/components/Text/index.d.ts +0 -2
  325. package/dist/Menu/types/components/TextAreaInput/TextAreaInput.d.ts +0 -12
  326. package/dist/Menu/types/components/TextAreaInput/index.d.ts +0 -2
  327. package/dist/Menu/types/components/TextInput/TextInput.d.ts +0 -10
  328. package/dist/Menu/types/components/TextInput/index.d.ts +0 -2
  329. package/dist/Menu/types/components/Title/Title.d.ts +0 -11
  330. package/dist/Menu/types/components/Title/index.d.ts +0 -2
  331. package/dist/Menu/types/components/index.d.ts +0 -46
  332. package/dist/Menu/types/components/types.d.ts +0 -37
  333. package/dist/Menu/types/hooks/useClientRect.d.ts +0 -5
  334. package/dist/Menu/types/index.d.ts +0 -2
  335. package/dist/Menu/types/utils/react.d.ts +0 -6
  336. package/dist/ProjectsPopover/index.cjs.js +0 -12660
  337. package/dist/ProjectsPopover/index.cjs.js.map +0 -1
  338. package/dist/ProjectsPopover/index.d.ts +0 -28
  339. package/dist/ProjectsPopover/index.js +0 -12640
  340. package/dist/ProjectsPopover/index.js.map +0 -1
  341. package/dist/ProjectsPopover/types/components/Alert/Alert.d.ts +0 -20
  342. package/dist/ProjectsPopover/types/components/Alert/index.d.ts +0 -2
  343. package/dist/ProjectsPopover/types/components/BlackTooltip/BlackTooltip.d.ts +0 -5
  344. package/dist/ProjectsPopover/types/components/BlackTooltip/index.d.ts +0 -2
  345. package/dist/ProjectsPopover/types/components/BubbleBox/index.d.ts +0 -3
  346. package/dist/ProjectsPopover/types/components/BubbleBox/utils.d.ts +0 -1
  347. package/dist/ProjectsPopover/types/components/Button/Button.d.ts +0 -12
  348. package/dist/ProjectsPopover/types/components/Button/index.d.ts +0 -2
  349. package/dist/ProjectsPopover/types/components/Checkbox/Checkbox.d.ts +0 -11
  350. package/dist/ProjectsPopover/types/components/Checkbox/index.d.ts +0 -2
  351. package/dist/ProjectsPopover/types/components/Datepicker/DatePicker.d.ts +0 -20
  352. package/dist/ProjectsPopover/types/components/Datepicker/index.d.ts +0 -2
  353. package/dist/ProjectsPopover/types/components/FlexBox/FlexBox.d.ts +0 -16
  354. package/dist/ProjectsPopover/types/components/FlexBox/index.d.ts +0 -2
  355. package/dist/ProjectsPopover/types/components/FollowUs/config.d.ts +0 -4
  356. package/dist/ProjectsPopover/types/components/FollowUs/index.d.ts +0 -2
  357. package/dist/ProjectsPopover/types/components/FollowUs/types.d.ts +0 -1
  358. package/dist/ProjectsPopover/types/components/Input/Input.d.ts +0 -15
  359. package/dist/ProjectsPopover/types/components/Input/index.d.ts +0 -2
  360. package/dist/ProjectsPopover/types/components/InputMeta/InputMeta.d.ts +0 -8
  361. package/dist/ProjectsPopover/types/components/InputMeta/index.d.ts +0 -2
  362. package/dist/ProjectsPopover/types/components/LabelText/index.d.ts +0 -1
  363. package/dist/ProjectsPopover/types/components/MaskInput/index.d.ts +0 -2
  364. package/dist/ProjectsPopover/types/components/Menu/Menu.d.ts +0 -11
  365. package/dist/ProjectsPopover/types/components/Menu/index.d.ts +0 -2
  366. package/dist/ProjectsPopover/types/components/MenuButton/MenuButton.d.ts +0 -7
  367. package/dist/ProjectsPopover/types/components/MenuButton/index.d.ts +0 -2
  368. package/dist/ProjectsPopover/types/components/MenuItem/MenuItem.d.ts +0 -7
  369. package/dist/ProjectsPopover/types/components/MenuItem/index.d.ts +0 -2
  370. package/dist/ProjectsPopover/types/components/MobileAppLinks/MobileAppLinks.d.ts +0 -16
  371. package/dist/ProjectsPopover/types/components/MobileAppLinks/config.d.ts +0 -4
  372. package/dist/ProjectsPopover/types/components/MobileAppLinks/index.d.ts +0 -2
  373. package/dist/ProjectsPopover/types/components/MobileAppLinks/types.d.ts +0 -4
  374. package/dist/ProjectsPopover/types/components/Pagination/Pagination.d.ts +0 -16
  375. package/dist/ProjectsPopover/types/components/Pagination/index.d.ts +0 -2
  376. package/dist/ProjectsPopover/types/components/Pagination/utils.d.ts +0 -1
  377. package/dist/ProjectsPopover/types/components/Paragraph/Paragraph.d.ts +0 -11
  378. package/dist/ProjectsPopover/types/components/Paragraph/index.d.ts +0 -2
  379. package/dist/ProjectsPopover/types/components/ProjectsPopover/ProductLink.d.ts +0 -13
  380. package/dist/ProjectsPopover/types/components/ProjectsPopover/ProjectsPopover.d.ts +0 -13
  381. package/dist/ProjectsPopover/types/components/ProjectsPopover/index.d.ts +0 -2
  382. package/dist/ProjectsPopover/types/components/ProjectsPopover/mappers.d.ts +0 -7
  383. package/dist/ProjectsPopover/types/components/ProjectsPopover/types.d.ts +0 -8
  384. package/dist/ProjectsPopover/types/components/ProjectsPopover/utils.d.ts +0 -11
  385. package/dist/ProjectsPopover/types/components/PulseDot/index.d.ts +0 -2
  386. package/dist/ProjectsPopover/types/components/Select/Label.d.ts +0 -6
  387. package/dist/ProjectsPopover/types/components/Select/Select.d.ts +0 -39
  388. package/dist/ProjectsPopover/types/components/Select/SelectCreatable.d.ts +0 -13
  389. package/dist/ProjectsPopover/types/components/Select/customComponents.d.ts +0 -10
  390. package/dist/ProjectsPopover/types/components/Select/defaultProps.d.ts +0 -6
  391. package/dist/ProjectsPopover/types/components/Select/index.d.ts +0 -5
  392. package/dist/ProjectsPopover/types/components/Select/types.d.ts +0 -9
  393. package/dist/ProjectsPopover/types/components/Select/utils.d.ts +0 -2
  394. package/dist/ProjectsPopover/types/components/Snackbar/ActionButton.d.ts +0 -6
  395. package/dist/ProjectsPopover/types/components/Snackbar/Snackbar.d.ts +0 -15
  396. package/dist/ProjectsPopover/types/components/Snackbar/WithAction.d.ts +0 -3
  397. package/dist/ProjectsPopover/types/components/Snackbar/index.d.ts +0 -2
  398. package/dist/ProjectsPopover/types/components/Spinner/index.d.ts +0 -2
  399. package/dist/ProjectsPopover/types/components/SplashLogo/dataUrls.d.ts +0 -6
  400. package/dist/ProjectsPopover/types/components/SplashLogo/index.d.ts +0 -2
  401. package/dist/ProjectsPopover/types/components/SvgBorder/SvgBorder.d.ts +0 -18
  402. package/dist/ProjectsPopover/types/components/SvgBorder/index.d.ts +0 -3
  403. package/dist/ProjectsPopover/types/components/SvgBorder/utils.d.ts +0 -1
  404. package/dist/ProjectsPopover/types/components/Switch/Switch.d.ts +0 -14
  405. package/dist/ProjectsPopover/types/components/Switch/index.d.ts +0 -2
  406. package/dist/ProjectsPopover/types/components/Tabs/index.d.ts +0 -2
  407. package/dist/ProjectsPopover/types/components/Text/Text.d.ts +0 -14
  408. package/dist/ProjectsPopover/types/components/Text/index.d.ts +0 -2
  409. package/dist/ProjectsPopover/types/components/TextAreaInput/TextAreaInput.d.ts +0 -12
  410. package/dist/ProjectsPopover/types/components/TextAreaInput/index.d.ts +0 -2
  411. package/dist/ProjectsPopover/types/components/TextInput/TextInput.d.ts +0 -10
  412. package/dist/ProjectsPopover/types/components/TextInput/index.d.ts +0 -2
  413. package/dist/ProjectsPopover/types/components/Title/Title.d.ts +0 -11
  414. package/dist/ProjectsPopover/types/components/Title/index.d.ts +0 -2
  415. package/dist/ProjectsPopover/types/components/index.d.ts +0 -46
  416. package/dist/ProjectsPopover/types/components/types.d.ts +0 -37
  417. package/dist/ProjectsPopover/types/hooks/useClientRect.d.ts +0 -5
  418. package/dist/ProjectsPopover/types/index.d.ts +0 -2
  419. package/dist/ProjectsPopover/types/utils/react.d.ts +0 -6
  420. package/dist/Select/index.cjs.js +0 -7805
  421. package/dist/Select/index.cjs.js.map +0 -1
  422. package/dist/Select/index.d.ts +0 -73
  423. package/dist/Select/index.js +0 -7782
  424. package/dist/Select/index.js.map +0 -1
  425. package/dist/Select/types/components/Alert/Alert.d.ts +0 -20
  426. package/dist/Select/types/components/Alert/index.d.ts +0 -2
  427. package/dist/Select/types/components/BlackTooltip/BlackTooltip.d.ts +0 -5
  428. package/dist/Select/types/components/BlackTooltip/index.d.ts +0 -2
  429. package/dist/Select/types/components/BubbleBox/BubbleBox.d.ts +0 -17
  430. package/dist/Select/types/components/BubbleBox/index.d.ts +0 -3
  431. package/dist/Select/types/components/BubbleBox/utils.d.ts +0 -1
  432. package/dist/Select/types/components/Button/Button.d.ts +0 -12
  433. package/dist/Select/types/components/Button/index.d.ts +0 -2
  434. package/dist/Select/types/components/Checkbox/Checkbox.d.ts +0 -11
  435. package/dist/Select/types/components/Checkbox/index.d.ts +0 -2
  436. package/dist/Select/types/components/Datepicker/DatePicker.d.ts +0 -20
  437. package/dist/Select/types/components/Datepicker/index.d.ts +0 -2
  438. package/dist/Select/types/components/FlexBox/FlexBox.d.ts +0 -16
  439. package/dist/Select/types/components/FlexBox/index.d.ts +0 -2
  440. package/dist/Select/types/components/FollowUs/FollowUs.d.ts +0 -14
  441. package/dist/Select/types/components/FollowUs/config.d.ts +0 -4
  442. package/dist/Select/types/components/FollowUs/index.d.ts +0 -2
  443. package/dist/Select/types/components/FollowUs/types.d.ts +0 -1
  444. package/dist/Select/types/components/Input/Input.d.ts +0 -15
  445. package/dist/Select/types/components/Input/index.d.ts +0 -2
  446. package/dist/Select/types/components/InputMeta/InputMeta.d.ts +0 -8
  447. package/dist/Select/types/components/InputMeta/index.d.ts +0 -2
  448. package/dist/Select/types/components/LabelText/LabelText.d.ts +0 -8
  449. package/dist/Select/types/components/LabelText/index.d.ts +0 -1
  450. package/dist/Select/types/components/MaskInput/MaskInput.d.ts +0 -11
  451. package/dist/Select/types/components/MaskInput/index.d.ts +0 -2
  452. package/dist/Select/types/components/Menu/Menu.d.ts +0 -11
  453. package/dist/Select/types/components/Menu/index.d.ts +0 -2
  454. package/dist/Select/types/components/MenuButton/MenuButton.d.ts +0 -7
  455. package/dist/Select/types/components/MenuButton/index.d.ts +0 -2
  456. package/dist/Select/types/components/MenuItem/MenuItem.d.ts +0 -7
  457. package/dist/Select/types/components/MenuItem/index.d.ts +0 -2
  458. package/dist/Select/types/components/MobileAppLinks/MobileAppLinks.d.ts +0 -16
  459. package/dist/Select/types/components/MobileAppLinks/config.d.ts +0 -4
  460. package/dist/Select/types/components/MobileAppLinks/index.d.ts +0 -2
  461. package/dist/Select/types/components/MobileAppLinks/types.d.ts +0 -4
  462. package/dist/Select/types/components/Pagination/Pagination.d.ts +0 -16
  463. package/dist/Select/types/components/Pagination/index.d.ts +0 -2
  464. package/dist/Select/types/components/Pagination/utils.d.ts +0 -1
  465. package/dist/Select/types/components/Paragraph/Paragraph.d.ts +0 -11
  466. package/dist/Select/types/components/Paragraph/index.d.ts +0 -2
  467. package/dist/Select/types/components/ProjectsPopover/ProductLink.d.ts +0 -13
  468. package/dist/Select/types/components/ProjectsPopover/ProjectsPopover.d.ts +0 -13
  469. package/dist/Select/types/components/ProjectsPopover/index.d.ts +0 -2
  470. package/dist/Select/types/components/ProjectsPopover/mappers.d.ts +0 -7
  471. package/dist/Select/types/components/ProjectsPopover/types.d.ts +0 -8
  472. package/dist/Select/types/components/ProjectsPopover/utils.d.ts +0 -11
  473. package/dist/Select/types/components/PulseDot/PulseDot.d.ts +0 -22
  474. package/dist/Select/types/components/PulseDot/index.d.ts +0 -2
  475. package/dist/Select/types/components/Select/Label.d.ts +0 -6
  476. package/dist/Select/types/components/Select/Select.d.ts +0 -39
  477. package/dist/Select/types/components/Select/SelectCreatable.d.ts +0 -13
  478. package/dist/Select/types/components/Select/customComponents.d.ts +0 -10
  479. package/dist/Select/types/components/Select/defaultProps.d.ts +0 -6
  480. package/dist/Select/types/components/Select/index.d.ts +0 -5
  481. package/dist/Select/types/components/Select/types.d.ts +0 -9
  482. package/dist/Select/types/components/Select/utils.d.ts +0 -2
  483. package/dist/Select/types/components/Snackbar/ActionButton.d.ts +0 -6
  484. package/dist/Select/types/components/Snackbar/Snackbar.d.ts +0 -15
  485. package/dist/Select/types/components/Snackbar/WithAction.d.ts +0 -3
  486. package/dist/Select/types/components/Snackbar/index.d.ts +0 -2
  487. package/dist/Select/types/components/Spinner/Spinner.d.ts +0 -18
  488. package/dist/Select/types/components/Spinner/index.d.ts +0 -2
  489. package/dist/Select/types/components/SplashLogo/SplashLogo.d.ts +0 -12
  490. package/dist/Select/types/components/SplashLogo/dataUrls.d.ts +0 -6
  491. package/dist/Select/types/components/SplashLogo/index.d.ts +0 -2
  492. package/dist/Select/types/components/SvgBorder/SvgBorder.d.ts +0 -18
  493. package/dist/Select/types/components/SvgBorder/index.d.ts +0 -3
  494. package/dist/Select/types/components/SvgBorder/utils.d.ts +0 -1
  495. package/dist/Select/types/components/Switch/Switch.d.ts +0 -14
  496. package/dist/Select/types/components/Switch/index.d.ts +0 -2
  497. package/dist/Select/types/components/Tabs/Tabs.d.ts +0 -19
  498. package/dist/Select/types/components/Tabs/index.d.ts +0 -2
  499. package/dist/Select/types/components/Text/Text.d.ts +0 -14
  500. package/dist/Select/types/components/Text/index.d.ts +0 -2
  501. package/dist/Select/types/components/TextAreaInput/TextAreaInput.d.ts +0 -12
  502. package/dist/Select/types/components/TextAreaInput/index.d.ts +0 -2
  503. package/dist/Select/types/components/TextInput/TextInput.d.ts +0 -10
  504. package/dist/Select/types/components/TextInput/index.d.ts +0 -2
  505. package/dist/Select/types/components/Title/Title.d.ts +0 -11
  506. package/dist/Select/types/components/Title/index.d.ts +0 -2
  507. package/dist/Select/types/components/index.d.ts +0 -46
  508. package/dist/Select/types/components/types.d.ts +0 -37
  509. package/dist/Select/types/hooks/useClientRect.d.ts +0 -5
  510. package/dist/Select/types/index.d.ts +0 -2
  511. package/dist/Select/types/utils/react.d.ts +0 -6
  512. package/dist/SelectCreatable/index.cjs.js +0 -7890
  513. package/dist/SelectCreatable/index.cjs.js.map +0 -1
  514. package/dist/SelectCreatable/index.d.ts +0 -42
  515. package/dist/SelectCreatable/index.js +0 -7870
  516. package/dist/SelectCreatable/index.js.map +0 -1
  517. package/dist/SelectCreatable/types/components/Alert/Alert.d.ts +0 -20
  518. package/dist/SelectCreatable/types/components/Alert/index.d.ts +0 -2
  519. package/dist/SelectCreatable/types/components/BlackTooltip/BlackTooltip.d.ts +0 -5
  520. package/dist/SelectCreatable/types/components/BlackTooltip/index.d.ts +0 -2
  521. package/dist/SelectCreatable/types/components/BubbleBox/BubbleBox.d.ts +0 -17
  522. package/dist/SelectCreatable/types/components/BubbleBox/index.d.ts +0 -3
  523. package/dist/SelectCreatable/types/components/BubbleBox/utils.d.ts +0 -1
  524. package/dist/SelectCreatable/types/components/Button/Button.d.ts +0 -12
  525. package/dist/SelectCreatable/types/components/Button/index.d.ts +0 -2
  526. package/dist/SelectCreatable/types/components/Checkbox/Checkbox.d.ts +0 -11
  527. package/dist/SelectCreatable/types/components/Checkbox/index.d.ts +0 -2
  528. package/dist/SelectCreatable/types/components/Datepicker/DatePicker.d.ts +0 -20
  529. package/dist/SelectCreatable/types/components/Datepicker/index.d.ts +0 -2
  530. package/dist/SelectCreatable/types/components/FlexBox/FlexBox.d.ts +0 -16
  531. package/dist/SelectCreatable/types/components/FlexBox/index.d.ts +0 -2
  532. package/dist/SelectCreatable/types/components/FollowUs/FollowUs.d.ts +0 -14
  533. package/dist/SelectCreatable/types/components/FollowUs/config.d.ts +0 -4
  534. package/dist/SelectCreatable/types/components/FollowUs/index.d.ts +0 -2
  535. package/dist/SelectCreatable/types/components/FollowUs/types.d.ts +0 -1
  536. package/dist/SelectCreatable/types/components/Input/Input.d.ts +0 -15
  537. package/dist/SelectCreatable/types/components/Input/index.d.ts +0 -2
  538. package/dist/SelectCreatable/types/components/InputMeta/InputMeta.d.ts +0 -8
  539. package/dist/SelectCreatable/types/components/InputMeta/index.d.ts +0 -2
  540. package/dist/SelectCreatable/types/components/LabelText/LabelText.d.ts +0 -8
  541. package/dist/SelectCreatable/types/components/LabelText/index.d.ts +0 -1
  542. package/dist/SelectCreatable/types/components/MaskInput/MaskInput.d.ts +0 -11
  543. package/dist/SelectCreatable/types/components/MaskInput/index.d.ts +0 -2
  544. package/dist/SelectCreatable/types/components/Menu/Menu.d.ts +0 -11
  545. package/dist/SelectCreatable/types/components/Menu/index.d.ts +0 -2
  546. package/dist/SelectCreatable/types/components/MenuButton/MenuButton.d.ts +0 -7
  547. package/dist/SelectCreatable/types/components/MenuButton/index.d.ts +0 -2
  548. package/dist/SelectCreatable/types/components/MenuItem/MenuItem.d.ts +0 -7
  549. package/dist/SelectCreatable/types/components/MenuItem/index.d.ts +0 -2
  550. package/dist/SelectCreatable/types/components/MobileAppLinks/MobileAppLinks.d.ts +0 -16
  551. package/dist/SelectCreatable/types/components/MobileAppLinks/config.d.ts +0 -4
  552. package/dist/SelectCreatable/types/components/MobileAppLinks/index.d.ts +0 -2
  553. package/dist/SelectCreatable/types/components/MobileAppLinks/types.d.ts +0 -4
  554. package/dist/SelectCreatable/types/components/Pagination/Pagination.d.ts +0 -16
  555. package/dist/SelectCreatable/types/components/Pagination/index.d.ts +0 -2
  556. package/dist/SelectCreatable/types/components/Pagination/utils.d.ts +0 -1
  557. package/dist/SelectCreatable/types/components/Paragraph/Paragraph.d.ts +0 -11
  558. package/dist/SelectCreatable/types/components/Paragraph/index.d.ts +0 -2
  559. package/dist/SelectCreatable/types/components/ProjectsPopover/ProductLink.d.ts +0 -13
  560. package/dist/SelectCreatable/types/components/ProjectsPopover/ProjectsPopover.d.ts +0 -13
  561. package/dist/SelectCreatable/types/components/ProjectsPopover/index.d.ts +0 -2
  562. package/dist/SelectCreatable/types/components/ProjectsPopover/mappers.d.ts +0 -7
  563. package/dist/SelectCreatable/types/components/ProjectsPopover/types.d.ts +0 -8
  564. package/dist/SelectCreatable/types/components/ProjectsPopover/utils.d.ts +0 -11
  565. package/dist/SelectCreatable/types/components/PulseDot/PulseDot.d.ts +0 -22
  566. package/dist/SelectCreatable/types/components/PulseDot/index.d.ts +0 -2
  567. package/dist/SelectCreatable/types/components/Select/Label.d.ts +0 -6
  568. package/dist/SelectCreatable/types/components/Select/Select.d.ts +0 -39
  569. package/dist/SelectCreatable/types/components/Select/SelectCreatable.d.ts +0 -13
  570. package/dist/SelectCreatable/types/components/Select/customComponents.d.ts +0 -10
  571. package/dist/SelectCreatable/types/components/Select/defaultProps.d.ts +0 -6
  572. package/dist/SelectCreatable/types/components/Select/index.d.ts +0 -5
  573. package/dist/SelectCreatable/types/components/Select/types.d.ts +0 -9
  574. package/dist/SelectCreatable/types/components/Select/utils.d.ts +0 -2
  575. package/dist/SelectCreatable/types/components/Snackbar/ActionButton.d.ts +0 -6
  576. package/dist/SelectCreatable/types/components/Snackbar/Snackbar.d.ts +0 -15
  577. package/dist/SelectCreatable/types/components/Snackbar/WithAction.d.ts +0 -3
  578. package/dist/SelectCreatable/types/components/Snackbar/index.d.ts +0 -2
  579. package/dist/SelectCreatable/types/components/Spinner/Spinner.d.ts +0 -18
  580. package/dist/SelectCreatable/types/components/Spinner/index.d.ts +0 -2
  581. package/dist/SelectCreatable/types/components/SplashLogo/SplashLogo.d.ts +0 -12
  582. package/dist/SelectCreatable/types/components/SplashLogo/dataUrls.d.ts +0 -6
  583. package/dist/SelectCreatable/types/components/SplashLogo/index.d.ts +0 -2
  584. package/dist/SelectCreatable/types/components/SvgBorder/SvgBorder.d.ts +0 -18
  585. package/dist/SelectCreatable/types/components/SvgBorder/index.d.ts +0 -3
  586. package/dist/SelectCreatable/types/components/SvgBorder/utils.d.ts +0 -1
  587. package/dist/SelectCreatable/types/components/Switch/Switch.d.ts +0 -14
  588. package/dist/SelectCreatable/types/components/Switch/index.d.ts +0 -2
  589. package/dist/SelectCreatable/types/components/Tabs/Tabs.d.ts +0 -19
  590. package/dist/SelectCreatable/types/components/Tabs/index.d.ts +0 -2
  591. package/dist/SelectCreatable/types/components/Text/Text.d.ts +0 -14
  592. package/dist/SelectCreatable/types/components/Text/index.d.ts +0 -2
  593. package/dist/SelectCreatable/types/components/TextAreaInput/TextAreaInput.d.ts +0 -12
  594. package/dist/SelectCreatable/types/components/TextAreaInput/index.d.ts +0 -2
  595. package/dist/SelectCreatable/types/components/TextInput/TextInput.d.ts +0 -10
  596. package/dist/SelectCreatable/types/components/TextInput/index.d.ts +0 -2
  597. package/dist/SelectCreatable/types/components/Title/Title.d.ts +0 -11
  598. package/dist/SelectCreatable/types/components/Title/index.d.ts +0 -2
  599. package/dist/SelectCreatable/types/components/index.d.ts +0 -46
  600. package/dist/SelectCreatable/types/components/types.d.ts +0 -37
  601. package/dist/SelectCreatable/types/hooks/useClientRect.d.ts +0 -5
  602. package/dist/SelectCreatable/types/index.d.ts +0 -2
  603. package/dist/SelectCreatable/types/utils/react.d.ts +0 -6
  604. package/dist/Snackbar/index.cjs.js +0 -13109
  605. package/dist/Snackbar/index.cjs.js.map +0 -1
  606. package/dist/Snackbar/index.js +0 -13086
  607. package/dist/Snackbar/index.js.map +0 -1
  608. package/dist/Snackbar/types/components/Alert/Alert.d.ts +0 -20
  609. package/dist/Snackbar/types/components/Alert/index.d.ts +0 -2
  610. package/dist/Snackbar/types/components/BlackTooltip/BlackTooltip.d.ts +0 -5
  611. package/dist/Snackbar/types/components/BlackTooltip/index.d.ts +0 -2
  612. package/dist/Snackbar/types/components/BubbleBox/BubbleBox.d.ts +0 -17
  613. package/dist/Snackbar/types/components/BubbleBox/index.d.ts +0 -3
  614. package/dist/Snackbar/types/components/BubbleBox/utils.d.ts +0 -1
  615. package/dist/Snackbar/types/components/Button/Button.d.ts +0 -12
  616. package/dist/Snackbar/types/components/Button/index.d.ts +0 -2
  617. package/dist/Snackbar/types/components/Checkbox/Checkbox.d.ts +0 -11
  618. package/dist/Snackbar/types/components/Checkbox/index.d.ts +0 -2
  619. package/dist/Snackbar/types/components/Datepicker/DatePicker.d.ts +0 -20
  620. package/dist/Snackbar/types/components/Datepicker/index.d.ts +0 -2
  621. package/dist/Snackbar/types/components/FlexBox/FlexBox.d.ts +0 -16
  622. package/dist/Snackbar/types/components/FlexBox/index.d.ts +0 -2
  623. package/dist/Snackbar/types/components/FollowUs/FollowUs.d.ts +0 -14
  624. package/dist/Snackbar/types/components/FollowUs/config.d.ts +0 -4
  625. package/dist/Snackbar/types/components/FollowUs/index.d.ts +0 -2
  626. package/dist/Snackbar/types/components/FollowUs/types.d.ts +0 -1
  627. package/dist/Snackbar/types/components/Input/Input.d.ts +0 -15
  628. package/dist/Snackbar/types/components/Input/index.d.ts +0 -2
  629. package/dist/Snackbar/types/components/InputMeta/InputMeta.d.ts +0 -8
  630. package/dist/Snackbar/types/components/InputMeta/index.d.ts +0 -2
  631. package/dist/Snackbar/types/components/LabelText/LabelText.d.ts +0 -8
  632. package/dist/Snackbar/types/components/LabelText/index.d.ts +0 -1
  633. package/dist/Snackbar/types/components/MaskInput/MaskInput.d.ts +0 -11
  634. package/dist/Snackbar/types/components/MaskInput/index.d.ts +0 -2
  635. package/dist/Snackbar/types/components/Menu/Menu.d.ts +0 -11
  636. package/dist/Snackbar/types/components/Menu/index.d.ts +0 -2
  637. package/dist/Snackbar/types/components/MenuButton/MenuButton.d.ts +0 -7
  638. package/dist/Snackbar/types/components/MenuButton/index.d.ts +0 -2
  639. package/dist/Snackbar/types/components/MenuItem/MenuItem.d.ts +0 -7
  640. package/dist/Snackbar/types/components/MenuItem/index.d.ts +0 -2
  641. package/dist/Snackbar/types/components/MobileAppLinks/MobileAppLinks.d.ts +0 -16
  642. package/dist/Snackbar/types/components/MobileAppLinks/config.d.ts +0 -4
  643. package/dist/Snackbar/types/components/MobileAppLinks/index.d.ts +0 -2
  644. package/dist/Snackbar/types/components/MobileAppLinks/types.d.ts +0 -4
  645. package/dist/Snackbar/types/components/Pagination/Pagination.d.ts +0 -16
  646. package/dist/Snackbar/types/components/Pagination/index.d.ts +0 -2
  647. package/dist/Snackbar/types/components/Pagination/utils.d.ts +0 -1
  648. package/dist/Snackbar/types/components/Paragraph/Paragraph.d.ts +0 -11
  649. package/dist/Snackbar/types/components/Paragraph/index.d.ts +0 -2
  650. package/dist/Snackbar/types/components/ProjectsPopover/ProductLink.d.ts +0 -13
  651. package/dist/Snackbar/types/components/ProjectsPopover/ProjectsPopover.d.ts +0 -13
  652. package/dist/Snackbar/types/components/ProjectsPopover/index.d.ts +0 -2
  653. package/dist/Snackbar/types/components/ProjectsPopover/mappers.d.ts +0 -7
  654. package/dist/Snackbar/types/components/ProjectsPopover/types.d.ts +0 -8
  655. package/dist/Snackbar/types/components/ProjectsPopover/utils.d.ts +0 -11
  656. package/dist/Snackbar/types/components/PulseDot/PulseDot.d.ts +0 -22
  657. package/dist/Snackbar/types/components/PulseDot/index.d.ts +0 -2
  658. package/dist/Snackbar/types/components/Select/Label.d.ts +0 -6
  659. package/dist/Snackbar/types/components/Select/Select.d.ts +0 -39
  660. package/dist/Snackbar/types/components/Select/SelectCreatable.d.ts +0 -13
  661. package/dist/Snackbar/types/components/Select/customComponents.d.ts +0 -10
  662. package/dist/Snackbar/types/components/Select/defaultProps.d.ts +0 -6
  663. package/dist/Snackbar/types/components/Select/index.d.ts +0 -5
  664. package/dist/Snackbar/types/components/Select/types.d.ts +0 -9
  665. package/dist/Snackbar/types/components/Select/utils.d.ts +0 -2
  666. package/dist/Snackbar/types/components/Snackbar/ActionButton.d.ts +0 -6
  667. package/dist/Snackbar/types/components/Snackbar/Snackbar.d.ts +0 -15
  668. package/dist/Snackbar/types/components/Snackbar/WithAction.d.ts +0 -3
  669. package/dist/Snackbar/types/components/Snackbar/index.d.ts +0 -2
  670. package/dist/Snackbar/types/components/Spinner/Spinner.d.ts +0 -18
  671. package/dist/Snackbar/types/components/Spinner/index.d.ts +0 -2
  672. package/dist/Snackbar/types/components/SplashLogo/SplashLogo.d.ts +0 -12
  673. package/dist/Snackbar/types/components/SplashLogo/dataUrls.d.ts +0 -6
  674. package/dist/Snackbar/types/components/SplashLogo/index.d.ts +0 -2
  675. package/dist/Snackbar/types/components/SvgBorder/SvgBorder.d.ts +0 -18
  676. package/dist/Snackbar/types/components/SvgBorder/index.d.ts +0 -3
  677. package/dist/Snackbar/types/components/SvgBorder/utils.d.ts +0 -1
  678. package/dist/Snackbar/types/components/Switch/Switch.d.ts +0 -14
  679. package/dist/Snackbar/types/components/Switch/index.d.ts +0 -2
  680. package/dist/Snackbar/types/components/Tabs/Tabs.d.ts +0 -19
  681. package/dist/Snackbar/types/components/Tabs/index.d.ts +0 -2
  682. package/dist/Snackbar/types/components/Text/Text.d.ts +0 -14
  683. package/dist/Snackbar/types/components/Text/index.d.ts +0 -2
  684. package/dist/Snackbar/types/components/TextAreaInput/TextAreaInput.d.ts +0 -12
  685. package/dist/Snackbar/types/components/TextAreaInput/index.d.ts +0 -2
  686. package/dist/Snackbar/types/components/TextInput/TextInput.d.ts +0 -10
  687. package/dist/Snackbar/types/components/TextInput/index.d.ts +0 -2
  688. package/dist/Snackbar/types/components/Title/Title.d.ts +0 -11
  689. package/dist/Snackbar/types/components/Title/index.d.ts +0 -2
  690. package/dist/Snackbar/types/components/index.d.ts +0 -46
  691. package/dist/Snackbar/types/components/types.d.ts +0 -37
  692. package/dist/Snackbar/types/hooks/useClientRect.d.ts +0 -5
  693. package/dist/Snackbar/types/index.d.ts +0 -2
  694. package/dist/Snackbar/types/utils/react.d.ts +0 -6
  695. package/dist/css/Alert.global.css +0 -79
  696. package/dist/css/BubbleBox.global.css +0 -47
  697. package/dist/css/Button.global.css +0 -198
  698. package/dist/css/Checkbox.global.css +0 -76
  699. package/dist/css/DatePicker.global.css +0 -654
  700. package/dist/css/FollowUs.global.css +0 -25
  701. package/dist/css/Input.global.css +0 -98
  702. package/dist/css/InputMeta.global.css +0 -25
  703. package/dist/css/LabelText.global.css +0 -76
  704. package/dist/css/MaskInput.global.css +0 -12
  705. package/dist/css/Menu.global.css +0 -117
  706. package/dist/css/MenuButton.global.css +0 -18
  707. package/dist/css/MenuItem.global.css +0 -30
  708. package/dist/css/MobileAppLinks.global.css +0 -22
  709. package/dist/css/Pagination.global.css +0 -51
  710. package/dist/css/Paragraph.global.css +0 -17
  711. package/dist/css/ProjectsPopover.global.css +0 -111
  712. package/dist/css/Select.global.css +0 -209
  713. package/dist/css/Snackbar.global.css +0 -31
  714. package/dist/css/Spinner.global.css +0 -47
  715. package/dist/css/SplashLogo.global.css +0 -29
  716. package/dist/css/SvgBorder.global.css +0 -32
  717. package/dist/css/Switch.global.css +0 -82
  718. package/dist/css/Tabs.global.css +0 -122
  719. package/dist/css/Text.global.css +0 -77
  720. package/dist/css/TextAreaInput.global.css +0 -39
  721. package/dist/css/TextInput.global.css +0 -22
  722. package/dist/css/Title.global.css +0 -48
  723. package/dist/types/components/Alert/Alert.d.ts +0 -20
  724. package/dist/types/components/Alert/index.d.ts +0 -2
  725. package/dist/types/components/BlackTooltip/BlackTooltip.d.ts +0 -5
  726. package/dist/types/components/BlackTooltip/index.d.ts +0 -2
  727. package/dist/types/components/BubbleBox/BubbleBox.d.ts +0 -17
  728. package/dist/types/components/BubbleBox/index.d.ts +0 -3
  729. package/dist/types/components/BubbleBox/utils.d.ts +0 -1
  730. package/dist/types/components/Button/Button.d.ts +0 -12
  731. package/dist/types/components/Button/index.d.ts +0 -2
  732. package/dist/types/components/Checkbox/Checkbox.d.ts +0 -11
  733. package/dist/types/components/Checkbox/index.d.ts +0 -2
  734. package/dist/types/components/Datepicker/DatePicker.d.ts +0 -20
  735. package/dist/types/components/Datepicker/index.d.ts +0 -2
  736. package/dist/types/components/FlexBox/FlexBox.d.ts +0 -16
  737. package/dist/types/components/FlexBox/index.d.ts +0 -2
  738. package/dist/types/components/FollowUs/FollowUs.d.ts +0 -14
  739. package/dist/types/components/FollowUs/config.d.ts +0 -4
  740. package/dist/types/components/FollowUs/index.d.ts +0 -2
  741. package/dist/types/components/FollowUs/types.d.ts +0 -1
  742. package/dist/types/components/Input/Input.d.ts +0 -15
  743. package/dist/types/components/Input/index.d.ts +0 -2
  744. package/dist/types/components/InputMeta/InputMeta.d.ts +0 -8
  745. package/dist/types/components/InputMeta/index.d.ts +0 -2
  746. package/dist/types/components/LabelText/LabelText.d.ts +0 -8
  747. package/dist/types/components/LabelText/index.d.ts +0 -1
  748. package/dist/types/components/MaskInput/MaskInput.d.ts +0 -11
  749. package/dist/types/components/MaskInput/index.d.ts +0 -2
  750. package/dist/types/components/Menu/Menu.d.ts +0 -11
  751. package/dist/types/components/Menu/index.d.ts +0 -2
  752. package/dist/types/components/MenuButton/MenuButton.d.ts +0 -7
  753. package/dist/types/components/MenuButton/index.d.ts +0 -2
  754. package/dist/types/components/MenuItem/MenuItem.d.ts +0 -7
  755. package/dist/types/components/MenuItem/index.d.ts +0 -2
  756. package/dist/types/components/MobileAppLinks/MobileAppLinks.d.ts +0 -16
  757. package/dist/types/components/MobileAppLinks/config.d.ts +0 -4
  758. package/dist/types/components/MobileAppLinks/index.d.ts +0 -2
  759. package/dist/types/components/MobileAppLinks/types.d.ts +0 -4
  760. package/dist/types/components/Pagination/Pagination.d.ts +0 -16
  761. package/dist/types/components/Pagination/index.d.ts +0 -2
  762. package/dist/types/components/Pagination/utils.d.ts +0 -1
  763. package/dist/types/components/Paragraph/Paragraph.d.ts +0 -11
  764. package/dist/types/components/Paragraph/index.d.ts +0 -2
  765. package/dist/types/components/ProjectsPopover/ProductLink.d.ts +0 -13
  766. package/dist/types/components/ProjectsPopover/ProjectsPopover.d.ts +0 -13
  767. package/dist/types/components/ProjectsPopover/index.d.ts +0 -2
  768. package/dist/types/components/ProjectsPopover/mappers.d.ts +0 -7
  769. package/dist/types/components/ProjectsPopover/types.d.ts +0 -8
  770. package/dist/types/components/ProjectsPopover/utils.d.ts +0 -11
  771. package/dist/types/components/PulseDot/PulseDot.d.ts +0 -22
  772. package/dist/types/components/PulseDot/index.d.ts +0 -2
  773. package/dist/types/components/Select/Label.d.ts +0 -6
  774. package/dist/types/components/Select/Select.d.ts +0 -39
  775. package/dist/types/components/Select/SelectCreatable.d.ts +0 -13
  776. package/dist/types/components/Select/customComponents.d.ts +0 -10
  777. package/dist/types/components/Select/defaultProps.d.ts +0 -6
  778. package/dist/types/components/Select/index.d.ts +0 -5
  779. package/dist/types/components/Select/types.d.ts +0 -9
  780. package/dist/types/components/Select/utils.d.ts +0 -2
  781. package/dist/types/components/Snackbar/ActionButton.d.ts +0 -6
  782. package/dist/types/components/Snackbar/Snackbar.d.ts +0 -15
  783. package/dist/types/components/Snackbar/WithAction.d.ts +0 -3
  784. package/dist/types/components/Snackbar/index.d.ts +0 -2
  785. package/dist/types/components/Spinner/Spinner.d.ts +0 -18
  786. package/dist/types/components/Spinner/index.d.ts +0 -2
  787. package/dist/types/components/SplashLogo/SplashLogo.d.ts +0 -12
  788. package/dist/types/components/SplashLogo/dataUrls.d.ts +0 -6
  789. package/dist/types/components/SplashLogo/index.d.ts +0 -2
  790. package/dist/types/components/SvgBorder/SvgBorder.d.ts +0 -18
  791. package/dist/types/components/SvgBorder/index.d.ts +0 -3
  792. package/dist/types/components/SvgBorder/utils.d.ts +0 -1
  793. package/dist/types/components/Switch/Switch.d.ts +0 -14
  794. package/dist/types/components/Switch/index.d.ts +0 -2
  795. package/dist/types/components/Tabs/Tabs.d.ts +0 -19
  796. package/dist/types/components/Tabs/index.d.ts +0 -2
  797. package/dist/types/components/Text/Text.d.ts +0 -14
  798. package/dist/types/components/Text/index.d.ts +0 -2
  799. package/dist/types/components/TextAreaInput/TextAreaInput.d.ts +0 -12
  800. package/dist/types/components/TextAreaInput/index.d.ts +0 -2
  801. package/dist/types/components/TextInput/TextInput.d.ts +0 -10
  802. package/dist/types/components/TextInput/index.d.ts +0 -2
  803. package/dist/types/components/Title/Title.d.ts +0 -11
  804. package/dist/types/components/Title/index.d.ts +0 -2
  805. package/dist/types/components/index.d.ts +0 -46
  806. package/dist/types/components/types.d.ts +0 -37
  807. package/dist/types/hooks/useClientRect.d.ts +0 -5
  808. package/dist/types/index.d.ts +0 -2
  809. package/dist/types/utils/react.d.ts +0 -6
@@ -1,2968 +0,0 @@
1
- import React, { useMemo, createContext, forwardRef, useState, useRef, useCallback, useLayoutEffect, useEffect, useReducer, useContext, useImperativeHandle, Fragment, cloneElement, memo } from 'react';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { unstable_batchedUpdates, flushSync, createPortal } from 'react-dom';
4
-
5
- /******************************************************************************
6
- Copyright (c) Microsoft Corporation.
7
-
8
- Permission to use, copy, modify, and/or distribute this software for any
9
- purpose with or without fee is hereby granted.
10
-
11
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
- PERFORMANCE OF THIS SOFTWARE.
18
- ***************************************************************************** */
19
- /* global Reflect, Promise, SuppressedError, Symbol */
20
-
21
-
22
- var __assign = function() {
23
- __assign = Object.assign || function __assign(t) {
24
- for (var s, i = 1, n = arguments.length; i < n; i++) {
25
- s = arguments[i];
26
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
27
- }
28
- return t;
29
- };
30
- return __assign.apply(this, arguments);
31
- };
32
-
33
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
34
- var e = new Error(message);
35
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
36
- };
37
-
38
- function getDefaultExportFromCjs (x) {
39
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
40
- }
41
-
42
- var classnames = {exports: {}};
43
-
44
- /*!
45
- Copyright (c) 2018 Jed Watson.
46
- Licensed under the MIT License (MIT), see
47
- http://jedwatson.github.io/classnames
48
- */
49
-
50
- (function (module) {
51
- /* global define */
52
-
53
- (function () {
54
-
55
- var hasOwn = {}.hasOwnProperty;
56
-
57
- function classNames () {
58
- var classes = '';
59
-
60
- for (var i = 0; i < arguments.length; i++) {
61
- var arg = arguments[i];
62
- if (arg) {
63
- classes = appendClass(classes, parseValue(arg));
64
- }
65
- }
66
-
67
- return classes;
68
- }
69
-
70
- function parseValue (arg) {
71
- if (typeof arg === 'string' || typeof arg === 'number') {
72
- return arg;
73
- }
74
-
75
- if (typeof arg !== 'object') {
76
- return '';
77
- }
78
-
79
- if (Array.isArray(arg)) {
80
- return classNames.apply(null, arg);
81
- }
82
-
83
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
84
- return arg.toString();
85
- }
86
-
87
- var classes = '';
88
-
89
- for (var key in arg) {
90
- if (hasOwn.call(arg, key) && arg[key]) {
91
- classes = appendClass(classes, key);
92
- }
93
- }
94
-
95
- return classes;
96
- }
97
-
98
- function appendClass (value, newClass) {
99
- if (!newClass) {
100
- return value;
101
- }
102
-
103
- if (value) {
104
- return value + ' ' + newClass;
105
- }
106
-
107
- return value + newClass;
108
- }
109
-
110
- if (module.exports) {
111
- classNames.default = classNames;
112
- module.exports = classNames;
113
- } else {
114
- window.classNames = classNames;
115
- }
116
- }());
117
- } (classnames));
118
-
119
- var classnamesExports = classnames.exports;
120
- var cn = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
121
-
122
- var propTypes = {exports: {}};
123
-
124
- var reactIs = {exports: {}};
125
-
126
- var reactIs_production_min = {};
127
-
128
- /** @license React v16.13.1
129
- * react-is.production.min.js
130
- *
131
- * Copyright (c) Facebook, Inc. and its affiliates.
132
- *
133
- * This source code is licensed under the MIT license found in the
134
- * LICENSE file in the root directory of this source tree.
135
- */
136
-
137
- var hasRequiredReactIs_production_min;
138
-
139
- function requireReactIs_production_min () {
140
- if (hasRequiredReactIs_production_min) return reactIs_production_min;
141
- hasRequiredReactIs_production_min = 1;
142
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
143
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
144
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
145
- reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
146
- reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
147
- reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
148
- return reactIs_production_min;
149
- }
150
-
151
- var reactIs_development = {};
152
-
153
- /** @license React v16.13.1
154
- * react-is.development.js
155
- *
156
- * Copyright (c) Facebook, Inc. and its affiliates.
157
- *
158
- * This source code is licensed under the MIT license found in the
159
- * LICENSE file in the root directory of this source tree.
160
- */
161
-
162
- var hasRequiredReactIs_development;
163
-
164
- function requireReactIs_development () {
165
- if (hasRequiredReactIs_development) return reactIs_development;
166
- hasRequiredReactIs_development = 1;
167
-
168
-
169
-
170
- if (process.env.NODE_ENV !== "production") {
171
- (function() {
172
-
173
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
174
- // nor polyfill, then a plain number is used for performance.
175
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
176
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
177
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
178
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
179
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
180
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
181
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
182
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
183
- // (unstable) APIs that have been removed. Can we remove the symbols?
184
-
185
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
186
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
187
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
188
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
189
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
190
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
191
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
192
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
193
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
194
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
195
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
196
-
197
- function isValidElementType(type) {
198
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
199
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
200
- }
201
-
202
- function typeOf(object) {
203
- if (typeof object === 'object' && object !== null) {
204
- var $$typeof = object.$$typeof;
205
-
206
- switch ($$typeof) {
207
- case REACT_ELEMENT_TYPE:
208
- var type = object.type;
209
-
210
- switch (type) {
211
- case REACT_ASYNC_MODE_TYPE:
212
- case REACT_CONCURRENT_MODE_TYPE:
213
- case REACT_FRAGMENT_TYPE:
214
- case REACT_PROFILER_TYPE:
215
- case REACT_STRICT_MODE_TYPE:
216
- case REACT_SUSPENSE_TYPE:
217
- return type;
218
-
219
- default:
220
- var $$typeofType = type && type.$$typeof;
221
-
222
- switch ($$typeofType) {
223
- case REACT_CONTEXT_TYPE:
224
- case REACT_FORWARD_REF_TYPE:
225
- case REACT_LAZY_TYPE:
226
- case REACT_MEMO_TYPE:
227
- case REACT_PROVIDER_TYPE:
228
- return $$typeofType;
229
-
230
- default:
231
- return $$typeof;
232
- }
233
-
234
- }
235
-
236
- case REACT_PORTAL_TYPE:
237
- return $$typeof;
238
- }
239
- }
240
-
241
- return undefined;
242
- } // AsyncMode is deprecated along with isAsyncMode
243
-
244
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
245
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
246
- var ContextConsumer = REACT_CONTEXT_TYPE;
247
- var ContextProvider = REACT_PROVIDER_TYPE;
248
- var Element = REACT_ELEMENT_TYPE;
249
- var ForwardRef = REACT_FORWARD_REF_TYPE;
250
- var Fragment = REACT_FRAGMENT_TYPE;
251
- var Lazy = REACT_LAZY_TYPE;
252
- var Memo = REACT_MEMO_TYPE;
253
- var Portal = REACT_PORTAL_TYPE;
254
- var Profiler = REACT_PROFILER_TYPE;
255
- var StrictMode = REACT_STRICT_MODE_TYPE;
256
- var Suspense = REACT_SUSPENSE_TYPE;
257
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
258
-
259
- function isAsyncMode(object) {
260
- {
261
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
262
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
263
-
264
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
265
- }
266
- }
267
-
268
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
269
- }
270
- function isConcurrentMode(object) {
271
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
272
- }
273
- function isContextConsumer(object) {
274
- return typeOf(object) === REACT_CONTEXT_TYPE;
275
- }
276
- function isContextProvider(object) {
277
- return typeOf(object) === REACT_PROVIDER_TYPE;
278
- }
279
- function isElement(object) {
280
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
281
- }
282
- function isForwardRef(object) {
283
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
284
- }
285
- function isFragment(object) {
286
- return typeOf(object) === REACT_FRAGMENT_TYPE;
287
- }
288
- function isLazy(object) {
289
- return typeOf(object) === REACT_LAZY_TYPE;
290
- }
291
- function isMemo(object) {
292
- return typeOf(object) === REACT_MEMO_TYPE;
293
- }
294
- function isPortal(object) {
295
- return typeOf(object) === REACT_PORTAL_TYPE;
296
- }
297
- function isProfiler(object) {
298
- return typeOf(object) === REACT_PROFILER_TYPE;
299
- }
300
- function isStrictMode(object) {
301
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
302
- }
303
- function isSuspense(object) {
304
- return typeOf(object) === REACT_SUSPENSE_TYPE;
305
- }
306
-
307
- reactIs_development.AsyncMode = AsyncMode;
308
- reactIs_development.ConcurrentMode = ConcurrentMode;
309
- reactIs_development.ContextConsumer = ContextConsumer;
310
- reactIs_development.ContextProvider = ContextProvider;
311
- reactIs_development.Element = Element;
312
- reactIs_development.ForwardRef = ForwardRef;
313
- reactIs_development.Fragment = Fragment;
314
- reactIs_development.Lazy = Lazy;
315
- reactIs_development.Memo = Memo;
316
- reactIs_development.Portal = Portal;
317
- reactIs_development.Profiler = Profiler;
318
- reactIs_development.StrictMode = StrictMode;
319
- reactIs_development.Suspense = Suspense;
320
- reactIs_development.isAsyncMode = isAsyncMode;
321
- reactIs_development.isConcurrentMode = isConcurrentMode;
322
- reactIs_development.isContextConsumer = isContextConsumer;
323
- reactIs_development.isContextProvider = isContextProvider;
324
- reactIs_development.isElement = isElement;
325
- reactIs_development.isForwardRef = isForwardRef;
326
- reactIs_development.isFragment = isFragment;
327
- reactIs_development.isLazy = isLazy;
328
- reactIs_development.isMemo = isMemo;
329
- reactIs_development.isPortal = isPortal;
330
- reactIs_development.isProfiler = isProfiler;
331
- reactIs_development.isStrictMode = isStrictMode;
332
- reactIs_development.isSuspense = isSuspense;
333
- reactIs_development.isValidElementType = isValidElementType;
334
- reactIs_development.typeOf = typeOf;
335
- })();
336
- }
337
- return reactIs_development;
338
- }
339
-
340
- var hasRequiredReactIs;
341
-
342
- function requireReactIs () {
343
- if (hasRequiredReactIs) return reactIs.exports;
344
- hasRequiredReactIs = 1;
345
-
346
- if (process.env.NODE_ENV === 'production') {
347
- reactIs.exports = requireReactIs_production_min();
348
- } else {
349
- reactIs.exports = requireReactIs_development();
350
- }
351
- return reactIs.exports;
352
- }
353
-
354
- /*
355
- object-assign
356
- (c) Sindre Sorhus
357
- @license MIT
358
- */
359
-
360
- var objectAssign;
361
- var hasRequiredObjectAssign;
362
-
363
- function requireObjectAssign () {
364
- if (hasRequiredObjectAssign) return objectAssign;
365
- hasRequiredObjectAssign = 1;
366
- /* eslint-disable no-unused-vars */
367
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
368
- var hasOwnProperty = Object.prototype.hasOwnProperty;
369
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
370
-
371
- function toObject(val) {
372
- if (val === null || val === undefined) {
373
- throw new TypeError('Object.assign cannot be called with null or undefined');
374
- }
375
-
376
- return Object(val);
377
- }
378
-
379
- function shouldUseNative() {
380
- try {
381
- if (!Object.assign) {
382
- return false;
383
- }
384
-
385
- // Detect buggy property enumeration order in older V8 versions.
386
-
387
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
388
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
389
- test1[5] = 'de';
390
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
391
- return false;
392
- }
393
-
394
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
395
- var test2 = {};
396
- for (var i = 0; i < 10; i++) {
397
- test2['_' + String.fromCharCode(i)] = i;
398
- }
399
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
400
- return test2[n];
401
- });
402
- if (order2.join('') !== '0123456789') {
403
- return false;
404
- }
405
-
406
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
407
- var test3 = {};
408
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
409
- test3[letter] = letter;
410
- });
411
- if (Object.keys(Object.assign({}, test3)).join('') !==
412
- 'abcdefghijklmnopqrst') {
413
- return false;
414
- }
415
-
416
- return true;
417
- } catch (err) {
418
- // We don't expect any of the above to throw, but better to be safe.
419
- return false;
420
- }
421
- }
422
-
423
- objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
424
- var from;
425
- var to = toObject(target);
426
- var symbols;
427
-
428
- for (var s = 1; s < arguments.length; s++) {
429
- from = Object(arguments[s]);
430
-
431
- for (var key in from) {
432
- if (hasOwnProperty.call(from, key)) {
433
- to[key] = from[key];
434
- }
435
- }
436
-
437
- if (getOwnPropertySymbols) {
438
- symbols = getOwnPropertySymbols(from);
439
- for (var i = 0; i < symbols.length; i++) {
440
- if (propIsEnumerable.call(from, symbols[i])) {
441
- to[symbols[i]] = from[symbols[i]];
442
- }
443
- }
444
- }
445
- }
446
-
447
- return to;
448
- };
449
- return objectAssign;
450
- }
451
-
452
- /**
453
- * Copyright (c) 2013-present, Facebook, Inc.
454
- *
455
- * This source code is licensed under the MIT license found in the
456
- * LICENSE file in the root directory of this source tree.
457
- */
458
-
459
- var ReactPropTypesSecret_1;
460
- var hasRequiredReactPropTypesSecret;
461
-
462
- function requireReactPropTypesSecret () {
463
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
464
- hasRequiredReactPropTypesSecret = 1;
465
-
466
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
467
-
468
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
469
- return ReactPropTypesSecret_1;
470
- }
471
-
472
- var has;
473
- var hasRequiredHas;
474
-
475
- function requireHas () {
476
- if (hasRequiredHas) return has;
477
- hasRequiredHas = 1;
478
- has = Function.call.bind(Object.prototype.hasOwnProperty);
479
- return has;
480
- }
481
-
482
- /**
483
- * Copyright (c) 2013-present, Facebook, Inc.
484
- *
485
- * This source code is licensed under the MIT license found in the
486
- * LICENSE file in the root directory of this source tree.
487
- */
488
-
489
- var checkPropTypes_1;
490
- var hasRequiredCheckPropTypes;
491
-
492
- function requireCheckPropTypes () {
493
- if (hasRequiredCheckPropTypes) return checkPropTypes_1;
494
- hasRequiredCheckPropTypes = 1;
495
-
496
- var printWarning = function() {};
497
-
498
- if (process.env.NODE_ENV !== 'production') {
499
- var ReactPropTypesSecret = requireReactPropTypesSecret();
500
- var loggedTypeFailures = {};
501
- var has = requireHas();
502
-
503
- printWarning = function(text) {
504
- var message = 'Warning: ' + text;
505
- if (typeof console !== 'undefined') {
506
- console.error(message);
507
- }
508
- try {
509
- // --- Welcome to debugging React ---
510
- // This error was thrown as a convenience so that you can use this stack
511
- // to find the callsite that caused this warning to fire.
512
- throw new Error(message);
513
- } catch (x) { /**/ }
514
- };
515
- }
516
-
517
- /**
518
- * Assert that the values match with the type specs.
519
- * Error messages are memorized and will only be shown once.
520
- *
521
- * @param {object} typeSpecs Map of name to a ReactPropType
522
- * @param {object} values Runtime values that need to be type-checked
523
- * @param {string} location e.g. "prop", "context", "child context"
524
- * @param {string} componentName Name of the component for error messages.
525
- * @param {?Function} getStack Returns the component stack.
526
- * @private
527
- */
528
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
529
- if (process.env.NODE_ENV !== 'production') {
530
- for (var typeSpecName in typeSpecs) {
531
- if (has(typeSpecs, typeSpecName)) {
532
- var error;
533
- // Prop type validation may throw. In case they do, we don't want to
534
- // fail the render phase where it didn't fail before. So we log it.
535
- // After these have been cleaned up, we'll let them throw.
536
- try {
537
- // This is intentionally an invariant that gets caught. It's the same
538
- // behavior as without this statement except with a better message.
539
- if (typeof typeSpecs[typeSpecName] !== 'function') {
540
- var err = Error(
541
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
542
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
543
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
544
- );
545
- err.name = 'Invariant Violation';
546
- throw err;
547
- }
548
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
549
- } catch (ex) {
550
- error = ex;
551
- }
552
- if (error && !(error instanceof Error)) {
553
- printWarning(
554
- (componentName || 'React class') + ': type specification of ' +
555
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
556
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
557
- 'You may have forgotten to pass an argument to the type checker ' +
558
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
559
- 'shape all require an argument).'
560
- );
561
- }
562
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
563
- // Only monitor this failure once because there tends to be a lot of the
564
- // same error.
565
- loggedTypeFailures[error.message] = true;
566
-
567
- var stack = getStack ? getStack() : '';
568
-
569
- printWarning(
570
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
571
- );
572
- }
573
- }
574
- }
575
- }
576
- }
577
-
578
- /**
579
- * Resets warning cache when testing.
580
- *
581
- * @private
582
- */
583
- checkPropTypes.resetWarningCache = function() {
584
- if (process.env.NODE_ENV !== 'production') {
585
- loggedTypeFailures = {};
586
- }
587
- };
588
-
589
- checkPropTypes_1 = checkPropTypes;
590
- return checkPropTypes_1;
591
- }
592
-
593
- /**
594
- * Copyright (c) 2013-present, Facebook, Inc.
595
- *
596
- * This source code is licensed under the MIT license found in the
597
- * LICENSE file in the root directory of this source tree.
598
- */
599
-
600
- var factoryWithTypeCheckers;
601
- var hasRequiredFactoryWithTypeCheckers;
602
-
603
- function requireFactoryWithTypeCheckers () {
604
- if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
605
- hasRequiredFactoryWithTypeCheckers = 1;
606
-
607
- var ReactIs = requireReactIs();
608
- var assign = requireObjectAssign();
609
-
610
- var ReactPropTypesSecret = requireReactPropTypesSecret();
611
- var has = requireHas();
612
- var checkPropTypes = requireCheckPropTypes();
613
-
614
- var printWarning = function() {};
615
-
616
- if (process.env.NODE_ENV !== 'production') {
617
- printWarning = function(text) {
618
- var message = 'Warning: ' + text;
619
- if (typeof console !== 'undefined') {
620
- console.error(message);
621
- }
622
- try {
623
- // --- Welcome to debugging React ---
624
- // This error was thrown as a convenience so that you can use this stack
625
- // to find the callsite that caused this warning to fire.
626
- throw new Error(message);
627
- } catch (x) {}
628
- };
629
- }
630
-
631
- function emptyFunctionThatReturnsNull() {
632
- return null;
633
- }
634
-
635
- factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
636
- /* global Symbol */
637
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
638
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
639
-
640
- /**
641
- * Returns the iterator method function contained on the iterable object.
642
- *
643
- * Be sure to invoke the function with the iterable as context:
644
- *
645
- * var iteratorFn = getIteratorFn(myIterable);
646
- * if (iteratorFn) {
647
- * var iterator = iteratorFn.call(myIterable);
648
- * ...
649
- * }
650
- *
651
- * @param {?object} maybeIterable
652
- * @return {?function}
653
- */
654
- function getIteratorFn(maybeIterable) {
655
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
656
- if (typeof iteratorFn === 'function') {
657
- return iteratorFn;
658
- }
659
- }
660
-
661
- /**
662
- * Collection of methods that allow declaration and validation of props that are
663
- * supplied to React components. Example usage:
664
- *
665
- * var Props = require('ReactPropTypes');
666
- * var MyArticle = React.createClass({
667
- * propTypes: {
668
- * // An optional string prop named "description".
669
- * description: Props.string,
670
- *
671
- * // A required enum prop named "category".
672
- * category: Props.oneOf(['News','Photos']).isRequired,
673
- *
674
- * // A prop named "dialog" that requires an instance of Dialog.
675
- * dialog: Props.instanceOf(Dialog).isRequired
676
- * },
677
- * render: function() { ... }
678
- * });
679
- *
680
- * A more formal specification of how these methods are used:
681
- *
682
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
683
- * decl := ReactPropTypes.{type}(.isRequired)?
684
- *
685
- * Each and every declaration produces a function with the same signature. This
686
- * allows the creation of custom validation functions. For example:
687
- *
688
- * var MyLink = React.createClass({
689
- * propTypes: {
690
- * // An optional string or URI prop named "href".
691
- * href: function(props, propName, componentName) {
692
- * var propValue = props[propName];
693
- * if (propValue != null && typeof propValue !== 'string' &&
694
- * !(propValue instanceof URI)) {
695
- * return new Error(
696
- * 'Expected a string or an URI for ' + propName + ' in ' +
697
- * componentName
698
- * );
699
- * }
700
- * }
701
- * },
702
- * render: function() {...}
703
- * });
704
- *
705
- * @internal
706
- */
707
-
708
- var ANONYMOUS = '<<anonymous>>';
709
-
710
- // Important!
711
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
712
- var ReactPropTypes = {
713
- array: createPrimitiveTypeChecker('array'),
714
- bigint: createPrimitiveTypeChecker('bigint'),
715
- bool: createPrimitiveTypeChecker('boolean'),
716
- func: createPrimitiveTypeChecker('function'),
717
- number: createPrimitiveTypeChecker('number'),
718
- object: createPrimitiveTypeChecker('object'),
719
- string: createPrimitiveTypeChecker('string'),
720
- symbol: createPrimitiveTypeChecker('symbol'),
721
-
722
- any: createAnyTypeChecker(),
723
- arrayOf: createArrayOfTypeChecker,
724
- element: createElementTypeChecker(),
725
- elementType: createElementTypeTypeChecker(),
726
- instanceOf: createInstanceTypeChecker,
727
- node: createNodeChecker(),
728
- objectOf: createObjectOfTypeChecker,
729
- oneOf: createEnumTypeChecker,
730
- oneOfType: createUnionTypeChecker,
731
- shape: createShapeTypeChecker,
732
- exact: createStrictShapeTypeChecker,
733
- };
734
-
735
- /**
736
- * inlined Object.is polyfill to avoid requiring consumers ship their own
737
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
738
- */
739
- /*eslint-disable no-self-compare*/
740
- function is(x, y) {
741
- // SameValue algorithm
742
- if (x === y) {
743
- // Steps 1-5, 7-10
744
- // Steps 6.b-6.e: +0 != -0
745
- return x !== 0 || 1 / x === 1 / y;
746
- } else {
747
- // Step 6.a: NaN == NaN
748
- return x !== x && y !== y;
749
- }
750
- }
751
- /*eslint-enable no-self-compare*/
752
-
753
- /**
754
- * We use an Error-like object for backward compatibility as people may call
755
- * PropTypes directly and inspect their output. However, we don't use real
756
- * Errors anymore. We don't inspect their stack anyway, and creating them
757
- * is prohibitively expensive if they are created too often, such as what
758
- * happens in oneOfType() for any type before the one that matched.
759
- */
760
- function PropTypeError(message, data) {
761
- this.message = message;
762
- this.data = data && typeof data === 'object' ? data: {};
763
- this.stack = '';
764
- }
765
- // Make `instanceof Error` still work for returned errors.
766
- PropTypeError.prototype = Error.prototype;
767
-
768
- function createChainableTypeChecker(validate) {
769
- if (process.env.NODE_ENV !== 'production') {
770
- var manualPropTypeCallCache = {};
771
- var manualPropTypeWarningCount = 0;
772
- }
773
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
774
- componentName = componentName || ANONYMOUS;
775
- propFullName = propFullName || propName;
776
-
777
- if (secret !== ReactPropTypesSecret) {
778
- if (throwOnDirectAccess) {
779
- // New behavior only for users of `prop-types` package
780
- var err = new Error(
781
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
782
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
783
- 'Read more at http://fb.me/use-check-prop-types'
784
- );
785
- err.name = 'Invariant Violation';
786
- throw err;
787
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
788
- // Old behavior for people using React.PropTypes
789
- var cacheKey = componentName + ':' + propName;
790
- if (
791
- !manualPropTypeCallCache[cacheKey] &&
792
- // Avoid spamming the console because they are often not actionable except for lib authors
793
- manualPropTypeWarningCount < 3
794
- ) {
795
- printWarning(
796
- 'You are manually calling a React.PropTypes validation ' +
797
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
798
- 'and will throw in the standalone `prop-types` package. ' +
799
- 'You may be seeing this warning due to a third-party PropTypes ' +
800
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
801
- );
802
- manualPropTypeCallCache[cacheKey] = true;
803
- manualPropTypeWarningCount++;
804
- }
805
- }
806
- }
807
- if (props[propName] == null) {
808
- if (isRequired) {
809
- if (props[propName] === null) {
810
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
811
- }
812
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
813
- }
814
- return null;
815
- } else {
816
- return validate(props, propName, componentName, location, propFullName);
817
- }
818
- }
819
-
820
- var chainedCheckType = checkType.bind(null, false);
821
- chainedCheckType.isRequired = checkType.bind(null, true);
822
-
823
- return chainedCheckType;
824
- }
825
-
826
- function createPrimitiveTypeChecker(expectedType) {
827
- function validate(props, propName, componentName, location, propFullName, secret) {
828
- var propValue = props[propName];
829
- var propType = getPropType(propValue);
830
- if (propType !== expectedType) {
831
- // `propValue` being instance of, say, date/regexp, pass the 'object'
832
- // check, but we can offer a more precise error message here rather than
833
- // 'of type `object`'.
834
- var preciseType = getPreciseType(propValue);
835
-
836
- return new PropTypeError(
837
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
838
- {expectedType: expectedType}
839
- );
840
- }
841
- return null;
842
- }
843
- return createChainableTypeChecker(validate);
844
- }
845
-
846
- function createAnyTypeChecker() {
847
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
848
- }
849
-
850
- function createArrayOfTypeChecker(typeChecker) {
851
- function validate(props, propName, componentName, location, propFullName) {
852
- if (typeof typeChecker !== 'function') {
853
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
854
- }
855
- var propValue = props[propName];
856
- if (!Array.isArray(propValue)) {
857
- var propType = getPropType(propValue);
858
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
859
- }
860
- for (var i = 0; i < propValue.length; i++) {
861
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
862
- if (error instanceof Error) {
863
- return error;
864
- }
865
- }
866
- return null;
867
- }
868
- return createChainableTypeChecker(validate);
869
- }
870
-
871
- function createElementTypeChecker() {
872
- function validate(props, propName, componentName, location, propFullName) {
873
- var propValue = props[propName];
874
- if (!isValidElement(propValue)) {
875
- var propType = getPropType(propValue);
876
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
877
- }
878
- return null;
879
- }
880
- return createChainableTypeChecker(validate);
881
- }
882
-
883
- function createElementTypeTypeChecker() {
884
- function validate(props, propName, componentName, location, propFullName) {
885
- var propValue = props[propName];
886
- if (!ReactIs.isValidElementType(propValue)) {
887
- var propType = getPropType(propValue);
888
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
889
- }
890
- return null;
891
- }
892
- return createChainableTypeChecker(validate);
893
- }
894
-
895
- function createInstanceTypeChecker(expectedClass) {
896
- function validate(props, propName, componentName, location, propFullName) {
897
- if (!(props[propName] instanceof expectedClass)) {
898
- var expectedClassName = expectedClass.name || ANONYMOUS;
899
- var actualClassName = getClassName(props[propName]);
900
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
901
- }
902
- return null;
903
- }
904
- return createChainableTypeChecker(validate);
905
- }
906
-
907
- function createEnumTypeChecker(expectedValues) {
908
- if (!Array.isArray(expectedValues)) {
909
- if (process.env.NODE_ENV !== 'production') {
910
- if (arguments.length > 1) {
911
- printWarning(
912
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
913
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
914
- );
915
- } else {
916
- printWarning('Invalid argument supplied to oneOf, expected an array.');
917
- }
918
- }
919
- return emptyFunctionThatReturnsNull;
920
- }
921
-
922
- function validate(props, propName, componentName, location, propFullName) {
923
- var propValue = props[propName];
924
- for (var i = 0; i < expectedValues.length; i++) {
925
- if (is(propValue, expectedValues[i])) {
926
- return null;
927
- }
928
- }
929
-
930
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
931
- var type = getPreciseType(value);
932
- if (type === 'symbol') {
933
- return String(value);
934
- }
935
- return value;
936
- });
937
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
938
- }
939
- return createChainableTypeChecker(validate);
940
- }
941
-
942
- function createObjectOfTypeChecker(typeChecker) {
943
- function validate(props, propName, componentName, location, propFullName) {
944
- if (typeof typeChecker !== 'function') {
945
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
946
- }
947
- var propValue = props[propName];
948
- var propType = getPropType(propValue);
949
- if (propType !== 'object') {
950
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
951
- }
952
- for (var key in propValue) {
953
- if (has(propValue, key)) {
954
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
955
- if (error instanceof Error) {
956
- return error;
957
- }
958
- }
959
- }
960
- return null;
961
- }
962
- return createChainableTypeChecker(validate);
963
- }
964
-
965
- function createUnionTypeChecker(arrayOfTypeCheckers) {
966
- if (!Array.isArray(arrayOfTypeCheckers)) {
967
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
968
- return emptyFunctionThatReturnsNull;
969
- }
970
-
971
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
972
- var checker = arrayOfTypeCheckers[i];
973
- if (typeof checker !== 'function') {
974
- printWarning(
975
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
976
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
977
- );
978
- return emptyFunctionThatReturnsNull;
979
- }
980
- }
981
-
982
- function validate(props, propName, componentName, location, propFullName) {
983
- var expectedTypes = [];
984
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
985
- var checker = arrayOfTypeCheckers[i];
986
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
987
- if (checkerResult == null) {
988
- return null;
989
- }
990
- if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
991
- expectedTypes.push(checkerResult.data.expectedType);
992
- }
993
- }
994
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
995
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
996
- }
997
- return createChainableTypeChecker(validate);
998
- }
999
-
1000
- function createNodeChecker() {
1001
- function validate(props, propName, componentName, location, propFullName) {
1002
- if (!isNode(props[propName])) {
1003
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1004
- }
1005
- return null;
1006
- }
1007
- return createChainableTypeChecker(validate);
1008
- }
1009
-
1010
- function invalidValidatorError(componentName, location, propFullName, key, type) {
1011
- return new PropTypeError(
1012
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
1013
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
1014
- );
1015
- }
1016
-
1017
- function createShapeTypeChecker(shapeTypes) {
1018
- function validate(props, propName, componentName, location, propFullName) {
1019
- var propValue = props[propName];
1020
- var propType = getPropType(propValue);
1021
- if (propType !== 'object') {
1022
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1023
- }
1024
- for (var key in shapeTypes) {
1025
- var checker = shapeTypes[key];
1026
- if (typeof checker !== 'function') {
1027
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1028
- }
1029
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1030
- if (error) {
1031
- return error;
1032
- }
1033
- }
1034
- return null;
1035
- }
1036
- return createChainableTypeChecker(validate);
1037
- }
1038
-
1039
- function createStrictShapeTypeChecker(shapeTypes) {
1040
- function validate(props, propName, componentName, location, propFullName) {
1041
- var propValue = props[propName];
1042
- var propType = getPropType(propValue);
1043
- if (propType !== 'object') {
1044
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1045
- }
1046
- // We need to check all keys in case some are required but missing from props.
1047
- var allKeys = assign({}, props[propName], shapeTypes);
1048
- for (var key in allKeys) {
1049
- var checker = shapeTypes[key];
1050
- if (has(shapeTypes, key) && typeof checker !== 'function') {
1051
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1052
- }
1053
- if (!checker) {
1054
- return new PropTypeError(
1055
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1056
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1057
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1058
- );
1059
- }
1060
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1061
- if (error) {
1062
- return error;
1063
- }
1064
- }
1065
- return null;
1066
- }
1067
-
1068
- return createChainableTypeChecker(validate);
1069
- }
1070
-
1071
- function isNode(propValue) {
1072
- switch (typeof propValue) {
1073
- case 'number':
1074
- case 'string':
1075
- case 'undefined':
1076
- return true;
1077
- case 'boolean':
1078
- return !propValue;
1079
- case 'object':
1080
- if (Array.isArray(propValue)) {
1081
- return propValue.every(isNode);
1082
- }
1083
- if (propValue === null || isValidElement(propValue)) {
1084
- return true;
1085
- }
1086
-
1087
- var iteratorFn = getIteratorFn(propValue);
1088
- if (iteratorFn) {
1089
- var iterator = iteratorFn.call(propValue);
1090
- var step;
1091
- if (iteratorFn !== propValue.entries) {
1092
- while (!(step = iterator.next()).done) {
1093
- if (!isNode(step.value)) {
1094
- return false;
1095
- }
1096
- }
1097
- } else {
1098
- // Iterator will provide entry [k,v] tuples rather than values.
1099
- while (!(step = iterator.next()).done) {
1100
- var entry = step.value;
1101
- if (entry) {
1102
- if (!isNode(entry[1])) {
1103
- return false;
1104
- }
1105
- }
1106
- }
1107
- }
1108
- } else {
1109
- return false;
1110
- }
1111
-
1112
- return true;
1113
- default:
1114
- return false;
1115
- }
1116
- }
1117
-
1118
- function isSymbol(propType, propValue) {
1119
- // Native Symbol.
1120
- if (propType === 'symbol') {
1121
- return true;
1122
- }
1123
-
1124
- // falsy value can't be a Symbol
1125
- if (!propValue) {
1126
- return false;
1127
- }
1128
-
1129
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1130
- if (propValue['@@toStringTag'] === 'Symbol') {
1131
- return true;
1132
- }
1133
-
1134
- // Fallback for non-spec compliant Symbols which are polyfilled.
1135
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1136
- return true;
1137
- }
1138
-
1139
- return false;
1140
- }
1141
-
1142
- // Equivalent of `typeof` but with special handling for array and regexp.
1143
- function getPropType(propValue) {
1144
- var propType = typeof propValue;
1145
- if (Array.isArray(propValue)) {
1146
- return 'array';
1147
- }
1148
- if (propValue instanceof RegExp) {
1149
- // Old webkits (at least until Android 4.0) return 'function' rather than
1150
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1151
- // passes PropTypes.object.
1152
- return 'object';
1153
- }
1154
- if (isSymbol(propType, propValue)) {
1155
- return 'symbol';
1156
- }
1157
- return propType;
1158
- }
1159
-
1160
- // This handles more types than `getPropType`. Only used for error messages.
1161
- // See `createPrimitiveTypeChecker`.
1162
- function getPreciseType(propValue) {
1163
- if (typeof propValue === 'undefined' || propValue === null) {
1164
- return '' + propValue;
1165
- }
1166
- var propType = getPropType(propValue);
1167
- if (propType === 'object') {
1168
- if (propValue instanceof Date) {
1169
- return 'date';
1170
- } else if (propValue instanceof RegExp) {
1171
- return 'regexp';
1172
- }
1173
- }
1174
- return propType;
1175
- }
1176
-
1177
- // Returns a string that is postfixed to a warning about an invalid type.
1178
- // For example, "undefined" or "of type array"
1179
- function getPostfixForTypeWarning(value) {
1180
- var type = getPreciseType(value);
1181
- switch (type) {
1182
- case 'array':
1183
- case 'object':
1184
- return 'an ' + type;
1185
- case 'boolean':
1186
- case 'date':
1187
- case 'regexp':
1188
- return 'a ' + type;
1189
- default:
1190
- return type;
1191
- }
1192
- }
1193
-
1194
- // Returns class name of the object, if any.
1195
- function getClassName(propValue) {
1196
- if (!propValue.constructor || !propValue.constructor.name) {
1197
- return ANONYMOUS;
1198
- }
1199
- return propValue.constructor.name;
1200
- }
1201
-
1202
- ReactPropTypes.checkPropTypes = checkPropTypes;
1203
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1204
- ReactPropTypes.PropTypes = ReactPropTypes;
1205
-
1206
- return ReactPropTypes;
1207
- };
1208
- return factoryWithTypeCheckers;
1209
- }
1210
-
1211
- /**
1212
- * Copyright (c) 2013-present, Facebook, Inc.
1213
- *
1214
- * This source code is licensed under the MIT license found in the
1215
- * LICENSE file in the root directory of this source tree.
1216
- */
1217
-
1218
- var factoryWithThrowingShims;
1219
- var hasRequiredFactoryWithThrowingShims;
1220
-
1221
- function requireFactoryWithThrowingShims () {
1222
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1223
- hasRequiredFactoryWithThrowingShims = 1;
1224
-
1225
- var ReactPropTypesSecret = requireReactPropTypesSecret();
1226
-
1227
- function emptyFunction() {}
1228
- function emptyFunctionWithReset() {}
1229
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
1230
-
1231
- factoryWithThrowingShims = function() {
1232
- function shim(props, propName, componentName, location, propFullName, secret) {
1233
- if (secret === ReactPropTypesSecret) {
1234
- // It is still safe when called from React.
1235
- return;
1236
- }
1237
- var err = new Error(
1238
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1239
- 'Use PropTypes.checkPropTypes() to call them. ' +
1240
- 'Read more at http://fb.me/use-check-prop-types'
1241
- );
1242
- err.name = 'Invariant Violation';
1243
- throw err;
1244
- } shim.isRequired = shim;
1245
- function getShim() {
1246
- return shim;
1247
- } // Important!
1248
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1249
- var ReactPropTypes = {
1250
- array: shim,
1251
- bigint: shim,
1252
- bool: shim,
1253
- func: shim,
1254
- number: shim,
1255
- object: shim,
1256
- string: shim,
1257
- symbol: shim,
1258
-
1259
- any: shim,
1260
- arrayOf: getShim,
1261
- element: shim,
1262
- elementType: shim,
1263
- instanceOf: getShim,
1264
- node: shim,
1265
- objectOf: getShim,
1266
- oneOf: getShim,
1267
- oneOfType: getShim,
1268
- shape: getShim,
1269
- exact: getShim,
1270
-
1271
- checkPropTypes: emptyFunctionWithReset,
1272
- resetWarningCache: emptyFunction
1273
- };
1274
-
1275
- ReactPropTypes.PropTypes = ReactPropTypes;
1276
-
1277
- return ReactPropTypes;
1278
- };
1279
- return factoryWithThrowingShims;
1280
- }
1281
-
1282
- /**
1283
- * Copyright (c) 2013-present, Facebook, Inc.
1284
- *
1285
- * This source code is licensed under the MIT license found in the
1286
- * LICENSE file in the root directory of this source tree.
1287
- */
1288
-
1289
- if (process.env.NODE_ENV !== 'production') {
1290
- var ReactIs = requireReactIs();
1291
-
1292
- // By explicitly using `prop-types` you are opting into new development behavior.
1293
- // http://fb.me/prop-types-in-prod
1294
- var throwOnDirectAccess = true;
1295
- propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1296
- } else {
1297
- // By explicitly using `prop-types` you are opting into new production behavior.
1298
- // http://fb.me/prop-types-in-prod
1299
- propTypes.exports = requireFactoryWithThrowingShims()();
1300
- }
1301
-
1302
- var propTypesExports = propTypes.exports;
1303
-
1304
- const isMenuOpen = state => !!state && state[0] === 'o';
1305
- const batchedUpdates = unstable_batchedUpdates || (callback => callback());
1306
- const values = Object.values || (obj => Object.keys(obj).map(key => obj[key]));
1307
- const floatEqual = (a, b, diff = 0.0001) => Math.abs(a - b) < diff;
1308
- const getTransition = (transition, name) => transition === true || !!(transition && transition[name]);
1309
- const safeCall = (fn, arg) => typeof fn === 'function' ? fn(arg) : fn;
1310
- const internalKey = '_szhsinMenu';
1311
- const getName = component => component[internalKey];
1312
- const defineName = (name, component) => Object.defineProperty(component, internalKey, {
1313
- value: name
1314
- });
1315
- const mergeProps = (target, source) => {
1316
- source && Object.keys(source).forEach(key => {
1317
- const targetProp = target[key];
1318
- const sourceProp = source[key];
1319
- if (typeof sourceProp === 'function' && targetProp) {
1320
- target[key] = (...arg) => {
1321
- sourceProp(...arg);
1322
- targetProp(...arg);
1323
- };
1324
- } else {
1325
- target[key] = sourceProp;
1326
- }
1327
- });
1328
- return target;
1329
- };
1330
- const parsePadding = paddingStr => {
1331
- if (typeof paddingStr !== 'string') return {
1332
- top: 0,
1333
- right: 0,
1334
- bottom: 0,
1335
- left: 0
1336
- };
1337
- const padding = paddingStr.trim().split(/\s+/, 4).map(parseFloat);
1338
- const top = !isNaN(padding[0]) ? padding[0] : 0;
1339
- const right = !isNaN(padding[1]) ? padding[1] : top;
1340
- return {
1341
- top,
1342
- right,
1343
- bottom: !isNaN(padding[2]) ? padding[2] : top,
1344
- left: !isNaN(padding[3]) ? padding[3] : right
1345
- };
1346
- };
1347
- const getScrollAncestor = node => {
1348
- while (node) {
1349
- node = node.parentNode;
1350
- if (!node || node === document.body || !node.parentNode) return;
1351
- const {
1352
- overflow,
1353
- overflowX,
1354
- overflowY
1355
- } = getComputedStyle(node);
1356
- if (/auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX)) return node;
1357
- }
1358
- };
1359
- function commonProps(isDisabled, isHovering) {
1360
- return {
1361
- 'aria-disabled': isDisabled || undefined,
1362
- tabIndex: isHovering ? 0 : -1
1363
- };
1364
- }
1365
- function indexOfNode(nodeList, node) {
1366
- for (let i = 0; i < nodeList.length; i++) {
1367
- if (nodeList[i] === node) return i;
1368
- }
1369
- return -1;
1370
- }
1371
-
1372
- const stylePropTypes = name => ({
1373
- [name ? `${name}ClassName` : 'className']: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func])
1374
- });
1375
- const menuPropTypes = {
1376
- className: propTypesExports.string,
1377
- ...stylePropTypes('menu'),
1378
- arrowProps: propTypesExports.object,
1379
- focusProps: propTypesExports.object,
1380
- menuStyle: propTypesExports.object,
1381
- arrow: propTypesExports.bool,
1382
- setDownOverflow: propTypesExports.bool,
1383
- gap: propTypesExports.number,
1384
- shift: propTypesExports.number,
1385
- align: /*#__PURE__*/propTypesExports.oneOf(['start', 'center', 'end']),
1386
- direction: /*#__PURE__*/propTypesExports.oneOf(['left', 'right', 'top', 'bottom']),
1387
- position: /*#__PURE__*/propTypesExports.oneOf(['auto', 'anchor', 'initial']),
1388
- overflow: /*#__PURE__*/propTypesExports.oneOf(['auto', 'visible', 'hidden'])
1389
- };
1390
- const rootMenuPropTypes = {
1391
- ...menuPropTypes,
1392
- containerProps: propTypesExports.object,
1393
- initialMounted: propTypesExports.bool,
1394
- unmountOnClose: propTypesExports.bool,
1395
- transition: /*#__PURE__*/propTypesExports.oneOfType([propTypesExports.bool, /*#__PURE__*/propTypesExports.exact({
1396
- open: propTypesExports.bool,
1397
- close: propTypesExports.bool,
1398
- item: propTypesExports.bool
1399
- })]),
1400
- transitionTimeout: propTypesExports.number,
1401
- boundingBoxRef: propTypesExports.object,
1402
- boundingBoxPadding: propTypesExports.string,
1403
- reposition: /*#__PURE__*/propTypesExports.oneOf(['auto', 'initial']),
1404
- repositionFlag: /*#__PURE__*/propTypesExports.oneOfType([propTypesExports.string, propTypesExports.number]),
1405
- viewScroll: /*#__PURE__*/propTypesExports.oneOf(['auto', 'close', 'initial']),
1406
- submenuOpenDelay: propTypesExports.number,
1407
- submenuCloseDelay: propTypesExports.number,
1408
- portal: /*#__PURE__*/propTypesExports.oneOfType([propTypesExports.bool, /*#__PURE__*/propTypesExports.exact({
1409
- target: propTypesExports.object,
1410
- stablePosition: propTypesExports.bool
1411
- })]),
1412
- theming: propTypesExports.string,
1413
- onItemClick: propTypesExports.func
1414
- };
1415
- const uncontrolledMenuPropTypes = {
1416
- instanceRef: /*#__PURE__*/propTypesExports.oneOfType([propTypesExports.object, propTypesExports.func]),
1417
- onMenuChange: propTypesExports.func
1418
- };
1419
-
1420
- const useBEM = ({
1421
- block,
1422
- element,
1423
- modifiers,
1424
- className
1425
- }) => useMemo(() => {
1426
- const blockElement = element ? `${block}__${element}` : block;
1427
- let classString = blockElement;
1428
- modifiers && Object.keys(modifiers).forEach(name => {
1429
- const value = modifiers[name];
1430
- if (value) classString += ` ${blockElement}--${value === true ? name : `${name}-${value}`}`;
1431
- });
1432
- let expandedClassName = typeof className === 'function' ? className(modifiers) : className;
1433
- if (typeof expandedClassName === 'string') {
1434
- expandedClassName = expandedClassName.trim();
1435
- if (expandedClassName) classString += ` ${expandedClassName}`;
1436
- }
1437
- return classString;
1438
- }, [block, element, modifiers, className]);
1439
-
1440
- const menuContainerClass = 'szh-menu-container';
1441
- const menuClass = 'szh-menu';
1442
- const menuButtonClass = 'szh-menu-button';
1443
- const menuArrowClass = 'arrow';
1444
- const menuItemClass = 'item';
1445
- const HoverItemContext = /*#__PURE__*/createContext();
1446
- const MenuListItemContext = /*#__PURE__*/createContext({});
1447
- const MenuListContext = /*#__PURE__*/createContext({});
1448
- const EventHandlersContext = /*#__PURE__*/createContext({});
1449
- const RadioGroupContext = /*#__PURE__*/createContext({});
1450
- const SettingsContext = /*#__PURE__*/createContext({});
1451
- const Keys = /*#__PURE__*/Object.freeze({
1452
- ENTER: 'Enter',
1453
- ESC: 'Escape',
1454
- SPACE: ' ',
1455
- HOME: 'Home',
1456
- END: 'End',
1457
- LEFT: 'ArrowLeft',
1458
- RIGHT: 'ArrowRight',
1459
- UP: 'ArrowUp',
1460
- DOWN: 'ArrowDown'
1461
- });
1462
- const HoverActionTypes = /*#__PURE__*/Object.freeze({
1463
- RESET: 0,
1464
- SET: 1,
1465
- UNSET: 2,
1466
- INCREASE: 3,
1467
- DECREASE: 4,
1468
- FIRST: 5,
1469
- LAST: 6,
1470
- SET_INDEX: 7
1471
- });
1472
- const CloseReason = /*#__PURE__*/Object.freeze({
1473
- CLICK: 'click',
1474
- CANCEL: 'cancel',
1475
- BLUR: 'blur',
1476
- SCROLL: 'scroll'
1477
- });
1478
- const FocusPositions = /*#__PURE__*/Object.freeze({
1479
- FIRST: 'first',
1480
- LAST: 'last'
1481
- });
1482
- const MenuStateMap = /*#__PURE__*/Object.freeze({
1483
- entering: 'opening',
1484
- entered: 'open',
1485
- exiting: 'closing',
1486
- exited: 'closed'
1487
- });
1488
- const positionAbsolute = 'absolute';
1489
- const roleNone = 'presentation';
1490
- const roleMenuitem = 'menuitem';
1491
- const dummyItemProps = {
1492
- 'aria-hidden': true,
1493
- role: roleMenuitem
1494
- };
1495
-
1496
- const MenuButton$1 = /*#__PURE__*/defineName('MenuButton', /*#__PURE__*/forwardRef(function MenuButton({
1497
- className,
1498
- isOpen,
1499
- disabled,
1500
- children,
1501
- ...restProps
1502
- }, ref) {
1503
- const modifiers = useMemo(() => ({
1504
- open: isOpen
1505
- }), [isOpen]);
1506
- return /*#__PURE__*/jsx("button", {
1507
- "aria-haspopup": true,
1508
- "aria-expanded": isOpen,
1509
- "aria-disabled": disabled || undefined,
1510
- type: "button",
1511
- disabled: disabled,
1512
- ...restProps,
1513
- ref: ref,
1514
- className: useBEM({
1515
- block: menuButtonClass,
1516
- modifiers,
1517
- className
1518
- }),
1519
- children: children
1520
- });
1521
- }));
1522
- process.env.NODE_ENV !== "production" ? MenuButton$1.propTypes = {
1523
- ...stylePropTypes(),
1524
- isOpen: propTypesExports.bool,
1525
- disabled: propTypesExports.bool
1526
- } : void 0;
1527
-
1528
- const MenuContainer = ({
1529
- className,
1530
- containerRef,
1531
- containerProps,
1532
- children,
1533
- isOpen,
1534
- theming,
1535
- transition,
1536
- onClose
1537
- }) => {
1538
- const itemTransition = getTransition(transition, 'item');
1539
- const onKeyDown = ({
1540
- key
1541
- }) => {
1542
- switch (key) {
1543
- case Keys.ESC:
1544
- safeCall(onClose, {
1545
- key,
1546
- reason: CloseReason.CANCEL
1547
- });
1548
- break;
1549
- }
1550
- };
1551
- const onBlur = e => {
1552
- if (isOpen && !e.currentTarget.contains(e.relatedTarget)) {
1553
- safeCall(onClose, {
1554
- reason: CloseReason.BLUR
1555
- });
1556
- }
1557
- };
1558
- return /*#__PURE__*/jsx("div", {
1559
- ...mergeProps({
1560
- onKeyDown,
1561
- onBlur
1562
- }, containerProps),
1563
- className: useBEM({
1564
- block: menuContainerClass,
1565
- modifiers: useMemo(() => ({
1566
- theme: theming,
1567
- itemTransition
1568
- }), [theming, itemTransition]),
1569
- className
1570
- }),
1571
- style: {
1572
- position: 'absolute',
1573
- ...(containerProps == null ? void 0 : containerProps.style)
1574
- },
1575
- ref: containerRef,
1576
- children: children
1577
- });
1578
- };
1579
-
1580
- const createSubmenuCtx = () => {
1581
- let timer,
1582
- count = 0;
1583
- return {
1584
- toggle: isOpen => {
1585
- isOpen ? count++ : count--;
1586
- count = Math.max(count, 0);
1587
- },
1588
- on: (closeDelay, pending, settled) => {
1589
- if (count) {
1590
- if (!timer) timer = setTimeout(() => {
1591
- timer = 0;
1592
- pending();
1593
- }, closeDelay);
1594
- } else {
1595
- settled == null || settled();
1596
- }
1597
- },
1598
- off: () => {
1599
- if (timer) {
1600
- clearTimeout(timer);
1601
- timer = 0;
1602
- }
1603
- }
1604
- };
1605
- };
1606
-
1607
- const useItems = (menuRef, focusRef) => {
1608
- const [hoverItem, setHoverItem] = useState();
1609
- const stateRef = useRef({
1610
- items: [],
1611
- hoverIndex: -1,
1612
- sorted: false
1613
- });
1614
- const mutableState = stateRef.current;
1615
- const updateItems = useCallback((item, isMounted) => {
1616
- const {
1617
- items
1618
- } = mutableState;
1619
- if (!item) {
1620
- mutableState.items = [];
1621
- } else if (isMounted) {
1622
- items.push(item);
1623
- } else {
1624
- const index = items.indexOf(item);
1625
- if (index > -1) {
1626
- items.splice(index, 1);
1627
- if (item.contains(document.activeElement)) {
1628
- focusRef.current.focus();
1629
- setHoverItem();
1630
- }
1631
- }
1632
- }
1633
- mutableState.hoverIndex = -1;
1634
- mutableState.sorted = false;
1635
- }, [mutableState, focusRef]);
1636
- const dispatch = useCallback((actionType, item, nextIndex) => {
1637
- const {
1638
- items,
1639
- hoverIndex
1640
- } = mutableState;
1641
- const sortItems = () => {
1642
- if (mutableState.sorted) return;
1643
- const orderedNodes = menuRef.current.querySelectorAll('.szh-menu__item');
1644
- items.sort((a, b) => indexOfNode(orderedNodes, a) - indexOfNode(orderedNodes, b));
1645
- mutableState.sorted = true;
1646
- };
1647
- let index = -1,
1648
- newItem = undefined;
1649
- switch (actionType) {
1650
- case HoverActionTypes.RESET:
1651
- break;
1652
- case HoverActionTypes.SET:
1653
- newItem = item;
1654
- break;
1655
- case HoverActionTypes.UNSET:
1656
- newItem = prevItem => prevItem === item ? undefined : prevItem;
1657
- break;
1658
- case HoverActionTypes.FIRST:
1659
- sortItems();
1660
- index = 0;
1661
- newItem = items[index];
1662
- break;
1663
- case HoverActionTypes.LAST:
1664
- sortItems();
1665
- index = items.length - 1;
1666
- newItem = items[index];
1667
- break;
1668
- case HoverActionTypes.SET_INDEX:
1669
- sortItems();
1670
- index = nextIndex;
1671
- newItem = items[index];
1672
- break;
1673
- case HoverActionTypes.INCREASE:
1674
- sortItems();
1675
- index = hoverIndex;
1676
- if (index < 0) index = items.indexOf(item);
1677
- index++;
1678
- if (index >= items.length) index = 0;
1679
- newItem = items[index];
1680
- break;
1681
- case HoverActionTypes.DECREASE:
1682
- sortItems();
1683
- index = hoverIndex;
1684
- if (index < 0) index = items.indexOf(item);
1685
- index--;
1686
- if (index < 0) index = items.length - 1;
1687
- newItem = items[index];
1688
- break;
1689
- default:
1690
- if (process.env.NODE_ENV !== 'production') throw new Error(`[React-Menu] Unknown hover action type: ${actionType}`);
1691
- }
1692
- if (!newItem) index = -1;
1693
- setHoverItem(newItem);
1694
- mutableState.hoverIndex = index;
1695
- }, [menuRef, mutableState]);
1696
- return {
1697
- hoverItem,
1698
- dispatch,
1699
- updateItems
1700
- };
1701
- };
1702
-
1703
- const getPositionHelpers = (containerRef, menuRef, menuScroll, boundingBoxPadding) => {
1704
- const menuRect = menuRef.current.getBoundingClientRect();
1705
- const containerRect = containerRef.current.getBoundingClientRect();
1706
- const boundingRect = menuScroll === window ? {
1707
- left: 0,
1708
- top: 0,
1709
- right: document.documentElement.clientWidth,
1710
- bottom: window.innerHeight
1711
- } : menuScroll.getBoundingClientRect();
1712
- const padding = parsePadding(boundingBoxPadding);
1713
- const getLeftOverflow = x => x + containerRect.left - boundingRect.left - padding.left;
1714
- const getRightOverflow = x => x + containerRect.left + menuRect.width - boundingRect.right + padding.right;
1715
- const getTopOverflow = y => y + containerRect.top - boundingRect.top - padding.top;
1716
- const getBottomOverflow = y => y + containerRect.top + menuRect.height - boundingRect.bottom + padding.bottom;
1717
- const confineHorizontally = x => {
1718
- let leftOverflow = getLeftOverflow(x);
1719
- if (leftOverflow < 0) {
1720
- x -= leftOverflow;
1721
- } else {
1722
- const rightOverflow = getRightOverflow(x);
1723
- if (rightOverflow > 0) {
1724
- x -= rightOverflow;
1725
- leftOverflow = getLeftOverflow(x);
1726
- if (leftOverflow < 0) x -= leftOverflow;
1727
- }
1728
- }
1729
- return x;
1730
- };
1731
- const confineVertically = y => {
1732
- let topOverflow = getTopOverflow(y);
1733
- if (topOverflow < 0) {
1734
- y -= topOverflow;
1735
- } else {
1736
- const bottomOverflow = getBottomOverflow(y);
1737
- if (bottomOverflow > 0) {
1738
- y -= bottomOverflow;
1739
- topOverflow = getTopOverflow(y);
1740
- if (topOverflow < 0) y -= topOverflow;
1741
- }
1742
- }
1743
- return y;
1744
- };
1745
- return {
1746
- menuRect,
1747
- containerRect,
1748
- getLeftOverflow,
1749
- getRightOverflow,
1750
- getTopOverflow,
1751
- getBottomOverflow,
1752
- confineHorizontally,
1753
- confineVertically
1754
- };
1755
- };
1756
-
1757
- const placeArrowVertical = ({
1758
- arrowRef,
1759
- menuY,
1760
- anchorRect,
1761
- containerRect,
1762
- menuRect
1763
- }) => {
1764
- let y = anchorRect.top - containerRect.top - menuY + anchorRect.height / 2;
1765
- const offset = arrowRef.current.offsetHeight * 1.25;
1766
- y = Math.max(offset, y);
1767
- y = Math.min(y, menuRect.height - offset);
1768
- return y;
1769
- };
1770
-
1771
- const placeLeftorRight = ({
1772
- anchorRect,
1773
- containerRect,
1774
- menuRect,
1775
- placeLeftorRightY,
1776
- placeLeftX,
1777
- placeRightX,
1778
- getLeftOverflow,
1779
- getRightOverflow,
1780
- confineHorizontally,
1781
- confineVertically,
1782
- arrowRef,
1783
- arrow,
1784
- direction,
1785
- position
1786
- }) => {
1787
- let computedDirection = direction;
1788
- let y = placeLeftorRightY;
1789
- if (position !== 'initial') {
1790
- y = confineVertically(y);
1791
- if (position === 'anchor') {
1792
- y = Math.min(y, anchorRect.bottom - containerRect.top);
1793
- y = Math.max(y, anchorRect.top - containerRect.top - menuRect.height);
1794
- }
1795
- }
1796
- let x, leftOverflow, rightOverflow;
1797
- if (computedDirection === 'left') {
1798
- x = placeLeftX;
1799
- if (position !== 'initial') {
1800
- leftOverflow = getLeftOverflow(x);
1801
- if (leftOverflow < 0) {
1802
- rightOverflow = getRightOverflow(placeRightX);
1803
- if (rightOverflow <= 0 || -leftOverflow > rightOverflow) {
1804
- x = placeRightX;
1805
- computedDirection = 'right';
1806
- }
1807
- }
1808
- }
1809
- } else {
1810
- x = placeRightX;
1811
- if (position !== 'initial') {
1812
- rightOverflow = getRightOverflow(x);
1813
- if (rightOverflow > 0) {
1814
- leftOverflow = getLeftOverflow(placeLeftX);
1815
- if (leftOverflow >= 0 || -leftOverflow < rightOverflow) {
1816
- x = placeLeftX;
1817
- computedDirection = 'left';
1818
- }
1819
- }
1820
- }
1821
- }
1822
- if (position === 'auto') x = confineHorizontally(x);
1823
- const arrowY = arrow ? placeArrowVertical({
1824
- menuY: y,
1825
- arrowRef,
1826
- anchorRect,
1827
- containerRect,
1828
- menuRect
1829
- }) : undefined;
1830
- return {
1831
- arrowY,
1832
- x,
1833
- y,
1834
- computedDirection
1835
- };
1836
- };
1837
-
1838
- const placeArrowHorizontal = ({
1839
- arrowRef,
1840
- menuX,
1841
- anchorRect,
1842
- containerRect,
1843
- menuRect
1844
- }) => {
1845
- let x = anchorRect.left - containerRect.left - menuX + anchorRect.width / 2;
1846
- const offset = arrowRef.current.offsetWidth * 1.25;
1847
- x = Math.max(offset, x);
1848
- x = Math.min(x, menuRect.width - offset);
1849
- return x;
1850
- };
1851
-
1852
- const placeToporBottom = ({
1853
- anchorRect,
1854
- containerRect,
1855
- menuRect,
1856
- placeToporBottomX,
1857
- placeTopY,
1858
- placeBottomY,
1859
- getTopOverflow,
1860
- getBottomOverflow,
1861
- confineHorizontally,
1862
- confineVertically,
1863
- arrowRef,
1864
- arrow,
1865
- direction,
1866
- position
1867
- }) => {
1868
- let computedDirection = direction === 'top' ? 'top' : 'bottom';
1869
- let x = placeToporBottomX;
1870
- if (position !== 'initial') {
1871
- x = confineHorizontally(x);
1872
- if (position === 'anchor') {
1873
- x = Math.min(x, anchorRect.right - containerRect.left);
1874
- x = Math.max(x, anchorRect.left - containerRect.left - menuRect.width);
1875
- }
1876
- }
1877
- let y, topOverflow, bottomOverflow;
1878
- if (computedDirection === 'top') {
1879
- y = placeTopY;
1880
- if (position !== 'initial') {
1881
- topOverflow = getTopOverflow(y);
1882
- if (topOverflow < 0) {
1883
- bottomOverflow = getBottomOverflow(placeBottomY);
1884
- if (bottomOverflow <= 0 || -topOverflow > bottomOverflow) {
1885
- y = placeBottomY;
1886
- computedDirection = 'bottom';
1887
- }
1888
- }
1889
- }
1890
- } else {
1891
- y = placeBottomY;
1892
- if (position !== 'initial') {
1893
- bottomOverflow = getBottomOverflow(y);
1894
- if (bottomOverflow > 0) {
1895
- topOverflow = getTopOverflow(placeTopY);
1896
- if (topOverflow >= 0 || -topOverflow < bottomOverflow) {
1897
- y = placeTopY;
1898
- computedDirection = 'top';
1899
- }
1900
- }
1901
- }
1902
- }
1903
- if (position === 'auto') y = confineVertically(y);
1904
- const arrowX = arrow ? placeArrowHorizontal({
1905
- menuX: x,
1906
- arrowRef,
1907
- anchorRect,
1908
- containerRect,
1909
- menuRect
1910
- }) : undefined;
1911
- return {
1912
- arrowX,
1913
- x,
1914
- y,
1915
- computedDirection
1916
- };
1917
- };
1918
-
1919
- const positionMenu = ({
1920
- arrow,
1921
- align,
1922
- direction,
1923
- gap,
1924
- shift,
1925
- position,
1926
- anchorRect,
1927
- arrowRef,
1928
- positionHelpers
1929
- }) => {
1930
- const {
1931
- menuRect,
1932
- containerRect
1933
- } = positionHelpers;
1934
- const isHorizontal = direction === 'left' || direction === 'right';
1935
- let horizontalOffset = isHorizontal ? gap : shift;
1936
- let verticalOffset = isHorizontal ? shift : gap;
1937
- if (arrow) {
1938
- const arrowElt = arrowRef.current;
1939
- if (isHorizontal) {
1940
- horizontalOffset += arrowElt.offsetWidth;
1941
- } else {
1942
- verticalOffset += arrowElt.offsetHeight;
1943
- }
1944
- }
1945
- const placeLeftX = anchorRect.left - containerRect.left - menuRect.width - horizontalOffset;
1946
- const placeRightX = anchorRect.right - containerRect.left + horizontalOffset;
1947
- const placeTopY = anchorRect.top - containerRect.top - menuRect.height - verticalOffset;
1948
- const placeBottomY = anchorRect.bottom - containerRect.top + verticalOffset;
1949
- let placeToporBottomX, placeLeftorRightY;
1950
- if (align === 'end') {
1951
- placeToporBottomX = anchorRect.right - containerRect.left - menuRect.width;
1952
- placeLeftorRightY = anchorRect.bottom - containerRect.top - menuRect.height;
1953
- } else if (align === 'center') {
1954
- placeToporBottomX = anchorRect.left - containerRect.left - (menuRect.width - anchorRect.width) / 2;
1955
- placeLeftorRightY = anchorRect.top - containerRect.top - (menuRect.height - anchorRect.height) / 2;
1956
- } else {
1957
- placeToporBottomX = anchorRect.left - containerRect.left;
1958
- placeLeftorRightY = anchorRect.top - containerRect.top;
1959
- }
1960
- placeToporBottomX += horizontalOffset;
1961
- placeLeftorRightY += verticalOffset;
1962
- const options = {
1963
- ...positionHelpers,
1964
- anchorRect,
1965
- placeLeftX,
1966
- placeRightX,
1967
- placeLeftorRightY,
1968
- placeTopY,
1969
- placeBottomY,
1970
- placeToporBottomX,
1971
- arrowRef,
1972
- arrow,
1973
- direction,
1974
- position
1975
- };
1976
- switch (direction) {
1977
- case 'left':
1978
- case 'right':
1979
- return placeLeftorRight(options);
1980
- case 'top':
1981
- case 'bottom':
1982
- default:
1983
- return placeToporBottom(options);
1984
- }
1985
- };
1986
-
1987
- const useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;
1988
-
1989
- function setRef(ref, instance) {
1990
- typeof ref === 'function' ? ref(instance) : ref.current = instance;
1991
- }
1992
- const useCombinedRef = (refA, refB) => useMemo(() => {
1993
- if (!refA) return refB;
1994
- if (!refB) return refA;
1995
- return instance => {
1996
- setRef(refA, instance);
1997
- setRef(refB, instance);
1998
- };
1999
- }, [refA, refB]);
2000
-
2001
- const offScreen = -9999;
2002
- const MenuList = ({
2003
- ariaLabel,
2004
- menuClassName,
2005
- menuStyle,
2006
- arrow,
2007
- arrowProps = {},
2008
- anchorPoint,
2009
- anchorRef,
2010
- containerRef,
2011
- containerProps,
2012
- focusProps,
2013
- externalRef,
2014
- parentScrollingRef,
2015
- align = 'start',
2016
- direction = 'bottom',
2017
- position = 'auto',
2018
- overflow = 'visible',
2019
- setDownOverflow,
2020
- repositionFlag,
2021
- captureFocus = true,
2022
- state,
2023
- endTransition,
2024
- isDisabled,
2025
- menuItemFocus,
2026
- gap = 0,
2027
- shift = 0,
2028
- children,
2029
- onClose,
2030
- ...restProps
2031
- }) => {
2032
- const [menuPosition, setMenuPosition] = useState({
2033
- x: offScreen,
2034
- y: offScreen
2035
- });
2036
- const [arrowPosition, setArrowPosition] = useState({});
2037
- const [overflowData, setOverflowData] = useState();
2038
- const [expandedDirection, setExpandedDirection] = useState(direction);
2039
- const [submenuCtx] = useState(createSubmenuCtx);
2040
- const [reposSubmenu, forceReposSubmenu] = useReducer(c => c + 1, 1);
2041
- const {
2042
- transition,
2043
- boundingBoxRef,
2044
- boundingBoxPadding,
2045
- rootMenuRef,
2046
- rootAnchorRef,
2047
- scrollNodesRef,
2048
- reposition,
2049
- viewScroll,
2050
- submenuCloseDelay
2051
- } = useContext(SettingsContext);
2052
- const {
2053
- submenuCtx: parentSubmenuCtx,
2054
- reposSubmenu: reposFlag = repositionFlag
2055
- } = useContext(MenuListContext);
2056
- const menuRef = useRef(null);
2057
- const focusRef = useRef();
2058
- const arrowRef = useRef();
2059
- const prevOpen = useRef(false);
2060
- const latestMenuSize = useRef({
2061
- width: 0,
2062
- height: 0
2063
- });
2064
- const latestHandlePosition = useRef(() => {});
2065
- const {
2066
- hoverItem,
2067
- dispatch,
2068
- updateItems
2069
- } = useItems(menuRef, focusRef);
2070
- const isOpen = isMenuOpen(state);
2071
- const openTransition = getTransition(transition, 'open');
2072
- const closeTransition = getTransition(transition, 'close');
2073
- const scrollNodes = scrollNodesRef.current;
2074
- const onKeyDown = e => {
2075
- switch (e.key) {
2076
- case Keys.HOME:
2077
- dispatch(HoverActionTypes.FIRST);
2078
- break;
2079
- case Keys.END:
2080
- dispatch(HoverActionTypes.LAST);
2081
- break;
2082
- case Keys.UP:
2083
- dispatch(HoverActionTypes.DECREASE, hoverItem);
2084
- break;
2085
- case Keys.DOWN:
2086
- dispatch(HoverActionTypes.INCREASE, hoverItem);
2087
- break;
2088
- case Keys.SPACE:
2089
- if (e.target && e.target.className.indexOf(menuClass) !== -1) {
2090
- e.preventDefault();
2091
- }
2092
- return;
2093
- default:
2094
- return;
2095
- }
2096
- e.preventDefault();
2097
- e.stopPropagation();
2098
- };
2099
- const onAnimationEnd = () => {
2100
- if (state === 'closing') {
2101
- setOverflowData();
2102
- }
2103
- safeCall(endTransition);
2104
- };
2105
- const onPointerMove = e => {
2106
- e.stopPropagation();
2107
- submenuCtx.on(submenuCloseDelay, () => {
2108
- dispatch(HoverActionTypes.RESET);
2109
- focusRef.current.focus();
2110
- });
2111
- };
2112
- const onPointerLeave = e => {
2113
- if (e.target === e.currentTarget) submenuCtx.off();
2114
- };
2115
- const handlePosition = useCallback(noOverflowCheck => {
2116
- var _anchorRef$current;
2117
- const anchorRect = anchorRef ? (_anchorRef$current = anchorRef.current) == null ? void 0 : _anchorRef$current.getBoundingClientRect() : anchorPoint ? {
2118
- left: anchorPoint.x,
2119
- right: anchorPoint.x,
2120
- top: anchorPoint.y,
2121
- bottom: anchorPoint.y,
2122
- width: 0,
2123
- height: 0
2124
- } : null;
2125
- if (!anchorRect) {
2126
- if (process.env.NODE_ENV !== 'production') {
2127
- console.warn('[React-Menu] Menu might not be positioned properly as one of the anchorRef or anchorPoint prop should be provided. If `anchorRef` is provided, the anchor must be mounted before menu is open.');
2128
- }
2129
- return;
2130
- }
2131
- if (!scrollNodes.menu) {
2132
- scrollNodes.menu = (boundingBoxRef ? boundingBoxRef.current : getScrollAncestor(rootMenuRef.current)) || window;
2133
- }
2134
- const positionHelpers = getPositionHelpers(containerRef, menuRef, scrollNodes.menu, boundingBoxPadding);
2135
- let {
2136
- arrowX,
2137
- arrowY,
2138
- x,
2139
- y,
2140
- computedDirection
2141
- } = positionMenu({
2142
- arrow,
2143
- align,
2144
- direction,
2145
- gap,
2146
- shift,
2147
- position,
2148
- anchorRect,
2149
- arrowRef,
2150
- positionHelpers
2151
- });
2152
- const {
2153
- menuRect
2154
- } = positionHelpers;
2155
- let menuHeight = menuRect.height;
2156
- if (!noOverflowCheck && overflow !== 'visible') {
2157
- const {
2158
- getTopOverflow,
2159
- getBottomOverflow
2160
- } = positionHelpers;
2161
- let height, overflowAmt;
2162
- const prevHeight = latestMenuSize.current.height;
2163
- const bottomOverflow = getBottomOverflow(y);
2164
- if (bottomOverflow > 0 || floatEqual(bottomOverflow, 0) && floatEqual(menuHeight, prevHeight)) {
2165
- height = menuHeight - bottomOverflow;
2166
- overflowAmt = bottomOverflow;
2167
- } else {
2168
- const topOverflow = getTopOverflow(y);
2169
- if (topOverflow < 0 || floatEqual(topOverflow, 0) && floatEqual(menuHeight, prevHeight)) {
2170
- height = menuHeight + topOverflow;
2171
- overflowAmt = 0 - topOverflow;
2172
- if (height >= 0) y -= topOverflow;
2173
- }
2174
- }
2175
- if (height >= 0) {
2176
- menuHeight = height;
2177
- setOverflowData({
2178
- height,
2179
- overflowAmt
2180
- });
2181
- } else {
2182
- setOverflowData();
2183
- }
2184
- }
2185
- if (arrow) setArrowPosition({
2186
- x: arrowX,
2187
- y: arrowY
2188
- });
2189
- setMenuPosition({
2190
- x,
2191
- y
2192
- });
2193
- setExpandedDirection(computedDirection);
2194
- latestMenuSize.current = {
2195
- width: menuRect.width,
2196
- height: menuHeight
2197
- };
2198
- }, [arrow, align, boundingBoxPadding, direction, gap, shift, position, overflow, anchorPoint, anchorRef, containerRef, boundingBoxRef, rootMenuRef, scrollNodes]);
2199
- useIsomorphicLayoutEffect(() => {
2200
- if (isOpen) {
2201
- handlePosition();
2202
- if (prevOpen.current) forceReposSubmenu();
2203
- }
2204
- prevOpen.current = isOpen;
2205
- latestHandlePosition.current = handlePosition;
2206
- }, [isOpen, handlePosition, reposFlag]);
2207
- useIsomorphicLayoutEffect(() => {
2208
- if (overflowData && !setDownOverflow) menuRef.current.scrollTop = 0;
2209
- }, [overflowData, setDownOverflow]);
2210
- useIsomorphicLayoutEffect(() => updateItems, [updateItems]);
2211
- useEffect(() => {
2212
- let {
2213
- menu: menuScroll
2214
- } = scrollNodes;
2215
- if (!isOpen || !menuScroll) return;
2216
- menuScroll = menuScroll.addEventListener ? menuScroll : window;
2217
- if (!scrollNodes.anchors) {
2218
- scrollNodes.anchors = [];
2219
- let anchorScroll = getScrollAncestor(rootAnchorRef && rootAnchorRef.current);
2220
- while (anchorScroll && anchorScroll !== menuScroll) {
2221
- scrollNodes.anchors.push(anchorScroll);
2222
- anchorScroll = getScrollAncestor(anchorScroll);
2223
- }
2224
- }
2225
- let scroll = viewScroll;
2226
- if (scrollNodes.anchors.length && scroll === 'initial') scroll = 'auto';
2227
- if (scroll === 'initial') return;
2228
- const handleScroll = () => {
2229
- if (scroll === 'auto') {
2230
- batchedUpdates(() => handlePosition(true));
2231
- } else {
2232
- safeCall(onClose, {
2233
- reason: CloseReason.SCROLL
2234
- });
2235
- }
2236
- };
2237
- const scrollObservers = scrollNodes.anchors.concat(viewScroll !== 'initial' ? menuScroll : []);
2238
- scrollObservers.forEach(o => o.addEventListener('scroll', handleScroll));
2239
- return () => scrollObservers.forEach(o => o.removeEventListener('scroll', handleScroll));
2240
- }, [rootAnchorRef, scrollNodes, isOpen, onClose, viewScroll, handlePosition]);
2241
- const hasOverflow = !!overflowData && overflowData.overflowAmt > 0;
2242
- useEffect(() => {
2243
- if (hasOverflow || !isOpen || !parentScrollingRef) return;
2244
- const handleScroll = () => batchedUpdates(handlePosition);
2245
- const parentScroll = parentScrollingRef.current;
2246
- parentScroll.addEventListener('scroll', handleScroll);
2247
- return () => parentScroll.removeEventListener('scroll', handleScroll);
2248
- }, [isOpen, hasOverflow, parentScrollingRef, handlePosition]);
2249
- useEffect(() => {
2250
- if (typeof ResizeObserver !== 'function' || reposition === 'initial') return;
2251
- const resizeObserver = new ResizeObserver(([entry]) => {
2252
- const {
2253
- borderBoxSize,
2254
- target
2255
- } = entry;
2256
- let width, height;
2257
- if (borderBoxSize) {
2258
- const {
2259
- inlineSize,
2260
- blockSize
2261
- } = borderBoxSize[0] || borderBoxSize;
2262
- width = inlineSize;
2263
- height = blockSize;
2264
- } else {
2265
- const borderRect = target.getBoundingClientRect();
2266
- width = borderRect.width;
2267
- height = borderRect.height;
2268
- }
2269
- if (width === 0 || height === 0) return;
2270
- if (floatEqual(width, latestMenuSize.current.width, 1) && floatEqual(height, latestMenuSize.current.height, 1)) return;
2271
- flushSync(() => {
2272
- latestHandlePosition.current();
2273
- forceReposSubmenu();
2274
- });
2275
- });
2276
- const observeTarget = menuRef.current;
2277
- resizeObserver.observe(observeTarget, {
2278
- box: 'border-box'
2279
- });
2280
- return () => resizeObserver.unobserve(observeTarget);
2281
- }, [reposition]);
2282
- useEffect(() => {
2283
- if (!isOpen) {
2284
- dispatch(HoverActionTypes.RESET);
2285
- if (!closeTransition) setOverflowData();
2286
- return;
2287
- }
2288
- const {
2289
- position,
2290
- alwaysUpdate
2291
- } = menuItemFocus || {};
2292
- const setItemFocus = () => {
2293
- if (position === FocusPositions.FIRST) {
2294
- dispatch(HoverActionTypes.FIRST);
2295
- } else if (position === FocusPositions.LAST) {
2296
- dispatch(HoverActionTypes.LAST);
2297
- } else if (position >= -1) {
2298
- dispatch(HoverActionTypes.SET_INDEX, undefined, position);
2299
- }
2300
- };
2301
- if (alwaysUpdate) {
2302
- setItemFocus();
2303
- } else if (captureFocus) {
2304
- const id = setTimeout(() => {
2305
- const menuElt = menuRef.current;
2306
- if (menuElt && !menuElt.contains(document.activeElement)) {
2307
- focusRef.current.focus();
2308
- setItemFocus();
2309
- }
2310
- }, openTransition ? 170 : 100);
2311
- return () => clearTimeout(id);
2312
- }
2313
- }, [isOpen, openTransition, closeTransition, captureFocus, menuItemFocus, dispatch]);
2314
- const itemContext = useMemo(() => ({
2315
- isParentOpen: isOpen,
2316
- submenuCtx,
2317
- dispatch,
2318
- updateItems
2319
- }), [isOpen, submenuCtx, dispatch, updateItems]);
2320
- let maxHeight, overflowAmt;
2321
- if (overflowData) {
2322
- setDownOverflow ? overflowAmt = overflowData.overflowAmt : maxHeight = overflowData.height;
2323
- }
2324
- const listContext = useMemo(() => ({
2325
- reposSubmenu,
2326
- submenuCtx,
2327
- overflow,
2328
- overflowAmt,
2329
- parentMenuRef: menuRef,
2330
- parentDir: expandedDirection
2331
- }), [reposSubmenu, submenuCtx, overflow, overflowAmt, expandedDirection]);
2332
- const overflowStyle = maxHeight >= 0 ? {
2333
- maxHeight,
2334
- overflow
2335
- } : undefined;
2336
- const modifiers = useMemo(() => ({
2337
- state,
2338
- dir: expandedDirection
2339
- }), [state, expandedDirection]);
2340
- const arrowModifiers = useMemo(() => ({
2341
- dir: expandedDirection
2342
- }), [expandedDirection]);
2343
- const _arrowClassName = useBEM({
2344
- block: menuClass,
2345
- element: menuArrowClass,
2346
- modifiers: arrowModifiers,
2347
- className: arrowProps.className
2348
- });
2349
- const menu = /*#__PURE__*/jsxs("ul", {
2350
- role: "menu",
2351
- "aria-label": ariaLabel,
2352
- ...commonProps(isDisabled),
2353
- ...mergeProps({
2354
- onPointerEnter: parentSubmenuCtx == null ? void 0 : parentSubmenuCtx.off,
2355
- onPointerMove,
2356
- onPointerLeave,
2357
- onKeyDown,
2358
- onAnimationEnd
2359
- }, restProps),
2360
- ref: useCombinedRef(externalRef, menuRef),
2361
- className: useBEM({
2362
- block: menuClass,
2363
- modifiers,
2364
- className: menuClassName
2365
- }),
2366
- style: {
2367
- ...menuStyle,
2368
- ...overflowStyle,
2369
- margin: 0,
2370
- display: state === 'closed' ? 'none' : undefined,
2371
- position: positionAbsolute,
2372
- left: menuPosition.x,
2373
- top: menuPosition.y
2374
- },
2375
- children: [/*#__PURE__*/jsx("li", {
2376
- tabIndex: -1,
2377
- style: {
2378
- position: positionAbsolute,
2379
- left: 0,
2380
- top: 0,
2381
- display: 'block',
2382
- outline: 'none'
2383
- },
2384
- ref: focusRef,
2385
- ...dummyItemProps,
2386
- ...focusProps
2387
- }), arrow && /*#__PURE__*/jsx("li", {
2388
- ...dummyItemProps,
2389
- ...arrowProps,
2390
- className: _arrowClassName,
2391
- style: {
2392
- display: 'block',
2393
- position: positionAbsolute,
2394
- left: arrowPosition.x,
2395
- top: arrowPosition.y,
2396
- ...arrowProps.style
2397
- },
2398
- ref: arrowRef
2399
- }), /*#__PURE__*/jsx(MenuListContext.Provider, {
2400
- value: listContext,
2401
- children: /*#__PURE__*/jsx(MenuListItemContext.Provider, {
2402
- value: itemContext,
2403
- children: /*#__PURE__*/jsx(HoverItemContext.Provider, {
2404
- value: hoverItem,
2405
- children: safeCall(children, modifiers)
2406
- })
2407
- })
2408
- })]
2409
- });
2410
- return containerProps ? /*#__PURE__*/jsx(MenuContainer, {
2411
- ...containerProps,
2412
- isOpen: isOpen,
2413
- children: menu
2414
- }) : menu;
2415
- };
2416
-
2417
- const ControlledMenu = /*#__PURE__*/forwardRef(function ControlledMenu({
2418
- 'aria-label': ariaLabel,
2419
- className,
2420
- containerProps,
2421
- initialMounted,
2422
- unmountOnClose,
2423
- transition,
2424
- transitionTimeout,
2425
- boundingBoxRef,
2426
- boundingBoxPadding,
2427
- reposition = 'auto',
2428
- submenuOpenDelay = 300,
2429
- submenuCloseDelay = 150,
2430
- viewScroll = 'initial',
2431
- portal,
2432
- theming,
2433
- onItemClick,
2434
- ...restProps
2435
- }, externalRef) {
2436
- const containerRef = useRef(null);
2437
- const scrollNodesRef = useRef({});
2438
- const {
2439
- anchorRef,
2440
- state,
2441
- onClose
2442
- } = restProps;
2443
- const settings = useMemo(() => ({
2444
- initialMounted,
2445
- unmountOnClose,
2446
- transition,
2447
- transitionTimeout,
2448
- boundingBoxRef,
2449
- boundingBoxPadding,
2450
- rootMenuRef: containerRef,
2451
- rootAnchorRef: anchorRef,
2452
- scrollNodesRef,
2453
- reposition,
2454
- viewScroll,
2455
- submenuOpenDelay,
2456
- submenuCloseDelay
2457
- }), [initialMounted, unmountOnClose, transition, transitionTimeout, anchorRef, boundingBoxRef, boundingBoxPadding, reposition, viewScroll, submenuOpenDelay, submenuCloseDelay]);
2458
- const eventHandlers = useMemo(() => ({
2459
- handleClick(event, isCheckorRadio) {
2460
- if (!event.stopPropagation) safeCall(onItemClick, event);
2461
- let keepOpen = event.keepOpen;
2462
- if (keepOpen === undefined) {
2463
- keepOpen = isCheckorRadio && event.key === Keys.SPACE;
2464
- }
2465
- if (!keepOpen) {
2466
- safeCall(onClose, {
2467
- value: event.value,
2468
- key: event.key,
2469
- reason: CloseReason.CLICK
2470
- });
2471
- }
2472
- },
2473
- handleClose(key) {
2474
- safeCall(onClose, {
2475
- key,
2476
- reason: CloseReason.CLICK
2477
- });
2478
- }
2479
- }), [onItemClick, onClose]);
2480
- if (!state) return null;
2481
- const menuList = /*#__PURE__*/jsx(SettingsContext.Provider, {
2482
- value: settings,
2483
- children: /*#__PURE__*/jsx(EventHandlersContext.Provider, {
2484
- value: eventHandlers,
2485
- children: /*#__PURE__*/jsx(MenuList, {
2486
- ...restProps,
2487
- ariaLabel: ariaLabel || 'Menu',
2488
- externalRef: externalRef,
2489
- containerRef: containerRef,
2490
- containerProps: {
2491
- className,
2492
- containerRef,
2493
- containerProps,
2494
- theming,
2495
- transition,
2496
- onClose
2497
- }
2498
- })
2499
- })
2500
- });
2501
- if (portal === true && typeof document !== 'undefined') {
2502
- return /*#__PURE__*/createPortal(menuList, document.body);
2503
- } else if (portal) {
2504
- return portal.target ? /*#__PURE__*/createPortal(menuList, portal.target) : portal.stablePosition ? null : menuList;
2505
- }
2506
- return menuList;
2507
- });
2508
- process.env.NODE_ENV !== "production" ? ControlledMenu.propTypes = {
2509
- ...rootMenuPropTypes,
2510
- state: /*#__PURE__*/propTypesExports.oneOf( /*#__PURE__*/values(MenuStateMap)),
2511
- anchorPoint: /*#__PURE__*/propTypesExports.exact({
2512
- x: propTypesExports.number,
2513
- y: propTypesExports.number
2514
- }),
2515
- anchorRef: propTypesExports.object,
2516
- captureFocus: propTypesExports.bool,
2517
- menuItemFocus: /*#__PURE__*/propTypesExports.exact({
2518
- position: /*#__PURE__*/propTypesExports.oneOfType([propTypesExports.string, propTypesExports.number]),
2519
- alwaysUpdate: propTypesExports.bool
2520
- }),
2521
- onClose: propTypesExports.func
2522
- } : void 0;
2523
-
2524
- const PRE_ENTER = 0;
2525
- const ENTERING = 1;
2526
- const ENTERED = 2;
2527
- const PRE_EXIT = 3;
2528
- const EXITING = 4;
2529
- const EXITED = 5;
2530
- const UNMOUNTED = 6;
2531
- const STATUS = ['preEnter', 'entering', 'entered', 'preExit', 'exiting', 'exited', 'unmounted'];
2532
- const getState = status => ({
2533
- _s: status,
2534
- status: STATUS[status],
2535
- isEnter: status < PRE_EXIT,
2536
- isMounted: status !== UNMOUNTED,
2537
- isResolved: status === ENTERED || status > EXITING
2538
- });
2539
- const startOrEnd = unmounted => unmounted ? UNMOUNTED : EXITED;
2540
- const getEndStatus = (status, unmountOnExit) => {
2541
- switch (status) {
2542
- case ENTERING:
2543
- case PRE_ENTER:
2544
- return ENTERED;
2545
- case EXITING:
2546
- case PRE_EXIT:
2547
- return startOrEnd(unmountOnExit);
2548
- }
2549
- };
2550
- const getTimeout = timeout => typeof timeout === 'object' ? [timeout.enter, timeout.exit] : [timeout, timeout];
2551
- const nextTick = (transitState, status) => setTimeout(() => {
2552
- // Reading document.body.offsetTop can force browser to repaint before transition to the next state
2553
- isNaN(document.body.offsetTop) || transitState(status + 1);
2554
- }, 0);
2555
-
2556
- const updateState = (status, setState, latestState, timeoutId, onChange) => {
2557
- clearTimeout(timeoutId.current);
2558
- const state = getState(status);
2559
- setState(state);
2560
- latestState.current = state;
2561
- onChange && onChange({
2562
- current: state
2563
- });
2564
- };
2565
- const useTransition = ({
2566
- enter = true,
2567
- exit = true,
2568
- preEnter,
2569
- preExit,
2570
- timeout,
2571
- initialEntered,
2572
- mountOnEnter,
2573
- unmountOnExit,
2574
- onStateChange: onChange
2575
- } = {}) => {
2576
- const [state, setState] = useState(() => getState(initialEntered ? ENTERED : startOrEnd(mountOnEnter)));
2577
- const latestState = useRef(state);
2578
- const timeoutId = useRef();
2579
- const [enterTimeout, exitTimeout] = getTimeout(timeout);
2580
- const endTransition = useCallback(() => {
2581
- const status = getEndStatus(latestState.current._s, unmountOnExit);
2582
- status && updateState(status, setState, latestState, timeoutId, onChange);
2583
- }, [onChange, unmountOnExit]);
2584
- const toggle = useCallback(toEnter => {
2585
- const transitState = status => {
2586
- updateState(status, setState, latestState, timeoutId, onChange);
2587
- switch (status) {
2588
- case ENTERING:
2589
- if (enterTimeout >= 0) timeoutId.current = setTimeout(endTransition, enterTimeout);
2590
- break;
2591
- case EXITING:
2592
- if (exitTimeout >= 0) timeoutId.current = setTimeout(endTransition, exitTimeout);
2593
- break;
2594
- case PRE_ENTER:
2595
- case PRE_EXIT:
2596
- timeoutId.current = nextTick(transitState, status);
2597
- break;
2598
- }
2599
- };
2600
- const enterStage = latestState.current.isEnter;
2601
- if (typeof toEnter !== 'boolean') toEnter = !enterStage;
2602
- if (toEnter) {
2603
- !enterStage && transitState(enter ? preEnter ? PRE_ENTER : ENTERING : ENTERED);
2604
- } else {
2605
- enterStage && transitState(exit ? preExit ? PRE_EXIT : EXITING : startOrEnd(unmountOnExit));
2606
- }
2607
- }, [endTransition, onChange, enter, exit, preEnter, preExit, enterTimeout, exitTimeout, unmountOnExit]);
2608
- useEffect(() => () => clearTimeout(timeoutId.current), []);
2609
- return [state, toggle, endTransition];
2610
- };
2611
-
2612
- const useMenuState = ({
2613
- initialOpen,
2614
- initialMounted,
2615
- unmountOnClose,
2616
- transition,
2617
- transitionTimeout = 500
2618
- } = {}) => {
2619
- const [{
2620
- status
2621
- }, toggleMenu, endTransition] = useTransition({
2622
- initialEntered: initialOpen,
2623
- mountOnEnter: !initialMounted,
2624
- unmountOnExit: unmountOnClose,
2625
- timeout: transitionTimeout,
2626
- enter: getTransition(transition, 'open'),
2627
- exit: getTransition(transition, 'close')
2628
- });
2629
- return [{
2630
- state: MenuStateMap[status],
2631
- endTransition
2632
- }, toggleMenu];
2633
- };
2634
-
2635
- const useMenuStateAndFocus = options => {
2636
- const [menuProps, toggleMenu] = useMenuState(options);
2637
- const [menuItemFocus, setMenuItemFocus] = useState();
2638
- const openMenu = (position, alwaysUpdate) => {
2639
- setMenuItemFocus({
2640
- position,
2641
- alwaysUpdate
2642
- });
2643
- toggleMenu(true);
2644
- };
2645
- return [{
2646
- menuItemFocus,
2647
- ...menuProps
2648
- }, toggleMenu, openMenu];
2649
- };
2650
-
2651
- const useClick = (state, onToggle) => {
2652
- if (process.env.NODE_ENV !== 'production' && typeof onToggle !== 'function') {
2653
- throw new Error('[React-Menu] useClick/useHover requires a function in the second parameter.');
2654
- }
2655
- const [skipOpen] = useState({});
2656
- return {
2657
- onMouseDown: () => {
2658
- skipOpen.v = state && state !== 'closed';
2659
- },
2660
- onClick: e => skipOpen.v ? skipOpen.v = false : onToggle(true, e)
2661
- };
2662
- };
2663
-
2664
- const useMenuChange = (onMenuChange, isOpen) => {
2665
- const prevOpen = useRef(isOpen);
2666
- useEffect(() => {
2667
- if (prevOpen.current !== isOpen) safeCall(onMenuChange, {
2668
- open: isOpen
2669
- });
2670
- prevOpen.current = isOpen;
2671
- }, [onMenuChange, isOpen]);
2672
- };
2673
-
2674
- const Menu$2 = /*#__PURE__*/forwardRef(function Menu({
2675
- 'aria-label': ariaLabel,
2676
- captureFocus: _,
2677
- initialOpen: _1,
2678
- menuButton,
2679
- instanceRef,
2680
- onMenuChange,
2681
- ...restProps
2682
- }, externalRef) {
2683
- const [stateProps, toggleMenu, openMenu] = useMenuStateAndFocus(restProps);
2684
- const {
2685
- state
2686
- } = stateProps;
2687
- const isOpen = isMenuOpen(state);
2688
- const buttonRef = useRef(null);
2689
- const anchorProps = useClick(state, (_, e) => openMenu(!e.detail ? FocusPositions.FIRST : undefined));
2690
- const handleClose = useCallback(e => {
2691
- toggleMenu(false);
2692
- if (e.key) buttonRef.current.focus();
2693
- }, [toggleMenu]);
2694
- const onKeyDown = e => {
2695
- switch (e.key) {
2696
- case Keys.UP:
2697
- openMenu(FocusPositions.LAST);
2698
- break;
2699
- case Keys.DOWN:
2700
- openMenu(FocusPositions.FIRST);
2701
- break;
2702
- default:
2703
- return;
2704
- }
2705
- e.preventDefault();
2706
- };
2707
- const button = safeCall(menuButton, {
2708
- open: isOpen
2709
- });
2710
- if (!button || !button.type) throw new Error('Menu requires a menuButton prop.');
2711
- const buttonProps = {
2712
- ref: useCombinedRef(button.ref, buttonRef),
2713
- ...mergeProps({
2714
- onKeyDown,
2715
- ...anchorProps
2716
- }, button.props)
2717
- };
2718
- if (getName(button.type) === 'MenuButton') {
2719
- buttonProps.isOpen = isOpen;
2720
- }
2721
- const renderButton = /*#__PURE__*/cloneElement(button, buttonProps);
2722
- useMenuChange(onMenuChange, isOpen);
2723
- useImperativeHandle(instanceRef, () => ({
2724
- openMenu,
2725
- closeMenu: () => toggleMenu(false)
2726
- }));
2727
- return /*#__PURE__*/jsxs(Fragment, {
2728
- children: [renderButton, /*#__PURE__*/jsx(ControlledMenu, {
2729
- ...restProps,
2730
- ...stateProps,
2731
- "aria-label": ariaLabel || (typeof button.props.children === 'string' ? button.props.children : 'Menu'),
2732
- anchorRef: buttonRef,
2733
- ref: externalRef,
2734
- onClose: handleClose
2735
- })]
2736
- });
2737
- });
2738
- process.env.NODE_ENV !== "production" ? Menu$2.propTypes = {
2739
- ...rootMenuPropTypes,
2740
- ...uncontrolledMenuPropTypes,
2741
- menuButton: propTypesExports.oneOfType([propTypesExports.element, propTypesExports.func]).isRequired
2742
- } : void 0;
2743
-
2744
- const withHovering = (name, WrappedComponent) => {
2745
- const Component = /*#__PURE__*/memo(WrappedComponent);
2746
- const WithHovering = /*#__PURE__*/forwardRef((props, ref) => {
2747
- const itemRef = useRef(null);
2748
- return /*#__PURE__*/jsx(Component, {
2749
- ...props,
2750
- itemRef: itemRef,
2751
- externalRef: ref,
2752
- isHovering: useContext(HoverItemContext) === itemRef.current
2753
- });
2754
- });
2755
- WithHovering.displayName = `WithHovering(${name})`;
2756
- return WithHovering;
2757
- };
2758
-
2759
- const useItemEffect = (isDisabled, itemRef, updateItems) => {
2760
- useIsomorphicLayoutEffect(() => {
2761
- if (process.env.NODE_ENV !== 'production' && !updateItems) {
2762
- throw new Error(`[React-Menu] This menu item or submenu should be rendered under a menu: ${itemRef.current.outerHTML}`);
2763
- }
2764
- if (isDisabled) return;
2765
- const item = itemRef.current;
2766
- updateItems(item, true);
2767
- return () => {
2768
- updateItems(item);
2769
- };
2770
- }, [isDisabled, itemRef, updateItems]);
2771
- };
2772
-
2773
- const useItemState = (itemRef, focusRef, isHovering, isDisabled) => {
2774
- const {
2775
- submenuCloseDelay
2776
- } = useContext(SettingsContext);
2777
- const {
2778
- isParentOpen,
2779
- submenuCtx,
2780
- dispatch,
2781
- updateItems
2782
- } = useContext(MenuListItemContext);
2783
- const setHover = () => {
2784
- !isHovering && !isDisabled && dispatch(HoverActionTypes.SET, itemRef.current);
2785
- };
2786
- const unsetHover = () => {
2787
- !isDisabled && dispatch(HoverActionTypes.UNSET, itemRef.current);
2788
- };
2789
- const onBlur = e => {
2790
- if (isHovering && !e.currentTarget.contains(e.relatedTarget)) unsetHover();
2791
- };
2792
- const onPointerMove = e => {
2793
- if (!isDisabled) {
2794
- e.stopPropagation();
2795
- submenuCtx.on(submenuCloseDelay, setHover, setHover);
2796
- }
2797
- };
2798
- const onPointerLeave = (_, keepHover) => {
2799
- submenuCtx.off();
2800
- !keepHover && unsetHover();
2801
- };
2802
- useItemEffect(isDisabled, itemRef, updateItems);
2803
- useEffect(() => {
2804
- if (isHovering && isParentOpen) {
2805
- focusRef.current && focusRef.current.focus();
2806
- }
2807
- }, [focusRef, isHovering, isParentOpen]);
2808
- return {
2809
- setHover,
2810
- onBlur,
2811
- onPointerMove,
2812
- onPointerLeave
2813
- };
2814
- };
2815
-
2816
- const MenuItem$1 = /*#__PURE__*/withHovering('MenuItem', function MenuItem({
2817
- className,
2818
- value,
2819
- href,
2820
- type,
2821
- checked,
2822
- disabled,
2823
- children,
2824
- onClick,
2825
- isHovering,
2826
- itemRef,
2827
- externalRef,
2828
- ...restProps
2829
- }) {
2830
- const isDisabled = !!disabled;
2831
- const {
2832
- setHover,
2833
- ...restStateProps
2834
- } = useItemState(itemRef, itemRef, isHovering, isDisabled);
2835
- const eventHandlers = useContext(EventHandlersContext);
2836
- const radioGroup = useContext(RadioGroupContext);
2837
- const isRadio = type === 'radio';
2838
- const isCheckBox = type === 'checkbox';
2839
- const isAnchor = !!href && !isDisabled && !isRadio && !isCheckBox;
2840
- const isChecked = isRadio ? radioGroup.value === value : isCheckBox ? !!checked : false;
2841
- const handleClick = e => {
2842
- if (isDisabled) {
2843
- e.stopPropagation();
2844
- e.preventDefault();
2845
- return;
2846
- }
2847
- const event = {
2848
- value,
2849
- syntheticEvent: e
2850
- };
2851
- if (e.key !== undefined) event.key = e.key;
2852
- if (isCheckBox) event.checked = !isChecked;
2853
- if (isRadio) event.name = radioGroup.name;
2854
- safeCall(onClick, event);
2855
- if (isRadio) safeCall(radioGroup.onRadioChange, event);
2856
- eventHandlers.handleClick(event, isCheckBox || isRadio);
2857
- };
2858
- const handleKeyDown = e => {
2859
- if (!isHovering) return;
2860
- switch (e.key) {
2861
- case Keys.ENTER:
2862
- e.preventDefault();
2863
- case Keys.SPACE:
2864
- isAnchor ? itemRef.current.click() : handleClick(e);
2865
- }
2866
- };
2867
- const modifiers = useMemo(() => ({
2868
- type,
2869
- disabled: isDisabled,
2870
- hover: isHovering,
2871
- checked: isChecked,
2872
- anchor: isAnchor
2873
- }), [type, isDisabled, isHovering, isChecked, isAnchor]);
2874
- const mergedProps = mergeProps({
2875
- ...restStateProps,
2876
- onPointerDown: setHover,
2877
- onKeyDown: handleKeyDown,
2878
- onClick: handleClick
2879
- }, restProps);
2880
- const menuItemProps = {
2881
- role: isRadio ? 'menuitemradio' : isCheckBox ? 'menuitemcheckbox' : roleMenuitem,
2882
- 'aria-checked': isRadio || isCheckBox ? isChecked : undefined,
2883
- ...commonProps(isDisabled, isHovering),
2884
- ...mergedProps,
2885
- ref: useCombinedRef(externalRef, itemRef),
2886
- className: useBEM({
2887
- block: menuClass,
2888
- element: menuItemClass,
2889
- modifiers,
2890
- className
2891
- }),
2892
- children: useMemo(() => safeCall(children, modifiers), [children, modifiers])
2893
- };
2894
- return isAnchor ? /*#__PURE__*/jsx("li", {
2895
- role: roleNone,
2896
- children: /*#__PURE__*/jsx("a", {
2897
- href: href,
2898
- ...menuItemProps
2899
- })
2900
- }) : /*#__PURE__*/jsx("li", {
2901
- ...menuItemProps
2902
- });
2903
- });
2904
- process.env.NODE_ENV !== "production" ? MenuItem$1.propTypes = {
2905
- ...stylePropTypes(),
2906
- value: propTypesExports.any,
2907
- href: propTypesExports.string,
2908
- type: /*#__PURE__*/propTypesExports.oneOf(['checkbox', 'radio']),
2909
- checked: propTypesExports.bool,
2910
- disabled: propTypesExports.bool,
2911
- children: /*#__PURE__*/propTypesExports.oneOfType([propTypesExports.node, propTypesExports.func]),
2912
- onClick: propTypesExports.func
2913
- } : void 0;
2914
-
2915
- function styleInject(css, ref) {
2916
- if ( ref === void 0 ) ref = {};
2917
- var insertAt = ref.insertAt;
2918
-
2919
- if (!css || typeof document === 'undefined') { return; }
2920
-
2921
- var head = document.head || document.getElementsByTagName('head')[0];
2922
- var style = document.createElement('style');
2923
- style.type = 'text/css';
2924
-
2925
- if (insertAt === 'top') {
2926
- if (head.firstChild) {
2927
- head.insertBefore(style, head.firstChild);
2928
- } else {
2929
- head.appendChild(style);
2930
- }
2931
- } else {
2932
- head.appendChild(style);
2933
- }
2934
-
2935
- if (style.styleSheet) {
2936
- style.styleSheet.cssText = css;
2937
- } else {
2938
- style.appendChild(document.createTextNode(css));
2939
- }
2940
- }
2941
-
2942
- var css_248z$2 = ".szh-menu-button {\n box-sizing: border-box;\n}\n\n.vchasno-ui-menu-button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 5px;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n transition: background-color var(--vchasno-ui-transition-duration-sec);\n}\n\n.vchasno-ui-menu-button:hover {\n background-color: var(--vchasno-ui-menu-button-bg);\n}\n";
2943
- styleInject(css_248z$2);
2944
-
2945
- var MenuButton = React.forwardRef(function (props, ref) {
2946
- return (React.createElement(MenuButton$1, __assign({}, props, { className: cn('vchasno-ui-menu-button', props.className), ref: ref })));
2947
- });
2948
- MenuButton.displayName = 'MenuButton';
2949
-
2950
- var css_248z$1 = ".szh-menu__item {\n position: relative;\n display: flex;\n align-items: center;\n padding: 10px 12px;\n cursor: pointer;\n transition: background-color var(--vchasno-ui-transition-duration-sec);\n}\n\n.szh-menu__item + .szh-menu__item {\n margin-top: 4px;\n}\n\n.szh-menu__item:focus {\n outline: none;\n}\n\n.szh-menu__item--hover {\n background-color: var(--vchasno-ui-menu-item-hover-bg);\n}\n\n.szh-menu__item--focusable {\n background-color: inherit;\n cursor: default;\n}\n\n.szh-menu__item--disabled {\n color: #aaa;\n cursor: default;\n}\n";
2951
- styleInject(css_248z$1);
2952
-
2953
- var MenuItem = React.forwardRef(function (props, ref) {
2954
- return React.createElement(MenuItem$1, __assign({}, props, { ref: ref }));
2955
- });
2956
- MenuItem.displayName = 'MenuButton';
2957
-
2958
- var css_248z = ".szh-menu {\n z-index: 100;\n width: max-content;\n min-width: 10rem;\n box-sizing: border-box;\n padding: 8px;\n border: 1px solid var(--vchasno-ui-input-border-color-default);\n border-radius: 4px;\n margin: 0;\n background-color: #fff;\n color: #212529;\n list-style: none;\n user-select: none;\n}\n\n.szh-menu:focus {\n outline: none;\n}\n\n.szh-menu__arrow {\n z-index: -1;\n width: 0.75rem;\n height: 0.75rem;\n box-sizing: border-box;\n border: 1px solid transparent;\n border-top-color: rgb(0 0 0 / 10%);\n border-left-color: rgb(0 0 0 / 10%);\n background-color: #fff;\n}\n\n.szh-menu__arrow--dir-left {\n right: -0.375rem;\n transform: translateY(-50%) rotate(135deg);\n}\n\n.szh-menu__arrow--dir-right {\n left: -0.375rem;\n transform: translateY(-50%) rotate(-45deg);\n}\n\n.szh-menu__arrow--dir-top {\n bottom: -0.375rem;\n transform: translateX(-50%) rotate(-135deg);\n}\n\n.szh-menu__arrow--dir-bottom {\n top: -0.375rem;\n transform: translateX(-50%) rotate(45deg);\n}\n\n.szh-menu__group {\n box-sizing: border-box;\n}\n\n.szh-menu__radio-group {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n.szh-menu__divider {\n height: 1px;\n margin: 0.5rem 0;\n background-color: rgb(0 0 0 / 12%);\n}\n\n.szh-menu-container--itemTransition .szh-menu__item {\n transition-duration: 0.15s;\n transition-property: background-color, color;\n transition-timing-function: ease-in-out;\n}\n\n.szh-menu__item--type-radio {\n padding-left: 2.2rem;\n}\n\n.szh-menu__item--type-radio::before {\n position: absolute;\n top: 0.55rem;\n left: 0.8rem;\n content: \"○\";\n font-size: 0.8rem;\n}\n\n.szh-menu__item--type-radio.szh-menu__item--checked::before {\n content: \"●\";\n}\n\n.szh-menu__item--type-checkbox {\n padding-left: 2.2rem;\n}\n\n.szh-menu__item--type-checkbox::before {\n position: absolute;\n left: 0.8rem;\n}\n\n.szh-menu__item--type-checkbox.szh-menu__item--checked::before {\n content: \"✔\";\n}\n\n.szh-menu__submenu > .szh-menu__item {\n padding-right: 2.5rem;\n}\n\n.szh-menu__submenu > .szh-menu__item::after {\n position: absolute;\n right: 1rem;\n content: \"❯\";\n}\n\n.szh-menu__header {\n padding: 0.2rem 1.5rem;\n color: #888;\n font-size: 0.8rem;\n text-transform: uppercase;\n}\n";
2959
- styleInject(css_248z);
2960
-
2961
- var Menu = React.forwardRef(function (props, ref) {
2962
- return React.createElement(Menu$2, __assign({ gap: 3, direction: "bottom", align: "end" }, props, { ref: ref }));
2963
- });
2964
- Menu.displayName = 'Menu';
2965
- var Menu$1 = Object.assign(Menu, { Button: MenuButton, Item: MenuItem });
2966
-
2967
- export { Menu$1 as default };
2968
- //# sourceMappingURL=index.js.map