@salutejs/plasma-new-hope 0.78.0-canary.1185.8915022482.0 → 0.78.0-canary.1195.8913931601.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (448) hide show
  1. package/cjs/components/Combobox/Combobox.css +7 -17
  2. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +6 -15
  3. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
  4. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +6 -15
  5. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
  6. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +6 -15
  7. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
  8. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +6 -15
  9. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
  10. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.css +23 -4
  11. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +10 -81
  12. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
  13. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +9 -21
  14. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
  15. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +1 -0
  16. package/cjs/components/Dropdown/Dropdown.css +2 -25
  17. package/cjs/components/Dropdown/Dropdown.js +54 -138
  18. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  19. package/cjs/components/Dropdown/Dropdown.styles.js +7 -40
  20. package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
  21. package/cjs/components/Dropdown/Dropdown.styles_1daxhqh.css +2 -0
  22. package/cjs/components/Dropdown/Dropdown.tokens.js +23 -26
  23. package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
  24. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -7
  25. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +100 -79
  26. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  27. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -90
  28. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  29. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +4 -0
  30. package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +1 -1
  31. package/cjs/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +1 -0
  32. package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +1 -1
  33. package/cjs/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +1 -0
  34. package/cjs/components/Dropdown/utils/index.js +0 -16
  35. package/cjs/components/Dropdown/utils/index.js.map +1 -1
  36. package/cjs/components/IconButton/IconButton.css +25 -0
  37. package/cjs/components/IconButton/IconButton.js +84 -0
  38. package/cjs/components/IconButton/IconButton.js.map +1 -0
  39. package/cjs/components/IconButton/IconButton.styles.js +25 -0
  40. package/cjs/components/IconButton/IconButton.styles.js.map +1 -0
  41. package/cjs/components/IconButton/IconButton.styles_12iyaye.css +2 -0
  42. package/cjs/components/IconButton/IconButton.tokens.js +36 -0
  43. package/cjs/components/IconButton/IconButton.tokens.js.map +1 -0
  44. package/cjs/components/IconButton/variations/_disabled/base.js +9 -0
  45. package/cjs/components/IconButton/variations/_disabled/base.js.map +1 -0
  46. package/cjs/components/IconButton/variations/_focused/base.js +9 -0
  47. package/cjs/components/IconButton/variations/_focused/base.js.map +1 -0
  48. package/cjs/components/IconButton/variations/_size/base.js +9 -0
  49. package/cjs/components/IconButton/variations/_size/base.js.map +1 -0
  50. package/cjs/components/IconButton/variations/_size/base_x642ct.css +1 -0
  51. package/cjs/components/IconButton/variations/_view/base.js +9 -0
  52. package/cjs/components/IconButton/variations/_view/base.js.map +1 -0
  53. package/cjs/components/IconButton/variations/_view/base_x642ct.css +1 -0
  54. package/cjs/components/Pagination/Pagination.css +7 -14
  55. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +7 -14
  56. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  57. package/cjs/components/Select/Select.css +7 -14
  58. package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +6 -15
  59. package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
  60. package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +6 -15
  61. package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
  62. package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +6 -15
  63. package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
  64. package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +6 -15
  65. package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
  66. package/cjs/components/Select/ui/SelectItem/SelectItem.css +7 -16
  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_vk39mp.css → SelectItem.styles_6h17aw.css} +1 -1
  72. package/cjs/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  73. package/cjs/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
  74. package/cjs/index.css +11 -18
  75. package/cjs/index.js +8 -8
  76. package/es/components/Combobox/Combobox.css +7 -17
  77. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +6 -15
  78. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
  79. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +6 -15
  80. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
  81. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +6 -15
  82. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
  83. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +6 -15
  84. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
  85. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +23 -4
  86. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +11 -82
  87. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
  88. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +10 -19
  89. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
  90. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +1 -0
  91. package/es/components/Dropdown/Dropdown.css +2 -25
  92. package/es/components/Dropdown/Dropdown.js +60 -144
  93. package/es/components/Dropdown/Dropdown.js.map +1 -1
  94. package/es/components/Dropdown/Dropdown.styles.js +7 -39
  95. package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
  96. package/es/components/Dropdown/Dropdown.styles_1daxhqh.css +2 -0
  97. package/es/components/Dropdown/Dropdown.tokens.js +23 -26
  98. package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
  99. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -7
  100. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +100 -80
  101. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  102. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -89
  103. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  104. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +4 -0
  105. package/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +1 -1
  106. package/es/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +1 -0
  107. package/es/components/Dropdown/ui/DropdownItem/variations/_size/base_x642ct.css +1 -0
  108. package/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +1 -1
  109. package/es/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +1 -0
  110. package/es/components/Dropdown/ui/DropdownItem/variations/_view/base_x642ct.css +1 -0
  111. package/es/components/Dropdown/utils/index.js +2 -16
  112. package/es/components/Dropdown/utils/index.js.map +1 -1
  113. package/es/components/IconButton/IconButton.css +25 -0
  114. package/es/components/IconButton/IconButton.js +79 -0
  115. package/es/components/IconButton/IconButton.js.map +1 -0
  116. package/es/components/IconButton/IconButton.styles.js +20 -0
  117. package/es/components/IconButton/IconButton.styles.js.map +1 -0
  118. package/es/components/IconButton/IconButton.styles_12iyaye.css +2 -0
  119. package/es/components/IconButton/IconButton.tokens.js +31 -0
  120. package/es/components/IconButton/IconButton.tokens.js.map +1 -0
  121. package/es/components/IconButton/variations/_disabled/base.js +5 -0
  122. package/es/components/IconButton/variations/_disabled/base.js.map +1 -0
  123. package/es/components/IconButton/variations/_disabled/base_x642ct.css +1 -0
  124. package/es/components/IconButton/variations/_focused/base.js +5 -0
  125. package/es/components/IconButton/variations/_focused/base.js.map +1 -0
  126. package/es/components/IconButton/variations/_focused/base_x642ct.css +1 -0
  127. package/es/components/IconButton/variations/_size/base.js +5 -0
  128. package/es/components/IconButton/variations/_size/base.js.map +1 -0
  129. package/es/components/IconButton/variations/_size/base_x642ct.css +1 -0
  130. package/es/components/IconButton/variations/_view/base.js +5 -0
  131. package/es/components/IconButton/variations/_view/base.js.map +1 -0
  132. package/es/components/IconButton/variations/_view/base_x642ct.css +1 -0
  133. package/es/components/Pagination/Pagination.css +7 -14
  134. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +7 -14
  135. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  136. package/es/components/Select/Select.css +7 -14
  137. package/es/components/Select/ui/SelectDivider/SelectDivider.css +6 -15
  138. package/es/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
  139. package/es/components/Select/ui/SelectFooter/SelectFooter.css +6 -15
  140. package/es/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
  141. package/es/components/Select/ui/SelectGroup/SelectGroup.css +6 -15
  142. package/es/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
  143. package/es/components/Select/ui/SelectHeader/SelectHeader.css +6 -15
  144. package/es/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
  145. package/es/components/Select/ui/SelectItem/SelectItem.css +7 -16
  146. package/es/components/Select/ui/SelectItem/SelectItem.js +3 -3
  147. package/es/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
  148. package/es/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
  149. package/es/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
  150. package/es/components/Select/ui/SelectItem/{SelectItem.styles_vk39mp.css → SelectItem.styles_6h17aw.css} +1 -1
  151. package/es/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  152. package/es/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
  153. package/es/index.css +11 -18
  154. package/es/index.js +3 -4
  155. package/es/index.js.map +1 -1
  156. package/package.json +2 -2
  157. package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +2 -91
  158. package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +7 -27
  159. package/styled-components/cjs/components/Dropdown/Dropdown.js +54 -140
  160. package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +7 -22
  161. package/styled-components/cjs/components/Dropdown/Dropdown.template-doc.mdx +80 -0
  162. package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +23 -26
  163. package/styled-components/cjs/components/Dropdown/index.js +1 -9
  164. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +105 -77
  165. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +18 -83
  166. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +19 -0
  167. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +9 -0
  168. package/styled-components/cjs/components/Dropdown/ui/index.js +5 -19
  169. package/styled-components/cjs/components/Dropdown/utils/index.js +1 -15
  170. package/styled-components/cjs/components/Dropdown/variations/_size/tokens.json +9 -1
  171. package/styled-components/cjs/components/Dropdown/variations/_view/tokens.json +1 -1
  172. package/styled-components/cjs/components/IconButton/IconButton.js +86 -0
  173. package/styled-components/cjs/components/IconButton/IconButton.styles.js +19 -0
  174. package/styled-components/cjs/components/IconButton/IconButton.tokens.js +34 -0
  175. package/styled-components/cjs/components/IconButton/index.js +31 -0
  176. package/styled-components/cjs/components/IconButton/variations/_disabled/base.js +8 -0
  177. package/styled-components/cjs/components/IconButton/variations/_disabled/tokens.json +1 -0
  178. package/styled-components/cjs/components/IconButton/variations/_focused/base.js +8 -0
  179. package/styled-components/cjs/components/IconButton/variations/_focused/tokens.json +1 -0
  180. package/styled-components/cjs/components/IconButton/variations/_size/base.js +8 -0
  181. package/styled-components/cjs/components/IconButton/variations/_size/tokens.json +1 -0
  182. package/styled-components/cjs/components/IconButton/variations/_view/base.js +8 -0
  183. package/styled-components/cjs/components/IconButton/variations/_view/tokens.json +1 -0
  184. package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.js +1 -1
  185. package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  186. package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  187. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +27 -0
  188. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +13 -0
  189. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +194 -0
  190. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +27 -0
  191. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +13 -0
  192. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  193. package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.config.js +46 -0
  194. package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.js +11 -0
  195. package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.stories.tsx +65 -0
  196. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +27 -0
  197. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +13 -0
  198. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +195 -0
  199. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +27 -0
  200. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +13 -0
  201. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  202. package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.config.js +46 -0
  203. package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.js +11 -0
  204. package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.stories.tsx +65 -0
  205. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.config.js +22 -0
  206. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.js +21 -0
  207. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +277 -0
  208. package/styled-components/cjs/index.js +11 -0
  209. package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +3 -90
  210. package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +6 -23
  211. package/styled-components/es/components/Dropdown/Dropdown.js +55 -142
  212. package/styled-components/es/components/Dropdown/Dropdown.styles.js +5 -18
  213. package/styled-components/es/components/Dropdown/Dropdown.template-doc.mdx +80 -0
  214. package/styled-components/es/components/Dropdown/Dropdown.tokens.js +23 -26
  215. package/styled-components/es/components/Dropdown/index.js +0 -1
  216. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +107 -78
  217. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +14 -80
  218. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +19 -0
  219. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +9 -0
  220. package/styled-components/es/components/Dropdown/ui/index.js +1 -3
  221. package/styled-components/es/components/Dropdown/utils/index.js +1 -15
  222. package/styled-components/es/components/Dropdown/variations/_size/tokens.json +9 -1
  223. package/styled-components/es/components/Dropdown/variations/_view/tokens.json +1 -1
  224. package/styled-components/es/components/IconButton/IconButton.js +77 -0
  225. package/styled-components/es/components/IconButton/IconButton.styles.js +11 -0
  226. package/styled-components/es/components/IconButton/IconButton.tokens.js +28 -0
  227. package/styled-components/es/components/IconButton/index.js +2 -0
  228. package/styled-components/es/components/IconButton/variations/_disabled/base.js +2 -0
  229. package/styled-components/es/components/IconButton/variations/_disabled/tokens.json +1 -0
  230. package/styled-components/es/components/IconButton/variations/_focused/base.js +2 -0
  231. package/styled-components/es/components/IconButton/variations/_focused/tokens.json +1 -0
  232. package/styled-components/es/components/IconButton/variations/_size/base.js +2 -0
  233. package/styled-components/es/components/IconButton/variations/_size/tokens.json +1 -0
  234. package/styled-components/es/components/IconButton/variations/_view/base.js +2 -0
  235. package/styled-components/es/components/IconButton/variations/_view/tokens.json +1 -0
  236. package/styled-components/es/components/Select/ui/SelectItem/SelectItem.js +2 -2
  237. package/styled-components/es/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  238. package/styled-components/es/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  239. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +21 -0
  240. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +7 -0
  241. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +194 -0
  242. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +21 -0
  243. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +7 -0
  244. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  245. package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.config.js +40 -0
  246. package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.js +5 -0
  247. package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.stories.tsx +65 -0
  248. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +21 -0
  249. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +7 -0
  250. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +195 -0
  251. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +21 -0
  252. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +7 -0
  253. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  254. package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.config.js +40 -0
  255. package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.js +5 -0
  256. package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.stories.tsx +65 -0
  257. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.config.js +16 -0
  258. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.js +15 -0
  259. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +277 -0
  260. package/styled-components/es/index.js +1 -0
  261. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts +13 -15
  262. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts.map +1 -1
  263. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts +1 -5
  264. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts.map +1 -1
  265. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts +2 -59
  266. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts.map +1 -1
  267. package/types/components/Dropdown/Dropdown.d.ts +4 -4
  268. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  269. package/types/components/Dropdown/Dropdown.styles.d.ts +1 -8
  270. package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
  271. package/types/components/Dropdown/Dropdown.tokens.d.ts +22 -24
  272. package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
  273. package/types/components/Dropdown/Dropdown.types.d.ts +40 -64
  274. package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
  275. package/types/components/Dropdown/index.d.ts +1 -3
  276. package/types/components/Dropdown/index.d.ts.map +1 -1
  277. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts +56 -2
  278. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
  279. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +2 -5
  280. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
  281. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +38 -44
  282. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
  283. package/types/components/Dropdown/ui/DropdownItem/variations/_size/base.d.ts.map +1 -0
  284. package/types/components/Dropdown/ui/DropdownItem/variations/_view/base.d.ts.map +1 -0
  285. package/types/components/Dropdown/ui/index.d.ts +1 -3
  286. package/types/components/Dropdown/ui/index.d.ts.map +1 -1
  287. package/types/components/Dropdown/utils/index.d.ts +2 -5
  288. package/types/components/Dropdown/utils/index.d.ts.map +1 -1
  289. package/types/components/IconButton/IconButton.d.ts +30 -0
  290. package/types/components/IconButton/IconButton.d.ts.map +1 -0
  291. package/types/components/IconButton/IconButton.styles.d.ts +4 -0
  292. package/types/components/IconButton/IconButton.styles.d.ts.map +1 -0
  293. package/types/components/IconButton/IconButton.tokens.d.ts +29 -0
  294. package/types/components/IconButton/IconButton.tokens.d.ts.map +1 -0
  295. package/types/components/IconButton/IconButton.types.d.ts +13 -0
  296. package/types/components/IconButton/IconButton.types.d.ts.map +1 -0
  297. package/types/components/IconButton/index.d.ts +4 -0
  298. package/types/components/IconButton/index.d.ts.map +1 -0
  299. package/types/components/IconButton/variations/_disabled/base.d.ts +2 -0
  300. package/types/components/IconButton/variations/_disabled/base.d.ts.map +1 -0
  301. package/types/components/IconButton/variations/_focused/base.d.ts +2 -0
  302. package/types/components/IconButton/variations/_focused/base.d.ts.map +1 -0
  303. package/types/components/IconButton/variations/_size/base.d.ts +2 -0
  304. package/types/components/IconButton/variations/_size/base.d.ts.map +1 -0
  305. package/types/components/IconButton/variations/_view/base.d.ts +2 -0
  306. package/types/components/IconButton/variations/_view/base.d.ts.map +1 -0
  307. package/types/components/Select/ui/SelectItem/SelectItem.d.ts +2 -2
  308. package/types/components/Select/ui/SelectItem/SelectItem.d.ts.map +1 -1
  309. package/types/components/Select/ui/SelectItem/SelectItem.type.d.ts +2 -2
  310. package/types/components/Select/utils/index.d.ts +1 -1
  311. package/types/components/_Icon/Icon.assets/DisclosureRight.d.ts.map +1 -1
  312. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -0
  313. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts +30 -0
  314. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts.map +1 -0
  315. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts +18 -0
  316. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -0
  317. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts +30 -0
  318. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts.map +1 -0
  319. package/types/examples/plasma_b2c/components/IconButton/IconButton.config.d.ts +39 -0
  320. package/types/examples/plasma_b2c/components/IconButton/IconButton.config.d.ts.map +1 -0
  321. package/types/examples/plasma_b2c/components/IconButton/IconButton.d.ts +33 -0
  322. package/types/examples/plasma_b2c/components/IconButton/IconButton.d.ts.map +1 -0
  323. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts +18 -0
  324. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -0
  325. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts +30 -0
  326. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts.map +1 -0
  327. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts +18 -0
  328. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -0
  329. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts +30 -0
  330. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts.map +1 -0
  331. package/types/examples/plasma_web/components/IconButton/IconButton.config.d.ts +39 -0
  332. package/types/examples/plasma_web/components/IconButton/IconButton.config.d.ts.map +1 -0
  333. package/types/examples/plasma_web/components/IconButton/IconButton.d.ts +33 -0
  334. package/types/examples/plasma_web/components/IconButton/IconButton.d.ts.map +1 -0
  335. package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts +15 -0
  336. package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts.map +1 -0
  337. package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts +51 -0
  338. package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts.map +1 -0
  339. package/types/index.d.ts +1 -0
  340. package/types/index.d.ts.map +1 -1
  341. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +0 -4
  342. package/cjs/components/Combobox/utils/index.js +0 -23
  343. package/cjs/components/Combobox/utils/index.js.map +0 -1
  344. package/cjs/components/Dropdown/Dropdown.styles_1tihqkp.css +0 -3
  345. package/cjs/components/Dropdown/hooks/useHashMaps.js +0 -31
  346. package/cjs/components/Dropdown/hooks/useHashMaps.js.map +0 -1
  347. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +0 -200
  348. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js.map +0 -1
  349. package/cjs/components/Dropdown/reducers/focusedPathReducer.js +0 -37
  350. package/cjs/components/Dropdown/reducers/focusedPathReducer.js.map +0 -1
  351. package/cjs/components/Dropdown/reducers/pathReducer.js +0 -41
  352. package/cjs/components/Dropdown/reducers/pathReducer.js.map +0 -1
  353. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -119
  354. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +0 -1
  355. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +0 -5
  356. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -30
  357. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +0 -1
  358. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +0 -4
  359. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +0 -4
  360. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -112
  361. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +0 -1
  362. package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +0 -1
  363. package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +0 -1
  364. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +0 -4
  365. package/es/components/Combobox/utils/index.js +0 -19
  366. package/es/components/Combobox/utils/index.js.map +0 -1
  367. package/es/components/Dropdown/Dropdown.styles_1tihqkp.css +0 -3
  368. package/es/components/Dropdown/hooks/useHashMaps.js +0 -27
  369. package/es/components/Dropdown/hooks/useHashMaps.js.map +0 -1
  370. package/es/components/Dropdown/hooks/useKeyboardNavigation.js +0 -196
  371. package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +0 -1
  372. package/es/components/Dropdown/reducers/focusedPathReducer.js +0 -33
  373. package/es/components/Dropdown/reducers/focusedPathReducer.js.map +0 -1
  374. package/es/components/Dropdown/reducers/pathReducer.js +0 -37
  375. package/es/components/Dropdown/reducers/pathReducer.js.map +0 -1
  376. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -115
  377. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +0 -1
  378. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +0 -5
  379. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -23
  380. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +0 -1
  381. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +0 -4
  382. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +0 -4
  383. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -107
  384. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +0 -1
  385. package/es/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +0 -1
  386. package/es/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +0 -1
  387. package/styled-components/cjs/components/Combobox/utils/index.js +0 -23
  388. package/styled-components/cjs/components/Dropdown/hooks/useHashMaps.js +0 -29
  389. package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +0 -199
  390. package/styled-components/cjs/components/Dropdown/reducers/focusedPathReducer.js +0 -40
  391. package/styled-components/cjs/components/Dropdown/reducers/pathReducer.js +0 -44
  392. package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -114
  393. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -33
  394. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +0 -5
  395. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -119
  396. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +0 -25
  397. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.js +0 -11
  398. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +0 -294
  399. package/styled-components/es/components/Combobox/utils/index.js +0 -15
  400. package/styled-components/es/components/Dropdown/hooks/useHashMaps.js +0 -23
  401. package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +0 -193
  402. package/styled-components/es/components/Dropdown/reducers/focusedPathReducer.js +0 -34
  403. package/styled-components/es/components/Dropdown/reducers/pathReducer.js +0 -38
  404. package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -108
  405. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -25
  406. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +0 -1
  407. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -111
  408. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +0 -19
  409. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.js +0 -5
  410. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +0 -294
  411. package/types/components/Combobox/utils/index.d.ts +0 -4
  412. package/types/components/Combobox/utils/index.d.ts.map +0 -1
  413. package/types/components/Dropdown/hooks/useHashMaps.d.ts +0 -6
  414. package/types/components/Dropdown/hooks/useHashMaps.d.ts.map +0 -1
  415. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts +0 -23
  416. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts.map +0 -1
  417. package/types/components/Dropdown/reducers/focusedPathReducer.d.ts +0 -16
  418. package/types/components/Dropdown/reducers/focusedPathReducer.d.ts.map +0 -1
  419. package/types/components/Dropdown/reducers/pathReducer.d.ts +0 -20
  420. package/types/components/Dropdown/reducers/pathReducer.d.ts.map +0 -1
  421. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts +0 -5
  422. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +0 -1
  423. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +0 -26
  424. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +0 -1
  425. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts +0 -7
  426. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts.map +0 -1
  427. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts +0 -60
  428. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts.map +0 -1
  429. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts +0 -58
  430. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts.map +0 -1
  431. package/types/components/Dropdown/ui/DropdownItemOld/variations/_size/base.d.ts.map +0 -1
  432. package/types/components/Dropdown/ui/DropdownItemOld/variations/_view/base.d.ts.map +0 -1
  433. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts.map +0 -1
  434. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +0 -13
  435. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +0 -1
  436. /package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base_x642ct.css +0 -0
  437. /package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base_x642ct.css +0 -0
  438. /package/{es/components/Dropdown/ui/DropdownItemOld/variations/_size → cjs/components/IconButton/variations/_disabled}/base_x642ct.css +0 -0
  439. /package/{es/components/Dropdown/ui/DropdownItemOld/variations/_view → cjs/components/IconButton/variations/_focused}/base_x642ct.css +0 -0
  440. /package/styled-components/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +0 -0
  441. /package/styled-components/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +0 -0
  442. /package/styled-components/cjs/components/{Dropdown/ui/DropdownInner/DropdownInner.type.js → IconButton/IconButton.types.js} +0 -0
  443. /package/styled-components/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +0 -0
  444. /package/styled-components/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +0 -0
  445. /package/styled-components/es/components/{Dropdown/ui/DropdownInner/DropdownInner.type.js → IconButton/IconButton.types.js} +0 -0
  446. /package/types/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.d.ts +0 -0
  447. /package/types/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.d.ts +0 -0
  448. /package/types/examples/plasma_b2c/components/Dropdown/{Dropdown.config.d.ts → Normal/Dropdown.config.d.ts} +0 -0
@@ -1 +0,0 @@
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') {\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;IACnBC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IACZC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACPb,iBAAiB,GAAAS,IAAA,CAAjBT,iBAAiB;IACjBc,kBAAkB,GAAAL,IAAA,CAAlBK,kBAAkB;IAClBC,aAAa,GAAAN,IAAA,CAAbM,aAAa;IACbC,YAAY,GAAAP,IAAA,CAAZO,YAAY;IAC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AAC,CAAC,CAAA;AAChF,SAAA;AACJ,OAAA;AACJ,KAAA;GACH,CAAA;EAED,OAAO;AAAEC,IAAAA,SAAS,EAATA,SAAAA;GAAW,CAAA;AACxB;;;;"}
@@ -1,33 +0,0 @@
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
@@ -1 +0,0 @@
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;;;;"}
@@ -1,37 +0,0 @@
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
@@ -1 +0,0 @@
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;;;;"}
@@ -1,115 +0,0 @@
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
@@ -1 +0,0 @@
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,YAA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a;AAC3BC,IAAAA,WAAW,EAAEA,WAAY;AACzBE,IAAAA,OAAO,EAAEA,OAAAA;AAAQ,GACpB,CAAC,CAAA;AAEV;;;;"}
@@ -1,5 +0,0 @@
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);}
@@ -1,23 +0,0 @@
1
- import './DropdownItem.styles_12e50g5.css';
2
- import { styled } from '@linaria/react';
3
- import 'focus-visible';
4
-
5
- var StyledContentLeft = /*#__PURE__*/styled('div')({
6
- name: "StyledContentLeft",
7
- "class": "s1iqs5in",
8
- propsAsIs: false
9
- });
10
- var StyledContentRight = /*#__PURE__*/styled('div')({
11
- name: "StyledContentRight",
12
- "class": "sfg3dyd",
13
- propsAsIs: false
14
- });
15
- var StyledText = /*#__PURE__*/styled('div')({
16
- name: "StyledText",
17
- "class": "s1dea6tl",
18
- propsAsIs: false
19
- });
20
- var base = "b1b2nce8";
21
-
22
- export { StyledContentLeft, StyledContentRight, StyledText, base };
23
- //# sourceMappingURL=DropdownItem.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DropdownItem.styles.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItemOld/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: auto;\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,MAAM,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,MAAM,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,MAAM,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,4 +0,0 @@
1
- .s1iqs5in{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
- .sfg3dyd{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
- .s1dea6tl{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
4
- .b1b2nce8{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:auto;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);}.b1b2nce8:focus{outline:none;}.b1b2nce8::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;}.b1b2nce8.focus-visible:focus::before,.b1b2nce8[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-dropdown-focus-color);}.b1b2nce8:hover:not(.dropdown-item-is-disabled){cursor:pointer;background:var(--plasma-dropdown-item-background-hover);}.b1b2nce8.dropdownItemIsSelected{color:var(--plasma-dropdown-item-color-selected);background:var(--plasma-dropdown-item-background-selected);}.b1b2nce8.dropdownItemIsSelected:hover:not(.dropdown-item-is-disabled){background:var(--plasma-dropdown-item-background-selected-hover);}.b1b2nce8.dropdown-item-is-disabled{opacity:var(--plasma-dropdown-disabled-opacity);cursor:not-allowed;}
@@ -1,4 +0,0 @@
1
- .DropdownItem_styles_12e50g5_s1iqs5in__94ac8eef{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_12e50g5_sfg3dyd__94ac8eef{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_12e50g5_s1dea6tl__94ac8eef{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
4
- .DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef{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:auto;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_12e50g5_b1b2nce8__94ac8eef:focus{outline:none;}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef::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_12e50g5_b1b2nce8__94ac8eef.DropdownItem_styles_12e50g5_focusVisible__94ac8eef:focus::before,.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-dropdown-focus-color);}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef:hover:not(.DropdownItem_styles_12e50g5_dropdownItemIsDisabled__94ac8eef){cursor:pointer;background:var(--plasma-dropdown-item-background-hover);}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef.DropdownItem_styles_12e50g5_dropdownItemIsSelected__94ac8eef{color:var(--plasma-dropdown-item-color-selected);background:var(--plasma-dropdown-item-background-selected);}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef.DropdownItem_styles_12e50g5_dropdownItemIsSelected__94ac8eef:hover:not(.DropdownItem_styles_12e50g5_dropdownItemIsDisabled__94ac8eef){background:var(--plasma-dropdown-item-background-selected-hover);}.DropdownItem_styles_12e50g5_b1b2nce8__94ac8eef.DropdownItem_styles_12e50g5_dropdownItemIsDisabled__94ac8eef{opacity:var(--plasma-dropdown-disabled-opacity);cursor:not-allowed;}
@@ -1,107 +0,0 @@
1
- import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
2
- import React, { forwardRef, useCallback, useMemo } from 'react';
3
- import { safeUseId } from '@salutejs/plasma-core';
4
- import { classes } from '../../Dropdown.tokens.js';
5
- import { cx } from '../../../../utils/index.js';
6
- import { getValidComponent } from '../../utils/index.js';
7
- import { base as base$1 } from './variations/_view/base.js';
8
- import { base as base$2 } from './variations/_size/base.js';
9
- import { StyledContentLeft, StyledText, StyledContentRight, base } from './DropdownItem.styles.js';
10
-
11
- var _excluded = ["id", "className", "children", "text", "isSelected", "name", "checked", "value", "role", "view", "size", "disabled", "contentLeft", "contentRight", "onSelect", "onClick", "onChange"];
12
- /**
13
- * Элемент выпадающего списка
14
- */
15
- var dropdownItemOldRoot = function dropdownItemOldRoot(Root) {
16
- return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
17
- var id = _ref.id,
18
- className = _ref.className,
19
- children = _ref.children,
20
- text = _ref.text,
21
- isSelected = _ref.isSelected,
22
- name = _ref.name,
23
- checked = _ref.checked,
24
- value = _ref.value,
25
- role = _ref.role,
26
- view = _ref.view,
27
- size = _ref.size,
28
- disabled = _ref.disabled,
29
- ContentLeftComponent = _ref.contentLeft,
30
- ContentRightComponent = _ref.contentRight,
31
- onSelect = _ref.onSelect,
32
- onClick = _ref.onClick,
33
- onChange = _ref.onChange,
34
- rest = _objectWithoutProperties(_ref, _excluded);
35
- var uniqId = safeUseId();
36
- var innerId = id || uniqId;
37
- var withDropdownItemIsSelected = checked || isSelected ? classes.dropdownItemIsSelected : undefined;
38
- var withDropdownItemIsDisabled = disabled ? classes.dropdownItemIsDisabled : undefined;
39
- var handleOnClick = useCallback(function (event) {
40
- if (disabled) {
41
- return;
42
- }
43
- onClick === null || onClick === void 0 || onClick(event);
44
- if (onSelect && !ContentLeftComponent) {
45
- onSelect(value, text);
46
- }
47
- }, [onSelect, disabled]);
48
- var handleOnChange = useCallback(function (event) {
49
- if (disabled) {
50
- return;
51
- }
52
- onChange === null || onChange === void 0 || onChange(event);
53
- if (onSelect && ContentLeftComponent) {
54
- onSelect(value, text);
55
- }
56
- }, [onSelect, disabled]);
57
- var contentProps = _objectSpread2({
58
- name: name,
59
- value: value,
60
- checked: checked || isSelected,
61
- disabled: disabled,
62
- tabIndex: 0
63
- }, !disabled && {
64
- onChange: handleOnChange
65
- });
66
- var ContentLeft = useMemo(function () {
67
- return getValidComponent(ContentLeftComponent, contentProps);
68
- }, [ContentRightComponent, contentProps]);
69
- var ContentRight = useMemo(function () {
70
- return getValidComponent(ContentRightComponent, contentProps);
71
- }, [ContentRightComponent, contentProps]);
72
- return /*#__PURE__*/React.createElement(Root, _extends({
73
- className: cx(withDropdownItemIsSelected, withDropdownItemIsDisabled, className),
74
- view: view,
75
- size: size,
76
- id: innerId,
77
- isSelected: isSelected,
78
- role: role,
79
- ref: outerRootRef,
80
- tabIndex: 0,
81
- "aria-disabled": disabled,
82
- onClick: handleOnClick,
83
- "data-value": value
84
- }, rest), text ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledContentLeft, null, ContentLeftComponent && ContentLeft), /*#__PURE__*/React.createElement(StyledText, null, text), /*#__PURE__*/React.createElement(StyledContentRight, null, ContentRightComponent && ContentRight)) : children);
85
- });
86
- };
87
- var dropdownItemOldConfig = {
88
- name: 'DropdownItem',
89
- tag: 'div',
90
- layout: dropdownItemOldRoot,
91
- base: base,
92
- variations: {
93
- view: {
94
- css: base$1
95
- },
96
- size: {
97
- css: base$2
98
- }
99
- },
100
- defaults: {
101
- view: 'primary',
102
- size: 'm'
103
- }
104
- };
105
-
106
- export { dropdownItemOldConfig, dropdownItemOldRoot };
107
- //# sourceMappingURL=DropdownItemOld.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DropdownItemOld.js","sources":["../../../../../src/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.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 dropdownItemOldRoot = (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 dropdownItemOldConfig = {\n name: 'DropdownItem',\n tag: 'div',\n layout: dropdownItemOldRoot,\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":["dropdownItemOldRoot","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","dropdownItemOldConfig","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;AAaA;AACA;AACA;IACaA,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,IAAkD,EAAA;AAAA,EAAA,oBAClFC,UAAU,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,GAAApB,IAAA,CAARoB,QAAQ;AACLC,MAAAA,IAAI,GAAAC,wBAAA,CAAAtB,IAAA,EAAAuB,SAAA,CAAA,CAAA;AAIX,IAAA,IAAMC,MAAM,GAAGC,SAAS,EAAE,CAAA;AAC1B,IAAA,IAA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AAAC,aAAA,CAACO,kBAAkB,QAAEpC,qBAAqB,IAAI2B,YAAiC,CACjF,CAAC,GAEHvC,QAEF,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMiD,qBAAqB,GAAG;AACjC9C,EAAAA,IAAI,EAAE,cAAc;AACpB+C,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE1D,mBAAmB;AAC3B2D,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACR9C,IAAAA,IAAI,EAAE;AACF+C,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACD/C,IAAAA,IAAI,EAAE;AACF8C,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNlD,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.js","sources":["../../../../../../../src/components/Dropdown/ui/DropdownItemOld/variations/_size/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":"AAEO,IAAMA,IAAI,GAAQ;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.js","sources":["../../../../../../../src/components/Dropdown/ui/DropdownItemOld/variations/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":"AAEO,IAAMA,IAAI,GAAQ;;;;"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getValidComponent = void 0;
7
- var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
8
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
9
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
10
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
- var isReactObject = function isReactObject(element) {
12
- return _typeof(element) === 'object' || typeof element === 'function';
13
- };
14
- var getValidComponent = exports.getValidComponent = function getValidComponent(element, props) {
15
- if ( /*#__PURE__*/(0, _react.isValidElement)(element)) {
16
- return /*#__PURE__*/(0, _react.cloneElement)(element, props);
17
- }
18
- if (isReactObject(element)) {
19
- var Component = element;
20
- return /*#__PURE__*/_react["default"].createElement(Component, props);
21
- }
22
- return element;
23
- };
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useHashMaps = void 0;
7
- var _react = /*#__PURE__*/require("react");
8
- var useHashMaps = exports.useHashMaps = function useHashMaps(items) {
9
- return (0, _react.useMemo)(function () {
10
- var pathMap = new Map();
11
- var focusedToValueMap = new Map();
12
- pathMap.set('root', items.length);
13
- var rec = function rec(items) {
14
- var prevIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
15
- items.forEach(function (item, index) {
16
- var value = item.value,
17
- innerItems = item.items;
18
- var currIndex = "".concat(prevIndex, "/").concat(index).replace(/^(\/)/, '');
19
- focusedToValueMap.set(currIndex, item);
20
- if (innerItems) {
21
- pathMap.set(value, innerItems.length);
22
- rec(innerItems, currIndex);
23
- }
24
- });
25
- };
26
- rec(items);
27
- return [pathMap, focusedToValueMap];
28
- }, [items]);
29
- };