@skbkontur/react-ui 5.0.8 → 5.0.10

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 (474) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/cjs/components/Autocomplete/__creevey__/Autocomplete.creevey.mts +239 -0
  3. package/cjs/components/Button/__creevey__/Button.creevey.mts +251 -0
  4. package/cjs/components/Calendar/__creevey__/Calendar.creevey.mts +74 -0
  5. package/cjs/components/Checkbox/__creevey__/Checkbox.creevey.mts +243 -0
  6. package/cjs/components/ComboBox/__creevey__/ComboBox.creevey.mts +541 -0
  7. package/cjs/components/CurrencyInput/__creevey__/CurrencyInput.creevey.mts +81 -0
  8. package/cjs/components/DateInput/__creevey__/DateInput.creevey.mts +156 -0
  9. package/cjs/components/DatePicker/__creevey__/DatePicker.creevey.mts +209 -0
  10. package/cjs/components/Dropdown/__creevey__/Dropdown.creevey.mts +184 -0
  11. package/cjs/components/DropdownMenu/__creevey__/DropdownMenu.creevey.mts +263 -0
  12. package/cjs/components/FxInput/__creevey__/FxInput.creevey.mts +21 -0
  13. package/cjs/components/GlobalLoader/GlobalLoader.d.ts +1 -0
  14. package/cjs/components/GlobalLoader/GlobalLoader.js +6 -2
  15. package/cjs/components/GlobalLoader/GlobalLoader.js.map +1 -1
  16. package/cjs/components/Group/__creevey__/Group.creevey.mts +19 -0
  17. package/cjs/components/Hint/__creevey__/Hint.creevey.mts +68 -0
  18. package/cjs/components/Input/__creevey__/Input.creevey.mts +239 -0
  19. package/cjs/components/Kebab/__creevey__/Kebab.creevey.mts +147 -0
  20. package/cjs/components/Link/__creevey__/Link.creevey.mts +162 -0
  21. package/cjs/components/Loader/__creevey__/Loader.creevey.mts +35 -0
  22. package/cjs/components/MaskedInput/__creevey__/MaskedInput.creevey.mts +216 -0
  23. package/cjs/components/Modal/Modal.js +7 -10
  24. package/cjs/components/Modal/Modal.js.map +1 -1
  25. package/cjs/components/Modal/ModalContext.d.ts +3 -3
  26. package/cjs/components/Modal/ModalContext.js.map +1 -1
  27. package/cjs/components/Modal/ModalFooter.js +2 -2
  28. package/cjs/components/Modal/ModalFooter.js.map +1 -1
  29. package/cjs/components/Modal/ModalHeader.js +1 -1
  30. package/cjs/components/Modal/ModalHeader.js.map +1 -1
  31. package/cjs/components/Modal/__creevey__/Modal.creevey.mts +281 -0
  32. package/cjs/components/Paging/__creevey__/Paging.creevey.mts +97 -0
  33. package/cjs/components/PasswordInput/__creevey__/PasswordInput.creevey.mts +38 -0
  34. package/cjs/components/Radio/__creevey__/Radio.creevey.mts +28 -0
  35. package/cjs/components/RadioGroup/__creevey__/RadioGroup.creevey.mts +86 -0
  36. package/cjs/components/ScrollContainer/__creevey__/ScrollContainer.creevey.mts +247 -0
  37. package/cjs/components/Select/Select.d.ts +1 -6
  38. package/cjs/components/Select/Select.js +7 -10
  39. package/cjs/components/Select/Select.js.map +1 -1
  40. package/cjs/components/Select/__creevey__/Select.creevey.mts +293 -0
  41. package/cjs/components/Select/tids.d.ts +5 -0
  42. package/cjs/components/Select/tids.js +5 -0
  43. package/cjs/components/Select/tids.js.map +1 -0
  44. package/cjs/components/SidePage/__creevey__/SidePage.creevey.mts +319 -0
  45. package/cjs/components/Sticky/__creevey__/Sticky.creevey.mts +98 -0
  46. package/cjs/components/Switcher/__creevey__/Switcher.creevey.mts +24 -0
  47. package/cjs/components/Tabs/__creevey__/Tabs.creevey.mts +239 -0
  48. package/cjs/components/Textarea/__creevey__/Textarea.creevey.mts +177 -0
  49. package/cjs/components/Toast/__creevey__/Toast.creevey.mts +54 -0
  50. package/cjs/components/Toggle/__creevey__/Toggle.creevey.mts +87 -0
  51. package/cjs/components/TokenInput/__creevey__/TokenInput.creevey.mts +414 -0
  52. package/cjs/components/Tooltip/__creevey__/Tooltip.creevey.mts +533 -0
  53. package/cjs/components/TooltipMenu/__creevey__/TooltipMenu.creevey.mts +131 -0
  54. package/cjs/internal/CloseButtonIcon/__creevey__/CloseButtonIcon.creevey.mts +48 -0
  55. package/cjs/internal/CustomComboBox/CustomComboBox.d.ts +1 -3
  56. package/cjs/internal/CustomComboBox/CustomComboBox.js +4 -6
  57. package/cjs/internal/CustomComboBox/CustomComboBox.js.map +1 -1
  58. package/cjs/internal/CustomComboBox/__creevey__/ComboBoxView.creevey.mts +30 -0
  59. package/cjs/internal/CustomComboBox/tids.d.ts +3 -0
  60. package/cjs/internal/CustomComboBox/tids.js +3 -0
  61. package/cjs/internal/CustomComboBox/tids.js.map +1 -0
  62. package/cjs/internal/FileUploaderControl/__creevey__/FileUploaderFile.creevey.mts +25 -0
  63. package/cjs/internal/HideBodyVerticalScroll/__creevey__/HideBodyVerticalScroll.creevey.mts +83 -0
  64. package/cjs/internal/Menu/__creevey__/Menu.creevey.mts +90 -0
  65. package/cjs/internal/PopupMenu/PopupMenu.d.ts +1 -5
  66. package/cjs/internal/PopupMenu/PopupMenu.js +8 -10
  67. package/cjs/internal/PopupMenu/PopupMenu.js.map +1 -1
  68. package/cjs/internal/PopupMenu/__creevey__/PopupMenu.creevey.mts +37 -0
  69. package/cjs/internal/PopupMenu/tids.d.ts +4 -0
  70. package/cjs/internal/PopupMenu/tids.js +4 -0
  71. package/cjs/internal/PopupMenu/tids.js.map +1 -0
  72. package/cjs/internal/ThemePlayground/__creevey__/ThemeProvider.creevey.mts +68 -0
  73. package/cjs/internal/ThemeShowcase/VariablesCollector.js +1 -0
  74. package/cjs/internal/ThemeShowcase/VariablesCollector.js.map +1 -1
  75. package/cjs/internal/ZIndex/__creevey__/ZIndex.creevey.mts +228 -0
  76. package/cjs/lib/delay.d.ts +1 -0
  77. package/cjs/lib/delay.js +3 -0
  78. package/cjs/lib/delay.js.map +1 -0
  79. package/cjs/lib/utils.d.ts +3 -3
  80. package/cjs/lib/utils.js +5 -4
  81. package/cjs/lib/utils.js.map +1 -1
  82. package/components/Autocomplete/__creevey__/Autocomplete.creevey.mts +239 -0
  83. package/components/Button/__creevey__/Button.creevey.mts +251 -0
  84. package/components/Calendar/__creevey__/Calendar.creevey.mts +74 -0
  85. package/components/Checkbox/__creevey__/Checkbox.creevey.mts +243 -0
  86. package/components/ComboBox/__creevey__/ComboBox.creevey.mts +541 -0
  87. package/components/CurrencyInput/__creevey__/CurrencyInput.creevey.mts +81 -0
  88. package/components/DateInput/__creevey__/DateInput.creevey.mts +156 -0
  89. package/components/DatePicker/__creevey__/DatePicker.creevey.mts +209 -0
  90. package/components/Dropdown/__creevey__/Dropdown.creevey.mts +184 -0
  91. package/components/DropdownMenu/__creevey__/DropdownMenu.creevey.mts +263 -0
  92. package/components/FxInput/__creevey__/FxInput.creevey.mts +21 -0
  93. package/components/GlobalLoader/GlobalLoader/GlobalLoader.js +13 -5
  94. package/components/GlobalLoader/GlobalLoader/GlobalLoader.js.map +1 -1
  95. package/components/GlobalLoader/GlobalLoader.d.ts +1 -0
  96. package/components/Group/__creevey__/Group.creevey.mts +19 -0
  97. package/components/Hint/__creevey__/Hint.creevey.mts +68 -0
  98. package/components/Input/__creevey__/Input.creevey.mts +239 -0
  99. package/components/Kebab/__creevey__/Kebab.creevey.mts +147 -0
  100. package/components/Link/__creevey__/Link.creevey.mts +162 -0
  101. package/components/Loader/__creevey__/Loader.creevey.mts +35 -0
  102. package/components/MaskedInput/__creevey__/MaskedInput.creevey.mts +216 -0
  103. package/components/Modal/Modal/Modal.js +4 -16
  104. package/components/Modal/Modal/Modal.js.map +1 -1
  105. package/components/Modal/ModalContext/ModalContext.js.map +1 -1
  106. package/components/Modal/ModalContext.d.ts +3 -3
  107. package/components/Modal/ModalFooter/ModalFooter.js +2 -2
  108. package/components/Modal/ModalFooter/ModalFooter.js.map +1 -1
  109. package/components/Modal/ModalHeader/ModalHeader.js +1 -1
  110. package/components/Modal/ModalHeader/ModalHeader.js.map +1 -1
  111. package/components/Modal/__creevey__/Modal.creevey.mts +281 -0
  112. package/components/Paging/__creevey__/Paging.creevey.mts +97 -0
  113. package/components/PasswordInput/__creevey__/PasswordInput.creevey.mts +38 -0
  114. package/components/Radio/__creevey__/Radio.creevey.mts +28 -0
  115. package/components/RadioGroup/__creevey__/RadioGroup.creevey.mts +86 -0
  116. package/components/ScrollContainer/__creevey__/ScrollContainer.creevey.mts +247 -0
  117. package/components/Select/Select/Select.js +2 -5
  118. package/components/Select/Select/Select.js.map +1 -1
  119. package/components/Select/Select.d.ts +1 -6
  120. package/components/Select/__creevey__/Select.creevey.mts +293 -0
  121. package/components/Select/tids/package.json +6 -0
  122. package/components/Select/tids/tids.js +5 -0
  123. package/components/Select/tids/tids.js.map +1 -0
  124. package/components/Select/tids.d.ts +5 -0
  125. package/components/SidePage/__creevey__/SidePage.creevey.mts +319 -0
  126. package/components/Sticky/__creevey__/Sticky.creevey.mts +98 -0
  127. package/components/Switcher/__creevey__/Switcher.creevey.mts +24 -0
  128. package/components/Tabs/__creevey__/Tabs.creevey.mts +239 -0
  129. package/components/Textarea/__creevey__/Textarea.creevey.mts +177 -0
  130. package/components/Toast/__creevey__/Toast.creevey.mts +54 -0
  131. package/components/Toggle/__creevey__/Toggle.creevey.mts +87 -0
  132. package/components/TokenInput/__creevey__/TokenInput.creevey.mts +414 -0
  133. package/components/Tooltip/__creevey__/Tooltip.creevey.mts +533 -0
  134. package/components/TooltipMenu/__creevey__/TooltipMenu.creevey.mts +131 -0
  135. package/internal/CloseButtonIcon/__creevey__/CloseButtonIcon.creevey.mts +48 -0
  136. package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js +1 -3
  137. package/internal/CustomComboBox/CustomComboBox/CustomComboBox.js.map +1 -1
  138. package/internal/CustomComboBox/CustomComboBox.d.ts +1 -3
  139. package/internal/CustomComboBox/__creevey__/ComboBoxView.creevey.mts +30 -0
  140. package/internal/CustomComboBox/tids/package.json +6 -0
  141. package/internal/CustomComboBox/tids/tids.js +3 -0
  142. package/internal/CustomComboBox/tids/tids.js.map +1 -0
  143. package/internal/CustomComboBox/tids.d.ts +3 -0
  144. package/internal/FileUploaderControl/__creevey__/FileUploaderFile.creevey.mts +25 -0
  145. package/internal/HideBodyVerticalScroll/__creevey__/HideBodyVerticalScroll.creevey.mts +83 -0
  146. package/internal/Menu/__creevey__/Menu.creevey.mts +90 -0
  147. package/internal/PopupMenu/PopupMenu/PopupMenu.js +2 -4
  148. package/internal/PopupMenu/PopupMenu/PopupMenu.js.map +1 -1
  149. package/internal/PopupMenu/PopupMenu.d.ts +1 -5
  150. package/internal/PopupMenu/__creevey__/PopupMenu.creevey.mts +37 -0
  151. package/internal/PopupMenu/tids/package.json +6 -0
  152. package/internal/PopupMenu/tids/tids.js +4 -0
  153. package/internal/PopupMenu/tids/tids.js.map +1 -0
  154. package/internal/PopupMenu/tids.d.ts +4 -0
  155. package/internal/ThemePlayground/__creevey__/ThemeProvider.creevey.mts +68 -0
  156. package/internal/ThemeShowcase/VariablesCollector/VariablesCollector.js +2 -0
  157. package/internal/ThemeShowcase/VariablesCollector/VariablesCollector.js.map +1 -1
  158. package/internal/ZIndex/__creevey__/ZIndex.creevey.mts +228 -0
  159. package/lib/delay/delay.js +6 -0
  160. package/lib/delay/delay.js.map +1 -0
  161. package/lib/delay/package.json +6 -0
  162. package/lib/delay.d.ts +1 -0
  163. package/lib/utils/utils.js +3 -7
  164. package/lib/utils/utils.js.map +1 -1
  165. package/lib/utils.d.ts +3 -3
  166. package/package.json +6 -5
  167. package/cjs/components/Autocomplete/__creevey__/Autocomplete.creevey.js +0 -239
  168. package/cjs/components/Autocomplete/__creevey__/Autocomplete.creevey.js.map +0 -1
  169. package/cjs/components/Button/__creevey__/Button.creevey.js +0 -250
  170. package/cjs/components/Button/__creevey__/Button.creevey.js.map +0 -1
  171. package/cjs/components/Calendar/__creevey__/Calendar.creevey.js +0 -74
  172. package/cjs/components/Calendar/__creevey__/Calendar.creevey.js.map +0 -1
  173. package/cjs/components/Checkbox/__creevey__/Checkbox.creevey.js +0 -242
  174. package/cjs/components/Checkbox/__creevey__/Checkbox.creevey.js.map +0 -1
  175. package/cjs/components/ComboBox/__creevey__/ComboBox.creevey.js +0 -540
  176. package/cjs/components/ComboBox/__creevey__/ComboBox.creevey.js.map +0 -1
  177. package/cjs/components/CurrencyInput/__creevey__/CurrencyInput.creevey.js +0 -81
  178. package/cjs/components/CurrencyInput/__creevey__/CurrencyInput.creevey.js.map +0 -1
  179. package/cjs/components/DateInput/__creevey__/DateInput.creevey.js +0 -155
  180. package/cjs/components/DateInput/__creevey__/DateInput.creevey.js.map +0 -1
  181. package/cjs/components/DatePicker/__creevey__/DatePicker.creevey.js +0 -209
  182. package/cjs/components/DatePicker/__creevey__/DatePicker.creevey.js.map +0 -1
  183. package/cjs/components/Dropdown/__creevey__/Dropdown.creevey.js +0 -184
  184. package/cjs/components/Dropdown/__creevey__/Dropdown.creevey.js.map +0 -1
  185. package/cjs/components/DropdownMenu/__creevey__/DropdownMenu.creevey.js +0 -262
  186. package/cjs/components/DropdownMenu/__creevey__/DropdownMenu.creevey.js.map +0 -1
  187. package/cjs/components/FxInput/__creevey__/FxInput.creevey.js +0 -21
  188. package/cjs/components/FxInput/__creevey__/FxInput.creevey.js.map +0 -1
  189. package/cjs/components/Group/__creevey__/Group.creevey.js +0 -19
  190. package/cjs/components/Group/__creevey__/Group.creevey.js.map +0 -1
  191. package/cjs/components/Hint/__creevey__/Hint.creevey.js +0 -68
  192. package/cjs/components/Hint/__creevey__/Hint.creevey.js.map +0 -1
  193. package/cjs/components/Input/__creevey__/Input.creevey.js +0 -239
  194. package/cjs/components/Input/__creevey__/Input.creevey.js.map +0 -1
  195. package/cjs/components/Kebab/__creevey__/Kebab.creevey.js +0 -146
  196. package/cjs/components/Kebab/__creevey__/Kebab.creevey.js.map +0 -1
  197. package/cjs/components/Link/__creevey__/Link.creevey.js +0 -161
  198. package/cjs/components/Link/__creevey__/Link.creevey.js.map +0 -1
  199. package/cjs/components/Loader/__creevey__/Loader.creevey.js +0 -34
  200. package/cjs/components/Loader/__creevey__/Loader.creevey.js.map +0 -1
  201. package/cjs/components/MaskedInput/__creevey__/MaskedInput.creevey.js +0 -219
  202. package/cjs/components/MaskedInput/__creevey__/MaskedInput.creevey.js.map +0 -1
  203. package/cjs/components/Modal/__creevey__/Modal.creevey.js +0 -258
  204. package/cjs/components/Modal/__creevey__/Modal.creevey.js.map +0 -1
  205. package/cjs/components/Paging/__creevey__/Paging.creevey.js +0 -96
  206. package/cjs/components/Paging/__creevey__/Paging.creevey.js.map +0 -1
  207. package/cjs/components/PasswordInput/__creevey__/PasswordInput.creevey.js +0 -38
  208. package/cjs/components/PasswordInput/__creevey__/PasswordInput.creevey.js.map +0 -1
  209. package/cjs/components/Radio/__creevey__/Radio.creevey.js +0 -27
  210. package/cjs/components/Radio/__creevey__/Radio.creevey.js.map +0 -1
  211. package/cjs/components/RadioGroup/__creevey__/RadioGroup.creevey.js +0 -85
  212. package/cjs/components/RadioGroup/__creevey__/RadioGroup.creevey.js.map +0 -1
  213. package/cjs/components/ScrollContainer/__creevey__/ScrollContainer.creevey.js +0 -247
  214. package/cjs/components/ScrollContainer/__creevey__/ScrollContainer.creevey.js.map +0 -1
  215. package/cjs/components/Select/__creevey__/Select.creevey.js +0 -284
  216. package/cjs/components/Select/__creevey__/Select.creevey.js.map +0 -1
  217. package/cjs/components/SidePage/__creevey__/SidePage.creevey.js +0 -313
  218. package/cjs/components/SidePage/__creevey__/SidePage.creevey.js.map +0 -1
  219. package/cjs/components/Sticky/__creevey__/Sticky.creevey.js +0 -98
  220. package/cjs/components/Sticky/__creevey__/Sticky.creevey.js.map +0 -1
  221. package/cjs/components/Switcher/__creevey__/Switcher.creevey.js +0 -24
  222. package/cjs/components/Switcher/__creevey__/Switcher.creevey.js.map +0 -1
  223. package/cjs/components/Tabs/__creevey__/Tabs.creevey.js +0 -238
  224. package/cjs/components/Tabs/__creevey__/Tabs.creevey.js.map +0 -1
  225. package/cjs/components/Textarea/__creevey__/Textarea.creevey.js +0 -176
  226. package/cjs/components/Textarea/__creevey__/Textarea.creevey.js.map +0 -1
  227. package/cjs/components/Toast/__creevey__/Toast.creevey.js +0 -54
  228. package/cjs/components/Toast/__creevey__/Toast.creevey.js.map +0 -1
  229. package/cjs/components/Toggle/__creevey__/Toggle.creevey.js +0 -87
  230. package/cjs/components/Toggle/__creevey__/Toggle.creevey.js.map +0 -1
  231. package/cjs/components/TokenInput/__creevey__/TokenInput.creevey.js +0 -413
  232. package/cjs/components/TokenInput/__creevey__/TokenInput.creevey.js.map +0 -1
  233. package/cjs/components/Tooltip/__creevey__/Tooltip.creevey.js +0 -534
  234. package/cjs/components/Tooltip/__creevey__/Tooltip.creevey.js.map +0 -1
  235. package/cjs/components/TooltipMenu/__creevey__/TooltipMenu.creevey.js +0 -130
  236. package/cjs/components/TooltipMenu/__creevey__/TooltipMenu.creevey.js.map +0 -1
  237. package/cjs/internal/CloseButtonIcon/__creevey__/CloseButtonIcon.creevey.js +0 -47
  238. package/cjs/internal/CloseButtonIcon/__creevey__/CloseButtonIcon.creevey.js.map +0 -1
  239. package/cjs/internal/CustomComboBox/__creevey__/ComboBoxView.creevey.js +0 -30
  240. package/cjs/internal/CustomComboBox/__creevey__/ComboBoxView.creevey.js.map +0 -1
  241. package/cjs/internal/FileUploaderControl/__creevey__/FileUploaderFile.creevey.js +0 -25
  242. package/cjs/internal/FileUploaderControl/__creevey__/FileUploaderFile.creevey.js.map +0 -1
  243. package/cjs/internal/HideBodyVerticalScroll/__creevey__/HideBodyVerticalScroll.creevey.js +0 -83
  244. package/cjs/internal/HideBodyVerticalScroll/__creevey__/HideBodyVerticalScroll.creevey.js.map +0 -1
  245. package/cjs/internal/Menu/__creevey__/Menu.creevey.js +0 -90
  246. package/cjs/internal/Menu/__creevey__/Menu.creevey.js.map +0 -1
  247. package/cjs/internal/PopupMenu/__creevey__/PopupMenu.creevey.js +0 -37
  248. package/cjs/internal/PopupMenu/__creevey__/PopupMenu.creevey.js.map +0 -1
  249. package/cjs/internal/ThemePlayground/__creevey__/ThemeProvider.creevey.js +0 -68
  250. package/cjs/internal/ThemePlayground/__creevey__/ThemeProvider.creevey.js.map +0 -1
  251. package/cjs/internal/ZIndex/__creevey__/ZIndex.creevey.js +0 -228
  252. package/cjs/internal/ZIndex/__creevey__/ZIndex.creevey.js.map +0 -1
  253. package/cjs/lib/styles/HoldSelectionColor.d.ts +0 -1
  254. package/cjs/lib/styles/HoldSelectionColor.js +0 -9
  255. package/cjs/lib/styles/HoldSelectionColor.js.map +0 -1
  256. package/components/Autocomplete/__creevey__/Autocomplete.creevey/Autocomplete.creevey.js +0 -506
  257. package/components/Autocomplete/__creevey__/Autocomplete.creevey/Autocomplete.creevey.js.map +0 -1
  258. package/components/Autocomplete/__creevey__/Autocomplete.creevey/package.json +0 -6
  259. package/components/Autocomplete/__creevey__/Autocomplete.creevey.d.ts +0 -1
  260. package/components/Button/__creevey__/Button.creevey/Button.creevey.js +0 -396
  261. package/components/Button/__creevey__/Button.creevey/Button.creevey.js.map +0 -1
  262. package/components/Button/__creevey__/Button.creevey/package.json +0 -6
  263. package/components/Button/__creevey__/Button.creevey.d.ts +0 -1
  264. package/components/Calendar/__creevey__/Calendar.creevey/Calendar.creevey.js +0 -138
  265. package/components/Calendar/__creevey__/Calendar.creevey/Calendar.creevey.js.map +0 -1
  266. package/components/Calendar/__creevey__/Calendar.creevey/package.json +0 -6
  267. package/components/Calendar/__creevey__/Calendar.creevey.d.ts +0 -1
  268. package/components/Checkbox/__creevey__/Checkbox.creevey/Checkbox.creevey.js +0 -487
  269. package/components/Checkbox/__creevey__/Checkbox.creevey/Checkbox.creevey.js.map +0 -1
  270. package/components/Checkbox/__creevey__/Checkbox.creevey/package.json +0 -6
  271. package/components/Checkbox/__creevey__/Checkbox.creevey.d.ts +0 -1
  272. package/components/ComboBox/__creevey__/ComboBox.creevey/ComboBox.creevey.js +0 -1043
  273. package/components/ComboBox/__creevey__/ComboBox.creevey/ComboBox.creevey.js.map +0 -1
  274. package/components/ComboBox/__creevey__/ComboBox.creevey/package.json +0 -6
  275. package/components/ComboBox/__creevey__/ComboBox.creevey.d.ts +0 -1
  276. package/components/CurrencyInput/__creevey__/CurrencyInput.creevey/CurrencyInput.creevey.js +0 -114
  277. package/components/CurrencyInput/__creevey__/CurrencyInput.creevey/CurrencyInput.creevey.js.map +0 -1
  278. package/components/CurrencyInput/__creevey__/CurrencyInput.creevey/package.json +0 -6
  279. package/components/CurrencyInput/__creevey__/CurrencyInput.creevey.d.ts +0 -1
  280. package/components/DateInput/__creevey__/DateInput.creevey/DateInput.creevey.js +0 -367
  281. package/components/DateInput/__creevey__/DateInput.creevey/DateInput.creevey.js.map +0 -1
  282. package/components/DateInput/__creevey__/DateInput.creevey/package.json +0 -6
  283. package/components/DateInput/__creevey__/DateInput.creevey.d.ts +0 -1
  284. package/components/DatePicker/__creevey__/DatePicker.creevey/DatePicker.creevey.js +0 -395
  285. package/components/DatePicker/__creevey__/DatePicker.creevey/DatePicker.creevey.js.map +0 -1
  286. package/components/DatePicker/__creevey__/DatePicker.creevey/package.json +0 -6
  287. package/components/DatePicker/__creevey__/DatePicker.creevey.d.ts +0 -1
  288. package/components/Dropdown/__creevey__/Dropdown.creevey/Dropdown.creevey.js +0 -417
  289. package/components/Dropdown/__creevey__/Dropdown.creevey/Dropdown.creevey.js.map +0 -1
  290. package/components/Dropdown/__creevey__/Dropdown.creevey/package.json +0 -6
  291. package/components/Dropdown/__creevey__/Dropdown.creevey.d.ts +0 -1
  292. package/components/DropdownMenu/__creevey__/DropdownMenu.creevey/DropdownMenu.creevey.js +0 -534
  293. package/components/DropdownMenu/__creevey__/DropdownMenu.creevey/DropdownMenu.creevey.js.map +0 -1
  294. package/components/DropdownMenu/__creevey__/DropdownMenu.creevey/package.json +0 -6
  295. package/components/DropdownMenu/__creevey__/DropdownMenu.creevey.d.ts +0 -1
  296. package/components/FxInput/__creevey__/FxInput.creevey/FxInput.creevey.js +0 -62
  297. package/components/FxInput/__creevey__/FxInput.creevey/FxInput.creevey.js.map +0 -1
  298. package/components/FxInput/__creevey__/FxInput.creevey/package.json +0 -6
  299. package/components/FxInput/__creevey__/FxInput.creevey.d.ts +0 -1
  300. package/components/Group/__creevey__/Group.creevey/Group.creevey.js +0 -48
  301. package/components/Group/__creevey__/Group.creevey/Group.creevey.js.map +0 -1
  302. package/components/Group/__creevey__/Group.creevey/package.json +0 -6
  303. package/components/Group/__creevey__/Group.creevey.d.ts +0 -1
  304. package/components/Hint/__creevey__/Hint.creevey/Hint.creevey.js +0 -127
  305. package/components/Hint/__creevey__/Hint.creevey/Hint.creevey.js.map +0 -1
  306. package/components/Hint/__creevey__/Hint.creevey/package.json +0 -6
  307. package/components/Hint/__creevey__/Hint.creevey.d.ts +0 -1
  308. package/components/Input/__creevey__/Input.creevey/Input.creevey.js +0 -517
  309. package/components/Input/__creevey__/Input.creevey/Input.creevey.js.map +0 -1
  310. package/components/Input/__creevey__/Input.creevey/package.json +0 -6
  311. package/components/Input/__creevey__/Input.creevey.d.ts +0 -1
  312. package/components/Kebab/__creevey__/Kebab.creevey/Kebab.creevey.js +0 -278
  313. package/components/Kebab/__creevey__/Kebab.creevey/Kebab.creevey.js.map +0 -1
  314. package/components/Kebab/__creevey__/Kebab.creevey/package.json +0 -6
  315. package/components/Kebab/__creevey__/Kebab.creevey.d.ts +0 -1
  316. package/components/Link/__creevey__/Link.creevey/Link.creevey.js +0 -238
  317. package/components/Link/__creevey__/Link.creevey/Link.creevey.js.map +0 -1
  318. package/components/Link/__creevey__/Link.creevey/package.json +0 -6
  319. package/components/Link/__creevey__/Link.creevey.d.ts +0 -1
  320. package/components/Loader/__creevey__/Loader.creevey/Loader.creevey.js +0 -129
  321. package/components/Loader/__creevey__/Loader.creevey/Loader.creevey.js.map +0 -1
  322. package/components/Loader/__creevey__/Loader.creevey/package.json +0 -6
  323. package/components/Loader/__creevey__/Loader.creevey.d.ts +0 -1
  324. package/components/MaskedInput/__creevey__/MaskedInput.creevey/MaskedInput.creevey.js +0 -405
  325. package/components/MaskedInput/__creevey__/MaskedInput.creevey/MaskedInput.creevey.js.map +0 -1
  326. package/components/MaskedInput/__creevey__/MaskedInput.creevey/package.json +0 -6
  327. package/components/MaskedInput/__creevey__/MaskedInput.creevey.d.ts +0 -1
  328. package/components/Modal/__creevey__/Modal.creevey/Modal.creevey.js +0 -565
  329. package/components/Modal/__creevey__/Modal.creevey/Modal.creevey.js.map +0 -1
  330. package/components/Modal/__creevey__/Modal.creevey/package.json +0 -6
  331. package/components/Modal/__creevey__/Modal.creevey.d.ts +0 -1
  332. package/components/Paging/__creevey__/Paging.creevey/Paging.creevey.js +0 -190
  333. package/components/Paging/__creevey__/Paging.creevey/Paging.creevey.js.map +0 -1
  334. package/components/Paging/__creevey__/Paging.creevey/package.json +0 -6
  335. package/components/Paging/__creevey__/Paging.creevey.d.ts +0 -1
  336. package/components/PasswordInput/__creevey__/PasswordInput.creevey/PasswordInput.creevey.js +0 -83
  337. package/components/PasswordInput/__creevey__/PasswordInput.creevey/PasswordInput.creevey.js.map +0 -1
  338. package/components/PasswordInput/__creevey__/PasswordInput.creevey/package.json +0 -6
  339. package/components/PasswordInput/__creevey__/PasswordInput.creevey.d.ts +0 -1
  340. package/components/Radio/__creevey__/Radio.creevey/Radio.creevey.js +0 -56
  341. package/components/Radio/__creevey__/Radio.creevey/Radio.creevey.js.map +0 -1
  342. package/components/Radio/__creevey__/Radio.creevey/package.json +0 -6
  343. package/components/Radio/__creevey__/Radio.creevey.d.ts +0 -1
  344. package/components/RadioGroup/__creevey__/RadioGroup.creevey/RadioGroup.creevey.js +0 -167
  345. package/components/RadioGroup/__creevey__/RadioGroup.creevey/RadioGroup.creevey.js.map +0 -1
  346. package/components/RadioGroup/__creevey__/RadioGroup.creevey/package.json +0 -6
  347. package/components/RadioGroup/__creevey__/RadioGroup.creevey.d.ts +0 -1
  348. package/components/ScrollContainer/__creevey__/ScrollContainer.creevey/ScrollContainer.creevey.js +0 -488
  349. package/components/ScrollContainer/__creevey__/ScrollContainer.creevey/ScrollContainer.creevey.js.map +0 -1
  350. package/components/ScrollContainer/__creevey__/ScrollContainer.creevey/package.json +0 -6
  351. package/components/ScrollContainer/__creevey__/ScrollContainer.creevey.d.ts +0 -1
  352. package/components/Select/__creevey__/Select.creevey/Select.creevey.js +0 -541
  353. package/components/Select/__creevey__/Select.creevey/Select.creevey.js.map +0 -1
  354. package/components/Select/__creevey__/Select.creevey/package.json +0 -6
  355. package/components/Select/__creevey__/Select.creevey.d.ts +0 -1
  356. package/components/SidePage/__creevey__/SidePage.creevey/SidePage.creevey.js +0 -697
  357. package/components/SidePage/__creevey__/SidePage.creevey/SidePage.creevey.js.map +0 -1
  358. package/components/SidePage/__creevey__/SidePage.creevey/package.json +0 -6
  359. package/components/SidePage/__creevey__/SidePage.creevey.d.ts +0 -1
  360. package/components/Sticky/__creevey__/Sticky.creevey/Sticky.creevey.js +0 -215
  361. package/components/Sticky/__creevey__/Sticky.creevey/Sticky.creevey.js.map +0 -1
  362. package/components/Sticky/__creevey__/Sticky.creevey/package.json +0 -6
  363. package/components/Sticky/__creevey__/Sticky.creevey.d.ts +0 -1
  364. package/components/Switcher/__creevey__/Switcher.creevey/Switcher.creevey.js +0 -58
  365. package/components/Switcher/__creevey__/Switcher.creevey/Switcher.creevey.js.map +0 -1
  366. package/components/Switcher/__creevey__/Switcher.creevey/package.json +0 -6
  367. package/components/Switcher/__creevey__/Switcher.creevey.d.ts +0 -1
  368. package/components/Tabs/__creevey__/Tabs.creevey/Tabs.creevey.js +0 -391
  369. package/components/Tabs/__creevey__/Tabs.creevey/Tabs.creevey.js.map +0 -1
  370. package/components/Tabs/__creevey__/Tabs.creevey/package.json +0 -6
  371. package/components/Tabs/__creevey__/Tabs.creevey.d.ts +0 -1
  372. package/components/Textarea/__creevey__/Textarea.creevey/Textarea.creevey.js +0 -404
  373. package/components/Textarea/__creevey__/Textarea.creevey/Textarea.creevey.js.map +0 -1
  374. package/components/Textarea/__creevey__/Textarea.creevey/package.json +0 -6
  375. package/components/Textarea/__creevey__/Textarea.creevey.d.ts +0 -1
  376. package/components/Toast/__creevey__/Toast.creevey/Toast.creevey.js +0 -70
  377. package/components/Toast/__creevey__/Toast.creevey/Toast.creevey.js.map +0 -1
  378. package/components/Toast/__creevey__/Toast.creevey/package.json +0 -6
  379. package/components/Toast/__creevey__/Toast.creevey.d.ts +0 -1
  380. package/components/Toggle/__creevey__/Toggle.creevey/Toggle.creevey.js +0 -195
  381. package/components/Toggle/__creevey__/Toggle.creevey/Toggle.creevey.js.map +0 -1
  382. package/components/Toggle/__creevey__/Toggle.creevey/package.json +0 -6
  383. package/components/Toggle/__creevey__/Toggle.creevey.d.ts +0 -1
  384. package/components/TokenInput/__creevey__/TokenInput.creevey/TokenInput.creevey.js +0 -635
  385. package/components/TokenInput/__creevey__/TokenInput.creevey/TokenInput.creevey.js.map +0 -1
  386. package/components/TokenInput/__creevey__/TokenInput.creevey/package.json +0 -6
  387. package/components/TokenInput/__creevey__/TokenInput.creevey.d.ts +0 -1
  388. package/components/Tooltip/__creevey__/Tooltip.creevey/Tooltip.creevey.js +0 -1171
  389. package/components/Tooltip/__creevey__/Tooltip.creevey/Tooltip.creevey.js.map +0 -1
  390. package/components/Tooltip/__creevey__/Tooltip.creevey/package.json +0 -6
  391. package/components/Tooltip/__creevey__/Tooltip.creevey.d.ts +0 -1
  392. package/components/TooltipMenu/__creevey__/TooltipMenu.creevey/TooltipMenu.creevey.js +0 -277
  393. package/components/TooltipMenu/__creevey__/TooltipMenu.creevey/TooltipMenu.creevey.js.map +0 -1
  394. package/components/TooltipMenu/__creevey__/TooltipMenu.creevey/package.json +0 -6
  395. package/components/TooltipMenu/__creevey__/TooltipMenu.creevey.d.ts +0 -1
  396. package/internal/CloseButtonIcon/__creevey__/CloseButtonIcon.creevey/CloseButtonIcon.creevey.js +0 -78
  397. package/internal/CloseButtonIcon/__creevey__/CloseButtonIcon.creevey/CloseButtonIcon.creevey.js.map +0 -1
  398. package/internal/CloseButtonIcon/__creevey__/CloseButtonIcon.creevey/package.json +0 -6
  399. package/internal/CloseButtonIcon/__creevey__/CloseButtonIcon.creevey.d.ts +0 -1
  400. package/internal/CustomComboBox/__creevey__/ComboBoxView.creevey/ComboBoxView.creevey.js +0 -58
  401. package/internal/CustomComboBox/__creevey__/ComboBoxView.creevey/ComboBoxView.creevey.js.map +0 -1
  402. package/internal/CustomComboBox/__creevey__/ComboBoxView.creevey/package.json +0 -6
  403. package/internal/CustomComboBox/__creevey__/ComboBoxView.creevey.d.ts +0 -1
  404. package/internal/FileUploaderControl/__creevey__/FileUploaderFile.creevey/FileUploaderFile.creevey.js +0 -41
  405. package/internal/FileUploaderControl/__creevey__/FileUploaderFile.creevey/FileUploaderFile.creevey.js.map +0 -1
  406. package/internal/FileUploaderControl/__creevey__/FileUploaderFile.creevey/package.json +0 -6
  407. package/internal/FileUploaderControl/__creevey__/FileUploaderFile.creevey.d.ts +0 -1
  408. package/internal/HideBodyVerticalScroll/__creevey__/HideBodyVerticalScroll.creevey/HideBodyVerticalScroll.creevey.js +0 -199
  409. package/internal/HideBodyVerticalScroll/__creevey__/HideBodyVerticalScroll.creevey/HideBodyVerticalScroll.creevey.js.map +0 -1
  410. package/internal/HideBodyVerticalScroll/__creevey__/HideBodyVerticalScroll.creevey/package.json +0 -6
  411. package/internal/HideBodyVerticalScroll/__creevey__/HideBodyVerticalScroll.creevey.d.ts +0 -1
  412. package/internal/Menu/__creevey__/Menu.creevey/Menu.creevey.js +0 -196
  413. package/internal/Menu/__creevey__/Menu.creevey/Menu.creevey.js.map +0 -1
  414. package/internal/Menu/__creevey__/Menu.creevey/package.json +0 -6
  415. package/internal/Menu/__creevey__/Menu.creevey.d.ts +0 -1
  416. package/internal/PopupMenu/__creevey__/PopupMenu.creevey/PopupMenu.creevey.js +0 -69
  417. package/internal/PopupMenu/__creevey__/PopupMenu.creevey/PopupMenu.creevey.js.map +0 -1
  418. package/internal/PopupMenu/__creevey__/PopupMenu.creevey/package.json +0 -6
  419. package/internal/PopupMenu/__creevey__/PopupMenu.creevey.d.ts +0 -1
  420. package/internal/ThemePlayground/__creevey__/ThemeProvider.creevey/ThemeProvider.creevey.js +0 -145
  421. package/internal/ThemePlayground/__creevey__/ThemeProvider.creevey/ThemeProvider.creevey.js.map +0 -1
  422. package/internal/ThemePlayground/__creevey__/ThemeProvider.creevey/package.json +0 -6
  423. package/internal/ThemePlayground/__creevey__/ThemeProvider.creevey.d.ts +0 -1
  424. package/internal/ZIndex/__creevey__/ZIndex.creevey/ZIndex.creevey.js +0 -550
  425. package/internal/ZIndex/__creevey__/ZIndex.creevey/ZIndex.creevey.js.map +0 -1
  426. package/internal/ZIndex/__creevey__/ZIndex.creevey/package.json +0 -6
  427. package/internal/ZIndex/__creevey__/ZIndex.creevey.d.ts +0 -1
  428. package/lib/styles/HoldSelectionColor/HoldSelectionColor.js +0 -8
  429. package/lib/styles/HoldSelectionColor/HoldSelectionColor.js.map +0 -1
  430. package/lib/styles/HoldSelectionColor/package.json +0 -6
  431. package/lib/styles/HoldSelectionColor.d.ts +0 -1
  432. /package/{cjs/components/Autocomplete/__creevey__/Autocomplete.creevey.d.ts → components/Autocomplete/__creevey__/Autocomplete.creevey.d.mts} +0 -0
  433. /package/{cjs/components/Button/__creevey__/Button.creevey.d.ts → components/Button/__creevey__/Button.creevey.d.mts} +0 -0
  434. /package/{cjs/components/Calendar/__creevey__/Calendar.creevey.d.ts → components/Calendar/__creevey__/Calendar.creevey.d.mts} +0 -0
  435. /package/{cjs/components/Checkbox/__creevey__/Checkbox.creevey.d.ts → components/Checkbox/__creevey__/Checkbox.creevey.d.mts} +0 -0
  436. /package/{cjs/components/ComboBox/__creevey__/ComboBox.creevey.d.ts → components/ComboBox/__creevey__/ComboBox.creevey.d.mts} +0 -0
  437. /package/{cjs/components/CurrencyInput/__creevey__/CurrencyInput.creevey.d.ts → components/CurrencyInput/__creevey__/CurrencyInput.creevey.d.mts} +0 -0
  438. /package/{cjs/components/DateInput/__creevey__/DateInput.creevey.d.ts → components/DateInput/__creevey__/DateInput.creevey.d.mts} +0 -0
  439. /package/{cjs/components/DatePicker/__creevey__/DatePicker.creevey.d.ts → components/DatePicker/__creevey__/DatePicker.creevey.d.mts} +0 -0
  440. /package/{cjs/components/Dropdown/__creevey__/Dropdown.creevey.d.ts → components/Dropdown/__creevey__/Dropdown.creevey.d.mts} +0 -0
  441. /package/{cjs/components/DropdownMenu/__creevey__/DropdownMenu.creevey.d.ts → components/DropdownMenu/__creevey__/DropdownMenu.creevey.d.mts} +0 -0
  442. /package/{cjs/components/FxInput/__creevey__/FxInput.creevey.d.ts → components/FxInput/__creevey__/FxInput.creevey.d.mts} +0 -0
  443. /package/{cjs/components/Group/__creevey__/Group.creevey.d.ts → components/Group/__creevey__/Group.creevey.d.mts} +0 -0
  444. /package/{cjs/components/Hint/__creevey__/Hint.creevey.d.ts → components/Hint/__creevey__/Hint.creevey.d.mts} +0 -0
  445. /package/{cjs/components/Input/__creevey__/Input.creevey.d.ts → components/Input/__creevey__/Input.creevey.d.mts} +0 -0
  446. /package/{cjs/components/Kebab/__creevey__/Kebab.creevey.d.ts → components/Kebab/__creevey__/Kebab.creevey.d.mts} +0 -0
  447. /package/{cjs/components/Link/__creevey__/Link.creevey.d.ts → components/Link/__creevey__/Link.creevey.d.mts} +0 -0
  448. /package/{cjs/components/Loader/__creevey__/Loader.creevey.d.ts → components/Loader/__creevey__/Loader.creevey.d.mts} +0 -0
  449. /package/{cjs/components/MaskedInput/__creevey__/MaskedInput.creevey.d.ts → components/MaskedInput/__creevey__/MaskedInput.creevey.d.mts} +0 -0
  450. /package/{cjs/components/Modal/__creevey__/Modal.creevey.d.ts → components/Modal/__creevey__/Modal.creevey.d.mts} +0 -0
  451. /package/{cjs/components/Paging/__creevey__/Paging.creevey.d.ts → components/Paging/__creevey__/Paging.creevey.d.mts} +0 -0
  452. /package/{cjs/components/PasswordInput/__creevey__/PasswordInput.creevey.d.ts → components/PasswordInput/__creevey__/PasswordInput.creevey.d.mts} +0 -0
  453. /package/{cjs/components/Radio/__creevey__/Radio.creevey.d.ts → components/Radio/__creevey__/Radio.creevey.d.mts} +0 -0
  454. /package/{cjs/components/RadioGroup/__creevey__/RadioGroup.creevey.d.ts → components/RadioGroup/__creevey__/RadioGroup.creevey.d.mts} +0 -0
  455. /package/{cjs/components/ScrollContainer/__creevey__/ScrollContainer.creevey.d.ts → components/ScrollContainer/__creevey__/ScrollContainer.creevey.d.mts} +0 -0
  456. /package/{cjs/components/Select/__creevey__/Select.creevey.d.ts → components/Select/__creevey__/Select.creevey.d.mts} +0 -0
  457. /package/{cjs/components/SidePage/__creevey__/SidePage.creevey.d.ts → components/SidePage/__creevey__/SidePage.creevey.d.mts} +0 -0
  458. /package/{cjs/components/Sticky/__creevey__/Sticky.creevey.d.ts → components/Sticky/__creevey__/Sticky.creevey.d.mts} +0 -0
  459. /package/{cjs/components/Switcher/__creevey__/Switcher.creevey.d.ts → components/Switcher/__creevey__/Switcher.creevey.d.mts} +0 -0
  460. /package/{cjs/components/Tabs/__creevey__/Tabs.creevey.d.ts → components/Tabs/__creevey__/Tabs.creevey.d.mts} +0 -0
  461. /package/{cjs/components/Textarea/__creevey__/Textarea.creevey.d.ts → components/Textarea/__creevey__/Textarea.creevey.d.mts} +0 -0
  462. /package/{cjs/components/Toast/__creevey__/Toast.creevey.d.ts → components/Toast/__creevey__/Toast.creevey.d.mts} +0 -0
  463. /package/{cjs/components/Toggle/__creevey__/Toggle.creevey.d.ts → components/Toggle/__creevey__/Toggle.creevey.d.mts} +0 -0
  464. /package/{cjs/components/TokenInput/__creevey__/TokenInput.creevey.d.ts → components/TokenInput/__creevey__/TokenInput.creevey.d.mts} +0 -0
  465. /package/{cjs/components/Tooltip/__creevey__/Tooltip.creevey.d.ts → components/Tooltip/__creevey__/Tooltip.creevey.d.mts} +0 -0
  466. /package/{cjs/components/TooltipMenu/__creevey__/TooltipMenu.creevey.d.ts → components/TooltipMenu/__creevey__/TooltipMenu.creevey.d.mts} +0 -0
  467. /package/{cjs/internal/CloseButtonIcon/__creevey__/CloseButtonIcon.creevey.d.ts → internal/CloseButtonIcon/__creevey__/CloseButtonIcon.creevey.d.mts} +0 -0
  468. /package/{cjs/internal/CustomComboBox/__creevey__/ComboBoxView.creevey.d.ts → internal/CustomComboBox/__creevey__/ComboBoxView.creevey.d.mts} +0 -0
  469. /package/{cjs/internal/FileUploaderControl/__creevey__/FileUploaderFile.creevey.d.ts → internal/FileUploaderControl/__creevey__/FileUploaderFile.creevey.d.mts} +0 -0
  470. /package/{cjs/internal/HideBodyVerticalScroll/__creevey__/HideBodyVerticalScroll.creevey.d.ts → internal/HideBodyVerticalScroll/__creevey__/HideBodyVerticalScroll.creevey.d.mts} +0 -0
  471. /package/{cjs/internal/Menu/__creevey__/Menu.creevey.d.ts → internal/Menu/__creevey__/Menu.creevey.d.mts} +0 -0
  472. /package/{cjs/internal/PopupMenu/__creevey__/PopupMenu.creevey.d.ts → internal/PopupMenu/__creevey__/PopupMenu.creevey.d.mts} +0 -0
  473. /package/{cjs/internal/ThemePlayground/__creevey__/ThemeProvider.creevey.d.ts → internal/ThemePlayground/__creevey__/ThemeProvider.creevey.d.mts} +0 -0
  474. /package/{cjs/internal/ZIndex/__creevey__/ZIndex.creevey.d.ts → internal/ZIndex/__creevey__/ZIndex.creevey.d.mts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_globalObject","_utils","_identifiers","_ThemeContext","_ThemeFactory","_Popup","_RenderLayer","_CommonWrapper","_decorator","_rootNode","_createPropsGetter","_Menu","_validatePositions","_PopupMenu2","_class","_PopupMenu","PopupMenuType","exports","Dropdown","Tooltip","PopupMenuDataTids","root","caption","Positions","PopupMenu","rootNode","responsiveLayout","_React$Component","_this","_len","arguments","length","args","Array","_key","call","apply","concat","rootId","PopupIds","getRandomID","getProps","createPropsGetter","defaultProps","state","menuVisible","firstItemShouldBeSelected","captionWrapper","savedFocusableElement","menu","open","showMenu","close","hideMenu","menuRef","element","handleOpen","focus","passPropsToCaption","_this$props$popupMenu","React","cloneElement","id","props","popupMenuId","renderCaption","opened","openMenu","closeMenu","toggleMenu","default","createElement","className","styles","ref","onClick","handleCaptionClick","onKeyDown","handleCaptionKeyDown","hideMenuWithoutFocusing","saveFocus","setState","handleChangeMenuVisible","restoreFocus","e","someKeys","isKeyEnter","isKeySpace","isKeyArrowVertical","preventDefault","handleKeyDown","isKeyEscape","globalObject","document","activeElement","focusShouldBeRestored","onOpen","onClose","onChangeMenuState","handleItemSelection","event","isDefaultPrevented","type","_inheritsLoose2","_proto","prototype","render","_this2","ThemeContext","Consumer","theme","Provider","value","ThemeFactory","create","menuOffsetY","popupMenuMenuOffsetY","renderMain","_this$props$popupMenu2","_this$getProps","popupHasPin","disableAnimations","CommonWrapper","_extends2","rootNodeRef","setRootNode","RenderLayer","onClickOutside","onFocusOutside","active","container","style","width","children","Popup","anchorElement","hasShadow","margin","popupMargin","hasPin","pinOffset","popupPinOffset","positions","getPositions","mobileOnCloseRequest","isMobileLayout","menuWidth","Menu","maxHeight","menuMaxHeight","onItemClick","preventIconsOffset","cyclicSelection","initialSelectedItemIndex","header","footer","isValidPositions","Component","__KONTUR_REACT_UI__","displayName","Type"],"sources":["PopupMenu.tsx"],"sourcesContent":["import React, { AriaAttributes, HTMLAttributes } from 'react';\nimport { globalObject } from '@skbkontur/global-object';\n\nimport { getRandomID } from '../../lib/utils';\nimport { HTMLProps } from '../../typings/html';\nimport {\n isKeyArrowVertical,\n isKeyEnter,\n isKeyEscape,\n isKeySpace,\n someKeys,\n} from '../../lib/events/keyboard/identifiers';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { ThemeFactory } from '../../lib/theming/ThemeFactory';\nimport { Popup, PopupIds, PopupPositionsType } from '../Popup';\nimport { RenderLayer } from '../RenderLayer';\nimport { Nullable } from '../../typings/utility-types';\nimport { CommonProps, CommonWrapper } from '../CommonWrapper';\nimport { responsiveLayout } from '../../components/ResponsiveLayout/decorator';\nimport { rootNode, TSetRootNode } from '../../lib/rootNode';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport { Menu, MenuProps } from '../Menu';\n\nimport { isValidPositions } from './validatePositions';\nimport { styles } from './PopupMenu.styles';\n\nexport interface PopupMenuCaptionProps {\n opened: boolean;\n openMenu: (firstItemShouldBeSelected?: boolean) => void;\n closeMenu: (restoreFocus?: boolean) => void;\n toggleMenu: () => void;\n}\n\nexport interface PopupMenuProps\n extends CommonProps,\n Pick<MenuProps, 'preventIconsOffset'>,\n Pick<HTMLAttributes<HTMLElement>, 'id'>,\n Pick<AriaAttributes, 'aria-label'> {\n children?: React.ReactNode;\n /** Максимальная высота меню */\n menuMaxHeight?: number | string;\n /** Ширина меню */\n menuWidth?: number | string;\n /** Ширина контейнера и caption */\n width?: React.CSSProperties['width'];\n\n /**\n * Элемент или функция возвращающая элемент,\n * если передана, используется вместо ```caption```,\n * в таком случае управлять открытием и закрытием меню\n * придется в этой функции\n */\n caption: React.ReactNode | ((props: PopupMenuCaptionProps) => React.ReactNode);\n\n header?: React.ReactNode;\n footer?: React.ReactNode;\n\n /** Массив разрешенных положений меню относительно caption'а. */\n positions?: PopupPositionsType[];\n /** Колбэк, вызываемый после открытия/закрытия меню */\n onChangeMenuState?: (isOpened: boolean, restoreFocus: boolean) => void;\n /** Пропсы, передающиеся в Popup */\n popupHasPin?: boolean;\n popupMargin?: number;\n popupPinOffset?: number;\n type?: 'dropdown' | 'tooltip';\n disableAnimations?: boolean;\n /** Действие при открытии меню */\n onOpen?: () => void;\n /** Действие при закрытии меню */\n onClose?: () => void;\n /**\n * Позволяет задать `id` выпадающему меню.\n *\n * Это может пригодиться при реализации a11y. Например, для того, чтобы связать `aria-controls` с выпадающим меню.\n */\n popupMenuId?: HTMLProps['id'];\n}\n\ninterface PopupMenuState {\n menuVisible: boolean;\n firstItemShouldBeSelected?: boolean;\n}\n\nexport const PopupMenuType = {\n Dropdown: 'dropdown',\n Tooltip: 'tooltip',\n} as const;\n\nexport const PopupMenuDataTids = {\n root: 'PopupMenu__root',\n caption: 'PopupMenu__caption',\n} as const;\n\nconst Positions: PopupPositionsType[] = [\n 'top left',\n 'top center',\n 'top right',\n 'right top',\n 'right middle',\n 'right bottom',\n 'bottom left',\n 'bottom center',\n 'bottom right',\n 'left top',\n 'left middle',\n 'left bottom',\n];\n\ntype DefaultProps = Required<Pick<PopupMenuProps, 'positions' | 'type' | 'popupHasPin' | 'disableAnimations'>>;\n\n@rootNode\n@responsiveLayout\nexport class PopupMenu extends React.Component<PopupMenuProps, PopupMenuState> {\n public static __KONTUR_REACT_UI__ = 'PopupMenu';\n public static displayName = 'PopupMenu';\n\n private isMobileLayout!: boolean;\n private rootId = PopupIds.root + getRandomID();\n\n public static defaultProps: DefaultProps = {\n positions: Positions,\n type: PopupMenuType.Tooltip,\n popupHasPin: true,\n disableAnimations: false,\n };\n\n private getProps = createPropsGetter(PopupMenu.defaultProps);\n\n public static Type = PopupMenuType;\n\n public state = {\n menuVisible: false,\n firstItemShouldBeSelected: false,\n };\n\n private captionWrapper: HTMLSpanElement | null = null;\n private savedFocusableElement: HTMLElement | null = null;\n private menu: Nullable<Menu> = null;\n private setRootNode!: TSetRootNode;\n\n public render(): JSX.Element {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n return (\n <ThemeContext.Provider\n value={ThemeFactory.create(\n {\n menuOffsetY: theme.popupMenuMenuOffsetY,\n },\n theme,\n )}\n >\n {this.renderMain()}\n </ThemeContext.Provider>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n\n private renderMain() {\n const { popupHasPin, disableAnimations } = this.getProps();\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <RenderLayer\n onClickOutside={this.hideMenuWithoutFocusing}\n onFocusOutside={this.hideMenuWithoutFocusing}\n active={this.state.menuVisible}\n >\n <div data-tid={PopupMenuDataTids.root} className={styles.container()} style={{ width: this.props.width }}>\n {this.renderCaption()}\n {this.captionWrapper && this.props.children && (\n <Popup\n id={this.props.popupMenuId ?? this.rootId}\n anchorElement={this.captionWrapper}\n opened={this.state.menuVisible}\n hasShadow\n margin={this.props.popupMargin}\n hasPin={popupHasPin}\n pinOffset={this.props.popupPinOffset}\n positions={this.getPositions()}\n disableAnimations={disableAnimations}\n onOpen={this.handleOpen}\n mobileOnCloseRequest={this.hideMenu}\n width={this.isMobileLayout ? 'auto' : this.props.menuWidth || 'auto'}\n >\n <Menu\n maxHeight={this.isMobileLayout ? 'none' : this.props.menuMaxHeight || 'none'}\n onKeyDown={this.handleKeyDown}\n onItemClick={this.handleItemSelection}\n preventIconsOffset={this.props.preventIconsOffset}\n cyclicSelection={false}\n ref={this.menuRef}\n initialSelectedItemIndex={this.state.firstItemShouldBeSelected ? 0 : -1}\n header={this.props.header}\n footer={this.props.footer}\n >\n {this.props.children}\n </Menu>\n </Popup>\n )}\n </div>\n </RenderLayer>\n </CommonWrapper>\n );\n }\n\n public open = (): void => this.showMenu();\n public close = (): void => this.hideMenu();\n\n private menuRef = (element: Nullable<Menu>) => (this.menu = element);\n\n private handleOpen = () => {\n if (this.menu) {\n this.menu.focus();\n }\n };\n\n private passPropsToCaption = (caption: React.ReactNode) => {\n if (typeof caption === 'string' || typeof caption === 'number') {\n return caption;\n }\n\n return React.cloneElement(caption as React.ReactElement, {\n id: this.props.id,\n 'aria-controls': this.props.popupMenuId ?? this.rootId,\n 'aria-expanded': this.state.menuVisible ? 'true' : 'false',\n 'aria-label': this.props['aria-label'],\n });\n };\n\n private renderCaption = () => {\n if (typeof this.props.caption === 'function') {\n const caption = this.props.caption({\n opened: this.state.menuVisible,\n openMenu: this.showMenu,\n closeMenu: this.hideMenu,\n toggleMenu: this.toggleMenu,\n });\n\n return (\n <span\n data-tid={PopupMenuDataTids.caption}\n className={styles.caption()}\n ref={(element) => (this.captionWrapper = element)}\n >\n {this.passPropsToCaption(caption)}\n </span>\n );\n }\n\n return (\n <span\n data-tid={PopupMenuDataTids.caption}\n onClick={this.handleCaptionClick}\n onKeyDown={this.handleCaptionKeyDown}\n ref={(element) => (this.captionWrapper = element)}\n className={styles.caption()}\n >\n {this.passPropsToCaption(this.props.caption)}\n </span>\n );\n };\n\n private hideMenuWithoutFocusing = () => this.hideMenu();\n\n private getPositions(): Readonly<PopupPositionsType[]> {\n const positions = this.getProps().positions;\n if (positions && isValidPositions(positions)) {\n return positions;\n }\n\n return Positions;\n }\n\n private showMenu = (firstItemShouldBeSelected?: boolean): void => {\n this.saveFocus();\n this.setState(\n {\n menuVisible: true,\n firstItemShouldBeSelected,\n },\n () => {\n this.handleChangeMenuVisible(false);\n },\n );\n };\n\n private hideMenu = (restoreFocus?: boolean): void => {\n this.setState(\n {\n menuVisible: false,\n firstItemShouldBeSelected: false,\n },\n () => {\n this.handleChangeMenuVisible(!!restoreFocus);\n },\n );\n };\n\n private toggleMenu = (): void => {\n this.state.menuVisible ? this.hideMenu() : this.showMenu();\n };\n\n private handleCaptionClick = (): void => {\n this.toggleMenu();\n };\n\n private handleCaptionKeyDown = (e: React.KeyboardEvent<HTMLElement>): void => {\n if (someKeys(isKeyEnter, isKeySpace, isKeyArrowVertical)(e)) {\n e.preventDefault();\n this.showMenu(true);\n }\n };\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (isKeyEscape(e)) {\n const restoreFocus = true;\n this.hideMenu(restoreFocus);\n }\n };\n\n private saveFocus = (): void => {\n if (globalObject.document) {\n this.savedFocusableElement = globalObject.document.activeElement as HTMLElement;\n }\n };\n\n private restoreFocus = (): void => {\n if (this.savedFocusableElement) {\n this.savedFocusableElement.focus();\n this.savedFocusableElement = null;\n }\n };\n\n private handleChangeMenuVisible = (focusShouldBeRestored: boolean): void => {\n if (focusShouldBeRestored) {\n this.restoreFocus();\n }\n\n if (this.state.menuVisible && this.props.onOpen) {\n this.props.onOpen();\n }\n\n if (!this.state.menuVisible && this.props.onClose) {\n this.props.onClose();\n }\n\n if (typeof this.props.onChangeMenuState === 'function') {\n this.props.onChangeMenuState(this.state.menuVisible, focusShouldBeRestored);\n }\n };\n\n private handleItemSelection = (event: React.SyntheticEvent<HTMLElement>): void => {\n if (event.isDefaultPrevented()) {\n return;\n }\n\n if (event.type === 'keydown') {\n event.preventDefault();\n }\n\n const restoreFocus = event.type === 'keydown';\n this.hideMenu(restoreFocus);\n };\n}\n"],"mappings":"mYAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;;AAEA,IAAAE,MAAA,GAAAF,OAAA;;AAEA,IAAAG,YAAA,GAAAH,OAAA;;;;;;;AAOA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;;AAEA,IAAAQ,cAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AACA,IAAAW,kBAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAZ,OAAA;;AAEA,IAAAa,kBAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA,uBAA4C,IAAAe,MAAA,EAAAC,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DrC,IAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC3BE,QAAQ,EAAE,UAAU;EACpBC,OAAO,EAAE;AACX,CAAU;;AAEH,IAAMC,iBAAiB,GAAAH,OAAA,CAAAG,iBAAA,GAAG;EAC/BC,IAAI,EAAE,iBAAiB;EACvBC,OAAO,EAAE;AACX,CAAU;;AAEV,IAAMC,SAA+B,GAAG;AACtC,UAAU;AACV,YAAY;AACZ,WAAW;AACX,WAAW;AACX,cAAc;AACd,cAAc;AACd,aAAa;AACb,eAAe;AACf,cAAc;AACd,UAAU;AACV,aAAa;AACb,aAAa,CACd,CAAC;;;;;;;AAMWC,SAAS,GAAAP,OAAA,CAAAO,SAAA,OAFrBC,kBAAQ,EAAAX,MAAA,OACRY,2BAAgB,EAAAZ,MAAA,IAAAC,UAAA,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B,EAACd,SAAS,CAAC,EAAE,CAC5C,OAAOA,SAAS,CAClB,CAEA,OAAOvH,SAAS,CAClB,CAAC,QAAAC,SAAA,GAlK4BoC,cAAK,CAACiG,SAAS,GAAA9I,UAAA,CAC9B+I,mBAAmB,GAAG,WAAW,EAAA/I,UAAA,CACjCgJ,WAAW,GAAG,WAAW,EAAAhJ,UAAA,CAKzB4B,YAAY,GAAiB,EACzCmG,SAAS,EAAEvH,SAAS,EACpB+E,IAAI,EAAEtF,aAAa,CAACG,OAAO,EAC3BqG,WAAW,EAAE,IAAI,EACjBC,iBAAiB,EAAE,KAAK,CAC1B,CAAC,EAAA1G,UAAA,CAIaiJ,IAAI,GAAGhJ,aAAa,EAAAD,UAAA,MAAAD,MAAA,KAAAA,MAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_globalObject","_utils","_identifiers","_ThemeContext","_ThemeFactory","_Popup","_RenderLayer","_CommonWrapper","_decorator","_rootNode","_createPropsGetter","_Menu","_validatePositions","_PopupMenu2","_tids","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","_class","_PopupMenu","PopupMenuType","Dropdown","Tooltip","Positions","PopupMenu","rootNode","responsiveLayout","_React$Component","_this","_len","arguments","length","args","Array","_key","apply","concat","rootId","PopupIds","root","getRandomID","getProps","createPropsGetter","defaultProps","state","menuVisible","firstItemShouldBeSelected","captionWrapper","savedFocusableElement","menu","open","showMenu","close","hideMenu","menuRef","element","handleOpen","focus","passPropsToCaption","caption","_this$props$popupMenu","React","cloneElement","id","props","popupMenuId","renderCaption","opened","openMenu","closeMenu","toggleMenu","default","createElement","PopupMenuDataTids","className","styles","ref","onClick","handleCaptionClick","onKeyDown","handleCaptionKeyDown","hideMenuWithoutFocusing","saveFocus","setState","handleChangeMenuVisible","restoreFocus","e","someKeys","isKeyEnter","isKeySpace","isKeyArrowVertical","preventDefault","handleKeyDown","isKeyEscape","globalObject","document","activeElement","focusShouldBeRestored","onOpen","onClose","onChangeMenuState","handleItemSelection","event","isDefaultPrevented","type","_inheritsLoose2","_proto","render","_this2","ThemeContext","Consumer","theme","Provider","value","ThemeFactory","create","menuOffsetY","popupMenuMenuOffsetY","renderMain","_this$props$popupMenu2","_this$getProps","popupHasPin","disableAnimations","CommonWrapper","_extends2","rootNodeRef","setRootNode","RenderLayer","onClickOutside","onFocusOutside","active","container","style","width","children","Popup","anchorElement","hasShadow","margin","popupMargin","hasPin","pinOffset","popupPinOffset","positions","getPositions","mobileOnCloseRequest","isMobileLayout","menuWidth","Menu","maxHeight","menuMaxHeight","onItemClick","preventIconsOffset","cyclicSelection","initialSelectedItemIndex","header","footer","isValidPositions","Component","__KONTUR_REACT_UI__","displayName","Type"],"sources":["PopupMenu.tsx"],"sourcesContent":["import React, { AriaAttributes, HTMLAttributes } from 'react';\nimport { globalObject } from '@skbkontur/global-object';\n\nimport { getRandomID } from '../../lib/utils';\nimport { HTMLProps } from '../../typings/html';\nimport {\n isKeyArrowVertical,\n isKeyEnter,\n isKeyEscape,\n isKeySpace,\n someKeys,\n} from '../../lib/events/keyboard/identifiers';\nimport { ThemeContext } from '../../lib/theming/ThemeContext';\nimport { ThemeFactory } from '../../lib/theming/ThemeFactory';\nimport { Popup, PopupIds, PopupPositionsType } from '../Popup';\nimport { RenderLayer } from '../RenderLayer';\nimport { Nullable } from '../../typings/utility-types';\nimport { CommonProps, CommonWrapper } from '../CommonWrapper';\nimport { responsiveLayout } from '../../components/ResponsiveLayout/decorator';\nimport { rootNode, TSetRootNode } from '../../lib/rootNode';\nimport { createPropsGetter } from '../../lib/createPropsGetter';\nimport { Menu, MenuProps } from '../Menu';\n\nimport { isValidPositions } from './validatePositions';\nimport { styles } from './PopupMenu.styles';\nimport { PopupMenuDataTids } from './tids';\n\nexport * from './tids';\n\nexport interface PopupMenuCaptionProps {\n opened: boolean;\n openMenu: (firstItemShouldBeSelected?: boolean) => void;\n closeMenu: (restoreFocus?: boolean) => void;\n toggleMenu: () => void;\n}\n\nexport interface PopupMenuProps\n extends CommonProps,\n Pick<MenuProps, 'preventIconsOffset'>,\n Pick<HTMLAttributes<HTMLElement>, 'id'>,\n Pick<AriaAttributes, 'aria-label'> {\n children?: React.ReactNode;\n /** Максимальная высота меню */\n menuMaxHeight?: number | string;\n /** Ширина меню */\n menuWidth?: number | string;\n /** Ширина контейнера и caption */\n width?: React.CSSProperties['width'];\n\n /**\n * Элемент или функция возвращающая элемент,\n * если передана, используется вместо ```caption```,\n * в таком случае управлять открытием и закрытием меню\n * придется в этой функции\n */\n caption: React.ReactNode | ((props: PopupMenuCaptionProps) => React.ReactNode);\n\n header?: React.ReactNode;\n footer?: React.ReactNode;\n\n /** Массив разрешенных положений меню относительно caption'а. */\n positions?: PopupPositionsType[];\n /** Колбэк, вызываемый после открытия/закрытия меню */\n onChangeMenuState?: (isOpened: boolean, restoreFocus: boolean) => void;\n /** Пропсы, передающиеся в Popup */\n popupHasPin?: boolean;\n popupMargin?: number;\n popupPinOffset?: number;\n type?: 'dropdown' | 'tooltip';\n disableAnimations?: boolean;\n /** Действие при открытии меню */\n onOpen?: () => void;\n /** Действие при закрытии меню */\n onClose?: () => void;\n /**\n * Позволяет задать `id` выпадающему меню.\n *\n * Это может пригодиться при реализации a11y. Например, для того, чтобы связать `aria-controls` с выпадающим меню.\n */\n popupMenuId?: HTMLProps['id'];\n}\n\ninterface PopupMenuState {\n menuVisible: boolean;\n firstItemShouldBeSelected?: boolean;\n}\n\nexport const PopupMenuType = {\n Dropdown: 'dropdown',\n Tooltip: 'tooltip',\n} as const;\n\nconst Positions: PopupPositionsType[] = [\n 'top left',\n 'top center',\n 'top right',\n 'right top',\n 'right middle',\n 'right bottom',\n 'bottom left',\n 'bottom center',\n 'bottom right',\n 'left top',\n 'left middle',\n 'left bottom',\n];\n\ntype DefaultProps = Required<Pick<PopupMenuProps, 'positions' | 'type' | 'popupHasPin' | 'disableAnimations'>>;\n\n@rootNode\n@responsiveLayout\nexport class PopupMenu extends React.Component<PopupMenuProps, PopupMenuState> {\n public static __KONTUR_REACT_UI__ = 'PopupMenu';\n public static displayName = 'PopupMenu';\n\n private isMobileLayout!: boolean;\n private rootId = PopupIds.root + getRandomID();\n\n public static defaultProps: DefaultProps = {\n positions: Positions,\n type: PopupMenuType.Tooltip,\n popupHasPin: true,\n disableAnimations: false,\n };\n\n private getProps = createPropsGetter(PopupMenu.defaultProps);\n\n public static Type = PopupMenuType;\n\n public state = {\n menuVisible: false,\n firstItemShouldBeSelected: false,\n };\n\n private captionWrapper: HTMLSpanElement | null = null;\n private savedFocusableElement: HTMLElement | null = null;\n private menu: Nullable<Menu> = null;\n private setRootNode!: TSetRootNode;\n\n public render(): JSX.Element {\n return (\n <ThemeContext.Consumer>\n {(theme) => {\n return (\n <ThemeContext.Provider\n value={ThemeFactory.create(\n {\n menuOffsetY: theme.popupMenuMenuOffsetY,\n },\n theme,\n )}\n >\n {this.renderMain()}\n </ThemeContext.Provider>\n );\n }}\n </ThemeContext.Consumer>\n );\n }\n\n private renderMain() {\n const { popupHasPin, disableAnimations } = this.getProps();\n return (\n <CommonWrapper rootNodeRef={this.setRootNode} {...this.props}>\n <RenderLayer\n onClickOutside={this.hideMenuWithoutFocusing}\n onFocusOutside={this.hideMenuWithoutFocusing}\n active={this.state.menuVisible}\n >\n <div data-tid={PopupMenuDataTids.root} className={styles.container()} style={{ width: this.props.width }}>\n {this.renderCaption()}\n {this.captionWrapper && this.props.children && (\n <Popup\n id={this.props.popupMenuId ?? this.rootId}\n anchorElement={this.captionWrapper}\n opened={this.state.menuVisible}\n hasShadow\n margin={this.props.popupMargin}\n hasPin={popupHasPin}\n pinOffset={this.props.popupPinOffset}\n positions={this.getPositions()}\n disableAnimations={disableAnimations}\n onOpen={this.handleOpen}\n mobileOnCloseRequest={this.hideMenu}\n width={this.isMobileLayout ? 'auto' : this.props.menuWidth || 'auto'}\n >\n <Menu\n maxHeight={this.isMobileLayout ? 'none' : this.props.menuMaxHeight || 'none'}\n onKeyDown={this.handleKeyDown}\n onItemClick={this.handleItemSelection}\n preventIconsOffset={this.props.preventIconsOffset}\n cyclicSelection={false}\n ref={this.menuRef}\n initialSelectedItemIndex={this.state.firstItemShouldBeSelected ? 0 : -1}\n header={this.props.header}\n footer={this.props.footer}\n >\n {this.props.children}\n </Menu>\n </Popup>\n )}\n </div>\n </RenderLayer>\n </CommonWrapper>\n );\n }\n\n public open = (): void => this.showMenu();\n public close = (): void => this.hideMenu();\n\n private menuRef = (element: Nullable<Menu>) => (this.menu = element);\n\n private handleOpen = () => {\n if (this.menu) {\n this.menu.focus();\n }\n };\n\n private passPropsToCaption = (caption: React.ReactNode) => {\n if (typeof caption === 'string' || typeof caption === 'number') {\n return caption;\n }\n\n return React.cloneElement(caption as React.ReactElement, {\n id: this.props.id,\n 'aria-controls': this.props.popupMenuId ?? this.rootId,\n 'aria-expanded': this.state.menuVisible ? 'true' : 'false',\n 'aria-label': this.props['aria-label'],\n });\n };\n\n private renderCaption = () => {\n if (typeof this.props.caption === 'function') {\n const caption = this.props.caption({\n opened: this.state.menuVisible,\n openMenu: this.showMenu,\n closeMenu: this.hideMenu,\n toggleMenu: this.toggleMenu,\n });\n\n return (\n <span\n data-tid={PopupMenuDataTids.caption}\n className={styles.caption()}\n ref={(element) => (this.captionWrapper = element)}\n >\n {this.passPropsToCaption(caption)}\n </span>\n );\n }\n\n return (\n <span\n data-tid={PopupMenuDataTids.caption}\n onClick={this.handleCaptionClick}\n onKeyDown={this.handleCaptionKeyDown}\n ref={(element) => (this.captionWrapper = element)}\n className={styles.caption()}\n >\n {this.passPropsToCaption(this.props.caption)}\n </span>\n );\n };\n\n private hideMenuWithoutFocusing = () => this.hideMenu();\n\n private getPositions(): Readonly<PopupPositionsType[]> {\n const positions = this.getProps().positions;\n if (positions && isValidPositions(positions)) {\n return positions;\n }\n\n return Positions;\n }\n\n private showMenu = (firstItemShouldBeSelected?: boolean): void => {\n this.saveFocus();\n this.setState(\n {\n menuVisible: true,\n firstItemShouldBeSelected,\n },\n () => {\n this.handleChangeMenuVisible(false);\n },\n );\n };\n\n private hideMenu = (restoreFocus?: boolean): void => {\n this.setState(\n {\n menuVisible: false,\n firstItemShouldBeSelected: false,\n },\n () => {\n this.handleChangeMenuVisible(!!restoreFocus);\n },\n );\n };\n\n private toggleMenu = (): void => {\n this.state.menuVisible ? this.hideMenu() : this.showMenu();\n };\n\n private handleCaptionClick = (): void => {\n this.toggleMenu();\n };\n\n private handleCaptionKeyDown = (e: React.KeyboardEvent<HTMLElement>): void => {\n if (someKeys(isKeyEnter, isKeySpace, isKeyArrowVertical)(e)) {\n e.preventDefault();\n this.showMenu(true);\n }\n };\n\n private handleKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n if (isKeyEscape(e)) {\n const restoreFocus = true;\n this.hideMenu(restoreFocus);\n }\n };\n\n private saveFocus = (): void => {\n if (globalObject.document) {\n this.savedFocusableElement = globalObject.document.activeElement as HTMLElement;\n }\n };\n\n private restoreFocus = (): void => {\n if (this.savedFocusableElement) {\n this.savedFocusableElement.focus();\n this.savedFocusableElement = null;\n }\n };\n\n private handleChangeMenuVisible = (focusShouldBeRestored: boolean): void => {\n if (focusShouldBeRestored) {\n this.restoreFocus();\n }\n\n if (this.state.menuVisible && this.props.onOpen) {\n this.props.onOpen();\n }\n\n if (!this.state.menuVisible && this.props.onClose) {\n this.props.onClose();\n }\n\n if (typeof this.props.onChangeMenuState === 'function') {\n this.props.onChangeMenuState(this.state.menuVisible, focusShouldBeRestored);\n }\n };\n\n private handleItemSelection = (event: React.SyntheticEvent<HTMLElement>): void => {\n if (event.isDefaultPrevented()) {\n return;\n }\n\n if (event.type === 'keydown') {\n event.preventDefault();\n }\n\n const restoreFocus = event.type === 'keydown';\n this.hideMenu(restoreFocus);\n };\n}\n"],"mappings":"maAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;;AAEA,IAAAE,MAAA,GAAAF,OAAA;;AAEA,IAAAG,YAAA,GAAAH,OA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C5C,OAAOA,SAAS,CAClB,CAEA,OAAOxH,SAAS,CAClB,CAAC,QAAAC,SAAA,GAlK4BqC,cAAK,CAACiG,SAAS,GAAA3I,UAAA,CAC9B4I,mBAAmB,GAAG,WAAW,EAAA5I,UAAA,CACjC6I,WAAW,GAAG,WAAW,EAAA7I,UAAA,CAKzBwB,YAAY,GAAiB,EACzCoG,SAAS,EAAExH,SAAS,EACpBiF,IAAI,EAAEpF,aAAa,CAACE,OAAO,EAC3BmG,WAAW,EAAE,IAAI,EACjBC,iBAAiB,EAAE,KAAK,CAC1B,CAAC,EAAAvG,UAAA,CAIa8I,IAAI,GAAG7I,aAAa,EAAAD,UAAA,MAAAD,MAAA,KAAAA,MAAA","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ import { story, kind, test } from 'creevey';
2
+
3
+ import { PopupMenuDataTids } from '../tids';
4
+ import { delay } from '../../../lib/delay';
5
+
6
+ const textAlignmentTests = () => {
7
+ test('opened', async (context) => {
8
+ await context.webdriver
9
+ .actions({
10
+ bridge: true,
11
+ })
12
+ .click(context.webdriver.findElement({ css: `[data-tid~="${PopupMenuDataTids.caption}"]` }))
13
+ .perform();
14
+ await delay(1000);
15
+ await context.matchImage(await context.takeScreenshot(), 'opened');
16
+ });
17
+ };
18
+
19
+ kind('PopupMenu', () => {
20
+ story('WithItems', ({ setStoryParameters }) => {
21
+ setStoryParameters({ skip: { 'themes dont affect logic': { in: /^(?!\bchrome2022\b)/ } } });
22
+
23
+ textAlignmentTests();
24
+ });
25
+
26
+ story('WithItemsWithIcons', ({ setStoryParameters }) => {
27
+ setStoryParameters({ skip: { 'themes dont affect logic': { in: /^(?!\bchrome2022\b)/ } } });
28
+
29
+ textAlignmentTests();
30
+ });
31
+
32
+ story('WithItemsWithIconsWithoutTextAlignment', ({ setStoryParameters }) => {
33
+ setStoryParameters({ skip: { 'themes dont affect logic': { in: /^(?!\bchrome2022\b)/ } } });
34
+
35
+ textAlignmentTests();
36
+ });
37
+ });
@@ -0,0 +1,4 @@
1
+ export declare const PopupMenuDataTids: {
2
+ readonly root: "PopupMenu__root";
3
+ readonly caption: "PopupMenu__caption";
4
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";exports.__esModule = true;exports.PopupMenuDataTids = void 0;var PopupMenuDataTids = exports.PopupMenuDataTids = {
2
+ root: 'PopupMenu__root',
3
+ caption: 'PopupMenu__caption'
4
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PopupMenuDataTids","exports","root","caption"],"sources":["tids.ts"],"sourcesContent":["export const PopupMenuDataTids = {\n root: 'PopupMenu__root',\n caption: 'PopupMenu__caption',\n} as const;\n"],"mappings":"0EAAO,IAAMA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC/BE,IAAI,EAAE,iBAAiB;EACvBC,OAAO,EAAE;AACX,CAAU","ignoreList":[]}
@@ -0,0 +1,68 @@
1
+ import { story, kind, test } from 'creevey';
2
+
3
+ import { delay } from '../../../lib/delay';
4
+
5
+ kind('ThemeProvider', () => {
6
+ story('Playground', ({ setStoryParameters }) => {
7
+ setStoryParameters({
8
+ skip: {
9
+ 'repeating tests': {
10
+ tests: ['theme 2022 top', 'theme 2022 bottom', 'theme 2022 dark top', 'theme 2022 dark bottom'],
11
+ in: /^(?!\b(chrome2022|firefox2022)\b)/,
12
+ },
13
+ },
14
+ });
15
+
16
+ test('theme 2022 top', async (context) => {
17
+ await context.webdriver
18
+ .actions({ bridge: true })
19
+ .click(context.webdriver.findElement({ css: '[data-prop-id="lightTheme"]' }))
20
+ .perform();
21
+ await delay(500);
22
+ await context.matchImage(await context.webdriver.takeScreenshot(), 'theme 2022 top');
23
+ });
24
+
25
+ test('theme 2022 bottom', async (context) => {
26
+ await context.webdriver
27
+ .actions({ bridge: true })
28
+ .click(context.webdriver.findElement({ css: '[data-prop-id="lightTheme"]' }))
29
+ .perform();
30
+ await context.webdriver.executeScript(function () {
31
+ document.documentElement.scrollTop = document.documentElement.scrollHeight;
32
+ });
33
+ await delay(1000);
34
+ await context.matchImage(await context.webdriver.takeScreenshot(), 'theme 2022 bottom');
35
+ });
36
+
37
+ test('theme 2022 dark top', async (context) => {
38
+ await context.webdriver
39
+ .actions({ bridge: true })
40
+ .click(context.webdriver.findElement({ css: '[data-prop-id="darkTheme"]' }))
41
+ .perform();
42
+ await delay(500);
43
+ await context.matchImage(await context.webdriver.takeScreenshot(), 'theme 2022 dark top');
44
+ });
45
+
46
+ test('theme 2022 dark bottom', async (context) => {
47
+ await context.webdriver
48
+ .actions({ bridge: true })
49
+ .click(context.webdriver.findElement({ css: '[data-prop-id="darkTheme"]' }))
50
+ .perform();
51
+ await context.webdriver.executeScript(function () {
52
+ document.documentElement.scrollTop = document.documentElement.scrollHeight;
53
+ });
54
+ await delay(1000);
55
+ await context.matchImage(await context.webdriver.takeScreenshot(), 'theme 2022 dark bottom');
56
+ });
57
+ });
58
+
59
+ story('UnlinkVars', ({ setStoryParameters }) => {
60
+ setStoryParameters({
61
+ skip: {
62
+ 'themes do not affect logic': {
63
+ in: ['chrome2022Dark', 'firefox2022', 'firefox2022Dark'],
64
+ },
65
+ },
66
+ });
67
+ });
68
+ });
@@ -38,6 +38,7 @@ if (_Supports.IS_PROXY_SUPPORTED) {
38
38
  baseThemes.push(_LightTheme.LIGHT_THEME);
39
39
  baseThemes.push(_DarkTheme.DARK_THEME);
40
40
 
41
+ // @ts-expect-error не очень-то и хотелось
41
42
  var componentsContext = require.context('../../../', true, /\.styles.ts$/);
42
43
  componentsContext.keys().forEach(function (fileName) {
43
44
  var fileNameStart = fileName.lastIndexOf('/') + 1;
@@ -1 +1 @@
1
- {"version":3,"names":["_globalObject","require","_LightTheme","_DarkTheme","_Supports","callsCount","executionTime","ALL_USED_VARIABLES_SET","Set","COMPONENT_DESCRIPTIONS","exports","COMPONENT_DESCRIPTIONS_BY_VARIABLE","IS_PROXY_SUPPORTED","baseThemes","push","LIGHT_THEME","DARK_THEME","componentsContext","context","keys","forEach","fileName","fileNameStart","lastIndexOf","componentName","substring","replace","componentDescription","Object","exportName","styles","elementName","jsStyle","variablesAccumulator","dependencies","elementProxyHandler","getProxyHandler","themes","map","t","Proxy","variables","Array","from","length","variableName","variableNode","componentNode","includes","dependenciesList","dependencyName","dependencyNode","accumulator","accessLevel","rootProp","isThemeVariable","theme","name","get","target","prop","receiver","_globalObject$perform","_globalObject$perform2","propName","add","start","globalObject","performance","now","result","Reflect","ALL_USED_VARIABLES","CALLS_COUNT","EXECUTION_TIME"],"sources":["VariablesCollector.ts"],"sourcesContent":["import { globalObject } from '@skbkontur/global-object';\n\nimport { Theme } from '../../lib/theming/Theme';\nimport { LIGHT_THEME } from '../../lib/theming/themes/LightTheme';\nimport { DARK_THEME } from '../../lib/theming/themes/DarkTheme';\nimport { IS_PROXY_SUPPORTED } from '../../lib/Supports';\n\nexport interface DescriptionsType {\n [componentName: string]: ComponentDescriptionType;\n}\n\nexport interface ComponentDescriptionType {\n [elementName: string]: ComponentRowDescriptionType;\n}\n\nexport interface ComponentRowDescriptionType {\n variables: Array<keyof Theme>;\n dependencies: VariableDependencies;\n}\n\nexport interface VariableNameToComponentsMap {\n [variableName: string]: DescriptionsType;\n}\n\nexport interface VariableDependencies {\n [variableName: string]: Array<keyof Theme>;\n}\n\nlet callsCount = 0;\nlet executionTime = 0;\nconst ALL_USED_VARIABLES_SET = new Set<keyof Theme>();\n\nexport const COMPONENT_DESCRIPTIONS: DescriptionsType = {};\nexport const COMPONENT_DESCRIPTIONS_BY_VARIABLE: VariableNameToComponentsMap = {};\n\nif (IS_PROXY_SUPPORTED) {\n const baseThemes: Theme[] = [];\n baseThemes.push(LIGHT_THEME);\n baseThemes.push(DARK_THEME);\n\n const componentsContext = require.context('../../../', true, /\\.styles.ts$/);\n componentsContext.keys().forEach((fileName) => {\n const fileNameStart = fileName.lastIndexOf('/') + 1;\n const componentName = fileName.substring(fileNameStart).replace('.styles.ts', '');\n const componentDescription: ComponentDescriptionType = {};\n Object.keys(componentsContext(fileName)).forEach((exportName) => {\n const styles = componentsContext(fileName)[exportName];\n\n Object.keys(styles).forEach((elementName) => {\n const jsStyle = styles[elementName];\n if (typeof jsStyle !== 'function') {\n return;\n }\n const variablesAccumulator = new Set<keyof Theme>();\n const dependencies: VariableDependencies = {};\n const elementProxyHandler = getProxyHandler(variablesAccumulator, dependencies);\n const themes = baseThemes.map((t) => new Proxy(t, elementProxyHandler));\n themes.forEach((t) => jsStyle(t));\n\n const variables = Array.from(variablesAccumulator);\n\n if (variables.length > 0) {\n componentDescription[elementName] = { variables, dependencies };\n\n variables.forEach((variableName) => {\n if (!COMPONENT_DESCRIPTIONS_BY_VARIABLE[variableName]) {\n COMPONENT_DESCRIPTIONS_BY_VARIABLE[variableName] = {};\n }\n\n const variableNode = COMPONENT_DESCRIPTIONS_BY_VARIABLE[variableName];\n if (!variableNode[componentName]) {\n variableNode[componentName] = {};\n }\n\n const componentNode = variableNode[componentName];\n if (!componentNode[elementName]) {\n componentNode[elementName] = {\n dependencies,\n variables: [variableName],\n };\n } else if (!componentNode[elementName].variables.includes(variableName)) {\n componentNode[elementName].dependencies = dependencies;\n componentNode[elementName].variables.push(variableName);\n }\n\n const dependenciesList = dependencies[variableName];\n if (dependenciesList) {\n dependenciesList.forEach((dependencyName) => {\n if (!COMPONENT_DESCRIPTIONS_BY_VARIABLE[dependencyName]) {\n COMPONENT_DESCRIPTIONS_BY_VARIABLE[dependencyName] = {};\n }\n\n const dependencyNode = COMPONENT_DESCRIPTIONS_BY_VARIABLE[dependencyName];\n if (!dependencyNode[componentName]) {\n dependencyNode[componentName] = COMPONENT_DESCRIPTIONS_BY_VARIABLE[variableName][componentName];\n }\n });\n }\n });\n }\n });\n });\n\n COMPONENT_DESCRIPTIONS[componentName] = componentDescription;\n });\n}\n\nfunction getProxyHandler(accumulator: Set<keyof Theme>, dependencies: VariableDependencies): ProxyHandler<Theme> {\n let accessLevel = 0;\n let rootProp = '';\n function isThemeVariable<T extends Theme>(theme: T, name: keyof T) {\n return typeof theme[name] === 'string';\n }\n return {\n get(target, prop, receiver) {\n const propName = prop as keyof Theme;\n if (isThemeVariable(target, propName)) {\n ALL_USED_VARIABLES_SET.add(propName);\n if (accessLevel === 0) {\n rootProp = propName;\n accumulator.add(propName);\n } else if (!dependencies[rootProp]) {\n dependencies[rootProp] = [propName];\n } else if (!dependencies[rootProp].includes(propName)) {\n dependencies[rootProp].push(propName);\n }\n }\n\n accessLevel++;\n const start = globalObject.performance?.now() || 0;\n const result = Reflect.get(target, prop, receiver);\n executionTime += (globalObject.performance?.now() || 0) - start;\n callsCount++;\n accessLevel--;\n return result;\n },\n };\n}\n\nexport const ALL_USED_VARIABLES = Array.from(ALL_USED_VARIABLES_SET);\nexport const CALLS_COUNT = callsCount;\nexport const EXECUTION_TIME = executionTime;\n"],"mappings":"wMAAA,IAAAA,aAAA,GAAAC,OAAA;;;AAGA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAII,UAAU,GAAG,CAAC;AAClB,IAAIC,aAAa,GAAG,CAAC;AACrB,IAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAc,CAAC;;AAE9C,IAAMC,sBAAwC,GAAAC,OAAA,CAAAD,sBAAA,GAAG,CAAC,CAAC;AACnD,IAAME,kCAA+D,GAAAD,OAAA,CAAAC,kCAAA,GAAG,CAAC,CAAC;;AAEjF,IAAIC,4BAAkB,EAAE;EACtB,IAAMC,UAAmB,GAAG,EAAE;EAC9BA,UAAU,CAACC,IAAI,CAACC,uBAAW,CAAC;EAC5BF,UAAU,CAACC,IAAI,CAACE,qBAAU,CAAC;;EAE3B,IAAMC,iBAAiB,GAAGhB,OAAO,CAACiB,OAAO,CAAC,WAAW,EAAE,IAAI,EAAE,cAAc,CAAC;EAC5ED,iBAAiB,CAACE,IAAI,CAAC,CAAC,CAACC,OAAO,CAAC,UAACC,QAAQ,EAAK;IAC7C,IAAMC,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,EAAEC,QAAQ,CAAC;MAClDvD,aAAa,IAAI,CAAC,EAAAyD,sBAAA,GAAAI,0BAAY,CAACC,WAAW,qBAAxBL,sBAAA,CAA0BM,GAAG,CAAC,CAAC,KAAI,CAAC,IAAIH,KAAK;MAC/D7D,UAAU,EAAE;MACZgD,WAAW,EAAE;MACb,OAAOiB,MAAM;IACf;EACF,CAAC;AACH;;AAEO,IAAME,kBAAkB,GAAA9D,OAAA,CAAA8D,kBAAA,GAAG9B,KAAK,CAACC,IAAI,CAACpC,sBAAsB,CAAC;AAC7D,IAAMkE,WAAW,GAAA/D,OAAA,CAAA+D,WAAA,GAAGpE,UAAU;AAC9B,IAAMqE,cAAc,GAAAhE,OAAA,CAAAgE,cAAA,GAAGpE,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_globalObject","require","_LightTheme","_DarkTheme","_Supports","callsCount","executionTime","ALL_USED_VARIABLES_SET","Set","COMPONENT_DESCRIPTIONS","exports","COMPONENT_DESCRIPTIONS_BY_VARIABLE","IS_PROXY_SUPPORTED","baseThemes","push","LIGHT_THEME","DARK_THEME","componentsContext","context","keys","forEach","fileName","fileNameStart","lastIndexOf","componentName","substring","replace","componentDescription","Object","exportName","styles","elementName","jsStyle","variablesAccumulator","dependencies","elementProxyHandler","getProxyHandler","themes","map","t","Proxy","variables","Array","from","length","variableName","variableNode","componentNode","includes","dependenciesList","dependencyName","dependencyNode","accumulator","accessLevel","rootProp","isThemeVariable","theme","name","get","target","prop","receiver","_globalObject$perform","_globalObject$perform2","propName","add","start","globalObject","performance","now","result","Reflect","ALL_USED_VARIABLES","CALLS_COUNT","EXECUTION_TIME"],"sources":["VariablesCollector.ts"],"sourcesContent":["import { globalObject } from '@skbkontur/global-object';\n\nimport { Theme } from '../../lib/theming/Theme';\nimport { LIGHT_THEME } from '../../lib/theming/themes/LightTheme';\nimport { DARK_THEME } from '../../lib/theming/themes/DarkTheme';\nimport { IS_PROXY_SUPPORTED } from '../../lib/Supports';\n\nexport interface DescriptionsType {\n [componentName: string]: ComponentDescriptionType;\n}\n\nexport interface ComponentDescriptionType {\n [elementName: string]: ComponentRowDescriptionType;\n}\n\nexport interface ComponentRowDescriptionType {\n variables: Array<keyof Theme>;\n dependencies: VariableDependencies;\n}\n\nexport interface VariableNameToComponentsMap {\n [variableName: string]: DescriptionsType;\n}\n\nexport interface VariableDependencies {\n [variableName: string]: Array<keyof Theme>;\n}\n\nlet callsCount = 0;\nlet executionTime = 0;\nconst ALL_USED_VARIABLES_SET = new Set<keyof Theme>();\n\nexport const COMPONENT_DESCRIPTIONS: DescriptionsType = {};\nexport const COMPONENT_DESCRIPTIONS_BY_VARIABLE: VariableNameToComponentsMap = {};\n\nif (IS_PROXY_SUPPORTED) {\n const baseThemes: Theme[] = [];\n baseThemes.push(LIGHT_THEME);\n baseThemes.push(DARK_THEME);\n\n // @ts-expect-error не очень-то и хотелось\n const componentsContext = require.context('../../../', true, /\\.styles.ts$/);\n componentsContext.keys().forEach((fileName: string) => {\n const fileNameStart = fileName.lastIndexOf('/') + 1;\n const componentName = fileName.substring(fileNameStart).replace('.styles.ts', '');\n const componentDescription: ComponentDescriptionType = {};\n Object.keys(componentsContext(fileName)).forEach((exportName) => {\n const styles = componentsContext(fileName)[exportName];\n\n Object.keys(styles).forEach((elementName) => {\n const jsStyle = styles[elementName];\n if (typeof jsStyle !== 'function') {\n return;\n }\n const variablesAccumulator = new Set<keyof Theme>();\n const dependencies: VariableDependencies = {};\n const elementProxyHandler = getProxyHandler(variablesAccumulator, dependencies);\n const themes = baseThemes.map((t) => new Proxy(t, elementProxyHandler));\n themes.forEach((t) => jsStyle(t));\n\n const variables = Array.from(variablesAccumulator);\n\n if (variables.length > 0) {\n componentDescription[elementName] = { variables, dependencies };\n\n variables.forEach((variableName) => {\n if (!COMPONENT_DESCRIPTIONS_BY_VARIABLE[variableName]) {\n COMPONENT_DESCRIPTIONS_BY_VARIABLE[variableName] = {};\n }\n\n const variableNode = COMPONENT_DESCRIPTIONS_BY_VARIABLE[variableName];\n if (!variableNode[componentName]) {\n variableNode[componentName] = {};\n }\n\n const componentNode = variableNode[componentName];\n if (!componentNode[elementName]) {\n componentNode[elementName] = {\n dependencies,\n variables: [variableName],\n };\n } else if (!componentNode[elementName].variables.includes(variableName)) {\n componentNode[elementName].dependencies = dependencies;\n componentNode[elementName].variables.push(variableName);\n }\n\n const dependenciesList = dependencies[variableName];\n if (dependenciesList) {\n dependenciesList.forEach((dependencyName) => {\n if (!COMPONENT_DESCRIPTIONS_BY_VARIABLE[dependencyName]) {\n COMPONENT_DESCRIPTIONS_BY_VARIABLE[dependencyName] = {};\n }\n\n const dependencyNode = COMPONENT_DESCRIPTIONS_BY_VARIABLE[dependencyName];\n if (!dependencyNode[componentName]) {\n dependencyNode[componentName] = COMPONENT_DESCRIPTIONS_BY_VARIABLE[variableName][componentName];\n }\n });\n }\n });\n }\n });\n });\n\n COMPONENT_DESCRIPTIONS[componentName] = componentDescription;\n });\n}\n\nfunction getProxyHandler(accumulator: Set<keyof Theme>, dependencies: VariableDependencies): ProxyHandler<Theme> {\n let accessLevel = 0;\n let rootProp = '';\n function isThemeVariable<T extends Theme>(theme: T, name: keyof T) {\n return typeof theme[name] === 'string';\n }\n return {\n get(target, prop, receiver) {\n const propName = prop as keyof Theme;\n if (isThemeVariable(target, propName)) {\n ALL_USED_VARIABLES_SET.add(propName);\n if (accessLevel === 0) {\n rootProp = propName;\n accumulator.add(propName);\n } else if (!dependencies[rootProp]) {\n dependencies[rootProp] = [propName];\n } else if (!dependencies[rootProp].includes(propName)) {\n dependencies[rootProp].push(propName);\n }\n }\n\n accessLevel++;\n const start = globalObject.performance?.now() || 0;\n const result = Reflect.get(target, prop, receiver);\n executionTime += (globalObject.performance?.now() || 0) - start;\n callsCount++;\n accessLevel--;\n return result;\n },\n };\n}\n\nexport const ALL_USED_VARIABLES = Array.from(ALL_USED_VARIABLES_SET);\nexport const CALLS_COUNT = callsCount;\nexport const EXECUTION_TIME = executionTime;\n"],"mappings":"wM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@@ -0,0 +1,228 @@
1
+ import { story, kind, test } from 'creevey';
2
+
3
+ import { delay } from '../../../lib/delay';
4
+ import { SelectDataTids } from '../../../components/Select/tids';
5
+
6
+ kind('ZIndex', () => {
7
+ story('HintAndModalStory', () => {
8
+ test('Modal covers hint', async (context) => {
9
+ await context.webdriver
10
+ .actions({ bridge: true })
11
+ .click(context.webdriver.findElement({ css: '[data-tid~="open-modal"]' }))
12
+ .perform();
13
+ await context.webdriver
14
+ .actions({ bridge: true })
15
+ .click(context.webdriver.findElement({ css: '.modalBody button' }))
16
+ .perform();
17
+ await delay(1000);
18
+ await context.matchImage(await context.webdriver.takeScreenshot(), 'Modal covers hint');
19
+ });
20
+ });
21
+
22
+ story('BigModalWithLoaderStory', () => {
23
+ test('Header covers Loader', async (context) => {
24
+ await context.webdriver.executeScript(function () {
25
+ const sidePage = window.document.querySelector('[data-tid="modal-container"]') as HTMLElement;
26
+
27
+ if (sidePage) {
28
+ sidePage.scrollTop = sidePage.offsetHeight / 3;
29
+ }
30
+ });
31
+ await delay(1000);
32
+ await context.matchImage(await context.webdriver.takeScreenshot(), 'Header covers Loader');
33
+ });
34
+ });
35
+
36
+ story('TooltipAndSelectStory', () => {
37
+ test('Menu covers tooltip', async (context) => {
38
+ const element = await context.webdriver.findElement({ css: '.container' });
39
+ await context.webdriver
40
+ .actions({ bridge: true })
41
+ .click(context.webdriver.findElement({ css: `[data-tid=${SelectDataTids.label}]` }))
42
+ .sendKeys('q')
43
+ .perform();
44
+ await delay(1000);
45
+ await context.matchImage(await element.takeScreenshot(), 'Modal covers hint');
46
+ });
47
+ });
48
+
49
+ story('LoaderInSidePageBody', () => {
50
+ test('is covered by Header and Footer', async (context) => {
51
+ await context.webdriver.executeScript(function () {
52
+ const sidePage = window.document.querySelector('[data-tid="SidePage__container"]') as HTMLElement;
53
+
54
+ if (sidePage) {
55
+ sidePage.scrollTop = sidePage.offsetHeight;
56
+ }
57
+ });
58
+ await delay(1000);
59
+ await context.matchImage(await context.webdriver.takeScreenshot(), 'is covered by Header and Footer');
60
+ });
61
+ });
62
+
63
+ story('SidepageAndSelect', () => {
64
+ test('SidePage covers Select and Tooltip', async (context) => {
65
+ await context.webdriver
66
+ .actions({ bridge: true })
67
+ .click(context.webdriver.findElement({ css: '.select-container button' }))
68
+ .sendKeys('q')
69
+ .perform();
70
+ await context.webdriver
71
+ .actions({ bridge: true })
72
+ .click(context.webdriver.findElement({ css: '.open-sidepage-container button' }))
73
+ .perform();
74
+ await context.webdriver
75
+ .actions({ bridge: true })
76
+ .click(context.webdriver.findElement({ css: '.sidepage-select-continer button' }))
77
+ .sendKeys('q')
78
+ .perform();
79
+ const element = await context.webdriver.findElement({ css: `[data-tid='SidePage__container']` });
80
+ await delay(1000);
81
+ await context.matchImage(await element.takeScreenshot(), 'SidePage covers Select and Tooltip');
82
+ });
83
+ });
84
+
85
+ story('ElementsInLoaderInModalStory', ({ setStoryParameters }) => {
86
+ setStoryParameters({
87
+ skip: {
88
+ 'flaky test': {
89
+ in: ['chrome2022Dark'],
90
+ tests: ['Hide Hint on active Loader'],
91
+ },
92
+ },
93
+ });
94
+
95
+ test('Open Dropdown while Loader is inactive', async (context) => {
96
+ await context.webdriver
97
+ .actions({ bridge: true })
98
+ .click(context.webdriver.findElement({ css: '[data-comp-name~="Select"]' }))
99
+ .perform();
100
+ await delay(1000);
101
+ await context.matchImage(await context.webdriver.takeScreenshot(), 'Open Dropdown while Loader is inactive');
102
+ });
103
+
104
+ test('Hide Hint on active Loader', async (context) => {
105
+ await context.webdriver
106
+ .actions({ bridge: true })
107
+ .click(context.webdriver.findElement({ css: '[data-comp-name~="Toggle"]' }))
108
+ .perform();
109
+ await delay(1000);
110
+ await context.matchImage(await context.webdriver.takeScreenshot(), 'Hide Hint on active Loader');
111
+ });
112
+ });
113
+
114
+ story('LoaderAndSidePageStory', () => {
115
+ test('SidePage shadow cover Loader', async (context) => {
116
+ await context.webdriver
117
+ .actions({ bridge: true })
118
+ .click(context.webdriver.findElement({ css: '[data-comp-name~="Toggle"]' }))
119
+ .perform();
120
+ await delay(1000);
121
+ await context.matchImage(await context.webdriver.takeScreenshot(), 'SidePage shadow cover Loader');
122
+ });
123
+ });
124
+
125
+ story('StickyAndTooltipsStory', () => {
126
+ test('Sticky covers outside Popup', async (context) => {
127
+ await context.webdriver
128
+ .actions({ bridge: true })
129
+ .click(context.webdriver.findElement({ css: '[data-comp-name~="Select"]' }))
130
+ .perform();
131
+ await delay(1000);
132
+ await context.matchImage(await context.webdriver.takeScreenshot(), 'Sticky covers outside Popup');
133
+ });
134
+ });
135
+
136
+ story('ModalAndToast', () => {
137
+ test('toastShown', async (context) => {
138
+ await context.webdriver
139
+ .actions({ bridge: true })
140
+ .click(context.webdriver.findElement({ css: '[data-comp-name~="Button"] button' }))
141
+ .perform();
142
+ await delay(1000);
143
+ await context.matchImage(await context.webdriver.takeScreenshot());
144
+ });
145
+ });
146
+
147
+ story('ToastOverEverything', ({ setStoryParameters }) => {
148
+ setStoryParameters({ skip: { 'flickering screenshot': { in: /^(?!\b(firefox))/, tests: 'staticToast' } } });
149
+
150
+ test('staticToast', async (context) => {
151
+ await context.webdriver
152
+ .actions({ bridge: true })
153
+ .click(context.webdriver.findElement({ css: '[data-tid~="static-toast"]' }))
154
+ .pause(1000)
155
+ .click(context.webdriver.findElement({ css: 'body' }))
156
+ .perform();
157
+ const shown = await context.webdriver.takeScreenshot(); // Toast rendered by static method doesn't get removed
158
+ // when story switches, so we have to close it manually
159
+ await context.webdriver
160
+ .actions({ bridge: true })
161
+ .click(context.webdriver.findElement({ css: '[data-tid~="ToastView__close"]' }))
162
+ .pause(500)
163
+ .perform();
164
+ await context.matchImage(shown);
165
+ });
166
+
167
+ test('refToast', async (context) => {
168
+ await context.webdriver
169
+ .actions({ bridge: true })
170
+ .click(context.webdriver.findElement({ css: '[data-tid~="ref-toast"]' }))
171
+ .pause(1000)
172
+ .click(context.webdriver.findElement({ css: 'body' }))
173
+ .perform();
174
+ await delay(1000);
175
+ await context.matchImage(await context.webdriver.takeScreenshot());
176
+ });
177
+ });
178
+
179
+ story('ModalWithDropdown', ({ setStoryParameters }) => {
180
+ setStoryParameters({ skip: { 'no themes': { in: /^(?!\b(chrome2022|firefox2022)\b)/ } } });
181
+
182
+ test('dropdown overlaps static header', async (context) => {
183
+ await context.webdriver
184
+ .actions({ bridge: true })
185
+ .click(context.webdriver.findElement({ css: '[data-tid="dropdown_top"]' }))
186
+ .perform();
187
+ await delay(1000);
188
+ await context.matchImage(await context.webdriver.takeScreenshot());
189
+ });
190
+
191
+ test('dropdown lays under fixed header', async (context) => {
192
+ await context.webdriver
193
+ .actions({ bridge: true })
194
+ .click(context.webdriver.findElement({ css: '[data-tid="dropdown_top"]' }))
195
+ .perform();
196
+ await delay(1000);
197
+ await context.webdriver.executeScript(function () {
198
+ const scrollContainer = window.document.querySelector('[data-tid="modal-container"]') as HTMLElement;
199
+ scrollContainer.scrollTop = scrollContainer.scrollHeight;
200
+ });
201
+ await delay(1000);
202
+ await context.matchImage(await context.webdriver.takeScreenshot());
203
+ });
204
+
205
+ test('dropdown lays under fixed footer', async (context) => {
206
+ await context.webdriver
207
+ .actions({ bridge: true })
208
+ .click(context.webdriver.findElement({ css: '[data-tid="dropdown_bottom"]' }))
209
+ .perform();
210
+ await delay(1000);
211
+ await context.matchImage(await context.webdriver.takeScreenshot());
212
+ });
213
+
214
+ test('dropdown overlaps static footer', async (context) => {
215
+ await context.webdriver
216
+ .actions({ bridge: true })
217
+ .click(context.webdriver.findElement({ css: '[data-tid="dropdown_bottom"]' }))
218
+ .perform();
219
+ await delay(1000);
220
+ await context.webdriver.executeScript(function () {
221
+ const scrollContainer = window.document.querySelector('[data-tid="modal-container"]') as HTMLElement;
222
+ scrollContainer.scrollTop = scrollContainer.scrollHeight;
223
+ });
224
+ await delay(1000);
225
+ await context.matchImage(await context.webdriver.takeScreenshot());
226
+ });
227
+ });
228
+ });
@@ -0,0 +1 @@
1
+ export declare const delay: (ms: number) => Promise<unknown>;
@@ -0,0 +1,3 @@
1
+ "use strict";exports.__esModule = true;exports.delay = void 0;var _globalObject = require("@skbkontur/global-object");
2
+
3
+ var delay = exports.delay = function delay(ms) {return new Promise(function (resolve) {return _globalObject.globalObject.setTimeout(resolve, ms);});};
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_globalObject","require","delay","exports","ms","Promise","resolve","globalObject","setTimeout"],"sources":["delay.ts"],"sourcesContent":["import { globalObject } from '@skbkontur/global-object';\n\nexport const delay = (ms: number) => new Promise((resolve) => globalObject.setTimeout(resolve, ms));\n"],"mappings":"8DAAA,IAAAA,aAAA,GAAAC,OAAA;;AAEO,IAAMC,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAG,SAARA,KAAKA,CAAIE,EAAU,UAAK,IAAIC,OAAO,CAAC,UAACC,OAAO,UAAKC,0BAAY,CAACC,UAAU,CAACF,OAAO,EAAEF,EAAE,CAAC,GAAC","ignoreList":[]}
@@ -1,12 +1,12 @@
1
- import React from 'react';
2
- import { InputProps } from '../components/Input';
1
+ import type React from 'react';
2
+ import type { InputProps } from '../components/Input';
3
+ export { delay } from './delay';
3
4
  export type Defaultize<P, D> = P extends any ? string extends keyof P ? P : Pick<P, Exclude<keyof P, keyof D>> & Partial<Pick<P, Extract<keyof P, keyof D>>> & Partial<Pick<D, Exclude<keyof D, keyof P>>> : never;
4
5
  export type DefaultizeProps<C, P> = C extends {
5
6
  defaultProps: infer D;
6
7
  } ? Defaultize<P, D> : P;
7
8
  export type AnyObject = Record<string, unknown>;
8
9
  export type NoInfer<T> = T extends infer U ? U : never;
9
- export declare const delay: (ms: number) => Promise<unknown>;
10
10
  export declare const emptyHandler: () => void;
11
11
  export declare class CancelationError extends Error {
12
12
  code: string;
package/cjs/lib/utils.js CHANGED
@@ -1,4 +1,5 @@
1
- "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.CancelationError = void 0;exports.clickOutside = clickOutside;exports.emptyHandler = exports.delay = void 0;exports.escapeRegExpSpecChars = escapeRegExpSpecChars;exports.getRandomID = exports.formatBytes = exports.extractDataProps = void 0;exports.isClassComponent = isClassComponent;exports.isExternalLink = void 0;exports.isFunction = isFunction;exports.isFunctionalComponent = isFunctionalComponent;exports.isInputLike = void 0;exports.isIntrinsicElement = isIntrinsicElement;exports.isReactUINode = exports.isReactUIComponent = exports.isNullable = exports.isNonNullable = exports.isKonturIcon = void 0;exports.isRefableElement = isRefableElement;exports.mergeRefs = mergeRefs;exports.startsWithOneOf = void 0;exports.taskWithDelay = taskWithDelay;var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));var _react = _interopRequireDefault(require("react"));
1
+ "use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.CancelationError = void 0;exports.clickOutside = clickOutside;exports.emptyHandler = exports.delay = void 0;exports.escapeRegExpSpecChars = escapeRegExpSpecChars;exports.getRandomID = exports.formatBytes = exports.extractDataProps = void 0;exports.isClassComponent = isClassComponent;exports.isExternalLink = void 0;exports.isFunction = isFunction;exports.isFunctionalComponent = isFunctionalComponent;exports.isInputLike = void 0;exports.isIntrinsicElement = isIntrinsicElement;exports.isReactUINode = exports.isReactUIComponent = exports.isNullable = exports.isNonNullable = exports.isKonturIcon = void 0;exports.isRefableElement = isRefableElement;exports.mergeRefs = mergeRefs;exports.startsWithOneOf = void 0;exports.taskWithDelay = taskWithDelay;var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
2
+ var _react = require("react");
2
3
  var _reactIs = require("react-is");
3
4
  var _globalObject = require("@skbkontur/global-object");
4
5
 
@@ -8,8 +9,9 @@ var _globalObject = require("@skbkontur/global-object");
8
9
 
9
10
 
10
11
 
11
- // NOTE: Copy-paste from @types/react
12
+ var _delay = require("./delay");exports.delay = _delay.delay;
12
13
 
14
+ // NOTE: Copy-paste from @types/react
13
15
 
14
16
 
15
17
 
@@ -23,7 +25,6 @@ var _globalObject = require("@skbkontur/global-object");
23
25
 
24
26
 
25
27
 
26
- var delay = exports.delay = function delay(ms) {return new Promise(function (resolve) {return _globalObject.globalObject.setTimeout(resolve, ms);});};
27
28
 
28
29
  var emptyHandler = exports.emptyHandler = function emptyHandler() {
29
30
 
@@ -81,7 +82,7 @@ var isExternalLink = exports.isExternalLink = function isExternalLink(link) {
81
82
  * Check if the given ReactNode is an element of the specified ReactUI component
82
83
  */
83
84
  var isReactUINode = exports.isReactUINode = function isReactUINode(componentName, node) {
84
- if ( /*#__PURE__*/_react.default.isValidElement(node)) {
85
+ if ( /*#__PURE__*/(0, _react.isValidElement)(node)) {
85
86
  return (
86
87
  Object.prototype.hasOwnProperty.call(node.type, '__KONTUR_REACT_UI__') &&
87
88
  // @ts-expect-error: React doesn't know about existence of __KONTUR_REACT_UI__.