@salutejs/plasma-new-hope 0.174.0-canary.1497.11501781410.0 → 0.174.0-canary.1503.11500823810.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (315) hide show
  1. package/cjs/components/Combobox/ComboboxNew/Combobox.css +10 -10
  2. package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +10 -10
  3. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +10 -10
  4. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
  5. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
  6. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -6
  7. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
  8. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_y71664.css → Item.styles_1us8jz1.css} +1 -1
  9. package/cjs/components/Combobox/ComboboxOld/Combobox.css +14 -28
  10. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +18 -32
  11. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +18 -32
  12. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +18 -32
  13. package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +18 -32
  14. package/cjs/components/Dropdown/Dropdown.css +16 -30
  15. package/cjs/components/Dropdown/Dropdown.js +37 -60
  16. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  17. package/cjs/components/Dropdown/Dropdown.styles.js +26 -14
  18. package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
  19. package/cjs/components/Dropdown/Dropdown.styles_1tihqkp.css +3 -0
  20. package/cjs/components/Dropdown/Dropdown.tokens.js +1 -24
  21. package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
  22. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +51 -17
  23. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
  24. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +6 -46
  25. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +18 -29
  26. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  27. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +31 -25
  28. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  29. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_blclup.css +6 -0
  30. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +1 -1
  31. package/cjs/components/Dropdown/ui/DropdownItemOld/{DropdownItem.styles_1lyg81y.css → DropdownItem.styles_12e50g5.css} +1 -1
  32. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -4
  33. package/cjs/components/Dropdown/utils/index.js.map +1 -1
  34. package/cjs/components/Notification/Notification.css +11 -11
  35. package/cjs/components/Notification/Notification.js +2 -2
  36. package/cjs/components/Notification/Notification.js.map +1 -1
  37. package/cjs/components/Notification/Notification.styles.js +1 -1
  38. package/cjs/components/Notification/Notification.styles.js.map +1 -1
  39. package/cjs/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_1cf2gwd.css} +1 -1
  40. package/cjs/components/Notification/Notification.tokens.js +2 -1
  41. package/cjs/components/Notification/Notification.tokens.js.map +1 -1
  42. package/cjs/components/Notification/Notification.types.js.map +1 -1
  43. package/cjs/components/Notification/NotificationsPortal.js +5 -3
  44. package/cjs/components/Notification/NotificationsPortal.js.map +1 -1
  45. package/cjs/components/Notification/NotificationsProvider.css +11 -11
  46. package/cjs/components/Notification/NotificationsProvider.js +3 -1
  47. package/cjs/components/Notification/NotificationsProvider.js.map +1 -1
  48. package/cjs/components/Select/Select.js +1 -1
  49. package/cjs/components/Select/utils/getCorrectHeight.js.map +1 -1
  50. package/cjs/hooks/useOutsideClick.js +1 -1
  51. package/cjs/hooks/useOutsideClick.js.map +1 -1
  52. package/cjs/index.css +33 -31
  53. package/cjs/index.js +1 -1
  54. package/cjs/utils/index.js.map +1 -1
  55. package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
  56. package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -14
  57. package/emotion/cjs/components/Dropdown/Dropdown.js +37 -58
  58. package/emotion/cjs/components/Dropdown/Dropdown.styles.js +25 -9
  59. package/emotion/cjs/components/Dropdown/Dropdown.tokens.js +2 -36
  60. package/emotion/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +51 -17
  61. package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +18 -29
  62. package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +41 -21
  63. package/emotion/cjs/components/Dropdown/utils/index.js +1 -23
  64. package/emotion/cjs/components/Notification/Notification.js +2 -2
  65. package/emotion/cjs/components/Notification/Notification.styles.js +11 -11
  66. package/emotion/cjs/components/Notification/Notification.template-doc.mdx +15 -7
  67. package/emotion/cjs/components/Notification/Notification.tokens.js +2 -1
  68. package/emotion/cjs/components/Notification/NotificationsPortal.js +6 -4
  69. package/emotion/cjs/components/Notification/NotificationsProvider.js +3 -1
  70. package/emotion/cjs/components/Notification/index.js +4 -4
  71. package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +12 -12
  72. package/emotion/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
  73. package/emotion/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
  74. package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
  75. package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  76. package/emotion/cjs/examples/plasma_web/components/Combobox/Combobox.config.js +12 -12
  77. package/emotion/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
  78. package/emotion/cjs/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
  79. package/emotion/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
  80. package/emotion/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  81. package/emotion/cjs/hooks/useOutsideClick.js +1 -1
  82. package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
  83. package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -14
  84. package/emotion/es/components/Dropdown/Dropdown.js +40 -60
  85. package/emotion/es/components/Dropdown/Dropdown.styles.js +25 -9
  86. package/emotion/es/components/Dropdown/Dropdown.tokens.js +1 -35
  87. package/emotion/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +52 -18
  88. package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +20 -31
  89. package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +42 -22
  90. package/emotion/es/components/Dropdown/utils/index.js +1 -4
  91. package/emotion/es/components/Notification/Notification.js +1 -1
  92. package/emotion/es/components/Notification/Notification.styles.js +11 -11
  93. package/emotion/es/components/Notification/Notification.template-doc.mdx +15 -7
  94. package/emotion/es/components/Notification/Notification.tokens.js +2 -1
  95. package/emotion/es/components/Notification/NotificationsPortal.js +6 -4
  96. package/emotion/es/components/Notification/NotificationsProvider.js +3 -1
  97. package/emotion/es/components/Notification/index.js +1 -1
  98. package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +12 -12
  99. package/emotion/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +6 -6
  100. package/emotion/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
  101. package/emotion/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
  102. package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  103. package/emotion/es/examples/plasma_web/components/Combobox/Combobox.config.js +12 -12
  104. package/emotion/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +6 -6
  105. package/emotion/es/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
  106. package/emotion/es/examples/plasma_web/components/Notification/Notification.js +6 -4
  107. package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  108. package/emotion/es/hooks/useOutsideClick.js +1 -1
  109. package/es/components/Combobox/ComboboxNew/Combobox.css +10 -10
  110. package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +10 -10
  111. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +10 -10
  112. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
  113. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
  114. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +20 -6
  115. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js.map +1 -1
  116. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/{Item.styles_y71664.css → Item.styles_1us8jz1.css} +1 -1
  117. package/es/components/Combobox/ComboboxOld/Combobox.css +14 -28
  118. package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +18 -32
  119. package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +18 -32
  120. package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +18 -32
  121. package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +18 -32
  122. package/es/components/Dropdown/Dropdown.css +16 -30
  123. package/es/components/Dropdown/Dropdown.js +40 -62
  124. package/es/components/Dropdown/Dropdown.js.map +1 -1
  125. package/es/components/Dropdown/Dropdown.styles.js +26 -15
  126. package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
  127. package/es/components/Dropdown/Dropdown.styles_1tihqkp.css +3 -0
  128. package/es/components/Dropdown/Dropdown.tokens.js +1 -24
  129. package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
  130. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +52 -18
  131. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
  132. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +6 -46
  133. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +20 -31
  134. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  135. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +29 -24
  136. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  137. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_blclup.css +6 -0
  138. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +1 -1
  139. package/es/components/Dropdown/ui/DropdownItemOld/{DropdownItem.styles_1lyg81y.css → DropdownItem.styles_12e50g5.css} +1 -1
  140. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -4
  141. package/es/components/Dropdown/utils/index.js.map +1 -1
  142. package/es/components/Notification/Notification.css +11 -11
  143. package/es/components/Notification/Notification.js +2 -2
  144. package/es/components/Notification/Notification.js.map +1 -1
  145. package/es/components/Notification/Notification.styles.js +1 -1
  146. package/es/components/Notification/Notification.styles.js.map +1 -1
  147. package/es/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_1cf2gwd.css} +1 -1
  148. package/es/components/Notification/Notification.tokens.js +2 -1
  149. package/es/components/Notification/Notification.tokens.js.map +1 -1
  150. package/es/components/Notification/Notification.types.js.map +1 -1
  151. package/es/components/Notification/NotificationsPortal.js +5 -3
  152. package/es/components/Notification/NotificationsPortal.js.map +1 -1
  153. package/es/components/Notification/NotificationsProvider.css +11 -11
  154. package/es/components/Notification/NotificationsProvider.js +3 -1
  155. package/es/components/Notification/NotificationsProvider.js.map +1 -1
  156. package/es/components/Select/Select.js +1 -1
  157. package/es/components/Select/utils/getCorrectHeight.js.map +1 -1
  158. package/es/hooks/useOutsideClick.js +1 -1
  159. package/es/hooks/useOutsideClick.js.map +1 -1
  160. package/es/index.css +33 -31
  161. package/es/index.js +1 -1
  162. package/es/utils/index.js.map +1 -1
  163. package/package.json +2 -2
  164. package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
  165. package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +10 -4
  166. package/styled-components/cjs/components/Dropdown/Dropdown.js +37 -58
  167. package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +15 -9
  168. package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +2 -36
  169. package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +51 -17
  170. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +18 -29
  171. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +19 -17
  172. package/styled-components/cjs/components/Dropdown/utils/index.js +1 -23
  173. package/styled-components/cjs/components/Notification/Notification.js +2 -2
  174. package/styled-components/cjs/components/Notification/Notification.styles.js +1 -1
  175. package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +15 -7
  176. package/styled-components/cjs/components/Notification/Notification.tokens.js +2 -1
  177. package/styled-components/cjs/components/Notification/NotificationsPortal.js +5 -3
  178. package/styled-components/cjs/components/Notification/NotificationsProvider.js +3 -1
  179. package/styled-components/cjs/components/Notification/index.js +4 -4
  180. package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.config.js +4 -4
  181. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +5 -5
  182. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
  183. package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
  184. package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  185. package/styled-components/cjs/examples/plasma_web/components/Combobox/Combobox.config.js +4 -4
  186. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Dropdown.config.js +5 -5
  187. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
  188. package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
  189. package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  190. package/styled-components/cjs/hooks/useOutsideClick.js +1 -1
  191. package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
  192. package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.js +10 -4
  193. package/styled-components/es/components/Dropdown/Dropdown.js +40 -60
  194. package/styled-components/es/components/Dropdown/Dropdown.styles.js +15 -9
  195. package/styled-components/es/components/Dropdown/Dropdown.tokens.js +1 -35
  196. package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +52 -18
  197. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +20 -31
  198. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +20 -18
  199. package/styled-components/es/components/Dropdown/utils/index.js +1 -4
  200. package/styled-components/es/components/Notification/Notification.js +1 -1
  201. package/styled-components/es/components/Notification/Notification.styles.js +1 -1
  202. package/styled-components/es/components/Notification/Notification.template-doc.mdx +15 -7
  203. package/styled-components/es/components/Notification/Notification.tokens.js +2 -1
  204. package/styled-components/es/components/Notification/NotificationsPortal.js +5 -3
  205. package/styled-components/es/components/Notification/NotificationsProvider.js +3 -1
  206. package/styled-components/es/components/Notification/index.js +1 -1
  207. package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.config.js +4 -4
  208. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +6 -6
  209. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +5 -6
  210. package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
  211. package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  212. package/styled-components/es/examples/plasma_web/components/Combobox/Combobox.config.js +4 -4
  213. package/styled-components/es/examples/plasma_web/components/Dropdown/Dropdown.config.js +6 -6
  214. package/styled-components/es/examples/plasma_web/components/Dropdown/Dropdown.stories.tsx +5 -6
  215. package/styled-components/es/examples/plasma_web/components/Notification/Notification.js +6 -4
  216. package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  217. package/styled-components/es/hooks/useOutsideClick.js +1 -1
  218. package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.d.ts.map +1 -1
  219. package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.styles.d.ts.map +1 -1
  220. package/types/components/Combobox/ComboboxOld/Combobox.types.d.ts +1 -2
  221. package/types/components/Combobox/ComboboxOld/Combobox.types.d.ts.map +1 -1
  222. package/types/components/Dropdown/Dropdown.d.ts +1 -2
  223. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  224. package/types/components/Dropdown/Dropdown.styles.d.ts +6 -1
  225. package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
  226. package/types/components/Dropdown/Dropdown.tokens.d.ts +0 -25
  227. package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
  228. package/types/components/Dropdown/Dropdown.types.d.ts +4 -30
  229. package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
  230. package/types/components/Dropdown/index.d.ts +1 -1
  231. package/types/components/Dropdown/index.d.ts.map +1 -1
  232. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +1 -1
  233. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +12 -1
  234. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +1 -1
  235. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
  236. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +3 -32
  237. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
  238. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +14 -1
  239. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
  240. package/types/components/Dropdown/utils/index.d.ts +0 -3
  241. package/types/components/Dropdown/utils/index.d.ts.map +1 -1
  242. package/types/components/Notification/Notification.d.ts +3 -3
  243. package/types/components/Notification/Notification.d.ts.map +1 -1
  244. package/types/components/Notification/Notification.styles.d.ts.map +1 -1
  245. package/types/components/Notification/Notification.tokens.d.ts +1 -0
  246. package/types/components/Notification/Notification.tokens.d.ts.map +1 -1
  247. package/types/components/Notification/Notification.types.d.ts +11 -5
  248. package/types/components/Notification/Notification.types.d.ts.map +1 -1
  249. package/types/components/Notification/NotificationsPortal.d.ts.map +1 -1
  250. package/types/components/Notification/NotificationsProvider.d.ts +4 -3
  251. package/types/components/Notification/NotificationsProvider.d.ts.map +1 -1
  252. package/types/components/Notification/index.d.ts +2 -2
  253. package/types/components/Notification/index.d.ts.map +1 -1
  254. package/types/components/Select/utils/getCorrectHeight.d.ts +2 -2
  255. package/types/components/Select/utils/getCorrectHeight.d.ts.map +1 -1
  256. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts +3 -3
  257. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts.map +1 -1
  258. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +4 -4
  259. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +1 -1
  260. package/types/examples/plasma_b2c/components/Notification/Notification.d.ts +4 -2
  261. package/types/examples/plasma_b2c/components/Notification/Notification.d.ts.map +1 -1
  262. package/types/examples/plasma_web/components/Dropdown/Dropdown.config.d.ts +3 -3
  263. package/types/examples/plasma_web/components/Dropdown/Dropdown.config.d.ts.map +1 -1
  264. package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts +4 -4
  265. package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts.map +1 -1
  266. package/types/examples/plasma_web/components/Notification/Notification.d.ts +4 -13
  267. package/types/examples/plasma_web/components/Notification/Notification.d.ts.map +1 -1
  268. package/types/hooks/useOutsideClick.d.ts +1 -1
  269. package/types/hooks/useOutsideClick.d.ts.map +1 -1
  270. package/types/utils/index.d.ts +1 -1
  271. package/types/utils/index.d.ts.map +1 -1
  272. package/cjs/components/Dropdown/Dropdown.styles_1ix6io8.css +0 -2
  273. package/cjs/components/Dropdown/FloatingPopover.js +0 -104
  274. package/cjs/components/Dropdown/FloatingPopover.js.map +0 -1
  275. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_17va0nk.css +0 -5
  276. package/cjs/components/Dropdown/utils/getItemByFocused.js +0 -13
  277. package/cjs/components/Dropdown/utils/getItemByFocused.js.map +0 -1
  278. package/cjs/components/Dropdown/utils/getItemId.js +0 -10
  279. package/cjs/components/Dropdown/utils/getItemId.js.map +0 -1
  280. package/cjs/components/Dropdown/utils/getPlacement.js +0 -16
  281. package/cjs/components/Dropdown/utils/getPlacement.js.map +0 -1
  282. package/emotion/cjs/components/Dropdown/FloatingPopover.js +0 -109
  283. package/emotion/cjs/components/Dropdown/utils/getItemByFocused.js +0 -12
  284. package/emotion/cjs/components/Dropdown/utils/getItemId.js +0 -9
  285. package/emotion/cjs/components/Dropdown/utils/getPlacement.js +0 -15
  286. package/emotion/es/components/Dropdown/FloatingPopover.js +0 -102
  287. package/emotion/es/components/Dropdown/utils/getItemByFocused.js +0 -6
  288. package/emotion/es/components/Dropdown/utils/getItemId.js +0 -3
  289. package/emotion/es/components/Dropdown/utils/getPlacement.js +0 -9
  290. package/es/components/Dropdown/Dropdown.styles_1ix6io8.css +0 -2
  291. package/es/components/Dropdown/FloatingPopover.js +0 -100
  292. package/es/components/Dropdown/FloatingPopover.js.map +0 -1
  293. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_17va0nk.css +0 -5
  294. package/es/components/Dropdown/utils/getItemByFocused.js +0 -9
  295. package/es/components/Dropdown/utils/getItemByFocused.js.map +0 -1
  296. package/es/components/Dropdown/utils/getItemId.js +0 -6
  297. package/es/components/Dropdown/utils/getItemId.js.map +0 -1
  298. package/es/components/Dropdown/utils/getPlacement.js +0 -12
  299. package/es/components/Dropdown/utils/getPlacement.js.map +0 -1
  300. package/styled-components/cjs/components/Dropdown/FloatingPopover.js +0 -109
  301. package/styled-components/cjs/components/Dropdown/utils/getItemByFocused.js +0 -12
  302. package/styled-components/cjs/components/Dropdown/utils/getItemId.js +0 -9
  303. package/styled-components/cjs/components/Dropdown/utils/getPlacement.js +0 -15
  304. package/styled-components/es/components/Dropdown/FloatingPopover.js +0 -102
  305. package/styled-components/es/components/Dropdown/utils/getItemByFocused.js +0 -6
  306. package/styled-components/es/components/Dropdown/utils/getItemId.js +0 -3
  307. package/styled-components/es/components/Dropdown/utils/getPlacement.js +0 -9
  308. package/types/components/Dropdown/FloatingPopover.d.ts +0 -5
  309. package/types/components/Dropdown/FloatingPopover.d.ts.map +0 -1
  310. package/types/components/Dropdown/utils/getItemByFocused.d.ts +0 -4
  311. package/types/components/Dropdown/utils/getItemByFocused.d.ts.map +0 -1
  312. package/types/components/Dropdown/utils/getItemId.d.ts +0 -2
  313. package/types/components/Dropdown/utils/getItemId.d.ts.map +0 -1
  314. package/types/components/Dropdown/utils/getPlacement.d.ts +0 -3
  315. package/types/components/Dropdown/utils/getPlacement.d.ts.map +0 -1
@@ -8,33 +8,30 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
8
8
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
- import React, { createContext, forwardRef, useReducer, useRef } from 'react';
12
- import { safeUseId } from '@salutejs/plasma-core';
13
- import { cx } from '../../utils';
14
- import { useOutsideClick } from '../../hooks';
11
+ import React, { forwardRef, useReducer } from 'react';
12
+ import { cx, getPlacements } from '../../utils';
15
13
  import { pathReducer } from './reducers/pathReducer';
16
14
  import { focusedPathReducer } from './reducers/focusedPathReducer';
17
15
  import { DropdownInner } from './ui';
18
16
  import { base as viewCSS } from './variations/_view/base';
19
17
  import { base as sizeCSS } from './variations/_size/base';
20
- import { Ul, base } from './Dropdown.styles';
21
- import { childrenWithProps, getItemByFocused, getItemId, getPlacement } from './utils';
18
+ import { Ul, StyledPopover, base } from './Dropdown.styles';
19
+ import { childrenWithProps } from './utils';
22
20
  import { classes } from './Dropdown.tokens';
23
21
  import { useKeyNavigation } from './hooks/useKeyboardNavigation';
24
22
  import { useHashMaps } from './hooks/useHashMaps';
25
- import { FloatingPopover } from './FloatingPopover';
26
- export var Context = /*#__PURE__*/createContext({});
27
23
 
28
24
  /**
29
25
  * Выпадающий список.
30
26
  */
31
27
  export var dropdownRoot = function dropdownRoot(Root) {
32
28
  return /*#__PURE__*/forwardRef(function (_ref, ref) {
33
- var _getItemByFocused;
34
29
  var items = _ref.items,
35
30
  children = _ref.children,
36
- placement = _ref.placement,
37
- offset = _ref.offset,
31
+ _ref$placement = _ref.placement,
32
+ placement = _ref$placement === void 0 ? 'bottom' : _ref$placement,
33
+ _ref$offset = _ref.offset,
34
+ offset = _ref$offset === void 0 ? [0, 0] : _ref$offset,
38
35
  _ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
39
36
  closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
40
37
  onToggle = _ref.onToggle,
@@ -71,25 +68,6 @@ export var dropdownRoot = function dropdownRoot(Root) {
71
68
  _useHashMaps2 = _slicedToArray(_useHashMaps, 2),
72
69
  pathMap = _useHashMaps2[0],
73
70
  focusedToValueMap = _useHashMaps2[1];
74
- var activeDescendantItemValue = ((_getItemByFocused = getItemByFocused(focusedPath, focusedToValueMap)) === null || _getItemByFocused === void 0 ? void 0 : _getItemByFocused.value) || '';
75
- var floatingPopoverRef = useRef(null);
76
- var treeId = safeUseId();
77
-
78
- // Логика работы при клике за пределами выпадающего списка
79
- var targetRef = useOutsideClick(function (event) {
80
- if (!isCurrentListOpen || !closeOnOverlayClick) {
81
- return;
82
- }
83
- dispatchPath({
84
- type: 'reset'
85
- });
86
- dispatchFocusedPath({
87
- type: 'reset'
88
- });
89
- if (onToggle) {
90
- onToggle(false, event);
91
- }
92
- }, floatingPopoverRef);
93
71
  var handleGlobalToggle = function handleGlobalToggle(opened, event) {
94
72
  if (opened) {
95
73
  dispatchPath({
@@ -121,64 +99,66 @@ export var dropdownRoot = function dropdownRoot(Root) {
121
99
  }),
122
100
  onKeyDown = _useKeyNavigation.onKeyDown;
123
101
  var isCurrentListOpen = Boolean(path[0]);
124
- return /*#__PURE__*/React.createElement(Context.Provider, {
125
- value: {
126
- focusedPath: focusedPath,
127
- size: size,
128
- variant: variant,
129
- itemRole: itemRole,
130
- handleGlobalToggle: handleGlobalToggle,
131
- closeOnSelect: closeOnSelect,
132
- onHover: onHover,
133
- onItemClick: onItemClick,
134
- onItemSelect: onItemSelect,
135
- hasArrow: hasArrow,
136
- treeId: treeId
137
- }
138
- }, /*#__PURE__*/React.createElement(FloatingPopover, {
139
- ref: floatingPopoverRef,
102
+ var getActiveDescendant = function getActiveDescendant() {
103
+ var _focusedToValueMap$ge;
104
+ var focusedPathAsString = focusedPath.reduce(function (acc, n) {
105
+ return "".concat(acc, "/").concat(n);
106
+ }, '').replace(/^(\/)/, '');
107
+ return focusedToValueMap === null || focusedToValueMap === void 0 || (_focusedToValueMap$ge = focusedToValueMap.get(focusedPathAsString)) === null || _focusedToValueMap$ge === void 0 ? void 0 : _focusedToValueMap$ge.value.toString();
108
+ };
109
+ return /*#__PURE__*/React.createElement(StyledPopover, {
140
110
  opened: isCurrentListOpen,
141
111
  onToggle: handleGlobalToggle,
142
- placement: getPlacement(placement),
143
112
  offset: offset,
144
- portal: portal,
113
+ placement: getPlacements(placement),
145
114
  trigger: trigger,
115
+ closeOnOverlayClick: closeOnOverlayClick,
116
+ isFocusTrapped: false,
146
117
  target: childrenWithProps(children, {
147
118
  role: 'combobox',
148
- 'aria-controls': "".concat(treeId, "_tree_level_1"),
119
+ 'aria-controls': 'tree_level_1',
149
120
  'aria-expanded': isCurrentListOpen,
150
- 'aria-activedescendant': activeDescendantItemValue ? getItemId(treeId, activeDescendantItemValue.toString()) : '',
121
+ 'aria-activedescendant': getActiveDescendant(),
151
122
  onKeyDown: onKeyDown
152
- })
123
+ }),
124
+ preventOverflow: false,
125
+ usePortal: Boolean(portal),
126
+ frame: portal
153
127
  }, /*#__PURE__*/React.createElement(Root, _extends({
154
128
  className: cx(className, classes.dropdownRoot),
155
129
  ref: ref,
156
130
  view: view,
157
- size: size,
158
- style: {
159
- display: 'inline-block'
160
- }
131
+ size: size
161
132
  }, rest), /*#__PURE__*/React.createElement(Ul, {
162
- ref: targetRef,
163
- id: "".concat(treeId, "_tree_level_1"),
164
- role: "tree",
165
133
  listHeight: listHeight,
166
134
  listOverflow: listOverflow,
135
+ role: "tree",
136
+ id: "tree_level_1",
167
137
  listWidth: listWidth
168
138
  }, items.map(function (item, index) {
169
139
  return /*#__PURE__*/React.createElement(DropdownInner, {
170
140
  key: "".concat(index, "/0"),
171
141
  item: item,
172
142
  currentLevel: 0,
143
+ focusedPath: focusedPath,
173
144
  trigger: trigger,
174
145
  path: path,
175
146
  dispatchPath: dispatchPath,
176
147
  index: index,
148
+ itemRole: itemRole,
177
149
  listHeight: listHeight,
178
150
  listOverflow: listOverflow,
179
- listWidth: listWidth
151
+ handleGlobalToggle: handleGlobalToggle,
152
+ closeOnSelect: closeOnSelect,
153
+ onHover: onHover,
154
+ onItemSelect: onItemSelect,
155
+ onItemClick: onItemClick,
156
+ listWidth: listWidth,
157
+ variant: variant,
158
+ hasArrow: hasArrow,
159
+ size: size
180
160
  });
181
- })))));
161
+ }))));
182
162
  });
183
163
  };
184
164
  export var dropdownConfig = {
@@ -1,21 +1,37 @@
1
1
  import _styled from "@emotion/styled/base";
2
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
3
  import { css } from '@emotion/react';
4
+ import { component } from '../../engines';
5
+ import { popoverConfig, popoverClasses } from '../Popover';
3
6
  import { getCorrectHeight } from './utils';
4
- import { tokens, constants } from './Dropdown.tokens';
7
+ import { tokens } from './Dropdown.tokens';
8
+ var Popover = /*#__PURE__*/component(popoverConfig);
9
+ export var StyledPopover = /*#__PURE__*/_styled(Popover, {
10
+ target: "euqmbvx1",
11
+ label: "plasma-new-hope__StyledPopover"
12
+ })(".", /*#__PURE__*/String(popoverClasses.wrapper), ",.", /*#__PURE__*/String(popoverClasses.target), "{display:block;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJvcGRvd24uc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVk0QyIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL0Ryb3Bkb3duL0Ryb3Bkb3duLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50Ij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yb3VuZH0pO1xuICAgIGJveC1zaGFkb3c6IHZhcigke3Rva2Vucy5ib3hTaGFkb3d9KTtcblxuICAgIGJvcmRlci1yYWRpdXM6IHZhcigke3Rva2Vucy5ib3JkZXJSYWRpdXN9KTtcbiAgICB3aWR0aDogJHsoeyBsaXN0V2lkdGggfSkgPT4gbGlzdFdpZHRoIHx8IGB2YXIoJHt0b2tlbnMud2lkdGh9KWB9O1xuICAgIGhlaWdodDogJHsoeyBsaXN0SGVpZ2h0IH0pID0+IChsaXN0SGVpZ2h0ID8gZ2V0Q29ycmVjdEhlaWdodChsaXN0SGVpZ2h0KSA6ICdhdXRvJyl9O1xuICAgIG92ZXJmbG93OiAkeyh7IGxpc3RPdmVyZmxvdyB9KSA9PiBsaXN0T3ZlcmZsb3cgfHwgJ2luaXRpYWwnfTtcblxuICAgIG1hcmdpbjogJHsoeyBpc0lubmVyVWwgfSkgPT4gKGlzSW5uZXJVbCA/IGBjYWxjKHZhcigke3Rva2Vucy5wYWRkaW5nfSkgKiAtMSkgMCAwIHZhcigke3Rva2Vucy5wYWRkaW5nfSlgIDogMCl9O1xuICAgIHBhZGRpbmc6IHZhcigke3Rva2Vucy5wYWRkaW5nfSk7XG5gO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG5gO1xuIl19 */"));
5
13
  export var Ul = /*#__PURE__*/_styled("ul", {
6
14
  target: "euqmbvx0",
7
15
  label: "plasma-new-hope__Ul"
8
- })("box-sizing:border-box;width:", function (_ref) {
16
+ })("box-sizing:border-box;background:var(", tokens.background, ");box-shadow:var(", tokens.boxShadow, ");border-radius:var(", tokens.borderRadius, ");width:", function (_ref) {
9
17
  var listWidth = _ref.listWidth;
10
18
  return listWidth || "var(".concat(tokens.width, ")");
11
19
  }, ";height:", function (_ref2) {
12
20
  var listHeight = _ref2.listHeight;
13
21
  return listHeight ? getCorrectHeight(listHeight) : 'auto';
14
- }, ";margin:", function (_ref3) {
15
- var isInnerUl = _ref3.isInnerUl;
16
- return isInnerUl ? "calc(var(".concat(tokens.padding, ") * -1) 0.125rem 0") : 0;
17
- }, ";padding:var(", tokens.padding, ") 0;overflow:", function (_ref4) {
18
- var listOverflow = _ref4.listOverflow;
22
+ }, ";overflow:", function (_ref3) {
23
+ var listOverflow = _ref3.listOverflow;
19
24
  return listOverflow || 'initial';
20
- }, ";background:var(", constants.background, ");box-shadow:", constants.boxShadow, ";border-radius:var(", tokens.borderRadius, ");" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJvcGRvd24uc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVlFIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJvcGRvd24uc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBnZXRDb3JyZWN0SGVpZ2h0IH0gZnJvbSAnLi91dGlscyc7XG5pbXBvcnQgeyBEcm9wZG93blByb3BzIH0gZnJvbSAnLi9Ecm9wZG93bi50eXBlcyc7XG5pbXBvcnQgeyB0b2tlbnMsIGNvbnN0YW50cyB9IGZyb20gJy4vRHJvcGRvd24udG9rZW5zJztcblxuZXhwb3J0IGNvbnN0IFVsID0gc3R5bGVkLnVsPHtcbiAgICBsaXN0SGVpZ2h0OiBEcm9wZG93blByb3BzWydsaXN0SGVpZ2h0J107XG4gICAgbGlzdE92ZXJmbG93OiBEcm9wZG93blByb3BzWydsaXN0T3ZlcmZsb3cnXTtcbiAgICBsaXN0V2lkdGg/OiBEcm9wZG93blByb3BzWydsaXN0V2lkdGgnXTtcbiAgICBpc0lubmVyVWw/OiBib29sZWFuO1xufT5gXG4gICAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgICB3aWR0aDogJHsoeyBsaXN0V2lkdGggfSkgPT4gbGlzdFdpZHRoIHx8IGB2YXIoJHt0b2tlbnMud2lkdGh9KWB9O1xuICAgIGhlaWdodDogJHsoeyBsaXN0SGVpZ2h0IH0pID0+IChsaXN0SGVpZ2h0ID8gZ2V0Q29ycmVjdEhlaWdodChsaXN0SGVpZ2h0KSA6ICdhdXRvJyl9O1xuICAgIG1hcmdpbjogJHsoeyBpc0lubmVyVWwgfSkgPT4gKGlzSW5uZXJVbCA/IGBjYWxjKHZhcigke3Rva2Vucy5wYWRkaW5nfSkgKiAtMSkgMC4xMjVyZW0gMGAgOiAwKX07XG4gICAgcGFkZGluZzogdmFyKCR7dG9rZW5zLnBhZGRpbmd9KSAwO1xuICAgIG92ZXJmbG93OiAkeyh7IGxpc3RPdmVyZmxvdyB9KSA9PiBsaXN0T3ZlcmZsb3cgfHwgJ2luaXRpYWwnfTtcbiAgICBiYWNrZ3JvdW5kOiB2YXIoJHtjb25zdGFudHMuYmFja2dyb3VuZH0pO1xuICAgIGJveC1zaGFkb3c6ICR7Y29uc3RhbnRzLmJveFNoYWRvd307XG4gICAgYm9yZGVyLXJhZGl1czogdmFyKCR7dG9rZW5zLmJvcmRlclJhZGl1c30pO1xuYDtcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgYDtcbiJdfQ== */"));
21
- export var base = /*#__PURE__*/css(";label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJ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XNJbm5lclVsID8gYGNhbGModmFyKCR7dG9rZW5zLnBhZGRpbmd9KSAqIC0xKSAwLjEyNXJlbSAwYCA6IDApfTtcbiAgICBwYWRkaW5nOiB2YXIoJHt0b2tlbnMucGFkZGluZ30pIDA7XG4gICAgb3ZlcmZsb3c6ICR7KHsgbGlzdE92ZXJmbG93IH0pID0+IGxpc3RPdmVyZmxvdyB8fCAnaW5pdGlhbCd9O1xuICAgIGJhY2tncm91bmQ6IHZhcigke2NvbnN0YW50cy5iYWNrZ3JvdW5kfSk7XG4gICAgYm94LXNoYWRvdzogJHtjb25zdGFudHMuYm94U2hhZG93fTtcbiAgICBib3JkZXItcmFkaXVzOiB2YXIoJHt0b2tlbnMuYm9yZGVyUmFkaXVzfSk7XG5gO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BgO1xuIl19 */"));
25
+ }, ";margin:", function (_ref4) {
26
+ var isInnerUl = _ref4.isInnerUl;
27
+ return isInnerUl ? "calc(var(".concat(tokens.padding, ") * -1) 0 0 var(").concat(tokens.padding, ")") : 0;
28
+ }, ";padding:var(", tokens.padding, ");" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJvcGRvd24uc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCRSIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL0Ryb3Bkb3duL0Ryb3Bkb3duLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgY29tcG9uZW50IH0gZ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AgICB3aWR0aDogJHsoeyBsaXN0V2lkdGggfSkgPT4gbGlzdFdpZHRoIHx8IGB2YXIoJHt0b2tlbnMud2lkdGh9KWB9O1xuICAgIGhlaWdodDogJHsoeyBsaXN0SGVpZ2h0IH0pID0+IChsaXN0SGVpZ2h0ID8gZ2V0Q29ycmVjdEhlaWdodChsaXN0SGVpZ2h0KSA6ICdhdXRvJyl9O1xuICAgIG92ZXJmbG93OiAkeyh7IGxpc3RPdmVyZmxvdyB9KSA9PiBsaXN0T3ZlcmZsb3cgfHwgJ2luaXRpYWwnfTtcblxuICAgIG1hcmdpbjogJHsoeyBpc0lubmVyVWwgfSkgPT4gKGlzSW5uZXJVbCA/IGBjYWxjKHZhcigke3Rva2Vucy5wYWRkaW5nfSkgKiAtMSkgMCAwIHZhcigke3Rva2Vucy5wYWRkaW5nfSlgIDogMCl9O1xuICAgIHBhZGRpbmc6IHZhcigke3Rva2Vucy5wYWRkaW5nfSk7XG5gO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG5gO1xuIl19 */"));
29
+ export var base = process.env.NODE_ENV === "production" ? {
30
+ name: "1mufh2u-plasma-new-hope__base",
31
+ styles: "display:inline-block;label:plasma-new-hope__base;"
32
+ } : {
33
+ name: "1mufh2u-plasma-new-hope__base",
34
+ styles: "display:inline-block;label:plasma-new-hope__base;",
35
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRHJvcGRvd24vRHJvcGRvd24uc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNDdUIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9Ecm9wZG93bi9Ecm9wZG93bi5zdHlsZXMudHMiLCJzb3VyY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ZW5zLmJhY2tncm91bmR9KTtcbiAgICBib3gtc2hhZG93OiB2YXIoJHt0b2tlbnMuYm94U2hhZG93fSk7XG5cbiAgICBib3JkZXItcmFkaXVzOiB2YXIoJHt0b2tlbnMuYm9yZGVyUmFkaXVzfSk7XG4gICAgd2lkdGg6ICR7KHsgbGlzdFdpZHRoIH0pID0+IGxpc3RXaWR0aCB8fCBgdmFyKCR7dG9rZW5zLndpZHRofSlgfTtcbiAgICBoZWlnaHQ6ICR7KHsgbGlzdEhlaWdodCB9KSA9PiAobGlzdEhlaWdodCA/IGdldENvcnJlY3RIZWlnaHQobGlzdEhlaWdodCkgOiAnYXV0bycpfTtcbiAgICBvdmVyZmxvdzogJHsoeyBsaXN0T3ZlcmZsb3cgfSkgPT4gbGlzdE92ZXJmbG93IHx8ICdpbml0aWFsJ307XG5cbiAgICBtYXJnaW46ICR7KHsgaXNJbm5lclVsIH0pID0+IChpc0lubmVyVWwgPyBgY2FsYyh2YXIoJHt0b2tlbnMucGFkZGluZ30pICogLTEpIDAgMCB2YXIoJHt0b2tlbnMucGFkZGluZ30pYCA6IDApfTtcbiAgICBwYWRkaW5nOiB2YXIoJHt0b2tlbnMucGFkZGluZ30pO1xuYDtcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgXG4gICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuYDtcbiJdfQ== */",
36
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
37
+ };
@@ -3,7 +3,7 @@ export var classes = {
3
3
  dropdownItemIsFocused: 'dropdown-item-is-focused',
4
4
  dropdownItemIsDisabled: 'dropdown-item-is-disabled',
5
5
  dropdownItemIsActive: 'dropdown-item-is-active',
6
- dropdownItemIsSelected: 'dropdown-item-is-selected'
6
+ dropdownItemIsSelected: 'dropdownItemIsSelected'
7
7
  };
8
8
  export var tokens = {
9
9
  background: '--plasma-dropdown-background',
@@ -14,8 +14,6 @@ export var tokens = {
14
14
  disclosureIconColor: '--plasma-dropdown-disclosure-icon-color',
15
15
  disabledOpacity: '--plasma-dropdown-disabled-opacity',
16
16
  focusColor: '--plasma-dropdown-focus-color',
17
- // Old
18
-
19
17
  dividerColor: '--plasma-dropdown-divider-color',
20
18
  dividerMarginTop: '--plasma-dropdown-divider-margin-top',
21
19
  dividerMarginTopTight: '--plasma-dropdown-divider-margin-top-tight',
@@ -30,7 +28,6 @@ export var tokens = {
30
28
  itemBackgroundSelectedHover: '--plasma-dropdown-item-background-selected-hover',
31
29
  // Old
32
30
  itemColor: '--plasma-dropdown-item-color',
33
- // Old
34
31
  itemColorSelected: '--plasma-dropdown-item-color-selected',
35
32
  // Old
36
33
  itemColorSelectedHover: '--plasma-dropdown-item-color-selected-hover',
@@ -49,17 +46,11 @@ export var tokens = {
49
46
  itemMarginLeft: '--plasma-dropdown-item-margin-left',
50
47
  // Old
51
48
  itemPaddingTop: '--plasma-dropdown-item-padding-top',
52
- // Old
53
49
  itemPaddingTopTight: '--plasma-dropdown-item-padding-top-tight',
54
- // Old
55
50
  itemPaddingRight: '--plasma-dropdown-item-padding-right',
56
- // Old
57
51
  itemPaddingBottom: '--plasma-dropdown-item-padding-bottom',
58
- // Old
59
52
  itemPaddingBottomTight: '--plasma-dropdown-item-padding-bottom-tight',
60
- // Old
61
53
  itemPaddingLeft: '--plasma-dropdown-item-padding-left',
62
- // Old
63
54
  itemContentLeftWidth: '--plasma-dropdown-item-content-left-width',
64
55
  // Old
65
56
  itemContentLeftColor: '--plasma-dropdown-item-content-left-color',
@@ -74,20 +65,6 @@ export var tokens = {
74
65
  itemFontWeightBold: '--plasma-dropdown-item-letter-spacing',
75
66
  itemFontLetterSpacing: '--plasma-dropdown-item-line-height',
76
67
  itemFontLineHeight: '--plasma-dropdown-item-font-weight',
77
- itemPadding: '--plasma-dropdown-item-padding',
78
- itemPaddingTight: '--plasma-dropdown-item-padding-tight',
79
- cellPadding: '--plasma-dropdown-cell-padding',
80
- cellPaddingLeftContent: '--plasma-dropdown-cell-padding-left-content',
81
- cellPaddingContent: '--plasma-dropdown-cell-padding-content',
82
- cellPaddingRightContent: '--plasma-dropdown-cell-padding-right-content',
83
- cellTextboxGap: '--plasma-dropdown-cell-textbox-gap',
84
- cellGap: '--plasma-dropdown-cell-gap',
85
- cellTitleFontFamily: '--plasma-dropdown-cell-title-font-family',
86
- cellTitleFontSize: '--plasma-dropdown-cell-title-font-size',
87
- cellTitleFontStyle: '--plasma-dropdown-cell-title-font-style',
88
- cellTitleFontWeight: '--plasma-dropdown-cell-title-font-weight',
89
- cellTitleLetterSpacing: '--plasma-dropdown-cell-title-letter-spacing',
90
- cellTitleLineHeight: '--plasma-dropdown-cell-title-line-height',
91
68
  // TODO: Remove below tokens as soon as they are no longer needed
92
69
  footerBackground: '--plasma-dropdown-footer-background',
93
70
  footerWidth: '--plasma-dropdown-footer-width',
@@ -151,15 +128,4 @@ export var tokens = {
151
128
  groupLabelMarginRight: '--plasma-dropdown-group-label-margin-right',
152
129
  groupLabelMarginBottom: '--plasma-dropdown-group-label-margin-bottom',
153
130
  groupLabelMarginLeft: '--plasma-dropdown-group-label-margin-left'
154
- };
155
- export var constants = {
156
- focusColor: '--surface-accent',
157
- background: '--surface-solid-card-brightness',
158
- boxShadow: '0px 4px 14px -4px rgba(8, 8, 8, 0.08), 0px 1px 4px -1px rgba(0, 0, 0, 0.04)',
159
- disclosureIconColor: '--text-secondary',
160
- itemBackground: '--plasma-colors-transparent',
161
- itemBackgroundHover: '--surface-transparent-secondary',
162
- opacity: '0.4',
163
- cellTitleColor: '--text-primary',
164
- cellBackgroundColor: '--plasma-colors-transparent'
165
131
  };
@@ -1,18 +1,26 @@
1
1
  import React from 'react';
2
- import { safeUseId } from '@salutejs/plasma-core';
3
2
  import { DropdownItem } from '..';
4
- import { Ul } from '../../Dropdown.styles';
5
- import { FloatingPopover } from '../../FloatingPopover';
3
+ import { Ul, StyledPopover } from '../../Dropdown.styles';
6
4
  var DropdownInner = function DropdownInner(_ref) {
7
5
  var item = _ref.item,
8
6
  currentLevel = _ref.currentLevel,
7
+ focusedPath = _ref.focusedPath,
9
8
  path = _ref.path,
10
9
  dispatchPath = _ref.dispatchPath,
11
10
  index = _ref.index,
12
11
  trigger = _ref.trigger,
12
+ itemRole = _ref.itemRole,
13
13
  listHeight = _ref.listHeight,
14
14
  listOverflow = _ref.listOverflow,
15
- listWidth = _ref.listWidth;
15
+ handleGlobalToggle = _ref.handleGlobalToggle,
16
+ closeOnSelect = _ref.closeOnSelect,
17
+ onHover = _ref.onHover,
18
+ onItemSelect = _ref.onItemSelect,
19
+ onItemClick = _ref.onItemClick,
20
+ listWidth = _ref.listWidth,
21
+ variant = _ref.variant,
22
+ hasArrow = _ref.hasArrow,
23
+ size = _ref.size;
16
24
  var handleToggle = function handleToggle(opened) {
17
25
  if (opened) {
18
26
  dispatchPath({
@@ -28,54 +36,80 @@ var DropdownInner = function DropdownInner(_ref) {
28
36
  }
29
37
  };
30
38
  var isCurrentListOpen = path[currentLevel + 1] === item.value.toString();
31
- var treeId = safeUseId();
32
- var listId = "".concat(treeId, "_tree_level_").concat(currentLevel + 2);
39
+ var listId = "tree_level_".concat(currentLevel + 2);
33
40
  var nextLevel = currentLevel + 1;
34
41
  if (item !== null && item !== void 0 && item.items) {
35
- return /*#__PURE__*/React.createElement(FloatingPopover, {
36
- placement: "right-start",
42
+ return /*#__PURE__*/React.createElement(StyledPopover, {
37
43
  opened: isCurrentListOpen,
38
- onToggle: handleToggle,
44
+ usePortal: false,
45
+ placement: "right-start",
39
46
  trigger: trigger,
40
47
  target: /*#__PURE__*/React.createElement(DropdownItem, {
41
48
  item: item,
42
49
  index: index,
43
50
  path: path,
51
+ focusedPath: focusedPath,
44
52
  currentLevel: currentLevel,
53
+ itemRole: itemRole,
54
+ onHover: onHover,
55
+ onItemSelect: onItemSelect,
56
+ onItemClick: onItemClick,
57
+ variant: variant,
58
+ hasArrow: hasArrow,
45
59
  ariaControls: listId,
46
60
  ariaExpanded: isCurrentListOpen,
47
61
  ariaLevel: nextLevel,
48
- ariaLabel: item.label
62
+ ariaLabel: item.label,
63
+ size: size
49
64
  }),
50
- isInner: true
65
+ onToggle: handleToggle,
66
+ isFocusTrapped: false,
67
+ preventOverflow: false
51
68
  }, /*#__PURE__*/React.createElement(Ul, {
52
- id: listId,
53
- role: "group",
54
- isInnerUl: true,
55
69
  listHeight: listHeight,
56
70
  listOverflow: listOverflow,
57
- listWidth: listWidth
71
+ role: "group",
72
+ id: listId,
73
+ listWidth: listWidth,
74
+ isInnerUl: true
58
75
  }, item.items.map(function (innerItem, innerIndex) {
59
76
  return /*#__PURE__*/React.createElement(DropdownInner, {
60
77
  key: "".concat(innerIndex, "/").concat(currentLevel),
61
78
  item: innerItem,
62
79
  currentLevel: nextLevel,
80
+ focusedPath: focusedPath,
63
81
  path: path,
64
82
  dispatchPath: dispatchPath,
65
83
  index: innerIndex,
66
84
  trigger: trigger,
85
+ itemRole: itemRole,
67
86
  listHeight: listHeight,
68
87
  listOverflow: listOverflow,
69
- listWidth: listWidth
88
+ handleGlobalToggle: handleGlobalToggle,
89
+ closeOnSelect: closeOnSelect,
90
+ onHover: onHover,
91
+ onItemSelect: onItemSelect,
92
+ onItemClick: onItemClick,
93
+ listWidth: listWidth,
94
+ variant: variant,
95
+ hasArrow: hasArrow,
96
+ size: size
70
97
  });
71
98
  })));
72
99
  }
73
100
  return /*#__PURE__*/React.createElement(DropdownItem, {
74
101
  item: item,
75
- path: path,
76
102
  index: index,
103
+ focusedPath: focusedPath,
77
104
  currentLevel: currentLevel,
78
- ariaLevel: nextLevel
105
+ itemRole: itemRole,
106
+ handleGlobalToggle: handleGlobalToggle,
107
+ closeOnSelect: closeOnSelect,
108
+ onHover: onHover,
109
+ onItemSelect: onItemSelect,
110
+ onItemClick: onItemClick,
111
+ variant: variant,
112
+ size: size
79
113
  });
80
114
  };
81
115
  export { DropdownInner };
@@ -1,19 +1,28 @@
1
- import React, { useEffect, useRef, useContext } from 'react';
1
+ import React, { useEffect, useRef } from 'react';
2
2
  import { classes } from '../../Dropdown.tokens';
3
3
  import { cx } from '../../../../utils';
4
4
  import { IconDisclosureRight } from '../../../_Icon';
5
- import { Context } from '../../Dropdown';
6
- import { getItemId } from '../../utils';
7
- import { Wrapper, DisclosureIconWrapper, Divider, CellWrapper, StyledCell } from './DropdownItem.styles';
5
+ import { StyledContentLeft, StyledContentRight, StyledText, Wrapper, DisclosureIconWrapper, Divider } from './DropdownItem.styles';
8
6
  export var DropdownItem = function DropdownItem(_ref) {
9
7
  var item = _ref.item,
10
8
  path = _ref.path,
9
+ focusedPath = _ref.focusedPath,
11
10
  currentLevel = _ref.currentLevel,
12
11
  index = _ref.index,
12
+ itemRole = _ref.itemRole,
13
+ closeOnSelect = _ref.closeOnSelect,
14
+ handleGlobalToggle = _ref.handleGlobalToggle,
15
+ onHover = _ref.onHover,
16
+ onItemSelect = _ref.onItemSelect,
17
+ onItemClick = _ref.onItemClick,
13
18
  ariaControls = _ref.ariaControls,
14
19
  ariaExpanded = _ref.ariaExpanded,
20
+ ariaHasPopup = _ref.ariaHasPopup,
15
21
  ariaLevel = _ref.ariaLevel,
16
- ariaLabel = _ref.ariaLabel;
22
+ ariaLabel = _ref.ariaLabel,
23
+ variant = _ref.variant,
24
+ hasArrow = _ref.hasArrow,
25
+ size = _ref.size;
17
26
  var value = item.value,
18
27
  label = item.label,
19
28
  disabled = item.disabled,
@@ -23,19 +32,6 @@ export var DropdownItem = function DropdownItem(_ref) {
23
32
  dividerBefore = item.dividerBefore,
24
33
  dividerAfter = item.dividerAfter;
25
34
  var ref = useRef(null);
26
- var _useContext = useContext(Context),
27
- focusedPath = _useContext.focusedPath,
28
- size = _useContext.size,
29
- variant = _useContext.variant,
30
- itemRole = _useContext.itemRole,
31
- handleGlobalToggle = _useContext.handleGlobalToggle,
32
- closeOnSelect = _useContext.closeOnSelect,
33
- onHover = _useContext.onHover,
34
- onItemSelect = _useContext.onItemSelect,
35
- onItemClick = _useContext.onItemClick,
36
- hasArrow = _useContext.hasArrow,
37
- treeId = _useContext.treeId;
38
- var hasDescendants = Boolean(item.items);
39
35
  var disclosureIconSize = size === 'xs' ? 'xs' : 's';
40
36
  var isDisabledClassName = disabled || isDisabled ? classes.dropdownItemIsDisabled : undefined;
41
37
  var focusedClass = currentLevel === focusedPath.length - 1 && index === (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[currentLevel]) ? classes.dropdownItemIsFocused : undefined;
@@ -59,9 +55,7 @@ export var DropdownItem = function DropdownItem(_ref) {
59
55
  if (onItemClick) {
60
56
  onItemClick(item, event);
61
57
  }
62
-
63
- // Закрываем весь дропдаун целиком при клике на айтем без потомков. Только при closeOnSelect === true.
64
- if (closeOnSelect && !hasDescendants) {
58
+ if (handleGlobalToggle && closeOnSelect) {
65
59
  handleGlobalToggle(false, event);
66
60
  }
67
61
  };
@@ -73,25 +67,20 @@ export var DropdownItem = function DropdownItem(_ref) {
73
67
  return /*#__PURE__*/React.createElement(React.Fragment, null, dividerBefore && /*#__PURE__*/React.createElement(Divider, {
74
68
  variant: variant
75
69
  }), /*#__PURE__*/React.createElement(Wrapper, {
76
- ref: ref,
77
70
  className: cx(isDisabledClassName, focusedClass, activeClass),
78
- id: getItemId(treeId, value.toString()),
71
+ id: value.toString(),
79
72
  role: itemRole,
73
+ ref: ref,
74
+ "aria-disabled": disabled || isDisabled,
80
75
  onClick: handleClick,
81
76
  onMouseEnter: handleHover,
82
77
  variant: variant,
83
- "aria-disabled": disabled || isDisabled,
84
78
  "aria-controls": ariaControls,
85
79
  "aria-expanded": ariaExpanded,
80
+ "aria-haspopup": ariaHasPopup,
86
81
  "aria-level": ariaLevel,
87
82
  "aria-label": ariaLabel
88
- }, /*#__PURE__*/React.createElement(CellWrapper, null, /*#__PURE__*/React.createElement(StyledCell, {
89
- contentLeft: contentLeft,
90
- contentRight: contentRight,
91
- alignContentLeft: "center",
92
- alignContentRight: "center",
93
- title: label
94
- })), item.items && hasArrow && /*#__PURE__*/React.createElement(DisclosureIconWrapper, null, /*#__PURE__*/React.createElement(IconDisclosureRight, {
83
+ }, contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), /*#__PURE__*/React.createElement(StyledText, null, label), contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), item.items && hasArrow && /*#__PURE__*/React.createElement(DisclosureIconWrapper, null, /*#__PURE__*/React.createElement(IconDisclosureRight, {
95
84
  size: disclosureIconSize,
96
85
  color: "inherit"
97
86
  }))), dividerAfter && /*#__PURE__*/React.createElement(Divider, {