@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
@@ -1,20 +1,26 @@
1
1
  import styled from 'styled-components';
2
2
  import { css } from 'styled-components';
3
+ import { component } from '../../engines';
4
+ import { popoverConfig, popoverClasses } from '../Popover';
3
5
  import { getCorrectHeight } from './utils';
4
- import { tokens, constants } from './Dropdown.tokens';
5
- export var Ul = /*#__PURE__*/styled.ul.withConfig({
6
+ import { tokens } from './Dropdown.tokens';
7
+ var Popover = /*#__PURE__*/component(popoverConfig);
8
+ export var StyledPopover = /*#__PURE__*/styled(Popover).withConfig({
6
9
  componentId: "plasma-new-hope__sc-13ezpo5-0"
7
- })(["box-sizing:border-box;width:", ";height:", ";margin:", ";padding:var(", ") 0;overflow:", ";background:var(", ");box-shadow:", ";border-radius:var(", ");"], function (_ref) {
10
+ })([".", ",.", "{display:block;}"], /*#__PURE__*/String(popoverClasses.wrapper), /*#__PURE__*/String(popoverClasses.target));
11
+ export var Ul = /*#__PURE__*/styled.ul.withConfig({
12
+ componentId: "plasma-new-hope__sc-13ezpo5-1"
13
+ })(["box-sizing:border-box;background:var(", ");box-shadow:var(", ");border-radius:var(", ");width:", ";height:", ";overflow:", ";margin:", ";padding:var(", ");"], tokens.background, tokens.boxShadow, tokens.borderRadius, function (_ref) {
8
14
  var listWidth = _ref.listWidth;
9
15
  return listWidth || "var(".concat(tokens.width, ")");
10
16
  }, function (_ref2) {
11
17
  var listHeight = _ref2.listHeight;
12
18
  return listHeight ? getCorrectHeight(listHeight) : 'auto';
13
19
  }, function (_ref3) {
14
- var isInnerUl = _ref3.isInnerUl;
15
- return isInnerUl ? "calc(var(".concat(tokens.padding, ") * -1) 0.125rem 0") : 0;
16
- }, tokens.padding, function (_ref4) {
17
- var listOverflow = _ref4.listOverflow;
20
+ var listOverflow = _ref3.listOverflow;
18
21
  return listOverflow || 'initial';
19
- }, constants.background, constants.boxShadow, tokens.borderRadius);
20
- export var base = /*#__PURE__*/css([""]);
22
+ }, function (_ref4) {
23
+ var isInnerUl = _ref4.isInnerUl;
24
+ return isInnerUl ? "calc(var(".concat(tokens.padding, ") * -1) 0 0 var(").concat(tokens.padding, ")") : 0;
25
+ }, tokens.padding);
26
+ export var base = /*#__PURE__*/css(["display:inline-block;"]);
@@ -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, {
@@ -1,21 +1,20 @@
1
1
  import styled from 'styled-components';
2
- import { classes, tokens, constants } from '../../Dropdown.tokens';
3
- import { addFocus } from '../../../../mixins';
4
- import { cellConfig, cellTokens } from '../../../Cell';
5
- import { component, mergeConfig } from '../../../../engines';
6
- var mergedCellConfig = /*#__PURE__*/mergeConfig(cellConfig);
7
- var Cell = /*#__PURE__*/component(mergedCellConfig);
8
- export var CellWrapper = /*#__PURE__*/styled.div.withConfig({
2
+ import { classes, tokens } from '../../Dropdown.tokens';
3
+ import { addFocus, applyEllipsis } from '../../../../mixins';
4
+ export var StyledContentLeft = /*#__PURE__*/styled.div.withConfig({
9
5
  componentId: "plasma-new-hope__sc-hs0ek1-0"
10
- })(["", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");width:100%;"], cellTokens.cellTitleColor, constants.cellTitleColor, cellTokens.cellBackgroundColor, constants.cellBackgroundColor, cellTokens.cellPadding, tokens.cellPadding, cellTokens.cellPaddingLeftContent, tokens.cellPaddingLeftContent, cellTokens.cellPaddingContent, tokens.cellPaddingContent, cellTokens.cellPaddingRightContent, tokens.cellPaddingRightContent, cellTokens.cellTextboxGap, tokens.cellTextboxGap, cellTokens.cellGap, tokens.cellGap, cellTokens.cellTitleFontFamily, tokens.cellTitleFontFamily, cellTokens.cellTitleFontSize, tokens.cellTitleFontSize, cellTokens.cellTitleFontStyle, tokens.cellTitleFontStyle, cellTokens.cellTitleFontWeight, tokens.cellTitleFontWeight, cellTokens.cellTitleLetterSpacing, tokens.cellTitleLetterSpacing, cellTokens.cellTitleLineHeight, tokens.cellTitleLineHeight);
11
- export var StyledCell = /*#__PURE__*/styled(Cell).withConfig({
6
+ })(["display:inline-flex;"]);
7
+ export var StyledContentRight = /*#__PURE__*/styled.div.withConfig({
12
8
  componentId: "plasma-new-hope__sc-hs0ek1-1"
13
- })([""]);
9
+ })(["margin-left:auto;display:inline-flex;"]);
14
10
  export var DisclosureIconWrapper = /*#__PURE__*/styled.div.withConfig({
15
11
  componentId: "plasma-new-hope__sc-hs0ek1-2"
16
- })(["line-height:0;color:var(", ");"], constants.disclosureIconColor);
17
- export var Divider = /*#__PURE__*/styled.div.withConfig({
12
+ })(["line-height:0;color:var(", ");"], tokens.disclosureIconColor);
13
+ export var StyledText = /*#__PURE__*/styled.div.withConfig({
18
14
  componentId: "plasma-new-hope__sc-hs0ek1-3"
15
+ })(["", ";flex:1;"], /*#__PURE__*/applyEllipsis());
16
+ export var Divider = /*#__PURE__*/styled.div.withConfig({
17
+ componentId: "plasma-new-hope__sc-hs0ek1-4"
19
18
  })(["height:1px;margin-top:", ";margin-right:var(", ");margin-bottom:", ";margin-left:var(", ");background:var(", ");"], function (_ref) {
20
19
  var variant = _ref.variant;
21
20
  return "var(".concat(variant === 'tight' ? tokens.dividerMarginTopTight : tokens.dividerMarginTop, ")");
@@ -24,15 +23,18 @@ export var Divider = /*#__PURE__*/styled.div.withConfig({
24
23
  return "var(".concat(variant === 'tight' ? tokens.dividerMarginBottomTight : tokens.dividerMarginBottom, ")");
25
24
  }, tokens.dividerMarginLeft, tokens.dividerColor);
26
25
  export var Wrapper = /*#__PURE__*/styled.li.withConfig({
27
- componentId: "plasma-new-hope__sc-hs0ek1-4"
28
- })(["display:flex;align-items:center;min-height:var(", ");margin:0;box-sizing:content-box;padding:", ";font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");background-color:var(", ");border-radius:var(", ");user-select:none;border-right:0.125rem solid transparent;border-left:0.125rem solid transparent;background-clip:padding-box;&:hover:not(.", "){cursor:pointer;background-color:var(", ");}&.", "{background-color:var(", ");}&.", "{opacity:", ";cursor:not-allowed;}:focus{outline:none;}", ";"], tokens.itemHeight, function (_ref3) {
26
+ componentId: "plasma-new-hope__sc-hs0ek1-5"
27
+ })(["display:flex;align-items:center;margin:0;box-sizing:content-box;padding-top:", ";padding-right:var(", ");padding-bottom:", ";padding-left:var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");background:var(", ");color:var(", ");border-radius:var(", ");user-select:none;&:hover:not(.", "){cursor:pointer;background:var(", ");}&.", "{background:var(", ");}&.", "{opacity:var(", ");cursor:not-allowed;}:focus{outline:none;}", ";"], function (_ref3) {
29
28
  var variant = _ref3.variant;
30
- return "var(".concat(variant === 'tight' ? tokens.itemPaddingTight : tokens.itemPadding, ")");
31
- }, tokens.itemFontFamily, tokens.itemFontSize, tokens.itemFontStyle, tokens.itemFontWeightBold, tokens.itemFontLetterSpacing, tokens.itemFontLineHeight, constants.itemBackground, tokens.borderRadius, classes.dropdownItemIsDisabled, constants.itemBackgroundHover, classes.dropdownItemIsActive, constants.itemBackgroundHover, classes.dropdownItemIsDisabled, constants.opacity, /*#__PURE__*/addFocus({
29
+ return "var(".concat(variant === 'tight' ? tokens.itemPaddingTopTight : tokens.itemPaddingTop, ")");
30
+ }, tokens.itemPaddingRight, function (_ref4) {
31
+ var variant = _ref4.variant;
32
+ return "var(".concat(variant === 'tight' ? tokens.itemPaddingBottomTight : tokens.itemPaddingBottom, ")");
33
+ }, tokens.itemPaddingLeft, tokens.itemFontFamily, tokens.itemFontSize, tokens.itemFontStyle, tokens.itemFontWeightBold, tokens.itemFontLetterSpacing, tokens.itemFontLineHeight, tokens.itemBackground, tokens.itemColor, tokens.itemBorderRadius, classes.dropdownItemIsDisabled, tokens.itemBackgroundHover, classes.dropdownItemIsActive, tokens.itemBackgroundHover, classes.dropdownItemIsDisabled, tokens.disabledOpacity, /*#__PURE__*/addFocus({
32
34
  outlineSize: '0.0625rem',
33
35
  outlineOffset: '0',
34
- outlineColor: /*#__PURE__*/"var(".concat(constants.focusColor, ")"),
36
+ outlineColor: /*#__PURE__*/"var(".concat(tokens.focusColor, ")"),
35
37
  outlineRadius: /*#__PURE__*/"var(".concat(tokens.itemBorderRadius, ")"),
36
38
  hasTransition: false,
37
- customFocusRules: /*#__PURE__*/"\n &.".concat(classes.dropdownItemIsFocused, ":before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(").concat(constants.focusColor, ");\n }\n ")
39
+ customFocusRules: /*#__PURE__*/"\n &.".concat(classes.dropdownItemIsFocused, ":before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(").concat(tokens.focusColor, ");\n }\n ")
38
40
  }));
@@ -26,7 +26,4 @@ export var getValidComponent = function getValidComponent(element, props) {
26
26
  return /*#__PURE__*/React.createElement(Component, props);
27
27
  }
28
28
  return element;
29
- };
30
- export { getItemId } from './getItemId';
31
- export { getItemByFocused } from './getItemByFocused';
32
- export { getPlacement } from './getPlacement';
29
+ };
@@ -86,7 +86,7 @@ export var notificationRoot = function notificationRoot(Root) {
86
86
  })))));
87
87
  });
88
88
  };
89
- export var noticationConfig = {
89
+ export var notificationConfig = {
90
90
  name: 'Notification',
91
91
  tag: 'div',
92
92
  layout: notificationRoot,
@@ -58,7 +58,7 @@ export var StyledContent = /*#__PURE__*/styled.div.withConfig({
58
58
  })(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:var(", ");"], tokens.contentFontFamily, tokens.contentFontSize, tokens.contentFontStyle, tokens.contentFontWeight, tokens.contentFontLetterSpacing, tokens.contentFontLineHeight, /*#__PURE__*/String(applyHyphens), tokens.contentColor);
59
59
  export var StyledItemWrapper = /*#__PURE__*/styled.div.withConfig({
60
60
  componentId: "plasma-new-hope__sc-1iufy9r-8"
61
- })(["margin-top:1rem;opacity:1;&&.", "{animation:0.4s showAnimation ease-out;}&&.", "{animation:0.4s hideAnimation ease-out;}@keyframes showAnimation{0%{transform:translateX(100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(100%);opacity:0;}}"], classes.notificationItemOpened, classes.notificationItemHidden);
61
+ })(["margin-top:1rem;opacity:1;&&.", "{animation:0.4s showAnimation ease-out;&.", "{animation:0.4s showLeftToRightAnimation ease-out;}}&&.", "{animation:0.4s hideAnimation ease-out;&.", "{animation:0.4s hideLeftToRightAnimation ease-out;}}@keyframes showLeftToRightAnimation{0%{transform:translateX(-100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideLeftToRightAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(-100%);opacity:0;}}@keyframes showAnimation{0%{transform:translateX(100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(100%);opacity:0;}}"], classes.notificationItemOpened, classes.notificationLeftToRightAnimation, classes.notificationItemHidden, classes.notificationLeftToRightAnimation);
62
62
  export var StyledRoot = /*#__PURE__*/styled.div.withConfig({
63
63
  componentId: "plasma-new-hope__sc-1iufy9r-9"
64
64
  })(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:flex-end;"]);
@@ -10,9 +10,9 @@ import { PropsTable, Description } from '@site/src/components';
10
10
  <PropsTable name="Notification" />
11
11
 
12
12
  ## Использование
13
- Компонент `Notification` может использоваться для создания собственных систем оповещения.
13
+ Компонент `Notification` может использоваться для создания собственных систем оповещения.
14
14
  Вид компонента контролируется свойствами (props).
15
- Текстовая часть оповещения состоит из `title` и `children`.
15
+ Текстовая часть оповещения состоит из `title` и `children`.
16
16
  Слева или сверху от нее, также можно пробросить иконку через свойство `icon`.
17
17
  Также есть часть `actions`, в которой предполагается отображение кнопок для взаимодействия.
18
18
 
@@ -34,24 +34,32 @@ ReactDOM.render(
34
34
  ```
35
35
 
36
36
  ### Вызов уведомления
37
- После подключения `NotificationsProvider` станет возможен вызов функции `addNotification`,который приведет к отображению оповещения.
38
- Функция принимает значения свойств компонента `Notification`:
37
+ После подключения `NotificationsProvider` станет возможен вызов функции `addNotification`, который приведет к отображению оповещения.
38
+ Функция принимает значения свойств компонента `Notification`, включая необязательное поле `id`. И возвращает сгенерированный или переданный `id`, по которому можно закрыть оповещение через вызов `closeNotification`.
39
39
 
40
40
  ```tsx live
41
41
  import React from 'react';
42
- import { Button, addNotification, NotificationsProvider } from '@salutejs/{{ package }}';
42
+ import { Button, ButtonGroup, addNotification, closeNotification, NotificationsProvider } from '@salutejs/{{ package }}';
43
43
 
44
44
  export function App() {
45
- const handleClick = React.useCallback(() => {
45
+ const handleShow = React.useCallback(() => {
46
46
  addNotification({
47
+ id: 'incoming-call',
47
48
  title: 'Входящий вызов',
48
49
  children: 'Принять?',
49
50
  }, 1000);
50
51
  }, []);
51
52
 
53
+ const handleHide = React.useCallback(() => {
54
+ closeNotification('incoming-call');
55
+ }, []);
56
+
52
57
  return (
53
58
  <NotificationsProvider>
54
- <Button text="Показать оповещение" onClick={handleClick} />
59
+ <ButtonGroup>
60
+ <Button text="Показать оповещение" onClick={handleShow} />
61
+ <Button text="Скрыть оповещение" onClick={handleHide} />
62
+ </ButtonGroup>
55
63
  </NotificationsProvider>
56
64
  );
57
65
  }
@@ -13,7 +13,8 @@ export var classes = {
13
13
  withoutIcon: 'notification-without-icon',
14
14
  withoutCloseIcon: 'notification-without-close-icon',
15
15
  notificationItemOpened: 'notification-item-opened',
16
- notificationItemHidden: 'notification-item-hidden'
16
+ notificationItemHidden: 'notification-item-hidden',
17
+ notificationLeftToRightAnimation: 'notification-left-to-right-animation'
17
18
  };
18
19
  export var tokens = {
19
20
  background: '--plasma-notification-backgorund',
@@ -24,7 +24,9 @@ var StyledPopup = /*#__PURE__*/styled(Popup).withConfig({
24
24
  */
25
25
  export var NotificationsPortal = function NotificationsPortal(_ref) {
26
26
  var config = _ref.config,
27
- frame = _ref.frame;
27
+ frame = _ref.frame,
28
+ _ref$placement = _ref.placement,
29
+ placement = _ref$placement === void 0 ? 'bottom-right' : _ref$placement;
28
30
  var _useStoreon = useStoreon('notifications'),
29
31
  notifications = _useStoreon.notifications;
30
32
  var Notification = useMemo(function () {
@@ -33,7 +35,7 @@ export var NotificationsPortal = function NotificationsPortal(_ref) {
33
35
  return /*#__PURE__*/React.createElement(PopupProvider, null, notifications.length > 0 && /*#__PURE__*/React.createElement(StyledPopup, {
34
36
  opened: true,
35
37
  frame: frame,
36
- placement: "bottom-right",
38
+ placement: placement,
37
39
  zIndex: "9100"
38
40
  }, /*#__PURE__*/React.createElement(StyledRoot, null, notifications.map(function (_ref2) {
39
41
  var id = _ref2.id,
@@ -41,7 +43,7 @@ export var NotificationsPortal = function NotificationsPortal(_ref) {
41
43
  rest = _objectWithoutProperties(_ref2, _excluded);
42
44
  return /*#__PURE__*/React.createElement(StyledItemWrapper, {
43
45
  key: id,
44
- className: cx(isHidden ? classes.notificationItemHidden : classes.notificationItemOpened),
46
+ className: cx(isHidden ? classes.notificationItemHidden : classes.notificationItemOpened, placement === 'bottom-left' && classes.notificationLeftToRightAnimation),
45
47
  isHidden: isHidden || false
46
48
  }, /*#__PURE__*/React.createElement(Notification, _extends({
47
49
  key: id,
@@ -5,11 +5,13 @@ import { NotificationsPortal } from './NotificationsPortal';
5
5
  export var NotificationsProvider = function NotificationsProvider(_ref) {
6
6
  var children = _ref.children,
7
7
  config = _ref.config,
8
- frame = _ref.frame;
8
+ frame = _ref.frame,
9
+ placement = _ref.placement;
9
10
  return /*#__PURE__*/React.createElement(StoreContext.Provider, {
10
11
  value: NotificationsStore
11
12
  }, children, /*#__PURE__*/React.createElement(NotificationsPortal, {
12
13
  frame: frame,
14
+ placement: placement,
13
15
  config: config
14
16
  }));
15
17
  };
@@ -1,4 +1,4 @@
1
1
  export { NotificationsProvider } from './NotificationsProvider';
2
- export { notificationRoot, noticationConfig } from './Notification';
2
+ export { notificationRoot, notificationConfig } from './Notification';
3
3
  export { addNotification, closeNotification } from './NotificationsStore';
4
4
  export { classes as notificationClasses, tokens as notificationTokens } from './Notification.tokens';