@salutejs/plasma-new-hope 0.77.1-canary.1199.8844794649.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 (343) 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/_Icon/Icon.assets/DisclosureRight.js +1 -2
  73. package/cjs/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
  74. package/cjs/index.css +18 -8
  75. package/cjs/index.js +8 -2
  76. package/cjs/index.js.map +1 -1
  77. package/es/components/Combobox/Combobox.css +17 -7
  78. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +15 -6
  79. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
  80. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +15 -6
  81. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
  82. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +15 -6
  83. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
  84. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +15 -6
  85. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
  86. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +4 -23
  87. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +82 -11
  88. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
  89. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +19 -10
  90. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
  91. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +4 -0
  92. package/es/components/Combobox/utils/index.js +19 -0
  93. package/es/components/Combobox/utils/index.js.map +1 -0
  94. package/es/components/Dropdown/Dropdown.css +25 -2
  95. package/es/components/Dropdown/Dropdown.js +144 -60
  96. package/es/components/Dropdown/Dropdown.js.map +1 -1
  97. package/es/components/Dropdown/Dropdown.styles.js +39 -7
  98. package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
  99. package/es/components/Dropdown/Dropdown.styles_1tihqkp.css +3 -0
  100. package/es/components/Dropdown/Dropdown.tokens.js +26 -23
  101. package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
  102. package/es/components/Dropdown/hooks/useHashMaps.js +27 -0
  103. package/es/components/Dropdown/hooks/useHashMaps.js.map +1 -0
  104. package/es/components/Dropdown/hooks/useKeyboardNavigation.js +196 -0
  105. package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +1 -0
  106. package/es/components/Dropdown/reducers/focusedPathReducer.js +33 -0
  107. package/es/components/Dropdown/reducers/focusedPathReducer.js.map +1 -0
  108. package/es/components/Dropdown/reducers/pathReducer.js +37 -0
  109. package/es/components/Dropdown/reducers/pathReducer.js.map +1 -0
  110. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +115 -0
  111. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -0
  112. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +7 -4
  113. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +80 -100
  114. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  115. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +89 -5
  116. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  117. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +5 -0
  118. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +23 -0
  119. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +1 -0
  120. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +4 -0
  121. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +4 -0
  122. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +107 -0
  123. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +1 -0
  124. package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +1 -1
  125. package/es/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +1 -0
  126. package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +1 -1
  127. package/es/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +1 -0
  128. package/es/components/Dropdown/utils/index.js +16 -2
  129. package/es/components/Dropdown/utils/index.js.map +1 -1
  130. package/es/components/Pagination/Pagination.css +14 -7
  131. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +14 -7
  132. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  133. package/es/components/Select/Select.css +14 -7
  134. package/es/components/Select/ui/SelectDivider/SelectDivider.css +15 -6
  135. package/es/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
  136. package/es/components/Select/ui/SelectFooter/SelectFooter.css +15 -6
  137. package/es/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
  138. package/es/components/Select/ui/SelectGroup/SelectGroup.css +15 -6
  139. package/es/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
  140. package/es/components/Select/ui/SelectHeader/SelectHeader.css +15 -6
  141. package/es/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
  142. package/es/components/Select/ui/SelectItem/SelectItem.css +16 -7
  143. package/es/components/Select/ui/SelectItem/SelectItem.js +3 -3
  144. package/es/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
  145. package/es/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
  146. package/es/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
  147. package/es/components/Select/ui/SelectItem/{SelectItem.styles_6h17aw.css → SelectItem.styles_vk39mp.css} +1 -1
  148. package/es/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
  149. package/es/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
  150. package/es/index.css +18 -8
  151. package/es/index.js +4 -1
  152. package/es/index.js.map +1 -1
  153. package/package.json +2 -2
  154. package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +91 -2
  155. package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +27 -7
  156. package/styled-components/cjs/components/Combobox/utils/index.js +23 -0
  157. package/styled-components/cjs/components/Dropdown/Dropdown.js +140 -54
  158. package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +22 -7
  159. package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +26 -23
  160. package/styled-components/cjs/components/Dropdown/hooks/useHashMaps.js +29 -0
  161. package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +199 -0
  162. package/styled-components/cjs/components/Dropdown/index.js +9 -1
  163. package/styled-components/cjs/components/Dropdown/reducers/focusedPathReducer.js +40 -0
  164. package/styled-components/cjs/components/Dropdown/reducers/pathReducer.js +44 -0
  165. package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +114 -0
  166. package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +5 -0
  167. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +77 -105
  168. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +83 -18
  169. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +33 -0
  170. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +5 -0
  171. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +119 -0
  172. package/styled-components/cjs/components/Dropdown/ui/index.js +19 -5
  173. package/styled-components/cjs/components/Dropdown/utils/index.js +15 -1
  174. package/styled-components/cjs/components/Dropdown/variations/_size/tokens.json +1 -9
  175. package/styled-components/cjs/components/Dropdown/variations/_view/tokens.json +1 -1
  176. package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.js +1 -1
  177. package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  178. package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
  179. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +25 -0
  180. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.js +11 -0
  181. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +292 -0
  182. package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +90 -3
  183. package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +23 -6
  184. package/styled-components/es/components/Combobox/utils/index.js +15 -0
  185. package/styled-components/es/components/Dropdown/Dropdown.js +142 -55
  186. package/styled-components/es/components/Dropdown/Dropdown.styles.js +18 -5
  187. package/styled-components/es/components/Dropdown/Dropdown.tokens.js +26 -23
  188. package/styled-components/es/components/Dropdown/hooks/useHashMaps.js +23 -0
  189. package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +193 -0
  190. package/styled-components/es/components/Dropdown/index.js +1 -0
  191. package/styled-components/es/components/Dropdown/reducers/focusedPathReducer.js +34 -0
  192. package/styled-components/es/components/Dropdown/reducers/pathReducer.js +38 -0
  193. package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +108 -0
  194. package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +1 -0
  195. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +78 -107
  196. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +80 -14
  197. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +25 -0
  198. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +1 -0
  199. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +111 -0
  200. package/styled-components/es/components/Dropdown/ui/index.js +3 -1
  201. package/styled-components/es/components/Dropdown/utils/index.js +15 -1
  202. package/styled-components/es/components/Dropdown/variations/_size/tokens.json +1 -9
  203. package/styled-components/es/components/Dropdown/variations/_view/tokens.json +1 -1
  204. package/styled-components/es/components/Select/ui/SelectItem/SelectItem.js +2 -2
  205. package/styled-components/es/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  206. package/styled-components/es/components/_Icon/Icon.assets/DisclosureRight.js +1 -2
  207. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +19 -0
  208. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.js +5 -0
  209. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +292 -0
  210. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts +15 -13
  211. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts.map +1 -1
  212. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts +5 -1
  213. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts.map +1 -1
  214. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts +59 -2
  215. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts.map +1 -1
  216. package/types/components/Combobox/utils/index.d.ts +4 -0
  217. package/types/components/Combobox/utils/index.d.ts.map +1 -0
  218. package/types/components/Dropdown/Dropdown.d.ts +4 -4
  219. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  220. package/types/components/Dropdown/Dropdown.styles.d.ts +8 -1
  221. package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
  222. package/types/components/Dropdown/Dropdown.tokens.d.ts +24 -22
  223. package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
  224. package/types/components/Dropdown/Dropdown.types.d.ts +64 -40
  225. package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
  226. package/types/components/Dropdown/hooks/useHashMaps.d.ts +6 -0
  227. package/types/components/Dropdown/hooks/useHashMaps.d.ts.map +1 -0
  228. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts +23 -0
  229. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts.map +1 -0
  230. package/types/components/Dropdown/index.d.ts +3 -1
  231. package/types/components/Dropdown/index.d.ts.map +1 -1
  232. package/types/components/Dropdown/reducers/focusedPathReducer.d.ts +16 -0
  233. package/types/components/Dropdown/reducers/focusedPathReducer.d.ts.map +1 -0
  234. package/types/components/Dropdown/reducers/pathReducer.d.ts +20 -0
  235. package/types/components/Dropdown/reducers/pathReducer.d.ts.map +1 -0
  236. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts +5 -0
  237. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +1 -0
  238. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +26 -0
  239. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +1 -0
  240. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts +2 -56
  241. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
  242. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +5 -2
  243. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
  244. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +44 -38
  245. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
  246. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts +7 -0
  247. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts.map +1 -0
  248. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts +60 -0
  249. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts.map +1 -0
  250. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts +58 -0
  251. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts.map +1 -0
  252. package/types/components/Dropdown/ui/DropdownItemOld/variations/_size/base.d.ts.map +1 -0
  253. package/types/components/Dropdown/ui/DropdownItemOld/variations/_view/base.d.ts.map +1 -0
  254. package/types/components/Dropdown/ui/index.d.ts +3 -1
  255. package/types/components/Dropdown/ui/index.d.ts.map +1 -1
  256. package/types/components/Dropdown/utils/index.d.ts +5 -2
  257. package/types/components/Dropdown/utils/index.d.ts.map +1 -1
  258. package/types/components/Select/ui/SelectItem/SelectItem.d.ts +2 -2
  259. package/types/components/Select/ui/SelectItem/SelectItem.d.ts.map +1 -1
  260. package/types/components/Select/ui/SelectItem/SelectItem.type.d.ts +2 -2
  261. package/types/components/Select/utils/index.d.ts +1 -1
  262. package/types/components/_Icon/Icon.assets/DisclosureRight.d.ts.map +1 -1
  263. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts.map +1 -0
  264. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +13 -0
  265. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +1 -0
  266. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +0 -1
  267. package/cjs/components/Dropdown/Dropdown.styles_1daxhqh.css +0 -2
  268. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +0 -4
  269. package/cjs/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +0 -1
  270. package/cjs/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +0 -1
  271. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +0 -1
  272. package/es/components/Dropdown/Dropdown.styles_1daxhqh.css +0 -2
  273. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +0 -4
  274. package/es/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +0 -1
  275. package/es/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +0 -1
  276. package/styled-components/cjs/components/Dropdown/Dropdown.template-doc.mdx +0 -80
  277. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +0 -19
  278. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +0 -9
  279. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +0 -27
  280. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +0 -13
  281. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +0 -194
  282. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +0 -27
  283. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +0 -13
  284. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
  285. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +0 -27
  286. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +0 -13
  287. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +0 -195
  288. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +0 -27
  289. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +0 -13
  290. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
  291. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.config.js +0 -22
  292. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.js +0 -21
  293. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +0 -277
  294. package/styled-components/es/components/Dropdown/Dropdown.template-doc.mdx +0 -80
  295. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +0 -19
  296. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +0 -9
  297. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +0 -21
  298. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +0 -7
  299. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +0 -194
  300. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +0 -21
  301. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +0 -7
  302. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
  303. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +0 -21
  304. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +0 -7
  305. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +0 -195
  306. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +0 -21
  307. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +0 -7
  308. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +0 -195
  309. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.config.js +0 -16
  310. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.js +0 -15
  311. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +0 -277
  312. package/types/components/Dropdown/ui/DropdownItem/variations/_size/base.d.ts.map +0 -1
  313. package/types/components/Dropdown/ui/DropdownItem/variations/_view/base.d.ts.map +0 -1
  314. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.d.ts.map +0 -1
  315. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts +0 -30
  316. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts.map +0 -1
  317. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts +0 -18
  318. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts.map +0 -1
  319. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts +0 -30
  320. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts.map +0 -1
  321. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts +0 -18
  322. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts.map +0 -1
  323. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts +0 -30
  324. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts.map +0 -1
  325. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts +0 -18
  326. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts.map +0 -1
  327. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts +0 -30
  328. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts.map +0 -1
  329. package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts +0 -15
  330. package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts.map +0 -1
  331. package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts +0 -51
  332. package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts.map +0 -1
  333. /package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base_x642ct.css +0 -0
  334. /package/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base_x642ct.css +0 -0
  335. /package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base_x642ct.css +0 -0
  336. /package/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base_x642ct.css +0 -0
  337. /package/styled-components/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +0 -0
  338. /package/styled-components/cjs/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +0 -0
  339. /package/styled-components/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.js +0 -0
  340. /package/styled-components/es/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.js +0 -0
  341. /package/types/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_size/base.d.ts +0 -0
  342. /package/types/components/Dropdown/ui/{DropdownItem → DropdownItemOld}/variations/_view/base.d.ts +0 -0
  343. /package/types/examples/plasma_b2c/components/Dropdown/{Normal/Dropdown.config.d.ts → Dropdown.config.d.ts} +0 -0
@@ -0,0 +1,196 @@
1
+ var getFurtherPath = function getFurtherPath(focusedPath, focusedToValueMap) {
2
+ var focusedPathAsString = focusedPath.reduce(function (acc, n) {
3
+ return "".concat(acc, "/").concat(n);
4
+ }, '').replace(/^(\/)/, '');
5
+ return focusedToValueMap.get(focusedPathAsString);
6
+ };
7
+ var useKeyNavigation = function useKeyNavigation(_ref) {
8
+ var focusedPath = _ref.focusedPath,
9
+ dispatchFocusedPath = _ref.dispatchFocusedPath,
10
+ path = _ref.path,
11
+ dispatchPath = _ref.dispatchPath,
12
+ pathMap = _ref.pathMap,
13
+ focusedToValueMap = _ref.focusedToValueMap,
14
+ handleGlobalToggle = _ref.handleGlobalToggle,
15
+ closeOnSelect = _ref.closeOnSelect,
16
+ onItemSelect = _ref.onItemSelect,
17
+ onItemClick = _ref.onItemClick;
18
+ var currentLength = pathMap.get(path === null || path === void 0 ? void 0 : path[path.length - 1]) || 0;
19
+ var currentIndex = (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[focusedPath.length - 1]) || 0;
20
+ var onKeyDown = function onKeyDown(event) {
21
+ var code = event.code;
22
+ if (code === 'ArrowUp') {
23
+ if (focusedPath.length) {
24
+ var newIndex = currentIndex <= 0 ? currentLength - 1 : currentIndex - 1;
25
+ dispatchFocusedPath({
26
+ type: 'change_last_focus',
27
+ value: newIndex
28
+ });
29
+ } else {
30
+ dispatchPath({
31
+ type: 'opened_first_level'
32
+ });
33
+ dispatchFocusedPath({
34
+ type: 'set_initial_focus'
35
+ });
36
+ handleGlobalToggle(true, event);
37
+ }
38
+ }
39
+ if (code === 'ArrowDown') {
40
+ if (focusedPath.length) {
41
+ var _newIndex = currentIndex + 1 >= currentLength ? 0 : currentIndex + 1;
42
+ dispatchFocusedPath({
43
+ type: 'change_last_focus',
44
+ value: _newIndex
45
+ });
46
+ } else {
47
+ dispatchPath({
48
+ type: 'opened_first_level'
49
+ });
50
+ dispatchFocusedPath({
51
+ type: 'set_initial_focus'
52
+ });
53
+ handleGlobalToggle(true, event);
54
+ }
55
+ }
56
+ if (code === 'ArrowLeft') {
57
+ if (focusedPath.length) {
58
+ dispatchPath({
59
+ type: 'removed_last_level'
60
+ });
61
+ dispatchFocusedPath({
62
+ type: 'return_prev_focus'
63
+ });
64
+ }
65
+ if (focusedPath.length === 1) {
66
+ handleGlobalToggle(false, event);
67
+ }
68
+ }
69
+ if (code === 'ArrowRight') {
70
+ if (focusedPath.length) {
71
+ var currentItem = getFurtherPath(focusedPath, focusedToValueMap);
72
+ if (currentItem !== null && currentItem !== void 0 && currentItem.items) {
73
+ dispatchPath({
74
+ type: 'added_next_level',
75
+ value: currentItem.value.toString()
76
+ });
77
+ dispatchFocusedPath({
78
+ type: 'add_focus',
79
+ value: 0
80
+ });
81
+ }
82
+ }
83
+ }
84
+ if (code === 'Enter' || code === 'Space') {
85
+ event.preventDefault();
86
+ if (path[0]) {
87
+ var _currentItem = getFurtherPath(focusedPath, focusedToValueMap);
88
+ if (_currentItem !== null && _currentItem !== void 0 && _currentItem.disabled || _currentItem !== null && _currentItem !== void 0 && _currentItem.isDisabled) return;
89
+ if (_currentItem !== null && _currentItem !== void 0 && _currentItem.items) {
90
+ dispatchPath({
91
+ type: 'added_next_level',
92
+ value: _currentItem.value.toString()
93
+ });
94
+ dispatchFocusedPath({
95
+ type: 'add_focus',
96
+ value: 0
97
+ });
98
+ } else {
99
+ if (closeOnSelect) {
100
+ handleGlobalToggle(false, event);
101
+ }
102
+ if (onItemSelect && _currentItem) {
103
+ onItemSelect(_currentItem, event);
104
+ }
105
+ if (onItemClick && _currentItem) {
106
+ onItemClick(_currentItem, event);
107
+ }
108
+ }
109
+ } else {
110
+ dispatchPath({
111
+ type: 'opened_first_level'
112
+ });
113
+ dispatchFocusedPath({
114
+ type: 'set_initial_focus'
115
+ });
116
+ }
117
+ }
118
+ if (code === 'Tab' || code === 'Escape') {
119
+ dispatchFocusedPath({
120
+ type: 'reset'
121
+ });
122
+ dispatchPath({
123
+ type: 'reset'
124
+ });
125
+ handleGlobalToggle(false, event);
126
+ }
127
+ if (code === 'Home') {
128
+ if (path[0]) {
129
+ dispatchFocusedPath({
130
+ type: 'change_last_focus',
131
+ value: 0
132
+ });
133
+ } else {
134
+ dispatchPath({
135
+ type: 'opened_first_level'
136
+ });
137
+ dispatchFocusedPath({
138
+ type: 'set_initial_focus'
139
+ });
140
+ handleGlobalToggle(true, event);
141
+ }
142
+ }
143
+ if (code === 'End') {
144
+ if (path[0]) {
145
+ dispatchFocusedPath({
146
+ type: 'change_last_focus',
147
+ value: currentLength - 1
148
+ });
149
+ } else {
150
+ dispatchPath({
151
+ type: 'opened_first_level'
152
+ });
153
+ dispatchFocusedPath({
154
+ type: 'change_last_focus',
155
+ value: (pathMap.get('root') || 0) - 1
156
+ });
157
+ handleGlobalToggle(true, event);
158
+ }
159
+ }
160
+ if (code === 'PageUp') {
161
+ if (path[0]) {
162
+ if (currentIndex <= 10) {
163
+ dispatchFocusedPath({
164
+ type: 'set_initial_focus'
165
+ });
166
+ } else {
167
+ dispatchFocusedPath({
168
+ type: 'change_last_focus',
169
+ value: currentIndex - 10
170
+ });
171
+ }
172
+ }
173
+ }
174
+ if (code === 'PageDown') {
175
+ if (path[0]) {
176
+ if (currentLength - currentIndex <= 10) {
177
+ dispatchFocusedPath({
178
+ type: 'change_last_focus',
179
+ value: currentLength - 1
180
+ });
181
+ } else {
182
+ dispatchFocusedPath({
183
+ type: 'change_last_focus',
184
+ value: currentIndex + 10
185
+ });
186
+ }
187
+ }
188
+ }
189
+ };
190
+ return {
191
+ onKeyDown: onKeyDown
192
+ };
193
+ };
194
+
195
+ export { useKeyNavigation };
196
+ //# sourceMappingURL=useKeyboardNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeyboardNavigation.js","sources":["../../../../src/components/Dropdown/hooks/useKeyboardNavigation.ts"],"sourcesContent":["import { KeyboardEvent } from 'react';\nimport type { Dispatch } from 'react';\n\nimport { PathAction, PathState } from '../reducers/pathReducer';\nimport { FocusedPathAction, FocusedPathState } from '../reducers/focusedPathReducer';\nimport { HandleGlobalToggleType, DropdownProps } from '../Dropdown.types';\n\nimport { PathMapType, FocusedToValueMapType } from './useHashMaps';\n\nconst getFurtherPath = (focusedPath: FocusedPathState, focusedToValueMap: FocusedToValueMapType) => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n\n return focusedToValueMap.get(focusedPathAsString);\n};\n\ninterface Props {\n focusedPath: FocusedPathState;\n dispatchFocusedPath: Dispatch<FocusedPathAction>;\n path: PathState;\n dispatchPath: Dispatch<PathAction>;\n pathMap: PathMapType;\n focusedToValueMap: FocusedToValueMapType;\n handleGlobalToggle: HandleGlobalToggleType;\n closeOnSelect: DropdownProps['closeOnSelect'];\n onItemSelect: DropdownProps['onItemSelect'];\n onItemClick: DropdownProps['onItemClick'];\n}\n\ninterface ReturnedProps {\n onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;\n}\n\nexport const useKeyNavigation = ({\n focusedPath,\n dispatchFocusedPath,\n path,\n dispatchPath,\n pathMap,\n focusedToValueMap,\n handleGlobalToggle,\n closeOnSelect,\n onItemSelect,\n onItemClick,\n}: Props): ReturnedProps => {\n const currentLength: number = pathMap.get(path?.[path.length - 1]) || 0;\n const currentIndex: number = focusedPath?.[focusedPath.length - 1] || 0;\n\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n const { code } = event;\n\n if (code === 'ArrowUp') {\n if (focusedPath.length) {\n const newIndex = currentIndex <= 0 ? currentLength - 1 : currentIndex - 1;\n dispatchFocusedPath({ type: 'change_last_focus', value: newIndex });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'set_initial_focus' });\n handleGlobalToggle(true, event);\n }\n }\n\n if (code === 'ArrowDown') {\n if (focusedPath.length) {\n const newIndex = currentIndex + 1 >= currentLength ? 0 : currentIndex + 1;\n dispatchFocusedPath({ type: 'change_last_focus', value: newIndex });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'set_initial_focus' });\n handleGlobalToggle(true, event);\n }\n }\n\n if (code === 'ArrowLeft') {\n if (focusedPath.length) {\n dispatchPath({ type: 'removed_last_level' });\n dispatchFocusedPath({ type: 'return_prev_focus' });\n }\n\n if (focusedPath.length === 1) {\n handleGlobalToggle(false, event);\n }\n }\n\n if (code === 'ArrowRight') {\n if (focusedPath.length) {\n const currentItem = getFurtherPath(focusedPath, focusedToValueMap);\n\n if (currentItem?.items) {\n dispatchPath({ type: 'added_next_level', value: currentItem.value.toString() });\n dispatchFocusedPath({ type: 'add_focus', value: 0 });\n }\n }\n }\n\n if (code === 'Enter' || code === 'Space') {\n event.preventDefault();\n\n if (path[0]) {\n const currentItem = getFurtherPath(focusedPath, focusedToValueMap);\n\n if (currentItem?.disabled || currentItem?.isDisabled) return;\n\n if (currentItem?.items) {\n dispatchPath({ type: 'added_next_level', value: currentItem.value.toString() });\n dispatchFocusedPath({ type: 'add_focus', value: 0 });\n } else {\n if (closeOnSelect) {\n handleGlobalToggle(false, event);\n }\n\n if (onItemSelect && currentItem) {\n onItemSelect(currentItem, event);\n }\n\n if (onItemClick && currentItem) {\n onItemClick(currentItem, event);\n }\n }\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'set_initial_focus' });\n }\n }\n\n if (code === 'Tab' || code === 'Escape') {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n\n handleGlobalToggle(false, event);\n }\n\n if (code === 'Home') {\n if (path[0]) {\n dispatchFocusedPath({ type: 'change_last_focus', value: 0 });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'set_initial_focus' });\n\n handleGlobalToggle(true, event);\n }\n }\n\n if (code === 'End') {\n if (path[0]) {\n dispatchFocusedPath({ type: 'change_last_focus', value: currentLength - 1 });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'change_last_focus', value: (pathMap.get('root') || 0) - 1 });\n\n handleGlobalToggle(true, event);\n }\n }\n\n if (code === 'PageUp') {\n if (path[0]) {\n if (currentIndex <= 10) {\n dispatchFocusedPath({ type: 'set_initial_focus' });\n } else {\n dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex - 10 });\n }\n }\n }\n\n if (code === 'PageDown') {\n if (path[0]) {\n if (currentLength - currentIndex <= 10) {\n dispatchFocusedPath({ type: 'change_last_focus', value: currentLength - 1 });\n } else {\n dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex + 10 });\n }\n }\n }\n };\n\n return { onKeyDown };\n};\n"],"names":["getFurtherPath","focusedPath","focusedToValueMap","focusedPathAsString","reduce","acc","n","concat","replace","get","useKeyNavigation","_ref","dispatchFocusedPath","path","dispatchPath","pathMap","handleGlobalToggle","closeOnSelect","onItemSelect","onItemClick","currentLength","length","currentIndex","onKeyDown","event","code","newIndex","type","value","currentItem","items","toString","preventDefault","disabled","isDisabled"],"mappings":"AASA,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,WAA6B,EAAEC,iBAAwC,EAAK;EAChG,IAAMC,mBAAmB,GAAGF,WAAW,CAACG,MAAM,CAAC,UAACC,GAAG,EAAEC,CAAC,EAAA;AAAA,IAAA,OAAA,EAAA,CAAAC,MAAA,CAAQF,GAAG,EAAAE,GAAAA,CAAAA,CAAAA,MAAA,CAAID,CAAC,CAAA,CAAA;GAAE,EAAE,EAAE,CAAC,CAACE,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;AAElG,EAAA,OAAON,iBAAiB,CAACO,GAAG,CAACN,mBAAmB,CAAC,CAAA;AACrD,CAAC,CAAA;IAmBYO,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAWD;AAAA,EAAA,IAVxBV,WAAW,GAAAU,IAAA,CAAXV,WAAW;IACXW,mBAAmB,GAAAD,IAAA,CAAnBC,mBAAmB;IAC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CAAC,EAAE;AACT,QAAA,IAAIO,aAAa,GAAGE,YAAY,IAAI,EAAE,EAAE;AACpCV,UAAAA,mBAAmB,CAAC;AAAEe,YAAAA,IAAI,EAAE,mBAAmB;YAAEC,KAAK,EAAER,aAAa,GAAG,CAAA;AAAE,WAAC,CAAC,CAAA;AAChF,SAAC,MAAM;AACHR,UAAAA,mBAAmB,CAAC;AAAEe,YAAAA,IAAI,EAAE,mBAAmB;YAAEC,KAAK,EAAEN,YAAY,GAAG,EAAA;AAAG,WAAC,CAAC,CAAA;AAChF,SAAA;AACJ,OAAA;AACJ,KAAA;GACH,CAAA;EAED,OAAO;AAAEC,IAAAA,SAAS,EAATA,SAAAA;GAAW,CAAA;AACxB;;;;"}
@@ -0,0 +1,33 @@
1
+ import { toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
+
3
+ function focusedPathReducer(state, action) {
4
+ switch (action.type) {
5
+ case 'reset':
6
+ {
7
+ return [];
8
+ }
9
+ case 'set_initial_focus':
10
+ {
11
+ return [0];
12
+ }
13
+ case 'change_last_focus':
14
+ {
15
+ return [].concat(_toConsumableArray(state.slice(0, -1)), [action.value]);
16
+ }
17
+ case 'add_focus':
18
+ {
19
+ return [].concat(_toConsumableArray(state), [action.value]);
20
+ }
21
+ case 'return_prev_focus':
22
+ {
23
+ return _toConsumableArray(state.slice(0, -1));
24
+ }
25
+ default:
26
+ {
27
+ return state;
28
+ }
29
+ }
30
+ }
31
+
32
+ export { focusedPathReducer };
33
+ //# sourceMappingURL=focusedPathReducer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focusedPathReducer.js","sources":["../../../../src/components/Dropdown/reducers/focusedPathReducer.ts"],"sourcesContent":["export type FocusedPathState = Array<number>;\n\nexport type FocusedPathAction =\n | { type: 'reset' }\n | { type: 'set_initial_focus' }\n | { type: 'change_last_focus'; value: number }\n | { type: 'add_focus'; value: number }\n | { type: 'return_prev_focus' };\n\nexport function focusedPathReducer(state: FocusedPathState, action: FocusedPathAction): FocusedPathState {\n switch (action.type) {\n case 'reset': {\n return [];\n }\n\n case 'set_initial_focus': {\n return [0];\n }\n\n case 'change_last_focus': {\n return [...state.slice(0, -1), action.value];\n }\n\n case 'add_focus': {\n return [...state, action.value];\n }\n\n case 'return_prev_focus': {\n return [...state.slice(0, -1)];\n }\n\n default: {\n return state;\n }\n }\n}\n"],"names":["focusedPathReducer","state","action","type","concat","_toConsumableArray","slice","value"],"mappings":";;AASO,SAASA,kBAAkBA,CAACC,KAAuB,EAAEC,MAAyB,EAAoB;EACrG,QAAQA,MAAM,CAACC,IAAI;AACf,IAAA,KAAK,OAAO;AAAE,MAAA;AACV,QAAA,OAAO,EAAE,CAAA;AACb,OAAA;AAEA,IAAA,KAAK,mBAAmB;AAAE,MAAA;QACtB,OAAO,CAAC,CAAC,CAAC,CAAA;AACd,OAAA;AAEA,IAAA,KAAK,mBAAmB;AAAE,MAAA;AACtB,QAAA,OAAA,EAAA,CAAAC,MAAA,CAAAC,kBAAA,CAAWJ,KAAK,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAEJ,EAAAA,CAAAA,MAAM,CAACK,KAAK,CAAA,CAAA,CAAA;AAC/C,OAAA;AAEA,IAAA,KAAK,WAAW;AAAE,MAAA;QACd,OAAAH,EAAAA,CAAAA,MAAA,CAAAC,kBAAA,CAAWJ,KAAK,CAAEC,EAAAA,CAAAA,MAAM,CAACK,KAAK,CAAA,CAAA,CAAA;AAClC,OAAA;AAEA,IAAA,KAAK,mBAAmB;AAAE,MAAA;QACtB,OAAAF,kBAAA,CAAWJ,KAAK,CAACK,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA,CAAA;AACjC,OAAA;AAEA,IAAA;AAAS,MAAA;AACL,QAAA,OAAOL,KAAK,CAAA;AAChB,OAAA;AACJ,GAAA;AACJ;;;;"}
@@ -0,0 +1,37 @@
1
+ import { toConsumableArray as _toConsumableArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
+
3
+ function pathReducer(state, action) {
4
+ switch (action.type) {
5
+ case 'reset':
6
+ {
7
+ return [];
8
+ }
9
+ case 'opened_first_level':
10
+ {
11
+ return ['root'];
12
+ }
13
+ case 'added_next_level':
14
+ {
15
+ return [].concat(_toConsumableArray(state), [action.value]);
16
+ }
17
+ case 'removed_last_level':
18
+ {
19
+ return _toConsumableArray(state.slice(0, -1));
20
+ }
21
+ case 'changed_on_level':
22
+ {
23
+ return [].concat(_toConsumableArray(state.slice(0, action.level)), [action.value]);
24
+ }
25
+ case 'cut_by_level':
26
+ {
27
+ return state.slice(0, action.level);
28
+ }
29
+ default:
30
+ {
31
+ return state;
32
+ }
33
+ }
34
+ }
35
+
36
+ export { pathReducer };
37
+ //# sourceMappingURL=pathReducer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pathReducer.js","sources":["../../../../src/components/Dropdown/reducers/pathReducer.ts"],"sourcesContent":["export type PathState = Array<string>;\n\nexport type PathAction =\n | { type: 'reset' }\n | { type: 'opened_first_level' }\n | { type: 'added_next_level'; value: string }\n | { type: 'removed_last_level' }\n | { type: 'changed_on_level'; value: string; level: number }\n | { type: 'cut_by_level'; level: number };\n\nexport function pathReducer(state: PathState, action: PathAction): PathState {\n switch (action.type) {\n case 'reset': {\n return [];\n }\n\n case 'opened_first_level': {\n return ['root'];\n }\n\n case 'added_next_level': {\n return [...state, action.value];\n }\n\n case 'removed_last_level': {\n return [...state.slice(0, -1)];\n }\n\n case 'changed_on_level': {\n return [...state.slice(0, action.level), action.value];\n }\n\n case 'cut_by_level': {\n return state.slice(0, action.level);\n }\n\n default: {\n return state;\n }\n }\n}\n"],"names":["pathReducer","state","action","type","concat","_toConsumableArray","value","slice","level"],"mappings":";;AAUO,SAASA,WAAWA,CAACC,KAAgB,EAAEC,MAAkB,EAAa;EACzE,QAAQA,MAAM,CAACC,IAAI;AACf,IAAA,KAAK,OAAO;AAAE,MAAA;AACV,QAAA,OAAO,EAAE,CAAA;AACb,OAAA;AAEA,IAAA,KAAK,oBAAoB;AAAE,MAAA;QACvB,OAAO,CAAC,MAAM,CAAC,CAAA;AACnB,OAAA;AAEA,IAAA,KAAK,kBAAkB;AAAE,MAAA;QACrB,OAAAC,EAAAA,CAAAA,MAAA,CAAAC,kBAAA,CAAWJ,KAAK,CAAEC,EAAAA,CAAAA,MAAM,CAACI,KAAK,CAAA,CAAA,CAAA;AAClC,OAAA;AAEA,IAAA,KAAK,oBAAoB;AAAE,MAAA;QACvB,OAAAD,kBAAA,CAAWJ,KAAK,CAACM,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA,CAAA;AACjC,OAAA;AAEA,IAAA,KAAK,kBAAkB;AAAE,MAAA;AACrB,QAAA,OAAA,EAAA,CAAAH,MAAA,CAAAC,kBAAA,CAAWJ,KAAK,CAACM,KAAK,CAAC,CAAC,EAAEL,MAAM,CAACM,KAAK,CAAC,CAAEN,EAAAA,CAAAA,MAAM,CAACI,KAAK,CAAA,CAAA,CAAA;AACzD,OAAA;AAEA,IAAA,KAAK,cAAc;AAAE,MAAA;QACjB,OAAOL,KAAK,CAACM,KAAK,CAAC,CAAC,EAAEL,MAAM,CAACM,KAAK,CAAC,CAAA;AACvC,OAAA;AAEA,IAAA;AAAS,MAAA;AACL,QAAA,OAAOP,KAAK,CAAA;AAChB,OAAA;AACJ,GAAA;AACJ;;;;"}
@@ -0,0 +1,115 @@
1
+ import React from 'react';
2
+ import '@salutejs/plasma-core';
3
+ import '@linaria/react';
4
+ import { DropdownItem } from '../DropdownItem/DropdownItem.js';
5
+ import { StyledPopover, Ul } from '../../Dropdown.styles.js';
6
+ import '../../../../utils/react.js';
7
+ import 'focus-visible';
8
+
9
+ var DropdownInner = function DropdownInner(_ref) {
10
+ var item = _ref.item,
11
+ currentLevel = _ref.currentLevel,
12
+ focusedPath = _ref.focusedPath,
13
+ path = _ref.path,
14
+ dispatchPath = _ref.dispatchPath,
15
+ index = _ref.index,
16
+ trigger = _ref.trigger,
17
+ itemRole = _ref.itemRole,
18
+ listHeight = _ref.listHeight,
19
+ listOverflow = _ref.listOverflow,
20
+ handleGlobalToggle = _ref.handleGlobalToggle,
21
+ closeOnSelect = _ref.closeOnSelect,
22
+ onHover = _ref.onHover,
23
+ onItemSelect = _ref.onItemSelect,
24
+ onItemClick = _ref.onItemClick,
25
+ listWidth = _ref.listWidth,
26
+ variant = _ref.variant,
27
+ hasArrow = _ref.hasArrow;
28
+ var handleToggle = function handleToggle(opened) {
29
+ if (opened) {
30
+ dispatchPath({
31
+ type: 'changed_on_level',
32
+ value: item.value.toString(),
33
+ level: currentLevel + 1
34
+ });
35
+ } else {
36
+ dispatchPath({
37
+ type: 'cut_by_level',
38
+ level: currentLevel + 1
39
+ });
40
+ }
41
+ };
42
+ var isCurrentListOpen = path[currentLevel + 1] === item.value.toString();
43
+ if (item !== null && item !== void 0 && item.items) {
44
+ return /*#__PURE__*/React.createElement(StyledPopover, {
45
+ isOpen: isCurrentListOpen,
46
+ usePortal: false,
47
+ placement: "right-start",
48
+ trigger: trigger,
49
+ target: /*#__PURE__*/React.createElement(DropdownItem, {
50
+ item: item,
51
+ index: index,
52
+ path: path,
53
+ focusedPath: focusedPath,
54
+ currentLevel: currentLevel,
55
+ onHover: onHover,
56
+ onItemSelect: onItemSelect,
57
+ onItemClick: onItemClick,
58
+ variant: variant,
59
+ hasArrow: hasArrow,
60
+ ariaControls: "listbox".concat(currentLevel + 2),
61
+ ariaExpanded: isCurrentListOpen,
62
+ ariaHasPopup: "listbox",
63
+ ariaLevel: currentLevel + 1,
64
+ ariaLabel: item.label
65
+ }),
66
+ onToggle: handleToggle,
67
+ isFocusTrapped: false
68
+ }, /*#__PURE__*/React.createElement(Ul, {
69
+ listHeight: listHeight,
70
+ listOverflow: listOverflow,
71
+ role: "listbox",
72
+ id: "listbox".concat(currentLevel + 2),
73
+ listWidth: listWidth,
74
+ isInnerUl: true
75
+ }, item.items.map(function (innerItem, innerIndex) {
76
+ return /*#__PURE__*/React.createElement(DropdownInner, {
77
+ key: "".concat(innerIndex, "/currentLevel"),
78
+ item: innerItem,
79
+ currentLevel: currentLevel + 1,
80
+ focusedPath: focusedPath,
81
+ path: path,
82
+ dispatchPath: dispatchPath,
83
+ index: innerIndex,
84
+ trigger: trigger,
85
+ itemRole: itemRole,
86
+ listHeight: listHeight,
87
+ listOverflow: listOverflow,
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
+ });
97
+ })));
98
+ }
99
+ return /*#__PURE__*/React.createElement(DropdownItem, {
100
+ item: item,
101
+ index: index,
102
+ focusedPath: focusedPath,
103
+ currentLevel: currentLevel,
104
+ itemRole: itemRole,
105
+ handleGlobalToggle: handleGlobalToggle,
106
+ closeOnSelect: closeOnSelect,
107
+ onHover: onHover,
108
+ onItemSelect: onItemSelect,
109
+ onItemClick: onItemClick,
110
+ variant: variant
111
+ });
112
+ };
113
+
114
+ export { DropdownInner };
115
+ //# 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","ariaHasPopup","ariaLevel","ariaLabel","label","onToggle","isFocusTrapped","Ul","role","id","isInnerUl","map","innerItem","innerIndex","key"],"mappings":";;;;;;;;AAQA,IAAMA,aAAqC,GAAG,SAAxCA,aAAqCA,CAAAC,IAAA,EAmBrC;AAAA,EAAA,IAlBFC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IACZC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;IACJC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IACZC,KAAK,GAAAN,IAAA,CAALM,KAAK;IACLC,OAAO,GAAAP,IAAA,CAAPO,OAAO;IACPC,QAAQ,GAAAR,IAAA,CAARQ,QAAQ;IACRC,UAAU,GAAAT,IAAA,CAAVS,UAAU;IACVC,YAAY,GAAAV,IAAA,CAAZU,YAAY;IACZC,kBAAkB,GAAAX,IAAA,CAAlBW,kBAAkB;IAClBC,aAAa,GAAAZ,IAAA,CAAbY,aAAa;IACbC,OAAO,GAAAb,IAAA,CAAPa,OAAO;IACPC,YAAY,GAAAd,IAAA,CAAZc,YAAY;IACZC,WAAW,GAAAf,IAAA,CAAXe,WAAW;IACXC,SAAS,GAAAhB,IAAA,CAATgB,SAAS;IACTC,OAAO,GAAAjB,IAAA,CAAPiB,OAAO;IACPC,QAAQ,GAAAlB,IAAA,CAARkB,QAAQ,CAAA;AAER,EAAA,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,MAAe,EAAW;AAC5C,IAAA,IAAIA,MAAM,EAAE;AACRf,MAAAA,YAAY,CAAC;AAAEgB,QAAAA,IAAI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WAAY;AACzBC,QAAAA,SAAS,EAAEA,SAAU;AACrBC,QAAAA,OAAO,EAAEA,OAAQ;AACjBC,QAAAA,QAAQ,EAAEA,QAAAA;AAAS,OACtB,CAAC,CAAA;KACL,CACD,CACO,CAAC,CAAA;AAExB,GAAA;AAEA,EAAA,oBACIS,KAAA,CAAAC,aAAA,CAACM,YAAY,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);}