@salutejs/plasma-new-hope 0.77.1-canary.1197.8831064988.0 → 0.77.1-canary.1201.8930079977.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (357) hide show
  1. package/cjs/components/Combobox/Combobox.css +17 -7
  2. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +15 -6
  3. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
  4. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +15 -6
  5. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
  6. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +15 -6
  7. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
  8. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +15 -6
  9. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
  10. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.css +4 -23
  11. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +81 -10
  12. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
  13. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +21 -9
  14. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
  15. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +4 -0
  16. package/cjs/components/Combobox/utils/index.js +23 -0
  17. package/cjs/components/Combobox/utils/index.js.map +1 -0
  18. package/cjs/components/Dropdown/Dropdown.css +25 -2
  19. package/cjs/components/Dropdown/Dropdown.js +138 -54
  20. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  21. package/cjs/components/Dropdown/Dropdown.styles.js +40 -7
  22. package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
  23. package/cjs/components/Dropdown/Dropdown.styles_1tihqkp.css +3 -0
  24. package/cjs/components/Dropdown/Dropdown.tokens.js +26 -23
  25. package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
  26. package/cjs/components/Dropdown/hooks/useHashMaps.js +31 -0
  27. package/cjs/components/Dropdown/hooks/useHashMaps.js.map +1 -0
  28. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +200 -0
  29. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -0
  30. package/cjs/components/Dropdown/reducers/focusedPathReducer.js +37 -0
  31. package/cjs/components/Dropdown/reducers/focusedPathReducer.js.map +1 -0
  32. package/cjs/components/Dropdown/reducers/pathReducer.js +41 -0
  33. package/cjs/components/Dropdown/reducers/pathReducer.js.map +1 -0
  34. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +119 -0
  35. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -0
  36. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +7 -4
  37. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +79 -100
  38. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  39. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +90 -5
  40. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  41. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +5 -0
  42. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +30 -0
  43. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -0
  44. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +4 -0
  45. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -0
  46. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +112 -0
  47. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +1 -0
  48. package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +1 -1
  49. package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +1 -0
  50. package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +1 -1
  51. package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +1 -0
  52. package/cjs/components/Dropdown/utils/index.js +16 -0
  53. package/cjs/components/Dropdown/utils/index.js.map +1 -1
  54. package/cjs/components/Pagination/Pagination.css +14 -7
  55. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +14 -7
  56. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  57. package/cjs/components/Select/Select.css +14 -7
  58. package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +15 -6
  59. package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
  60. package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +15 -6
  61. package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
  62. package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +15 -6
  63. package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
  64. package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +15 -6
  65. package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
  66. package/cjs/components/Select/ui/SelectItem/SelectItem.css +16 -7
  67. package/cjs/components/Select/ui/SelectItem/SelectItem.js +3 -3
  68. package/cjs/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
  69. package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
  70. package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
  71. package/cjs/components/Select/ui/SelectItem/{SelectItem.styles_6h17aw.css → SelectItem.styles_vk39mp.css} +1 -1
  72. package/cjs/components/TextField/TextField.js +2 -2
  73. package/cjs/components/TextField/TextField.js.map +1 -1
  74. package/cjs/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
  75. package/cjs/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
  76. package/cjs/index.css +18 -8
  77. package/cjs/index.js +8 -2
  78. package/cjs/index.js.map +1 -1
  79. package/es/components/Combobox/Combobox.css +17 -7
  80. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +15 -6
  81. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
  82. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +15 -6
  83. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
  84. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +15 -6
  85. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
  86. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +15 -6
  87. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
  88. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +4 -23
  89. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +82 -11
  90. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
  91. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +19 -10
  92. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
  93. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +4 -0
  94. package/es/components/Combobox/utils/index.js +19 -0
  95. package/es/components/Combobox/utils/index.js.map +1 -0
  96. package/es/components/Dropdown/Dropdown.css +25 -2
  97. package/es/components/Dropdown/Dropdown.js +144 -60
  98. package/es/components/Dropdown/Dropdown.js.map +1 -1
  99. package/es/components/Dropdown/Dropdown.styles.js +39 -7
  100. package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
  101. package/es/components/Dropdown/Dropdown.styles_1tihqkp.css +3 -0
  102. package/es/components/Dropdown/Dropdown.tokens.js +26 -23
  103. package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
  104. package/es/components/Dropdown/hooks/useHashMaps.js +27 -0
  105. package/es/components/Dropdown/hooks/useHashMaps.js.map +1 -0
  106. package/es/components/Dropdown/hooks/useKeyboardNavigation.js +196 -0
  107. package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -0
  108. package/es/components/Dropdown/reducers/focusedPathReducer.js +33 -0
  109. package/es/components/Dropdown/reducers/focusedPathReducer.js.map +1 -0
  110. package/es/components/Dropdown/reducers/pathReducer.js +37 -0
  111. package/es/components/Dropdown/reducers/pathReducer.js.map +1 -0
  112. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +115 -0
  113. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -0
  114. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +7 -4
  115. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +80 -100
  116. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  117. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +89 -5
  118. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  119. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +5 -0
  120. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +23 -0
  121. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -0
  122. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +4 -0
  123. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -0
  124. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +107 -0
  125. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +1 -0
  126. package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +1 -1
  127. package/es/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +1 -0
  128. package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +1 -1
  129. package/es/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +1 -0
  130. package/es/components/Dropdown/utils/index.js +16 -2
  131. package/es/components/Dropdown/utils/index.js.map +1 -1
  132. package/es/components/Pagination/Pagination.css +14 -7
  133. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +14 -7
  134. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  135. package/es/components/Select/Select.css +14 -7
  136. package/es/components/Select/ui/SelectDivider/SelectDivider.css +15 -6
  137. package/es/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
  138. package/es/components/Select/ui/SelectFooter/SelectFooter.css +15 -6
  139. package/es/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
  140. package/es/components/Select/ui/SelectGroup/SelectGroup.css +15 -6
  141. package/es/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
  142. package/es/components/Select/ui/SelectHeader/SelectHeader.css +15 -6
  143. package/es/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
  144. package/es/components/Select/ui/SelectItem/SelectItem.css +16 -7
  145. package/es/components/Select/ui/SelectItem/SelectItem.js +3 -3
  146. package/es/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
  147. package/es/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
  148. package/es/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
  149. package/es/components/Select/ui/SelectItem/{SelectItem.styles_6h17aw.css → SelectItem.styles_vk39mp.css} +1 -1
  150. package/es/components/TextField/TextField.js +3 -3
  151. package/es/components/TextField/TextField.js.map +1 -1
  152. package/es/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
  153. package/es/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
  154. package/es/index.css +18 -8
  155. package/es/index.js +4 -1
  156. package/es/index.js.map +1 -1
  157. package/package.json +3 -3
  158. package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +91 -2
  159. package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +27 -7
  160. package/styled-components/cjs/components/Combobox/utils/index.js +23 -0
  161. package/styled-components/cjs/components/Dropdown/Dropdown.js +140 -54
  162. package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +22 -7
  163. package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +26 -23
  164. package/styled-components/cjs/components/Dropdown/hooks/useHashMaps.js +29 -0
  165. package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +199 -0
  166. package/styled-components/cjs/components/Dropdown/index.js +9 -1
  167. package/styled-components/cjs/components/Dropdown/reducers/focusedPathReducer.js +40 -0
  168. package/styled-components/cjs/components/Dropdown/reducers/pathReducer.js +44 -0
  169. package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +114 -0
  170. package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +5 -0
  171. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +77 -105
  172. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +83 -18
  173. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +33 -0
  174. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +5 -0
  175. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +119 -0
  176. package/styled-components/cjs/components/Dropdown/ui/index.js +19 -5
  177. package/styled-components/cjs/components/Dropdown/utils/index.js +15 -1
  178. package/styled-components/cjs/components/Dropdown/variations/_size/tokens.json +1 -9
  179. package/styled-components/cjs/components/Dropdown/variations/_view/tokens.json +1 -1
  180. package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.js +1 -1
  181. package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  182. package/styled-components/cjs/components/TextField/TextField.js +4 -4
  183. package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
  184. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +25 -0
  185. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.js +11 -0
  186. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +292 -0
  187. package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +90 -3
  188. package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +23 -6
  189. package/styled-components/es/components/Combobox/utils/index.js +15 -0
  190. package/styled-components/es/components/Dropdown/Dropdown.js +142 -55
  191. package/styled-components/es/components/Dropdown/Dropdown.styles.js +18 -5
  192. package/styled-components/es/components/Dropdown/Dropdown.tokens.js +26 -23
  193. package/styled-components/es/components/Dropdown/hooks/useHashMaps.js +23 -0
  194. package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +193 -0
  195. package/styled-components/es/components/Dropdown/index.js +1 -0
  196. package/styled-components/es/components/Dropdown/reducers/focusedPathReducer.js +34 -0
  197. package/styled-components/es/components/Dropdown/reducers/pathReducer.js +38 -0
  198. package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +108 -0
  199. package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +1 -0
  200. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +78 -107
  201. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +80 -14
  202. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +25 -0
  203. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +1 -0
  204. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +111 -0
  205. package/styled-components/es/components/Dropdown/ui/index.js +3 -1
  206. package/styled-components/es/components/Dropdown/utils/index.js +15 -1
  207. package/styled-components/es/components/Dropdown/variations/_size/tokens.json +1 -9
  208. package/styled-components/es/components/Dropdown/variations/_view/tokens.json +1 -1
  209. package/styled-components/es/components/Select/ui/SelectItem/SelectItem.js +2 -2
  210. package/styled-components/es/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  211. package/styled-components/es/components/TextField/TextField.js +4 -4
  212. package/styled-components/es/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
  213. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +19 -0
  214. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.js +5 -0
  215. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +292 -0
  216. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts +15 -13
  217. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts.map +1 -1
  218. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts +5 -1
  219. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts.map +1 -1
  220. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts +59 -2
  221. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts.map +1 -1
  222. package/types/components/Combobox/utils/index.d.ts +4 -0
  223. package/types/components/Combobox/utils/index.d.ts.map +1 -0
  224. package/types/components/Dropdown/Dropdown.d.ts +4 -4
  225. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  226. package/types/components/Dropdown/Dropdown.styles.d.ts +8 -1
  227. package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
  228. package/types/components/Dropdown/Dropdown.tokens.d.ts +24 -22
  229. package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
  230. package/types/components/Dropdown/Dropdown.types.d.ts +64 -40
  231. package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
  232. package/types/components/Dropdown/hooks/useHashMaps.d.ts +6 -0
  233. package/types/components/Dropdown/hooks/useHashMaps.d.ts.map +1 -0
  234. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts +23 -0
  235. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts.map +1 -0
  236. package/types/components/Dropdown/index.d.ts +3 -1
  237. package/types/components/Dropdown/index.d.ts.map +1 -1
  238. package/types/components/Dropdown/reducers/focusedPathReducer.d.ts +16 -0
  239. package/types/components/Dropdown/reducers/focusedPathReducer.d.ts.map +1 -0
  240. package/types/components/Dropdown/reducers/pathReducer.d.ts +20 -0
  241. package/types/components/Dropdown/reducers/pathReducer.d.ts.map +1 -0
  242. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts +5 -0
  243. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +1 -0
  244. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +26 -0
  245. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +1 -0
  246. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts +2 -56
  247. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
  248. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +5 -2
  249. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
  250. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +44 -38
  251. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
  252. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts +7 -0
  253. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts.map +1 -0
  254. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts +60 -0
  255. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts.map +1 -0
  256. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts +58 -0
  257. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts.map +1 -0
  258. package/types/components/Dropdown/ui/DropdownItemOld/variations/_size/base.d.ts.map +1 -0
  259. package/types/components/Dropdown/ui/DropdownItemOld/variations/_view/base.d.ts.map +1 -0
  260. package/types/components/Dropdown/ui/index.d.ts +3 -1
  261. package/types/components/Dropdown/ui/index.d.ts.map +1 -1
  262. package/types/components/Dropdown/utils/index.d.ts +5 -2
  263. package/types/components/Dropdown/utils/index.d.ts.map +1 -1
  264. package/types/components/Select/ui/SelectItem/SelectItem.d.ts +2 -2
  265. package/types/components/Select/ui/SelectItem/SelectItem.d.ts.map +1 -1
  266. package/types/components/Select/ui/SelectItem/SelectItem.type.d.ts +2 -2
  267. package/types/components/Select/utils/index.d.ts +1 -1
  268. package/types/components/TextField/TextField.d.ts +2 -2
  269. package/types/components/TextField/TextField.d.ts.map +1 -1
  270. package/types/components/_Icon/Icon.assets/DisclosureRight.d.ts.map +1 -1
  271. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts.map +1 -0
  272. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +13 -0
  273. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +1 -0
  274. package/types/examples/plasma_b2c/components/TextField/TextField.d.ts +2 -2
  275. package/types/examples/plasma_b2c/components/TextField/TextField.d.ts.map +1 -1
  276. package/types/examples/plasma_web/components/TextField/TextField.d.ts +2 -2
  277. package/types/examples/plasma_web/components/TextField/TextField.d.ts.map +1 -1
  278. package/types/examples/sds_engineer/components/TextField/TextField.d.ts +2 -2
  279. package/types/examples/sds_engineer/components/TextField/TextField.d.ts.map +1 -1
  280. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +0 -1
  281. package/cjs/components/Dropdown/Dropdown.styles_1daxhqh.css +0 -2
  282. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +0 -4
  283. package/cjs/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +0 -1
  284. package/cjs/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +0 -1
  285. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +0 -1
  286. package/es/components/Dropdown/Dropdown.styles_1daxhqh.css +0 -2
  287. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +0 -4
  288. package/es/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +0 -1
  289. package/es/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +0 -1
  290. package/styled-components/cjs/components/Dropdown/Dropdown.template-doc.mdx +0 -80
  291. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +0 -19
  292. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +0 -9
  293. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +0 -27
  294. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +0 -13
  295. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +0 -194
  296. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +0 -27
  297. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +0 -13
  298. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
  299. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +0 -27
  300. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +0 -13
  301. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +0 -195
  302. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +0 -27
  303. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +0 -13
  304. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
  305. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.config.js +0 -22
  306. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.js +0 -21
  307. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +0 -277
  308. package/styled-components/es/components/Dropdown/Dropdown.template-doc.mdx +0 -80
  309. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +0 -19
  310. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +0 -9
  311. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +0 -21
  312. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +0 -7
  313. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +0 -194
  314. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +0 -21
  315. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +0 -7
  316. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
  317. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +0 -21
  318. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +0 -7
  319. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +0 -195
  320. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +0 -21
  321. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +0 -7
  322. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
  323. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.config.js +0 -16
  324. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.js +0 -15
  325. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +0 -277
  326. package/types/components/Dropdown/ui/DropdownItem/variations/_size/base.d.ts.map +0 -1
  327. package/types/components/Dropdown/ui/DropdownItem/variations/_view/base.d.ts.map +0 -1
  328. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.d.ts.map +0 -1
  329. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts +0 -30
  330. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts.map +0 -1
  331. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts +0 -18
  332. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts.map +0 -1
  333. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts +0 -30
  334. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts.map +0 -1
  335. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts +0 -18
  336. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts.map +0 -1
  337. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts +0 -30
  338. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts.map +0 -1
  339. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts +0 -18
  340. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts.map +0 -1
  341. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts +0 -30
  342. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts.map +0 -1
  343. package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts +0 -15
  344. package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts.map +0 -1
  345. package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts +0 -51
  346. package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts.map +0 -1
  347. /package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base_x642ct.css +0 -0
  348. /package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base_x642ct.css +0 -0
  349. /package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base_x642ct.css +0 -0
  350. /package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base_x642ct.css +0 -0
  351. /package/styled-components/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +0 -0
  352. /package/styled-components/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +0 -0
  353. /package/styled-components/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +0 -0
  354. /package/styled-components/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +0 -0
  355. /package/types/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.d.ts +0 -0
  356. /package/types/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.d.ts +0 -0
  357. /package/types/examples/plasma_b2c/components/Dropdown/{Normal/Dropdown.config.d.ts → Dropdown.config.d.ts} +0 -0
@@ -0,0 +1,119 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ require('@salutejs/plasma-core');
7
+ require('@linaria/react');
8
+ var DropdownItem = require('../DropdownItem/DropdownItem.js');
9
+ var Dropdown_styles = require('../../Dropdown.styles.js');
10
+ require('../../../../utils/react.js');
11
+ require('focus-visible');
12
+
13
+ var DropdownInner = function DropdownInner(_ref) {
14
+ var item = _ref.item,
15
+ currentLevel = _ref.currentLevel,
16
+ focusedPath = _ref.focusedPath,
17
+ path = _ref.path,
18
+ dispatchPath = _ref.dispatchPath,
19
+ index = _ref.index,
20
+ trigger = _ref.trigger,
21
+ itemRole = _ref.itemRole,
22
+ listHeight = _ref.listHeight,
23
+ listOverflow = _ref.listOverflow,
24
+ handleGlobalToggle = _ref.handleGlobalToggle,
25
+ closeOnSelect = _ref.closeOnSelect,
26
+ onHover = _ref.onHover,
27
+ onItemSelect = _ref.onItemSelect,
28
+ onItemClick = _ref.onItemClick,
29
+ listWidth = _ref.listWidth,
30
+ variant = _ref.variant,
31
+ hasArrow = _ref.hasArrow;
32
+ var handleToggle = function handleToggle(opened) {
33
+ if (opened) {
34
+ dispatchPath({
35
+ type: 'changed_on_level',
36
+ value: item.value.toString(),
37
+ level: currentLevel + 1
38
+ });
39
+ } else {
40
+ dispatchPath({
41
+ type: 'cut_by_level',
42
+ level: currentLevel + 1
43
+ });
44
+ }
45
+ };
46
+ var isCurrentListOpen = path[currentLevel + 1] === item.value.toString();
47
+ if (item !== null && item !== void 0 && item.items) {
48
+ return /*#__PURE__*/React.createElement(Dropdown_styles.StyledPopover, {
49
+ isOpen: isCurrentListOpen,
50
+ usePortal: false,
51
+ placement: "right-start",
52
+ trigger: trigger,
53
+ target: /*#__PURE__*/React.createElement(DropdownItem.DropdownItem, {
54
+ item: item,
55
+ index: index,
56
+ path: path,
57
+ focusedPath: focusedPath,
58
+ currentLevel: currentLevel,
59
+ onHover: onHover,
60
+ onItemSelect: onItemSelect,
61
+ onItemClick: onItemClick,
62
+ variant: variant,
63
+ hasArrow: hasArrow,
64
+ ariaControls: "listbox".concat(currentLevel + 2),
65
+ ariaExpanded: isCurrentListOpen,
66
+ ariaHasPopup: "listbox",
67
+ ariaLevel: currentLevel + 1,
68
+ ariaLabel: item.label
69
+ }),
70
+ onToggle: handleToggle,
71
+ isFocusTrapped: false
72
+ }, /*#__PURE__*/React.createElement(Dropdown_styles.Ul, {
73
+ listHeight: listHeight,
74
+ listOverflow: listOverflow,
75
+ role: "listbox",
76
+ id: "listbox".concat(currentLevel + 2),
77
+ listWidth: listWidth,
78
+ isInnerUl: true
79
+ }, item.items.map(function (innerItem, innerIndex) {
80
+ return /*#__PURE__*/React.createElement(DropdownInner, {
81
+ key: "".concat(innerIndex, "/currentLevel"),
82
+ item: innerItem,
83
+ currentLevel: currentLevel + 1,
84
+ focusedPath: focusedPath,
85
+ path: path,
86
+ dispatchPath: dispatchPath,
87
+ index: innerIndex,
88
+ trigger: trigger,
89
+ itemRole: itemRole,
90
+ listHeight: listHeight,
91
+ listOverflow: listOverflow,
92
+ handleGlobalToggle: handleGlobalToggle,
93
+ closeOnSelect: closeOnSelect,
94
+ onHover: onHover,
95
+ onItemSelect: onItemSelect,
96
+ onItemClick: onItemClick,
97
+ listWidth: listWidth,
98
+ variant: variant,
99
+ hasArrow: hasArrow
100
+ });
101
+ })));
102
+ }
103
+ return /*#__PURE__*/React.createElement(DropdownItem.DropdownItem, {
104
+ item: item,
105
+ index: index,
106
+ focusedPath: focusedPath,
107
+ currentLevel: currentLevel,
108
+ itemRole: itemRole,
109
+ handleGlobalToggle: handleGlobalToggle,
110
+ closeOnSelect: closeOnSelect,
111
+ onHover: onHover,
112
+ onItemSelect: onItemSelect,
113
+ onItemClick: onItemClick,
114
+ variant: variant
115
+ });
116
+ };
117
+
118
+ exports.DropdownInner = DropdownInner;
119
+ //# sourceMappingURL=DropdownInner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownInner.js","sources":["../../../../../src/components/Dropdown/ui/DropdownInner/DropdownInner.tsx"],"sourcesContent":["import React from 'react';\nimport type { FC } from 'react';\n\nimport { DropdownItem } from '..';\nimport { Ul, StyledPopover } from '../../Dropdown.styles';\n\nimport { DropdownInnerProps } from './DropdownInner.type';\n\nconst DropdownInner: FC<DropdownInnerProps> = ({\n item,\n currentLevel,\n focusedPath,\n path,\n dispatchPath,\n index,\n trigger,\n itemRole,\n listHeight,\n listOverflow,\n handleGlobalToggle,\n closeOnSelect,\n onHover,\n onItemSelect,\n onItemClick,\n listWidth,\n variant,\n hasArrow,\n}) => {\n const handleToggle = (opened: boolean): void => {\n if (opened) {\n dispatchPath({ type: 'changed_on_level', value: item.value.toString(), level: currentLevel + 1 });\n } else {\n dispatchPath({ type: 'cut_by_level', level: currentLevel + 1 });\n }\n };\n\n const isCurrentListOpen = path[currentLevel + 1] === item.value.toString();\n\n if (item?.items) {\n return (\n <StyledPopover\n isOpen={isCurrentListOpen}\n usePortal={false}\n placement=\"right-start\"\n trigger={trigger}\n target={\n <DropdownItem\n item={item}\n index={index}\n path={path}\n focusedPath={focusedPath}\n currentLevel={currentLevel}\n onHover={onHover}\n onItemSelect={onItemSelect}\n onItemClick={onItemClick}\n variant={variant}\n hasArrow={hasArrow}\n ariaControls={`listbox${currentLevel + 2}`}\n ariaExpanded={isCurrentListOpen}\n ariaHasPopup=\"listbox\"\n ariaLevel={currentLevel + 1}\n ariaLabel={item.label}\n />\n }\n onToggle={handleToggle}\n isFocusTrapped={false}\n >\n <Ul\n listHeight={listHeight}\n listOverflow={listOverflow}\n role=\"listbox\"\n id={`listbox${currentLevel + 2}`}\n listWidth={listWidth}\n isInnerUl\n >\n {item.items.map((innerItem, innerIndex) => (\n <DropdownInner\n key={`${innerIndex}/currentLevel`}\n item={innerItem}\n currentLevel={currentLevel + 1}\n focusedPath={focusedPath}\n path={path}\n dispatchPath={dispatchPath}\n index={innerIndex}\n trigger={trigger}\n itemRole={itemRole}\n listHeight={listHeight}\n listOverflow={listOverflow}\n handleGlobalToggle={handleGlobalToggle}\n closeOnSelect={closeOnSelect}\n onHover={onHover}\n onItemSelect={onItemSelect}\n onItemClick={onItemClick}\n listWidth={listWidth}\n variant={variant}\n hasArrow={hasArrow}\n />\n ))}\n </Ul>\n </StyledPopover>\n );\n }\n\n return (\n <DropdownItem\n item={item}\n index={index}\n focusedPath={focusedPath}\n currentLevel={currentLevel}\n itemRole={itemRole}\n handleGlobalToggle={handleGlobalToggle}\n closeOnSelect={closeOnSelect}\n onHover={onHover}\n onItemSelect={onItemSelect}\n onItemClick={onItemClick}\n variant={variant}\n />\n );\n};\n\nexport { DropdownInner };\n"],"names":["DropdownInner","_ref","item","currentLevel","focusedPath","path","dispatchPath","index","trigger","itemRole","listHeight","listOverflow","handleGlobalToggle","closeOnSelect","onHover","onItemSelect","onItemClick","listWidth","variant","hasArrow","handleToggle","opened","type","value","toString","level","isCurrentListOpen","items","React","createElement","StyledPopover","isOpen","usePortal","placement","target","DropdownItem","ariaControls","concat","ariaExpanded","ariaHasP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KAAA,CAAAC,aAAA,CAACM,yBAAY,EAAA;AACTjC,IAAAA,IAAI,EAAEA,IAAK;AACXK,IAAAA,KAAK,EAAEA,KAAM;AACbH,IAAAA,WAAW,EAAEA,WAAY;AACzBD,IAAAA,YAAY,EAAEA,YAAa;AAC3BM,IAAAA,QAAQ,EAAEA,QAAS;AACnBG,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCC,IAAAA,aAAa,EAAEA,aAAc;AAC7BC,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,YAAY,EAAEA,YAAa;AAC3BC,IAAAA,WAAW,EAAEA,WAAY;AACzBE,IAAAA,OAAO,EAAEA,OAAAA;AAAQ,GACpB,CAAC,CAAA;AAEV;;;;"}
@@ -1,4 +1,7 @@
1
- .DropdownItem_styles_1juhjtq_s1gkzlls__cab27d09{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--plasma-dropdown-item-content-left-width);color:var(--plasma-dropdown-item-content-left-color);}
2
- .DropdownItem_styles_1juhjtq_sz6s14y__cab27d09{margin-left:auto;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--plasma-dropdown-item-content-right-width);color:var(--plasma-dropdown-item-content-right-color);}
3
- .DropdownItem_styles_1juhjtq_s1m97l2m__cab27d09{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
4
- .DropdownItem_styles_1juhjtq_boib72h__cab27d09{box-sizing:content-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;width:100%;font-family:var(--plasma-dropdown-item-font-family);font-size:var(--plasma-dropdown-item-font-size);font-style:var(--plasma-dropdown-item-font-style);font-weight:var(--plasma-dropdown-item-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-item-line-height);-moz-letter-spacing:var(--plasma-dropdown-item-line-height);-ms-letter-spacing:var(--plasma-dropdown-item-line-height);letter-spacing:var(--plasma-dropdown-item-line-height);line-height:var(--plasma-dropdown-item-font-weight);background:var(--plasma-dropdown-item-background);color:var(--plasma-dropdown-item-color);border-radius:var(--plasma-dropdown-item-border-radius);width:var(--plasma-dropdown-item-width);height:var(--plasma-dropdown-item-height);padding:var(--plasma-dropdown-item-padding-top) var(--plasma-dropdown-item-padding-right) var(--plasma-dropdown-item-padding-bottom) var(--plasma-dropdown-item-padding-left);margin:var(--plasma-dropdown-item-margin-top) var(--plasma-dropdown-item-margin-right) var(--plasma-dropdown-item-margin-bottom) var(--plasma-dropdown-item-margin-left);}.DropdownItem_styles_1juhjtq_boib72h__cab27d09:focus{outline:none;}.DropdownItem_styles_1juhjtq_boib72h__cab27d09::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:var(--plasma-dropdown-item-border-radius);-webkit-transition:none;transition:none;pointer-events:none;}.DropdownItem_styles_1juhjtq_boib72h__cab27d09.DropdownItem_styles_1juhjtq_focusVisible__cab27d09:focus::before,.DropdownItem_styles_1juhjtq_boib72h__cab27d09[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-dropdown-focus-color);}.DropdownItem_styles_1juhjtq_boib72h__cab27d09:hover:not(.DropdownItem_styles_1juhjtq_dropdownItemIsDisabled__cab27d09){cursor:pointer;background:var(--plasma-dropdown-item-background-hover);}.DropdownItem_styles_1juhjtq_boib72h__cab27d09.DropdownItem_styles_1juhjtq_dropdownItemIsSelected__cab27d09{color:var(--plasma-dropdown-item-color-selected);background:var(--plasma-dropdown-item-background-selected);}.DropdownItem_styles_1juhjtq_boib72h__cab27d09.DropdownItem_styles_1juhjtq_dropdownItemIsSelected__cab27d09:hover:not(.DropdownItem_styles_1juhjtq_dropdownItemIsDisabled__cab27d09){background:var(--plasma-dropdown-item-background-selected-hover);}.DropdownItem_styles_1juhjtq_boib72h__cab27d09.DropdownItem_styles_1juhjtq_dropdownItemIsDisabled__cab27d09{opacity:var(--plasma-dropdown-disabled-opacity);cursor:not-allowed;}
1
+ .IconRoot_7pl7ig_svvlqhf__32c458a1{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:var(--svvlqhf-0);height:var(--svvlqhf-0);-webkit-flex:0 0 var(--svvlqhf-0);-ms-flex:0 0 var(--svvlqhf-0);flex:0 0 var(--svvlqhf-0);}
2
+
3
+ .DropdownItem_styles_1o4szyu_s1gkzlls__6703745b{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
4
+ .DropdownItem_styles_1o4szyu_sz6s14y__6703745b{margin-left:auto;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
5
+ .DropdownItem_styles_1o4szyu_d1m97l2m__6703745b{line-height:0;color:var(--plasma-dropdown-disclosure-icon-color);}
6
+ .DropdownItem_styles_1o4szyu_soib72h__6703745b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-flex:1;-ms-flex:1;flex:1;}
7
+ .DropdownItem_styles_1o4szyu_w6l2f0g__6703745b{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0;box-sizing:content-box;padding-top:var(--w6l2f0g-0);padding-right:var(--plasma-dropdown-item-padding-right);padding-bottom:var(--w6l2f0g-1);padding-left:var(--plasma-dropdown-item-padding-left);font-family:var(--plasma-dropdown-item-font-family);font-size:var(--plasma-dropdown-item-font-size);font-style:var(--plasma-dropdown-item-font-style);font-weight:var(--plasma-dropdown-item-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-item-line-height);-moz-letter-spacing:var(--plasma-dropdown-item-line-height);-ms-letter-spacing:var(--plasma-dropdown-item-line-height);letter-spacing:var(--plasma-dropdown-item-line-height);line-height:var(--plasma-dropdown-item-font-weight);background:var(--plasma-dropdown-item-background);color:var(--plasma-dropdown-item-color);border-radius:var(--plasma-dropdown-item-border-radius);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b:hover:not(.DropdownItem_styles_1o4szyu_dropdownItemIsDisabled__6703745b){cursor:pointer;background:var(--plasma-dropdown-item-background-hover);}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b.DropdownItem_styles_1o4szyu_dropdownItemIsActive__6703745b{background:var(--plasma-dropdown-item-background-hover);}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b.DropdownItem_styles_1o4szyu_dropdownItemIsDisabled__6703745b{opacity:var(--plasma-dropdown-disabled-opacity);cursor:not-allowed;}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b:focus{outline:none;}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:var(--plasma-dropdown-item-border-radius);-webkit-transition:none;transition:none;pointer-events:none;}.DropdownItem_styles_1o4szyu_w6l2f0g__6703745b.DropdownItem_styles_1o4szyu_dropdownItemIsFocused__6703745b:before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-dropdown-focus-color);}
@@ -2,111 +2,90 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
6
5
  var React = require('react');
7
- var plasmaCore = require('@salutejs/plasma-core');
8
6
  var Dropdown_tokens = require('../../Dropdown.tokens.js');
9
- var index$1 = require('../../../../utils/index.js');
10
- var index = require('../../utils/index.js');
11
- var base = require('./variations/_view/base.js');
12
- var base$1 = require('./variations/_size/base.js');
7
+ var index = require('../../../../utils/index.js');
8
+ require('@linaria/react');
9
+ var IconDisclosureRight = require('../../../_Icon/Icons/IconDisclosureRight.js');
13
10
  var DropdownItem_styles = require('./DropdownItem.styles.js');
14
11
 
15
- var _excluded = ["id", "className", "children", "text", "isSelected", "name", "checked", "value", "role", "view", "size", "disabled", "contentLeft", "contentRight", "onSelect", "onClick", "onChange"];
16
- /**
17
- * Элемент выпадающего списка
18
- */
19
- var dropdownItemRoot = function dropdownItemRoot(Root) {
20
- return /*#__PURE__*/React.forwardRef(function (_ref, outerRootRef) {
21
- var id = _ref.id,
22
- className = _ref.className,
23
- children = _ref.children,
24
- text = _ref.text,
25
- isSelected = _ref.isSelected,
26
- name = _ref.name,
27
- checked = _ref.checked,
28
- value = _ref.value,
29
- role = _ref.role,
30
- view = _ref.view,
31
- size = _ref.size,
32
- disabled = _ref.disabled,
33
- ContentLeftComponent = _ref.contentLeft,
34
- ContentRightComponent = _ref.contentRight,
35
- onSelect = _ref.onSelect,
36
- onClick = _ref.onClick,
37
- onChange = _ref.onChange,
38
- rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
39
- var uniqId = plasmaCore.safeUseId();
40
- var innerId = id || uniqId;
41
- var withDropdownItemIsSelected = checked || isSelected ? Dropdown_tokens.classes.dropdownItemIsSelected : undefined;
42
- var withDropdownItemIsDisabled = disabled ? Dropdown_tokens.classes.dropdownItemIsDisabled : undefined;
43
- var handleOnClick = React.useCallback(function (event) {
44
- if (disabled) {
45
- return;
46
- }
47
- onClick === null || onClick === void 0 || onClick(event);
48
- if (onSelect && !ContentLeftComponent) {
49
- onSelect(value, text);
50
- }
51
- }, [onSelect, disabled]);
52
- var handleOnChange = React.useCallback(function (event) {
53
- if (disabled) {
54
- return;
55
- }
56
- onChange === null || onChange === void 0 || onChange(event);
57
- if (onSelect && ContentLeftComponent) {
58
- onSelect(value, text);
59
- }
60
- }, [onSelect, disabled]);
61
- var contentProps = _rollupPluginBabelHelpers.objectSpread2({
62
- name: name,
63
- value: value,
64
- checked: checked || isSelected,
65
- disabled: disabled,
66
- tabIndex: 0
67
- }, !disabled && {
68
- onChange: handleOnChange
69
- });
70
- var ContentLeft = React.useMemo(function () {
71
- return index.getValidComponent(ContentLeftComponent, contentProps);
72
- }, [ContentRightComponent, contentProps]);
73
- var ContentRight = React.useMemo(function () {
74
- return index.getValidComponent(ContentRightComponent, contentProps);
75
- }, [ContentRightComponent, contentProps]);
76
- return /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
77
- className: index$1.cx(withDropdownItemIsSelected, withDropdownItemIsDisabled, className),
78
- view: view,
79
- size: size,
80
- id: innerId,
81
- isSelected: isSelected,
82
- role: role,
83
- ref: outerRootRef,
84
- tabIndex: 0,
85
- "aria-disabled": disabled,
86
- onClick: handleOnClick,
87
- "data-value": value
88
- }, rest), text ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DropdownItem_styles.StyledContentLeft, null, ContentLeftComponent && ContentLeft), /*#__PURE__*/React.createElement(DropdownItem_styles.StyledText, null, text), /*#__PURE__*/React.createElement(DropdownItem_styles.StyledContentRight, null, ContentRightComponent && ContentRight)) : children);
89
- });
90
- };
91
- var dropdownItemConfig = {
92
- name: 'DropdownItem',
93
- tag: 'div',
94
- layout: dropdownItemRoot,
95
- base: DropdownItem_styles.base,
96
- variations: {
97
- view: {
98
- css: base.base
99
- },
100
- size: {
101
- css: base$1.base
12
+ var _DisclosureIconWrappe;
13
+ var DropdownItem = function DropdownItem(_ref) {
14
+ var item = _ref.item,
15
+ path = _ref.path,
16
+ focusedPath = _ref.focusedPath,
17
+ currentLevel = _ref.currentLevel,
18
+ index$1 = _ref.index,
19
+ itemRole = _ref.itemRole,
20
+ closeOnSelect = _ref.closeOnSelect,
21
+ handleGlobalToggle = _ref.handleGlobalToggle,
22
+ onHover = _ref.onHover,
23
+ onItemSelect = _ref.onItemSelect,
24
+ onItemClick = _ref.onItemClick,
25
+ ariaControls = _ref.ariaControls,
26
+ ariaExpanded = _ref.ariaExpanded,
27
+ ariaHasPopup = _ref.ariaHasPopup,
28
+ ariaLevel = _ref.ariaLevel,
29
+ ariaLabel = _ref.ariaLabel,
30
+ variant = _ref.variant,
31
+ hasArrow = _ref.hasArrow;
32
+ var value = item.value,
33
+ label = item.label,
34
+ disabled = item.disabled,
35
+ isDisabled = item.isDisabled,
36
+ contentLeft = item.contentLeft,
37
+ contentRight = item.contentRight;
38
+ var ref = React.useRef(null);
39
+ var isDisabledClassName = disabled || isDisabled ? Dropdown_tokens.classes.dropdownItemIsDisabled : undefined;
40
+ var focusedClass = currentLevel === focusedPath.length - 1 && index$1 === (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[currentLevel]) ? Dropdown_tokens.classes.dropdownItemIsFocused : undefined;
41
+ var activeClass = value === (path === null || path === void 0 ? void 0 : path[currentLevel + 1]) ? Dropdown_tokens.classes.dropdownItemIsActive : undefined;
42
+ React.useEffect(function () {
43
+ if (focusedClass && ref !== null && ref !== void 0 && ref.current) {
44
+ ref.current.scrollIntoView({
45
+ behavior: 'smooth',
46
+ block: 'center',
47
+ inline: 'center'
48
+ });
49
+ }
50
+ }, [focusedClass]);
51
+ var handleClick = function handleClick(event) {
52
+ if (disabled || isDisabled) {
53
+ return;
54
+ }
55
+ if (onItemSelect) {
56
+ onItemSelect(item, event);
57
+ }
58
+ if (onItemClick) {
59
+ onItemClick(item, event);
60
+ }
61
+ if (handleGlobalToggle && closeOnSelect) {
62
+ handleGlobalToggle(false, event);
63
+ }
64
+ };
65
+ var handleHover = function handleHover() {
66
+ if (onHover) {
67
+ onHover(index$1);
102
68
  }
103
- },
104
- defaults: {
105
- view: 'primary',
106
- size: 'm'
107
- }
69
+ };
70
+ return /*#__PURE__*/React.createElement(DropdownItem_styles.Wrapper, {
71
+ className: index.cx(isDisabledClassName, focusedClass, activeClass),
72
+ id: value.toString(),
73
+ role: itemRole,
74
+ ref: ref,
75
+ "aria-disabled": disabled || isDisabled,
76
+ onClick: handleClick,
77
+ onMouseEnter: handleHover,
78
+ variant: variant,
79
+ "aria-controls": ariaControls,
80
+ "aria-expanded": ariaExpanded,
81
+ "aria-haspopup": ariaHasPopup,
82
+ "aria-level": ariaLevel,
83
+ "aria-label": ariaLabel
84
+ }, contentLeft && /*#__PURE__*/React.createElement(DropdownItem_styles.StyledContentLeft, null, contentLeft), /*#__PURE__*/React.createElement(DropdownItem_styles.StyledText, null, label), contentRight && /*#__PURE__*/React.createElement(DropdownItem_styles.StyledContentRight, null, contentRight), item.items && hasArrow && (_DisclosureIconWrappe || (_DisclosureIconWrappe = /*#__PURE__*/React.createElement(DropdownItem_styles.DisclosureIconWrapper, null, /*#__PURE__*/React.createElement(IconDisclosureRight.IconDisclosureRight, {
85
+ size: "xs",
86
+ color: "inherit"
87
+ })))));
108
88
  };
109
89
 
110
- exports.dropdownItemConfig = dropdownItemConfig;
111
- exports.dropdownItemRoot = dropdownItemRoot;
90
+ exports.DropdownItem = DropdownItem;
112
91
  //# sourceMappingURL=DropdownItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownItem.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItem/DropdownItem.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../../../engines';\nimport { classes } from '../../Dropdown.tokens';\nimport { cx } from '../../../../utils';\nimport { getValidComponent } from '../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { StyledContentLeft, StyledContentRight, StyledText, base } from './DropdownItem.styles';\nimport type { DropdownItemProps } from './DropdownItem.type';\n\n/**\n * Элемент выпадающего списка\n */\nexport const dropdownItemRoot = (Root: RootProps<HTMLDivElement, DropdownItemProps>) =>\n forwardRef<HTMLDivElement, DropdownItemProps>(\n (\n {\n id,\n className,\n children,\n text,\n isSelected,\n name,\n checked,\n value,\n role,\n view,\n size,\n disabled,\n contentLeft: ContentLeftComponent,\n contentRight: ContentRightComponent,\n onSelect,\n onClick,\n onChange,\n ...rest\n },\n outerRootRef,\n ) => {\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n\n const withDropdownItemIsSelected = checked || isSelected ? classes.dropdownItemIsSelected : undefined;\n const withDropdownItemIsDisabled = disabled ? classes.dropdownItemIsDisabled : undefined;\n\n const handleOnClick = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n if (disabled) {\n return;\n }\n\n onClick?.(event);\n\n if (onSelect && !ContentLeftComponent) {\n onSelect(value, text);\n }\n },\n [onSelect, disabled],\n );\n\n const handleOnChange = useCallback(\n (event: React.MouseEvent<HTMLInputElement>) => {\n if (disabled) {\n return;\n }\n\n onChange?.(event);\n\n if (onSelect && ContentLeftComponent) {\n onSelect(value, text);\n }\n },\n [onSelect, disabled],\n );\n\n const contentProps = {\n name,\n value,\n checked: checked || isSelected,\n disabled,\n tabIndex: 0,\n ...(!disabled && { onChange: handleOnChange }),\n };\n\n const ContentLeft = useMemo(() => getValidComponent(ContentLeftComponent, contentProps), [\n ContentRightComponent,\n contentProps,\n ]);\n\n const ContentRight = useMemo(() => getValidComponent(ContentRightComponent, contentProps), [\n ContentRightComponent,\n contentProps,\n ]);\n\n return (\n <Root\n className={cx(withDropdownItemIsSelected, withDropdownItemIsDisabled, className)}\n view={view}\n size={size}\n id={innerId}\n isSelected={isSelected}\n role={role}\n ref={outerRootRef}\n tabIndex={0}\n aria-disabled={disabled}\n onClick={handleOnClick}\n data-value={value}\n {...rest}\n >\n {text ? (\n <>\n <StyledContentLeft>{ContentLeftComponent && ContentLeft}</StyledContentLeft>\n <StyledText>{text}</StyledText>\n <StyledContentRight>{ContentRightComponent && ContentRight}</StyledContentRight>\n </>\n ) : (\n children\n )}\n </Root>\n );\n },\n );\n\nexport const dropdownItemConfig = {\n name: 'DropdownItem',\n tag: 'div',\n layout: dropdownItemRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["dropdownItemRoot","Root","forwardRef","_ref","outerRootRef","id","className","children","text","isSelected","name","checked","value","role","view","size","disabled","ContentLeftComponent","contentLeft","ContentRightComponent","contentRight","onSelect","onClick","onChange","rest","_objectWithoutProperties","_excluded","uniqId","safeUseId","innerId","withDropdownItemIsSelected","classes","dropdownItemIsSelected","undefined","withDropdownItemIsDisabled","dropdownItemIsDisabled","handleOnClick","useCallback","event","handleOnChange","contentProps","_objectSpread","tabIndex","ContentLeft","useMemo","getValidComponent","ContentRight","React","createElement","_extends","cx","ref","Fragment","StyledContentLeft","StyledText","StyledContentRight","dropdownItemConfig","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;AAaA;AACA;AACA;IACaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAkD,EAAA;AAAA,EAAA,oBAC/EC,gBAAU,CACN,UAAAC,IAAA,EAqBIC,YAAY,EACX;AAAA,IAAA,IApBGC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MACFC,SAAS,GAAAH,IAAA,CAATG,SAAS;MACTC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;MACRC,IAAI,GAAAL,IAAA,CAAJK,IAAI;MACJC,UAAU,GAAAN,IAAA,CAAVM,UAAU;MACVC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,OAAO,GAAAR,IAAA,CAAPQ,OAAO;MACPC,KAAK,GAAAT,IAAA,CAALS,KAAK;MACLC,IAAI,GAAAV,IAAA,CAAJU,IAAI;MACJC,IAAI,GAAAX,IAAA,CAAJW,IAAI;MACJC,IAAI,GAAAZ,IAAA,CAAJY,IAAI;MACJC,QAAQ,GAAAb,IAAA,CAARa,QAAQ;MACKC,oBAAoB,GAAAd,IAAA,CAAjCe,WAAW;MACGC,qBAAqB,GAAAhB,IAAA,CAAnCiB,YAAY;MACZC,QAAQ,GAAAlB,IAAA,CAARkB,QAAQ;MACRC,OAAO,GAAAnB,IAAA,CAAPmB,OAAO;MACPC,QAAQ,GAAAp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,eAAAA,KAAA,CAAAC,aAAA,CAACK,qCAAiB,EAAEpC,IAAAA,EAAAA,oBAAoB,IAAI0B,WAA+B,CAAC,eAC5EI,KAAA,CAAAC,aAAA,CAACM,8BAAU,QAAE9C,IAAiB,CAAC,eAC/BuC,KAAA,CAAAC,aAAA,CAACO,sCAAkB,QAAEpC,qBAAqB,IAAI2B,YAAiC,CACjF,CAAC,GAEHvC,QAEF,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMiD,kBAAkB,GAAG;AAC9B9C,EAAAA,IAAI,EAAE,cAAc;AACpB+C,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE1D,gBAAgB;AACxB2D,EAAAA,IAAI,EAAJA,wBAAI;AACJC,EAAAA,UAAU,EAAE;AACR9C,IAAAA,IAAI,EAAE;AACF+C,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD/C,IAAAA,IAAI,EAAE;AACF8C,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNlD,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"DropdownItem.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItem/DropdownItem.tsx"],"sourcesContent":["import React, { useEffect, useRef, FC } from 'react';\n\nimport { classes } from '../../Dropdown.tokens';\nimport { cx } from '../../../../utils';\nimport { IconDisclosureRight } from '../../../_Icon';\n\nimport {\n StyledContentLeft,\n StyledContentRight,\n StyledText,\n Wrapper,\n DisclosureIconWrapper,\n} from './DropdownItem.styles';\nimport type { DropdownItemProps } from './DropdownItem.type';\n\nexport const DropdownItem: FC<DropdownItemProps> = ({\n item,\n path,\n focusedPath,\n currentLevel,\n index,\n itemRole,\n closeOnSelect,\n handleGlobalToggle,\n onHover,\n onItemSelect,\n onItemClick,\n ariaControls,\n ariaExpanded,\n ariaHasPopup,\n ariaLevel,\n ariaLabel,\n variant,\n hasArrow,\n}) => {\n const { value, label, disabled, isDisabled, contentLeft, contentRight } = item;\n\n const ref = useRef<HTMLLIElement | null>(null);\n\n const isDisabledClassName = disabled || isDisabled ? classes.dropdownItemIsDisabled : undefined;\n const focusedClass =\n currentLevel === focusedPath.length - 1 && index === focusedPath?.[currentLevel]\n ? classes.dropdownItemIsFocused\n : undefined;\n const activeClass = value === path?.[currentLevel + 1] ? classes.dropdownItemIsActive : undefined;\n\n useEffect(() => {\n if (focusedClass && ref?.current) {\n ref.current.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n }\n }, [focusedClass]);\n\n const handleClick = (event: React.MouseEvent<HTMLLIElement>): void => {\n if (disabled || isDisabled) {\n return;\n }\n\n if (onItemSelect) {\n onItemSelect(item, event);\n }\n\n if (onItemClick) {\n onItemClick(item, event);\n }\n\n if (handleGlobalToggle && closeOnSelect) {\n handleGlobalToggle(false, event);\n }\n };\n\n const handleHover = () => {\n if (onHover) {\n onHover(index);\n }\n };\n\n return (\n <Wrapper\n className={cx(isDisabledClassName, focusedClass, activeClass)}\n id={value.toString()}\n role={itemRole}\n ref={ref}\n aria-disabled={disabled || isDisabled}\n onClick={handleClick}\n onMouseEnter={handleHover}\n variant={variant}\n aria-controls={ariaControls}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-level={ariaLevel}\n aria-label={ariaLabel}\n >\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n <StyledText>{label}</StyledText>\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n\n {item.items && hasArrow && (\n <DisclosureIconWrapper>\n <IconDisclosureRight size=\"xs\" color=\"inherit\" />\n </DisclosureIconWrapper>\n )}\n </Wrapper>\n );\n};\n"],"names":["DropdownItem","_ref","item","path","focusedPath","currentLevel","index","itemRole","closeOnSelect","handleGlobalToggle","onHover","onItemSelect","onItemClick","ariaControls","ariaExpanded","ariaHasPopup","ariaLevel","ariaLabel","variant","hasArrow","value","label","disabled","isDisabled","contentLeft","contentRight","ref","useRef","isDisabledClassName","classes","dropdownItemIsDisabled","undefined","focusedClass","length","dropdownItemIsFocused","activeClass","dropdownItemIsActive","useEffect","current","scrollIntoView","behavior","block","inline","handleClick","event","handleHover","React","createElement","Wrapper","className","cx","id","toString","role","onClick","onMouseEnter","StyledContentLeft","StyledText","StyledContentRight","items","_DisclosureIconWrappe","DisclosureIconWrapper","IconDisclosureRight","size","color"],"mappings":";;;;;;;;;;;;IAeaA,YAAmC,GAAG,SAAtCA,YAAmCA,CAAAC,IAAA,EAmB1C;AAAA,EAAA,IAlBFC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IACZC,OAAK,GAAAL,IAAA,CAALK,KAAK;IACLC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;IACRC,aAAa,GAAAP,IAAA,CAAbO,aAAa;IACbC,kBAAkB,GAAAR,IAAA,CAAlBQ,kBAAkB;IAClBC,OAAO,GAAAT,IAAA,CAAPS,OAAO;IACPC,YAAY,GAAAV,IAAA,CAAZU,YAAY;IACZC,WAAW,GAAAX,IAAA,CAAXW,WAAW;IACXC,YAAY,GAAAZ,IAAA,CAAZY,YAAY;IACZC,YAAY,GAAAb,IAAA,CAAZa,YAAY;IACZC,YAAY,GAAAd,IAAA,CAAZc,YAAY;IACZC,SAAS,GAAAf,IAAA,CAATe,SAAS;IACTC,SAAS,GAAAhB,IAAA,CAATgB,SAAS;IACTC,OAAO,GAAAjB,IAAA,CAAPiB,OAAO;IACPC,QAAQ,GAAAlB,IAAA,CAARkB,QAAQ,CAAA;AAER,EAAA,IAAQC,KAAK,GAA6DlB,IAAI,CAAtEkB,KAAK;IAAEC,KAAK,GAAsDnB,IAAI,CAA/DmB,KAAK;IAAE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AA+B,CAAC,eACpEsB,KAAA,CAAAC,aAAA,CAACU,8BAAU,EAAEpC,IAAAA,EAAAA,KAAkB,CAAC,EAC/BI,YAAY,iBAAIqB,KAAA,CAAAC,aAAA,CAACW,sCAAkB,EAAA,IAAA,EAAEjC,YAAiC,CAAC,EAEvEvB,IAAI,CAACyD,KAAK,IAAIxC,QAAQ,KAAAyC,qBAAA,KAAAA,qBAAA,gBACnBd,KAAA,CAAAC,aAAA,CAACc,yCAAqB,qBAClBf,KAAA,CAAAC,aAAA,CAACe,uCAAmB,EAAA;AAACC,IAAAA,IAAI,EAAC,IAAI;AAACC,IAAAA,KAAK,EAAC,SAAA;GAAW,CAC7B,CAAC,CAAA,CAEvB,CAAC,CAAA;AAElB;;;;"}
@@ -1,10 +1,10 @@
1
- import './DropdownItem.styles_1juhjtq.css';
1
+ import './DropdownItem.styles_1o4szyu.css';
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var react = require('@linaria/react');
7
- require('focus-visible');
7
+ var Dropdown_tokens = require('../../Dropdown.tokens.js');
8
8
 
9
9
  var StyledContentLeft = /*#__PURE__*/react.styled('div')({
10
10
  name: "StyledContentLeft",
@@ -16,15 +16,100 @@ var StyledContentRight = /*#__PURE__*/react.styled('div')({
16
16
  "class": "sz6s14y",
17
17
  propsAsIs: false
18
18
  });
19
+ var DisclosureIconWrapper = /*#__PURE__*/react.styled('div')({
20
+ name: "DisclosureIconWrapper",
21
+ "class": "d1m97l2m",
22
+ propsAsIs: false
23
+ });
19
24
  var StyledText = /*#__PURE__*/react.styled('div')({
20
25
  name: "StyledText",
21
- "class": "s1m97l2m",
26
+ "class": "soib72h",
22
27
  propsAsIs: false
23
28
  });
24
- var base = "boib72h";
25
29
 
30
+ // TODO: Remove baseContent after refactoring a Select component
31
+ // export const baseContent = `
32
+ // box-sizing: content-box;
33
+ // display: flex;
34
+ // align-items: center;
35
+ // user-select: none;
36
+ //
37
+ // :focus {
38
+ // outline: none;
39
+ // }
40
+ //
41
+ // ${addFocus({
42
+ // outlineSize: '0.0625rem',
43
+ // outlineOffset: '0',
44
+ // outlineColor: `var(${tokens.focusColor})`,
45
+ // outlineRadius: `var(${tokens.itemBorderRadius})`,
46
+ // hasTransition: false,
47
+ // customFocusRules: `
48
+ // &.${classes.dropdownItemIsFocused}:before {
49
+ // outline: none;
50
+ // box-shadow: 0 0 0 0.0625rem var(${tokens.focusColor});
51
+ // }
52
+ // `,
53
+ // })};
54
+ //
55
+ // width: 100%;
56
+ //
57
+ // font-family: var(${tokens.itemFontFamily});
58
+ // font-size: var(${tokens.itemFontSize});
59
+ // font-style: var(${tokens.itemFontStyle});
60
+ // font-weight: var(${tokens.itemFontWeightBold});
61
+ // letter-spacing: var(${tokens.itemFontLetterSpacing});
62
+ // line-height: var(${tokens.itemFontLineHeight});
63
+ //
64
+ // background: var(${tokens.itemBackground});
65
+ // color: var(${tokens.itemColor});
66
+ // border-radius: var(${tokens.itemBorderRadius});
67
+ //
68
+ // padding: var(${tokens.itemPaddingTop}) var(${tokens.itemPaddingRight}) var(${tokens.itemPaddingBottom}) var(${
69
+ // tokens.itemPaddingLeft
70
+ // });
71
+ //
72
+ // margin: 0;
73
+ //
74
+ // &:hover:not(.${classes.dropdownItemIsDisabled}) {
75
+ // cursor: pointer;
76
+ // background: var(${tokens.itemBackgroundHover});
77
+ // }
78
+ //
79
+ // &.${classes.dropdownItemIsActive} {
80
+ // background: var(${tokens.itemBackgroundHover});
81
+ // }
82
+ //
83
+ // &.${classes.dropdownItemIsDisabled} {
84
+ // opacity: var(${tokens.disabledOpacity});
85
+ // cursor: not-allowed;
86
+ // }
87
+ // `;
88
+ var _exp3 = function _exp3() {
89
+ return function (_ref) {
90
+ var variant = _ref.variant;
91
+ return "var(".concat(variant === 'tight' ? Dropdown_tokens.tokens.itemPaddingTopTight : Dropdown_tokens.tokens.itemPaddingTop, ")");
92
+ };
93
+ };
94
+ var _exp5 = function _exp5() {
95
+ return function (_ref2) {
96
+ var variant = _ref2.variant;
97
+ return "var(".concat(variant === 'tight' ? Dropdown_tokens.tokens.itemPaddingBottomTight : Dropdown_tokens.tokens.itemPaddingBottom, ")");
98
+ };
99
+ };
100
+ var Wrapper = /*#__PURE__*/react.styled('li')({
101
+ name: "Wrapper",
102
+ "class": "w6l2f0g",
103
+ propsAsIs: false,
104
+ vars: {
105
+ "w6l2f0g-0": [/*#__PURE__*/_exp3()],
106
+ "w6l2f0g-1": [/*#__PURE__*/_exp5()]
107
+ }
108
+ });
109
+
110
+ exports.DisclosureIconWrapper = DisclosureIconWrapper;
26
111
  exports.StyledContentLeft = StyledContentLeft;
27
112
  exports.StyledContentRight = StyledContentRight;
28
113
  exports.StyledText = StyledText;
29
- exports.base = base;
114
+ exports.Wrapper = Wrapper;
30
115
  //# sourceMappingURL=DropdownItem.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownItem.styles.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItem/DropdownItem.styles.ts"],"sourcesContent":["import { css } from '@linaria/core';\nimport { styled } from '@linaria/react';\n\nimport { classes, tokens } from '../../Dropdown.tokens';\nimport { addFocus, applyEllipsis } from '../../../../mixins';\n\nexport const StyledContentLeft = styled.div`\n display: inline-flex;\n\n min-width: var(${tokens.itemContentLeftWidth});\n color: var(${tokens.itemContentLeftColor});\n`;\n\nexport const StyledContentRight = styled.div`\n margin-left: auto;\n display: inline-flex;\n\n min-width: var(${tokens.itemContentRightWidth});\n color: var(${tokens.itemContentRightColor});\n`;\n\nexport const StyledText = styled.div`\n ${applyEllipsis()};\n`;\n\n// INFO: Для возможности переиспользования стилей в других компонентах\nexport const baseContent = `\n box-sizing: content-box;\n display: flex;\n align-items: center;\n user-select: none;\n\n :focus {\n outline: none;\n }\n\n ${addFocus({\n outlineSize: '0.0625rem',\n outlineOffset: '0',\n outlineColor: `var(${tokens.focusColor})`,\n outlineRadius: `var(${tokens.itemBorderRadius})`,\n hasTransition: false,\n })};\n\n width: 100%;\n\n font-family: var(${tokens.itemFontFamily});\n font-size: var(${tokens.itemFontSize});\n font-style: var(${tokens.itemFontStyle});\n font-weight: var(${tokens.itemFontWeightBold});\n letter-spacing: var(${tokens.itemFontLetterSpacing});\n line-height: var(${tokens.itemFontLineHeight});\n\n background: var(${tokens.itemBackground});\n color: var(${tokens.itemColor});\n border-radius: var(${tokens.itemBorderRadius});\n\n width: var(${tokens.itemWidth});\n height: var(${tokens.itemHeight});\n\n padding: var(${tokens.itemPaddingTop}) var(${tokens.itemPaddingRight}) var(${tokens.itemPaddingBottom})\n var(${tokens.itemPaddingLeft});\n\n margin: var(${tokens.itemMarginTop}) var(${tokens.itemMarginRight}) var(${tokens.itemMarginBottom})\n var(${tokens.itemMarginLeft});\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n cursor: pointer;\n background: var(${tokens.itemBackgroundHover});\n }\n\n &.${String(classes.dropdownItemIsSelected)} {\n color: var(${tokens.itemColorSelected});\n background: var(${tokens.itemBackgroundSelected});\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n background: var(${tokens.itemBackgroundSelectedHover});\n }\n }\n\n &.${classes.dropdownItemIsDisabled} {\n opacity: var(${tokens.disabledOpacity});\n cursor: not-allowed;\n }\n`;\n\nexport const base = css`\n ${baseContent};\n`;\n"],"names":["StyledContentLeft","styled","name","class","propsAsIs","StyledContentRight","StyledText","base"],"mappings":";;;;;;;AAMO,IAAMA,iBAAiB,gBAAGC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,mBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAKtC,EAAA;AAEM,IAAMC,kBAAkB,gBAAGJ,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,oBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAMvC,EAAA;AAEM,IAAME,UAAU,gBAAGL,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAE/B,EAAA;AA+DM,IAAMG,IAAI,GAEhB;;;;;;;"}
1
+ {"version":3,"file":"DropdownItem.styles.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItem/DropdownItem.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { classes, tokens } from '../../Dropdown.tokens';\nimport { addFocus, applyEllipsis } from '../../../../mixins';\nimport { DropdownProps } from '../../Dropdown.types';\n\nexport const StyledContentLeft = styled.div`\n display: inline-flex;\n`;\n\nexport const StyledContentRight = styled.div`\n margin-left: auto;\n display: inline-flex;\n`;\n\nexport const DisclosureIconWrapper = styled.div`\n line-height: 0;\n color: var(${tokens.disclosureIconColor});\n`;\n\nexport const StyledText = styled.div`\n ${applyEllipsis()};\n flex: 1;\n`;\n\n// TODO: Remove baseContent after refactoring a Select component\n// export const baseContent = `\n// box-sizing: content-box;\n// display: flex;\n// align-items: center;\n// user-select: none;\n//\n// :focus {\n// outline: none;\n// }\n//\n// ${addFocus({\n// outlineSize: '0.0625rem',\n// outlineOffset: '0',\n// outlineColor: `var(${tokens.focusColor})`,\n// outlineRadius: `var(${tokens.itemBorderRadius})`,\n// hasTransition: false,\n// customFocusRules: `\n// &.${classes.dropdownItemIsFocused}:before {\n// outline: none;\n// box-shadow: 0 0 0 0.0625rem var(${tokens.focusColor});\n// }\n// `,\n// })};\n//\n// width: 100%;\n//\n// font-family: var(${tokens.itemFontFamily});\n// font-size: var(${tokens.itemFontSize});\n// font-style: var(${tokens.itemFontStyle});\n// font-weight: var(${tokens.itemFontWeightBold});\n// letter-spacing: var(${tokens.itemFontLetterSpacing});\n// line-height: var(${tokens.itemFontLineHeight});\n//\n// background: var(${tokens.itemBackground});\n// color: var(${tokens.itemColor});\n// border-radius: var(${tokens.itemBorderRadius});\n//\n// padding: var(${tokens.itemPaddingTop}) var(${tokens.itemPaddingRight}) var(${tokens.itemPaddingBottom}) var(${\n// tokens.itemPaddingLeft\n// });\n//\n// margin: 0;\n//\n// &:hover:not(.${classes.dropdownItemIsDisabled}) {\n// cursor: pointer;\n// background: var(${tokens.itemBackgroundHover});\n// }\n//\n// &.${classes.dropdownItemIsActive} {\n// background: var(${tokens.itemBackgroundHover});\n// }\n//\n// &.${classes.dropdownItemIsDisabled} {\n// opacity: var(${tokens.disabledOpacity});\n// cursor: not-allowed;\n// }\n// `;\n\nexport const Wrapper = styled.li<{ variant: DropdownProps['variant'] }>`\n display: flex;\n align-items: center;\n margin: 0;\n box-sizing: content-box;\n padding-top: ${({ variant }) => `var(${variant === 'tight' ? tokens.itemPaddingTopTight : tokens.itemPaddingTop})`};\n padding-right: var(${tokens.itemPaddingRight});\n padding-bottom: ${({ variant }) =>\n `var(${variant === 'tight' ? tokens.itemPaddingBottomTight : tokens.itemPaddingBottom})`};\n padding-left: var(${tokens.itemPaddingLeft});\n font-family: var(${tokens.itemFontFamily});\n font-size: var(${tokens.itemFontSize});\n font-style: var(${tokens.itemFontStyle});\n font-weight: var(${tokens.itemFontWeightBold});\n letter-spacing: var(${tokens.itemFontLetterSpacing});\n line-height: var(${tokens.itemFontLineHeight});\n background: var(${tokens.itemBackground});\n color: var(${tokens.itemColor});\n border-radius: var(${tokens.itemBorderRadius});\n user-select: none;\n\n &:hover:not(.${classes.dropdownItemIsDisabled}) {\n cursor: pointer;\n background: var(${tokens.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsActive} {\n background: var(${tokens.itemBackgroundHover});\n }\n\n &.${classes.dropdownItemIsDisabled} {\n opacity: var(${tokens.disabledOpacity});\n cursor: not-allowed;\n }\n\n :focus {\n outline: none;\n }\n\n ${addFocus({\n outlineSize: '0.0625rem',\n outlineOffset: '0',\n outlineColor: `var(${tokens.focusColor})`,\n outlineRadius: `var(${tokens.itemBorderRadius})`,\n hasTransition: false,\n customFocusRules: `\n &.${classes.dropdownItemIsFocused}:before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(${tokens.focusColor});\n }\n `,\n })};\n`;\n"],"names":["StyledContentLeft","styled","name","class","propsAsIs","StyledContentRight","DisclosureIconWrapper","StyledText","_exp3","_ref","variant","tokens","itemPaddingTopTight","itemPaddingTop","_exp5","_ref2","itemPaddingBottomTight","itemPaddingBottom","Wrapper","vars"],"mappings":";;;;;;;AAMO,IAAMA,iBAAiB,gBAAGC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,mBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAEtC,EAAA;AAEM,IAAMC,kBAAkB,gBAAGJ,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,oBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAGvC,EAAA;AAEM,IAAME,qBAAqB,gBAAGL,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,uBAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAG1C,EAAA;AAEM,IAAMG,UAAU,gBAAGN,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,YAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAG/B,EAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,IAAAI,KAAA,GAjFkBA,SAiFlBA,KAAAA,GAAA;AAAA,EAAA,OAOmB,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAGC,OAAAA,GAAAA,IAAAA,CAAAA,OAAAA,CAAAA;AAAAA,IAAAA,OAAAA,MAAAA,CAAAA,MAAAA,CAAqBA,OAAO,KAAK,OAAO,GAAGC,sBAAM,CAACC,mBAAmB,GAAGD,sBAAM,CAACE,cAAe,EAAA,GAAA,CAAA,CAAA;GAAE,CAAA;AAAA,CAAA,CAAA;AAAA,IAAAC,KAAA,GAxFpGA,SAwFoGA,KAAAA,GAAA;AAAA,EAAA,OAEhG,UAAAC,KAAA,EAAA;AAAA,IAAA,IAAGL,OAAAA,GAAAA,KAAAA,CAAAA,OAAAA,CAAAA;AAAAA,IAAAA,OAAAA,MAAAA,CAAAA,MAAAA,CACVA,OAAO,KAAK,OAAO,GAAGC,sBAAM,CAACK,sBAAsB,GAAGL,sBAAM,CAACM,iBAAkB,EAAA,GAAA,CAAA,CAAA;GAAE,CAAA;AAAA,CAAA,CAAA;AARzF,IAAMC,OAAO,gBAAGjB,YAAM,CAAA,IAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,SAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAAe,EAAAA,IAAA,EAAA;AAAA,IAAA,WAAA,EAAA,cAKVX,KAAmG,EAAA,CAAA;AAAA,IAAA,WAAA,EAAA,cAEhGM,KAC0E,EAAA,CAAA;AAAA,GAAA;AAAA,CA4C/F;;;;;;;;"}
@@ -0,0 +1,5 @@
1
+ .s1gkzlls{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
2
+ .sz6s14y{margin-left:auto;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
3
+ .d1m97l2m{line-height:0;color:var(--plasma-dropdown-disclosure-icon-color);}
4
+ .soib72h{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-flex:1;-ms-flex:1;flex:1;}
5
+ .w6l2f0g{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0;box-sizing:content-box;padding-top:var(--w6l2f0g-0);padding-right:var(--plasma-dropdown-item-padding-right);padding-bottom:var(--w6l2f0g-1);padding-left:var(--plasma-dropdown-item-padding-left);font-family:var(--plasma-dropdown-item-font-family);font-size:var(--plasma-dropdown-item-font-size);font-style:var(--plasma-dropdown-item-font-style);font-weight:var(--plasma-dropdown-item-letter-spacing);-webkit-letter-spacing:var(--plasma-dropdown-item-line-height);-moz-letter-spacing:var(--plasma-dropdown-item-line-height);-ms-letter-spacing:var(--plasma-dropdown-item-line-height);letter-spacing:var(--plasma-dropdown-item-line-height);line-height:var(--plasma-dropdown-item-font-weight);background:var(--plasma-dropdown-item-background);color:var(--plasma-dropdown-item-color);border-radius:var(--plasma-dropdown-item-border-radius);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;}.w6l2f0g:hover:not(.dropdown-item-is-disabled){cursor:pointer;background:var(--plasma-dropdown-item-background-hover);}.w6l2f0g.dropdown-item-is-active{background:var(--plasma-dropdown-item-background-hover);}.w6l2f0g.dropdown-item-is-disabled{opacity:var(--plasma-dropdown-disabled-opacity);cursor:not-allowed;}.w6l2f0g:focus{outline:none;}.w6l2f0g::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:var(--plasma-dropdown-item-border-radius);-webkit-transition:none;transition:none;pointer-events:none;}.w6l2f0g.dropdown-item-is-focused:before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-dropdown-focus-color);}
@@ -0,0 +1,30 @@
1
+ import './DropdownItem.styles_12e50g5.css';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var react = require('@linaria/react');
7
+ require('focus-visible');
8
+
9
+ var StyledContentLeft = /*#__PURE__*/react.styled('div')({
10
+ name: "StyledContentLeft",
11
+ "class": "s1iqs5in",
12
+ propsAsIs: false
13
+ });
14
+ var StyledContentRight = /*#__PURE__*/react.styled('div')({
15
+ name: "StyledContentRight",
16
+ "class": "sfg3dyd",
17
+ propsAsIs: false
18
+ });
19
+ var StyledText = /*#__PURE__*/react.styled('div')({
20
+ name: "StyledText",
21
+ "class": "s1dea6tl",
22
+ propsAsIs: false
23
+ });
24
+ var base = "b1b2nce8";
25
+
26
+ exports.StyledContentLeft = StyledContentLeft;
27
+ exports.StyledContentRight = StyledContentRight;
28
+ exports.StyledText = StyledText;
29
+ exports.base = base;
30
+ //# sourceMappingURL=DropdownItem.styles.js.map