@salutejs/plasma-new-hope 0.78.0-canary.1201.8968491632.0 → 0.78.0-canary.1203.8970261959.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (377) hide show
  1. package/cjs/components/Calendar/Calendar.types.js.map +1 -1
  2. package/cjs/components/Calendar/CalendarBase/CalendarBase.js +3 -1
  3. package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  4. package/cjs/components/Calendar/hooks/useDays.js +6 -3
  5. package/cjs/components/Calendar/hooks/useDays.js.map +1 -1
  6. package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +2 -1
  7. package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
  8. package/cjs/components/Combobox/Combobox.css +7 -17
  9. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +6 -15
  10. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
  11. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +6 -15
  12. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
  13. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +6 -15
  14. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
  15. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +6 -15
  16. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
  17. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.css +23 -4
  18. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +10 -81
  19. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
  20. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +9 -21
  21. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
  22. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +1 -0
  23. package/cjs/components/Dropdown/Dropdown.css +2 -25
  24. package/cjs/components/Dropdown/Dropdown.js +54 -138
  25. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  26. package/cjs/components/Dropdown/Dropdown.styles.js +7 -40
  27. package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
  28. package/cjs/components/Dropdown/Dropdown.styles_1daxhqh.css +2 -0
  29. package/cjs/components/Dropdown/Dropdown.tokens.js +23 -26
  30. package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
  31. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -7
  32. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +100 -79
  33. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  34. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -31
  35. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  36. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +4 -0
  37. package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +1 -1
  38. package/cjs/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +1 -0
  39. package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +1 -1
  40. package/cjs/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +1 -0
  41. package/cjs/components/Dropdown/utils/index.js +0 -16
  42. package/cjs/components/Dropdown/utils/index.js.map +1 -1
  43. package/cjs/components/Pagination/Pagination.css +7 -14
  44. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +7 -14
  45. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  46. package/cjs/components/Select/Select.css +7 -14
  47. package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +6 -15
  48. package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
  49. package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +6 -15
  50. package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
  51. package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +6 -15
  52. package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
  53. package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +6 -15
  54. package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
  55. package/cjs/components/Select/ui/SelectItem/SelectItem.css +7 -16
  56. package/cjs/components/Select/ui/SelectItem/SelectItem.js +3 -3
  57. package/cjs/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
  58. package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
  59. package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
  60. package/cjs/components/Select/ui/SelectItem/{SelectItem.styles_vk39mp.css → SelectItem.styles_6h17aw.css} +1 -1
  61. package/cjs/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  62. package/cjs/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
  63. package/cjs/index.css +8 -18
  64. package/cjs/index.js +2 -8
  65. package/cjs/index.js.map +1 -1
  66. package/es/components/Calendar/Calendar.types.js.map +1 -1
  67. package/es/components/Calendar/CalendarBase/CalendarBase.js +3 -1
  68. package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
  69. package/es/components/Calendar/hooks/useDays.js +6 -3
  70. package/es/components/Calendar/hooks/useDays.js.map +1 -1
  71. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js +2 -1
  72. package/es/components/Calendar/ui/CalendarDays/CalendarDays.js.map +1 -1
  73. package/es/components/Combobox/Combobox.css +7 -17
  74. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +6 -15
  75. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +2 -2
  76. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +6 -15
  77. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +2 -2
  78. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +6 -15
  79. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +2 -2
  80. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +6 -15
  81. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +2 -2
  82. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +23 -4
  83. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +11 -82
  84. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
  85. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +10 -19
  86. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
  87. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +1 -0
  88. package/es/components/Dropdown/Dropdown.css +2 -25
  89. package/es/components/Dropdown/Dropdown.js +60 -144
  90. package/es/components/Dropdown/Dropdown.js.map +1 -1
  91. package/es/components/Dropdown/Dropdown.styles.js +7 -39
  92. package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
  93. package/es/components/Dropdown/Dropdown.styles_1daxhqh.css +2 -0
  94. package/es/components/Dropdown/Dropdown.tokens.js +23 -26
  95. package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
  96. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -7
  97. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +100 -80
  98. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  99. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +5 -30
  100. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  101. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +4 -0
  102. package/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +1 -1
  103. package/es/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +1 -0
  104. package/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +1 -1
  105. package/es/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +1 -0
  106. package/es/components/Dropdown/utils/index.js +2 -16
  107. package/es/components/Dropdown/utils/index.js.map +1 -1
  108. package/es/components/Pagination/Pagination.css +7 -14
  109. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +7 -14
  110. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +1 -1
  111. package/es/components/Select/Select.css +7 -14
  112. package/es/components/Select/ui/SelectDivider/SelectDivider.css +6 -15
  113. package/es/components/Select/ui/SelectDivider/SelectDivider.js +2 -2
  114. package/es/components/Select/ui/SelectFooter/SelectFooter.css +6 -15
  115. package/es/components/Select/ui/SelectFooter/SelectFooter.js +2 -2
  116. package/es/components/Select/ui/SelectGroup/SelectGroup.css +6 -15
  117. package/es/components/Select/ui/SelectGroup/SelectGroup.js +2 -2
  118. package/es/components/Select/ui/SelectHeader/SelectHeader.css +6 -15
  119. package/es/components/Select/ui/SelectHeader/SelectHeader.js +2 -2
  120. package/es/components/Select/ui/SelectItem/SelectItem.css +7 -16
  121. package/es/components/Select/ui/SelectItem/SelectItem.js +3 -3
  122. package/es/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
  123. package/es/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
  124. package/es/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
  125. package/es/components/Select/ui/SelectItem/{SelectItem.styles_vk39mp.css → SelectItem.styles_6h17aw.css} +1 -1
  126. package/es/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  127. package/es/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
  128. package/es/index.css +8 -18
  129. package/es/index.js +1 -4
  130. package/es/index.js.map +1 -1
  131. package/package.json +2 -2
  132. package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +3 -1
  133. package/styled-components/cjs/components/Calendar/hooks/useDays.js +6 -3
  134. package/styled-components/cjs/components/Calendar/ui/CalendarDays/CalendarDays.js +2 -1
  135. package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +2 -91
  136. package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +7 -27
  137. package/styled-components/cjs/components/Dropdown/Dropdown.js +54 -140
  138. package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +7 -22
  139. package/styled-components/cjs/components/Dropdown/Dropdown.template-doc.mdx +80 -0
  140. package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +23 -26
  141. package/styled-components/cjs/components/Dropdown/index.js +1 -9
  142. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +105 -77
  143. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +19 -24
  144. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +19 -0
  145. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +9 -0
  146. package/styled-components/cjs/components/Dropdown/ui/index.js +5 -19
  147. package/styled-components/cjs/components/Dropdown/utils/index.js +1 -15
  148. package/styled-components/cjs/components/Dropdown/variations/_size/tokens.json +9 -1
  149. package/styled-components/cjs/components/Dropdown/variations/_view/tokens.json +1 -1
  150. package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.js +1 -1
  151. package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  152. package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  153. package/styled-components/cjs/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +18 -6
  154. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +27 -0
  155. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +13 -0
  156. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +194 -0
  157. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +27 -0
  158. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +13 -0
  159. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  160. package/styled-components/cjs/examples/plasma_web/components/Calendar/Calendar.stories.tsx +18 -6
  161. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +27 -0
  162. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +13 -0
  163. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +195 -0
  164. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +27 -0
  165. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +13 -0
  166. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  167. package/styled-components/cjs/examples/sds_engineer/components/Calendar/Calendar.stories.tsx +18 -6
  168. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.config.js +22 -0
  169. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.js +21 -0
  170. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +277 -0
  171. package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +3 -1
  172. package/styled-components/es/components/Calendar/hooks/useDays.js +6 -3
  173. package/styled-components/es/components/Calendar/ui/CalendarDays/CalendarDays.js +2 -1
  174. package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +3 -90
  175. package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +6 -23
  176. package/styled-components/es/components/Dropdown/Dropdown.js +55 -142
  177. package/styled-components/es/components/Dropdown/Dropdown.styles.js +5 -18
  178. package/styled-components/es/components/Dropdown/Dropdown.template-doc.mdx +80 -0
  179. package/styled-components/es/components/Dropdown/Dropdown.tokens.js +23 -26
  180. package/styled-components/es/components/Dropdown/index.js +0 -1
  181. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +107 -78
  182. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +15 -21
  183. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +19 -0
  184. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +9 -0
  185. package/styled-components/es/components/Dropdown/ui/index.js +1 -3
  186. package/styled-components/es/components/Dropdown/utils/index.js +1 -15
  187. package/styled-components/es/components/Dropdown/variations/_size/tokens.json +9 -1
  188. package/styled-components/es/components/Dropdown/variations/_view/tokens.json +1 -1
  189. package/styled-components/es/components/Select/ui/SelectItem/SelectItem.js +2 -2
  190. package/styled-components/es/components/Select/ui/SelectItem/SelectItem.styles.js +1 -1
  191. package/styled-components/es/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  192. package/styled-components/es/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +18 -6
  193. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +21 -0
  194. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +7 -0
  195. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +194 -0
  196. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +21 -0
  197. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +7 -0
  198. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  199. package/styled-components/es/examples/plasma_web/components/Calendar/Calendar.stories.tsx +18 -6
  200. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +21 -0
  201. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +7 -0
  202. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +195 -0
  203. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +21 -0
  204. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +7 -0
  205. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  206. package/styled-components/es/examples/sds_engineer/components/Calendar/Calendar.stories.tsx +18 -6
  207. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.config.js +16 -0
  208. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.js +15 -0
  209. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +277 -0
  210. package/types/components/Calendar/Calendar.types.d.ts +4 -0
  211. package/types/components/Calendar/Calendar.types.d.ts.map +1 -1
  212. package/types/components/Calendar/CalendarBase/CalendarBase.d.ts.map +1 -1
  213. package/types/components/Calendar/hooks/useDays.d.ts +1 -1
  214. package/types/components/Calendar/hooks/useDays.d.ts.map +1 -1
  215. package/types/components/Calendar/ui/CalendarDays/CalendarDays.d.ts.map +1 -1
  216. package/types/components/Calendar/ui/CalendarDays/CalendarDays.types.d.ts +1 -0
  217. package/types/components/Calendar/ui/CalendarDays/CalendarDays.types.d.ts.map +1 -1
  218. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts +13 -15
  219. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts.map +1 -1
  220. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts +1 -5
  221. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts.map +1 -1
  222. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts +2 -59
  223. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts.map +1 -1
  224. package/types/components/Dropdown/Dropdown.d.ts +4 -4
  225. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  226. package/types/components/Dropdown/Dropdown.styles.d.ts +1 -8
  227. package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
  228. package/types/components/Dropdown/Dropdown.tokens.d.ts +22 -24
  229. package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
  230. package/types/components/Dropdown/Dropdown.types.d.ts +40 -64
  231. package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
  232. package/types/components/Dropdown/index.d.ts +1 -3
  233. package/types/components/Dropdown/index.d.ts.map +1 -1
  234. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts +56 -2
  235. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
  236. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +2 -5
  237. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
  238. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +38 -44
  239. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
  240. package/types/components/Dropdown/ui/DropdownItem/variations/_size/base.d.ts.map +1 -0
  241. package/types/components/Dropdown/ui/DropdownItem/variations/_view/base.d.ts.map +1 -0
  242. package/types/components/Dropdown/ui/index.d.ts +1 -3
  243. package/types/components/Dropdown/ui/index.d.ts.map +1 -1
  244. package/types/components/Dropdown/utils/index.d.ts +2 -5
  245. package/types/components/Dropdown/utils/index.d.ts.map +1 -1
  246. package/types/components/Select/ui/SelectItem/SelectItem.d.ts +2 -2
  247. package/types/components/Select/ui/SelectItem/SelectItem.d.ts.map +1 -1
  248. package/types/components/Select/ui/SelectItem/SelectItem.type.d.ts +2 -2
  249. package/types/components/Select/utils/index.d.ts +1 -1
  250. package/types/components/_Icon/Icon.assets/DisclosureRight.d.ts.map +1 -1
  251. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -0
  252. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts +30 -0
  253. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts.map +1 -0
  254. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts +18 -0
  255. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -0
  256. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts +30 -0
  257. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts.map +1 -0
  258. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts +18 -0
  259. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -0
  260. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts +30 -0
  261. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts.map +1 -0
  262. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts +18 -0
  263. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -0
  264. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts +30 -0
  265. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts.map +1 -0
  266. package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts +15 -0
  267. package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts.map +1 -0
  268. package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts +51 -0
  269. package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts.map +1 -0
  270. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +0 -4
  271. package/cjs/components/Combobox/utils/index.js +0 -23
  272. package/cjs/components/Combobox/utils/index.js.map +0 -1
  273. package/cjs/components/Dropdown/Dropdown.styles_1tihqkp.css +0 -3
  274. package/cjs/components/Dropdown/hooks/useHashMaps.js +0 -34
  275. package/cjs/components/Dropdown/hooks/useHashMaps.js.map +0 -1
  276. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +0 -223
  277. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js.map +0 -1
  278. package/cjs/components/Dropdown/reducers/focusedPathReducer.js +0 -37
  279. package/cjs/components/Dropdown/reducers/focusedPathReducer.js.map +0 -1
  280. package/cjs/components/Dropdown/reducers/pathReducer.js +0 -41
  281. package/cjs/components/Dropdown/reducers/pathReducer.js.map +0 -1
  282. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -122
  283. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +0 -1
  284. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +0 -5
  285. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -30
  286. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +0 -1
  287. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +0 -4
  288. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +0 -4
  289. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -112
  290. package/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +0 -1
  291. package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +0 -1
  292. package/cjs/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +0 -1
  293. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +0 -4
  294. package/es/components/Combobox/utils/index.js +0 -19
  295. package/es/components/Combobox/utils/index.js.map +0 -1
  296. package/es/components/Dropdown/Dropdown.styles_1tihqkp.css +0 -3
  297. package/es/components/Dropdown/hooks/useHashMaps.js +0 -30
  298. package/es/components/Dropdown/hooks/useHashMaps.js.map +0 -1
  299. package/es/components/Dropdown/hooks/useKeyboardNavigation.js +0 -218
  300. package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +0 -1
  301. package/es/components/Dropdown/reducers/focusedPathReducer.js +0 -33
  302. package/es/components/Dropdown/reducers/focusedPathReducer.js.map +0 -1
  303. package/es/components/Dropdown/reducers/pathReducer.js +0 -37
  304. package/es/components/Dropdown/reducers/pathReducer.js.map +0 -1
  305. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -118
  306. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +0 -1
  307. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +0 -5
  308. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -23
  309. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js.map +0 -1
  310. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles_12e50g5.css +0 -4
  311. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.css +0 -4
  312. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -107
  313. package/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js.map +0 -1
  314. package/es/components/Dropdown/ui/DropdownItemOld/variations/_size/base.js.map +0 -1
  315. package/es/components/Dropdown/ui/DropdownItemOld/variations/_view/base.js.map +0 -1
  316. package/styled-components/cjs/components/Combobox/utils/index.js +0 -23
  317. package/styled-components/cjs/components/Dropdown/hooks/useHashMaps.js +0 -32
  318. package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +0 -221
  319. package/styled-components/cjs/components/Dropdown/reducers/focusedPathReducer.js +0 -40
  320. package/styled-components/cjs/components/Dropdown/reducers/pathReducer.js +0 -44
  321. package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -117
  322. package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +0 -5
  323. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -33
  324. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +0 -5
  325. package/styled-components/cjs/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -119
  326. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +0 -25
  327. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.js +0 -11
  328. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +0 -292
  329. package/styled-components/es/components/Combobox/utils/index.js +0 -15
  330. package/styled-components/es/components/Dropdown/hooks/useHashMaps.js +0 -26
  331. package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +0 -215
  332. package/styled-components/es/components/Dropdown/reducers/focusedPathReducer.js +0 -34
  333. package/styled-components/es/components/Dropdown/reducers/pathReducer.js +0 -38
  334. package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -111
  335. package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.type.js +0 -1
  336. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.js +0 -25
  337. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.js +0 -1
  338. package/styled-components/es/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.js +0 -111
  339. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +0 -19
  340. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.js +0 -5
  341. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +0 -292
  342. package/types/components/Combobox/utils/index.d.ts +0 -4
  343. package/types/components/Combobox/utils/index.d.ts.map +0 -1
  344. package/types/components/Dropdown/hooks/useHashMaps.d.ts +0 -6
  345. package/types/components/Dropdown/hooks/useHashMaps.d.ts.map +0 -1
  346. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts +0 -37
  347. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts.map +0 -1
  348. package/types/components/Dropdown/reducers/focusedPathReducer.d.ts +0 -16
  349. package/types/components/Dropdown/reducers/focusedPathReducer.d.ts.map +0 -1
  350. package/types/components/Dropdown/reducers/pathReducer.d.ts +0 -20
  351. package/types/components/Dropdown/reducers/pathReducer.d.ts.map +0 -1
  352. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts +0 -5
  353. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +0 -1
  354. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +0 -26
  355. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +0 -1
  356. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts +0 -7
  357. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.styles.d.ts.map +0 -1
  358. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts +0 -60
  359. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItem.type.d.ts.map +0 -1
  360. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts +0 -58
  361. package/types/components/Dropdown/ui/DropdownItemOld/DropdownItemOld.d.ts.map +0 -1
  362. package/types/components/Dropdown/ui/DropdownItemOld/variations/_size/base.d.ts.map +0 -1
  363. package/types/components/Dropdown/ui/DropdownItemOld/variations/_view/base.d.ts.map +0 -1
  364. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts.map +0 -1
  365. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +0 -13
  366. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +0 -1
  367. /package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base_x642ct.css +0 -0
  368. /package/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base_x642ct.css +0 -0
  369. /package/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base_x642ct.css +0 -0
  370. /package/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base_x642ct.css +0 -0
  371. /package/styled-components/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +0 -0
  372. /package/styled-components/cjs/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +0 -0
  373. /package/styled-components/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.js +0 -0
  374. /package/styled-components/es/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.js +0 -0
  375. /package/types/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_size/base.d.ts +0 -0
  376. /package/types/components/Dropdown/ui/{DropdownItemOld → DropdownItem}/variations/_view/base.d.ts +0 -0
  377. /package/types/examples/plasma_b2c/components/Dropdown/{Dropdown.config.d.ts → Normal/Dropdown.config.d.ts} +0 -0
@@ -1,112 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
6
- var React = require('react');
7
- var plasmaCore = require('@salutejs/plasma-core');
8
- var Dropdown_tokens = require('../../Dropdown.tokens.js');
9
- var index$1 = require('../../../../utils/index.js');
10
- var index = require('../../utils/index.js');
11
- var base = require('./variations/_view/base.js');
12
- var base$1 = require('./variations/_size/base.js');
13
- var DropdownItem_styles = require('./DropdownItem.styles.js');
14
-
15
- var _excluded = ["id", "className", "children", "text", "isSelected", "name", "checked", "value", "role", "view", "size", "disabled", "contentLeft", "contentRight", "onSelect", "onClick", "onChange"];
16
- /**
17
- * Элемент выпадающего списка
18
- */
19
- var dropdownItemOldRoot = function dropdownItemOldRoot(Root) {
20
- return /*#__PURE__*/React.forwardRef(function (_ref, outerRootRef) {
21
- var id = _ref.id,
22
- className = _ref.className,
23
- children = _ref.children,
24
- text = _ref.text,
25
- isSelected = _ref.isSelected,
26
- name = _ref.name,
27
- checked = _ref.checked,
28
- value = _ref.value,
29
- role = _ref.role,
30
- view = _ref.view,
31
- size = _ref.size,
32
- disabled = _ref.disabled,
33
- ContentLeftComponent = _ref.contentLeft,
34
- ContentRightComponent = _ref.contentRight,
35
- onSelect = _ref.onSelect,
36
- onClick = _ref.onClick,
37
- onChange = _ref.onChange,
38
- rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
39
- var uniqId = plasmaCore.safeUseId();
40
- var innerId = id || uniqId;
41
- var withDropdownItemIsSelected = checked || isSelected ? Dropdown_tokens.classes.dropdownItemIsSelected : undefined;
42
- var withDropdownItemIsDisabled = disabled ? Dropdown_tokens.classes.dropdownItemIsDisabled : undefined;
43
- var handleOnClick = React.useCallback(function (event) {
44
- if (disabled) {
45
- return;
46
- }
47
- onClick === null || onClick === void 0 || onClick(event);
48
- if (onSelect && !ContentLeftComponent) {
49
- onSelect(value, text);
50
- }
51
- }, [onSelect, disabled]);
52
- var handleOnChange = React.useCallback(function (event) {
53
- if (disabled) {
54
- return;
55
- }
56
- onChange === null || onChange === void 0 || onChange(event);
57
- if (onSelect && ContentLeftComponent) {
58
- onSelect(value, text);
59
- }
60
- }, [onSelect, disabled]);
61
- var contentProps = _rollupPluginBabelHelpers.objectSpread2({
62
- name: name,
63
- value: value,
64
- checked: checked || isSelected,
65
- disabled: disabled,
66
- tabIndex: 0
67
- }, !disabled && {
68
- onChange: handleOnChange
69
- });
70
- var ContentLeft = React.useMemo(function () {
71
- return index.getValidComponent(ContentLeftComponent, contentProps);
72
- }, [ContentRightComponent, contentProps]);
73
- var ContentRight = React.useMemo(function () {
74
- return index.getValidComponent(ContentRightComponent, contentProps);
75
- }, [ContentRightComponent, contentProps]);
76
- return /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
77
- className: index$1.cx(withDropdownItemIsSelected, withDropdownItemIsDisabled, className),
78
- view: view,
79
- size: size,
80
- id: innerId,
81
- isSelected: isSelected,
82
- role: role,
83
- ref: outerRootRef,
84
- tabIndex: 0,
85
- "aria-disabled": disabled,
86
- onClick: handleOnClick,
87
- "data-value": value
88
- }, rest), text ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DropdownItem_styles.StyledContentLeft, null, ContentLeftComponent && ContentLeft), /*#__PURE__*/React.createElement(DropdownItem_styles.StyledText, null, text), /*#__PURE__*/React.createElement(DropdownItem_styles.StyledContentRight, null, ContentRightComponent && ContentRight)) : children);
89
- });
90
- };
91
- var dropdownItemOldConfig = {
92
- name: 'DropdownItem',
93
- tag: 'div',
94
- layout: dropdownItemOldRoot,
95
- base: DropdownItem_styles.base,
96
- variations: {
97
- view: {
98
- css: base.base
99
- },
100
- size: {
101
- css: base$1.base
102
- }
103
- },
104
- defaults: {
105
- view: 'primary',
106
- size: 'm'
107
- }
108
- };
109
-
110
- exports.dropdownItemOldConfig = dropdownItemOldConfig;
111
- exports.dropdownItemOldRoot = dropdownItemOldRoot;
112
- //# 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,gBAAU,CACN,UAAAC,IAAA,EAqBIC,YAAY,EACX;AAAA,IAAA,IApBGC,EAAE,GAAAF,IAAA,CAAFE,EAAE;MACFC,SAAS,GAAAH,IAAA,CAATG,SAAS;MACTC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;MACRC,IAAI,GAAAL,IAAA,CAAJK,IAAI;MACJC,UAAU,GAAAN,IAAA,CAAVM,UAAU;MACVC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,OAAO,GAAAR,IAAA,CAAPQ,OAAO;MACPC,KAAK,GAAAT,IAAA,CAALS,KAAK;MACLC,IAAI,GAAAV,IAAA,CAAJU,IAAI;MACJC,IAAI,GAAAX,IAAA,CAAJW,IAAI;MACJC,IAAI,GAAAZ,IAAA,CAAJY,IAAI;MACJC,QAAQ,GAAAb,IAAA,CAARa,QAAQ;MACKC,oBAAoB,GAAAd,IAAA,CAAjCe,WAAW;MACGC,qBAAqB,GAAAhB,IAAA,CAAnCiB,YAAY;MACZC,QAAQ,GAAAlB,IAAA,CAARkB,QAAQ;MACRC,OAAO,GAAAnB,IAAA,CAAPmB,OAAO;MACPC,QAAQ,GAAApB,IAAA,CAARoB,QAAQ;AACLC,MAAAA,IAAI,GAAAC,iDAAA,CAAAtB,IAAA,EAAAuB,SAAA,CAAA,CAAA;AAIX,I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AAA,CAAAC,aAAA,CAACM,8BAAU,QAAE9C,IAAiB,CAAC,eAC/BuC,KAAA,CAAAC,aAAA,CAACO,sCAAkB,QAAEpC,qBAAqB,IAAI2B,YAAiC,CACjF,CAAC,GAEHvC,QAEF,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMiD,qBAAqB,GAAG;AACjC9C,EAAAA,IAAI,EAAE,cAAc;AACpB+C,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE1D,mBAAmB;AAC3B2D,EAAAA,IAAI,EAAJA,wBAAI;AACJC,EAAAA,UAAU,EAAE;AACR9C,IAAAA,IAAI,EAAE;AACF+C,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD/C,IAAAA,IAAI,EAAE;AACF8C,MAAAA,GAAG,EAAEE,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNlD,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
@@ -1 +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,4 +0,0 @@
1
- .s1thh7ji{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--plasma-combobox-item-content-left-width);color:var(--plasma-combobox-item-content-left-color);}
2
- .s1exy6xj{margin-left:auto;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--plasma-combobox-item-content-right-width);color:var(--plasma-combobox-item-content-right-color);}
3
- .s18437sq{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
4
- .bvoi56l{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-combobox-item-font-family);font-size:var(--plasma-combobox-item-font-size);font-style:var(--plasma-combobox-item-font-style);font-weight:var(--plasma-combobox-item-letter-spacing);-webkit-letter-spacing:var(--plasma-combobox-item-line-height);-moz-letter-spacing:var(--plasma-combobox-item-line-height);-ms-letter-spacing:var(--plasma-combobox-item-line-height);letter-spacing:var(--plasma-combobox-item-line-height);line-height:var(--plasma-combobox-item-font-weight);background:var(--plasma-combobox-item-background);color:var(--plasma-combobox-item-color);border-radius:var(--plasma-combobox-item-border-radius);width:var(--plasma-combobox-item-width);height:var(--plasma-combobox-item-height);padding:var(--plasma-combobox-item-padding-top) var(--plasma-combobox-item-padding-right) var(--plasma-combobox-item-padding-bottom) var(--plasma-combobox-item-padding-left);margin:var(--plasma-combobox-item-margin-top) var(--plasma-combobox-item-margin-right) var(--plasma-combobox-item-margin-bottom) var(--plasma-combobox-item-margin-left);}.bvoi56l:focus{outline:none;}.bvoi56l::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-combobox-item-border-radius);-webkit-transition:none;transition:none;pointer-events:none;}.bvoi56l.focus-visible:focus::before,.bvoi56l[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-combobox-focus-color);}.bvoi56l:hover:not(.combobox-item-is-disabled){cursor:pointer;background:var(--plasma-combobox-item-background-hover);}.bvoi56l.combobox-item-is-selected{color:var(--plasma-combobox-item-color-selected);background:var(--plasma-combobox-item-background-selected);}.bvoi56l.combobox-item-is-selected:hover:not(.combobox-item-is-disabled){background:var(--plasma-combobox-item-background-selected-hover);}.bvoi56l.combobox-item-is-disabled{opacity:var(--plasma-combobox-disabled-opacity);cursor:not-allowed;}
@@ -1,19 +0,0 @@
1
- import { typeof as _typeof } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
- import React, { isValidElement, cloneElement } from 'react';
3
-
4
- var isReactObject = function isReactObject(element) {
5
- return _typeof(element) === 'object' || typeof element === 'function';
6
- };
7
- var getValidComponent = function getValidComponent(element, props) {
8
- if ( /*#__PURE__*/isValidElement(element)) {
9
- return /*#__PURE__*/cloneElement(element, props);
10
- }
11
- if (isReactObject(element)) {
12
- var Component = element;
13
- return /*#__PURE__*/React.createElement(Component, props);
14
- }
15
- return element;
16
- };
17
-
18
- export { getValidComponent };
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Combobox/utils/index.tsx"],"sourcesContent":["import React, { cloneElement, isValidElement } from 'react';\nimport type { ElementType, ReactNode } from 'react';\n\nconst isReactObject = (element: any): element is ElementType => {\n return typeof element === 'object' || typeof element === 'function';\n};\n\nexport const getValidComponent = (element: ElementType | ReactNode, props: object) => {\n if (isValidElement(element)) {\n return cloneElement(element, props);\n }\n\n if (isReactObject(element)) {\n const Component = element;\n\n return <Component {...props} />;\n }\n\n return element;\n};\n"],"names":["isReactObject","element","_typeof","getValidComponent","props","isValidElement","cloneElement","Component","React","createElement"],"mappings":";;;AAGA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,OAAY,EAA6B;EAC5D,OAAOC,OAAA,CAAOD,OAAO,CAAA,KAAK,QAAQ,IAAI,OAAOA,OAAO,KAAK,UAAU,CAAA;AACvE,CAAC,CAAA;AAEM,IAAME,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIF,OAAgC,EAAEG,KAAa,EAAK;AAClF,EAAA,kBAAIC,cAAc,CAACJ,OAAO,CAAC,EAAE;AACzB,IAAA,oBAAOK,YAAY,CAACL,OAAO,EAAEG,KAAK,CAAC,CAAA;AACvC,GAAA;AAEA,EAAA,IAAIJ,aAAa,CAACC,OAAO,CAAC,EAAE;IACxB,IAAMM,SAAS,GAAGN,OAAO,CAAA;AAEzB,IAAA,oBAAOO,KAAA,CAAAC,aAAA,CAACF,SAAS,EAAKH,KAAQ,CAAC,CAAA;AACnC,GAAA;AAEA,EAAA,OAAOH,OAAO,CAAA;AAClB;;;;"}
@@ -1,3 +0,0 @@
1
- .sn7uamp .popover-wrapper,.sn7uamp .popover-target{display:block;}
2
- .ujr7fmv{box-sizing:border-box;background:var(--plasma-dropdown-background);box-shadow:var(--plasma-dropdown-box-shadow);border-radius:var(--plasma-dropdown-border-radius);width:var(--ujr7fmv-0);height:var(--ujr7fmv-1);overflow:var(--ujr7fmv-2);margin:var(--ujr7fmv-3);padding:var(--plasma-dropdown-padding);}
3
- .byfocd2{display:inline-block;}
@@ -1,30 +0,0 @@
1
- import { useMemo } from 'react';
2
-
3
- // Данный хук рекурсивно проходится по дереву items и создаем 2 мапы: мапу путей и мапу фокусов.
4
- // Нужно для получения информации всей об item, зная только путь до нее.
5
-
6
- var useHashMaps = function useHashMaps(items) {
7
- return useMemo(function () {
8
- var pathMap = new Map();
9
- var focusedToValueMap = new Map();
10
- pathMap.set('root', items.length);
11
- var rec = function rec(items) {
12
- var prevIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
13
- items.forEach(function (item, index) {
14
- var value = item.value,
15
- innerItems = item.items;
16
- var currIndex = "".concat(prevIndex, "/").concat(index).replace(/^(\/)/, '');
17
- focusedToValueMap.set(currIndex, item);
18
- if (innerItems) {
19
- pathMap.set(value, innerItems.length);
20
- rec(innerItems, currIndex);
21
- }
22
- });
23
- };
24
- rec(items);
25
- return [pathMap, focusedToValueMap];
26
- }, [items]);
27
- };
28
-
29
- export { useHashMaps };
30
- //# sourceMappingURL=useHashMaps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useHashMaps.js","sources":["../../../../src/components/Dropdown/hooks/useHashMaps.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { DropdownProps } from '../Dropdown.types';\nimport { DropdownItemOption } from '../ui/DropdownItem/DropdownItem.type';\n\nexport type PathMapType = Map<string | number, number>;\nexport type FocusedToValueMapType = Map<string, DropdownItemOption>;\n\n// Данный хук рекурсивно проходится по дереву items и создаем 2 мапы: мапу путей и мапу фокусов.\n// Нужно для получения информации всей об item, зная только путь до нее.\n\nexport const useHashMaps = (items: DropdownProps['items']) => {\n return useMemo(() => {\n const pathMap: PathMapType = new Map();\n const focusedToValueMap: FocusedToValueMapType = new Map();\n\n pathMap.set('root', items.length);\n\n const rec = (items: DropdownProps['items'], prevIndex = '') => {\n items.forEach((item: DropdownItemOption, index: number) => {\n const { value, items: innerItems } = item;\n\n const currIndex = `${prevIndex}/${index}`.replace(/^(\\/)/, '');\n focusedToValueMap.set(currIndex, item);\n\n if (innerItems) {\n pathMap.set(value, innerItems.length);\n rec(innerItems, currIndex);\n }\n });\n };\n rec(items);\n\n return [pathMap, focusedToValueMap] as [PathMapType, FocusedToValueMapType];\n }, [items]);\n};\n"],"names":["useHashMaps","items","useMemo","pathMap","Map","focusedToValueMap","set","length","rec","prevIndex","arguments","undefined","forEach","item","index","value","innerItems","currIndex","concat","replace"],"mappings":";;AAQA;AACA;;IAEaA,WAAW,GAAG,SAAdA,WAAWA,CAAIC,KAA6B,EAAK;EAC1D,OAAOC,OAAO,CAAC,YAAM;AACjB,IAAA,IAAMC,OAAoB,GAAG,IAAIC,GAAG,EAAE,CAAA;AACtC,IAAA,IAAMC,iBAAwC,GAAG,IAAID,GAAG,EAAE,CAAA;IAE1DD,OAAO,CAACG,GAAG,CAAC,MAAM,EAAEL,KAAK,CAACM,MAAM,CAAC,CAAA;AAEjC,IAAA,IAAMC,GAAG,GAAG,SAANA,GAAGA,CAAIP,KAA6B,EAAqB;AAAA,MAAA,IAAnBQ,SAAS,GAAAC,SAAA,CAAAH,MAAA,GAAA,CAAA,IAAAG,SAAA,CAAA,CAAA,CAAA,KAAAC,SAAA,GAAAD,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE,CAAA;AACtDT,MAAAA,KAAK,CAACW,OAAO,CAAC,UAACC,IAAwB,EAAEC,KAAa,EAAK;AACvD,QAAA,IAAQC,KAAK,GAAwBF,IAAI,CAAjCE,KAAK;UAASC,UAAU,GAAKH,IAAI,CAA1BZ,KAAK,CAAA;AAEpB,QAAA,IAAMgB,SAAS,GAAG,EAAA,CAAAC,MAAA,CAAGT,SAAS,EAAAS,GAAAA,CAAAA,CAAAA,MAAA,CAAIJ,KAAK,EAAGK,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;AAC9Dd,QAAAA,iBAAiB,CAACC,GAAG,CAACW,SAAS,EAAEJ,IAAI,CAAC,CAAA;AAEtC,QAAA,IAAIG,UAAU,EAAE;UACZb,OAAO,CAACG,GAAG,CAACS,KAAK,EAAEC,UAAU,CAACT,MAAM,CAAC,CAAA;AACrCC,UAAAA,GAAG,CAACQ,UAAU,EAAEC,SAAS,CAAC,CAAA;AAC9B,SAAA;AACJ,OAAC,CAAC,CAAA;KACL,CAAA;IACDT,GAAG,CAACP,KAAK,CAAC,CAAA;AAEV,IAAA,OAAO,CAACE,OAAO,EAAEE,iBAAiB,CAAC,CAAA;AACvC,GAAC,EAAE,CAACJ,KAAK,CAAC,CAAC,CAAA;AACf;;;;"}
@@ -1,218 +0,0 @@
1
- var JUMP_SIZE = 10;
2
- var keys = {
3
- Enter: 'Enter',
4
- Space: 'Space',
5
- Tab: 'Tab',
6
- Escape: 'Escape',
7
- ArrowLeft: 'ArrowLeft',
8
- ArrowRight: 'ArrowRight',
9
- ArrowUp: 'ArrowUp',
10
- ArrowDown: 'ArrowDown',
11
- Home: 'Home',
12
- End: 'End',
13
- PageUp: 'PageUp',
14
- PageDown: 'PageDown'
15
- };
16
- var getFurtherPath = function getFurtherPath(focusedPath, focusedToValueMap) {
17
- var focusedPathAsString = focusedPath.reduce(function (acc, n) {
18
- return "".concat(acc, "/").concat(n);
19
- }, '').replace(/^(\/)/, '');
20
- return focusedToValueMap.get(focusedPathAsString);
21
- };
22
- var useKeyNavigation = function useKeyNavigation(_ref) {
23
- var focusedPath = _ref.focusedPath,
24
- dispatchFocusedPath = _ref.dispatchFocusedPath,
25
- path = _ref.path,
26
- dispatchPath = _ref.dispatchPath,
27
- pathMap = _ref.pathMap,
28
- focusedToValueMap = _ref.focusedToValueMap,
29
- handleGlobalToggle = _ref.handleGlobalToggle,
30
- closeOnSelect = _ref.closeOnSelect,
31
- onItemSelect = _ref.onItemSelect,
32
- onItemClick = _ref.onItemClick;
33
- var currentLength = pathMap.get(path === null || path === void 0 ? void 0 : path[path.length - 1]) || 0;
34
- var currentIndex = (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[focusedPath.length - 1]) || 0;
35
- var onKeyDown = function onKeyDown(event) {
36
- var code = event.code;
37
- if (code === keys.ArrowUp) {
38
- if (focusedPath.length) {
39
- if (currentIndex <= 0) {
40
- return;
41
- }
42
- dispatchFocusedPath({
43
- type: 'change_last_focus',
44
- value: currentIndex - 1
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 === keys.ArrowDown) {
57
- if (focusedPath.length) {
58
- if (currentIndex + 1 >= currentLength) {
59
- return;
60
- }
61
- dispatchFocusedPath({
62
- type: 'change_last_focus',
63
- value: currentIndex + 1
64
- });
65
- } else {
66
- dispatchPath({
67
- type: 'opened_first_level'
68
- });
69
- dispatchFocusedPath({
70
- type: 'set_initial_focus'
71
- });
72
- handleGlobalToggle(true, event);
73
- }
74
- }
75
- if (code === keys.ArrowLeft) {
76
- if (focusedPath.length) {
77
- dispatchPath({
78
- type: 'removed_last_level'
79
- });
80
- dispatchFocusedPath({
81
- type: 'return_prev_focus'
82
- });
83
- }
84
- if (focusedPath.length === 1) {
85
- handleGlobalToggle(false, event);
86
- }
87
- }
88
- if (code === keys.ArrowRight) {
89
- if (focusedPath.length) {
90
- var currentItem = getFurtherPath(focusedPath, focusedToValueMap);
91
- if (currentItem !== null && currentItem !== void 0 && currentItem.items) {
92
- dispatchPath({
93
- type: 'added_next_level',
94
- value: currentItem.value.toString()
95
- });
96
- dispatchFocusedPath({
97
- type: 'add_focus',
98
- value: 0
99
- });
100
- }
101
- }
102
- }
103
- if (code === keys.Enter || code === keys.Space) {
104
- event.preventDefault();
105
- if (path[0]) {
106
- var _currentItem = getFurtherPath(focusedPath, focusedToValueMap);
107
- if (_currentItem !== null && _currentItem !== void 0 && _currentItem.disabled || _currentItem !== null && _currentItem !== void 0 && _currentItem.isDisabled) {
108
- return;
109
- }
110
- if (_currentItem !== null && _currentItem !== void 0 && _currentItem.items) {
111
- dispatchPath({
112
- type: 'added_next_level',
113
- value: _currentItem.value.toString()
114
- });
115
- dispatchFocusedPath({
116
- type: 'add_focus',
117
- value: 0
118
- });
119
- } else {
120
- if (closeOnSelect) {
121
- handleGlobalToggle(false, event);
122
- }
123
- if (onItemSelect && _currentItem) {
124
- onItemSelect(_currentItem, event);
125
- }
126
- if (onItemClick && _currentItem) {
127
- onItemClick(_currentItem, event);
128
- }
129
- }
130
- } else {
131
- dispatchPath({
132
- type: 'opened_first_level'
133
- });
134
- dispatchFocusedPath({
135
- type: 'set_initial_focus'
136
- });
137
- }
138
- }
139
- if (code === keys.Tab || code === keys.Escape) {
140
- dispatchFocusedPath({
141
- type: 'reset'
142
- });
143
- dispatchPath({
144
- type: 'reset'
145
- });
146
- handleGlobalToggle(false, event);
147
- }
148
- if (code === keys.Home) {
149
- if (path[0]) {
150
- dispatchFocusedPath({
151
- type: 'change_last_focus',
152
- value: 0
153
- });
154
- } else {
155
- dispatchPath({
156
- type: 'opened_first_level'
157
- });
158
- dispatchFocusedPath({
159
- type: 'set_initial_focus'
160
- });
161
- handleGlobalToggle(true, event);
162
- }
163
- }
164
- if (code === keys.End) {
165
- if (path[0]) {
166
- dispatchFocusedPath({
167
- type: 'change_last_focus',
168
- value: currentLength - 1
169
- });
170
- } else {
171
- dispatchPath({
172
- type: 'opened_first_level'
173
- });
174
- dispatchFocusedPath({
175
- type: 'change_last_focus',
176
- value: (pathMap.get('root') || 0) - 1
177
- });
178
- handleGlobalToggle(true, event);
179
- }
180
- }
181
- if (code === keys.PageUp) {
182
- if (path[0]) {
183
- if (currentIndex <= JUMP_SIZE) {
184
- dispatchFocusedPath({
185
- type: 'change_last_focus',
186
- value: 0
187
- });
188
- } else {
189
- dispatchFocusedPath({
190
- type: 'change_last_focus',
191
- value: currentIndex - JUMP_SIZE
192
- });
193
- }
194
- }
195
- }
196
- if (code === keys.PageDown) {
197
- if (path[0]) {
198
- if (currentLength - currentIndex <= JUMP_SIZE) {
199
- dispatchFocusedPath({
200
- type: 'change_last_focus',
201
- value: currentLength - 1
202
- });
203
- } else {
204
- dispatchFocusedPath({
205
- type: 'change_last_focus',
206
- value: currentIndex + JUMP_SIZE
207
- });
208
- }
209
- }
210
- }
211
- };
212
- return {
213
- onKeyDown: onKeyDown
214
- };
215
- };
216
-
217
- export { keys, useKeyNavigation };
218
- //# sourceMappingURL=useKeyboardNavigation.js.map
@@ -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 JUMP_SIZE = 10;\n\nexport const keys = {\n Enter: 'Enter',\n Space: 'Space',\n Tab: 'Tab',\n Escape: 'Escape',\n ArrowLeft: 'ArrowLeft',\n ArrowRight: 'ArrowRight',\n ArrowUp: 'ArrowUp',\n ArrowDown: 'ArrowDown',\n Home: 'Home',\n End: 'End',\n PageUp: 'PageUp',\n PageDown: 'PageDown',\n};\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 === keys.ArrowUp) {\n if (focusedPath.length) {\n if (currentIndex <= 0) {\n return;\n }\n\n dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex - 1 });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'set_initial_focus' });\n handleGlobalToggle(true, event);\n }\n }\n\n if (code === keys.ArrowDown) {\n if (focusedPath.length) {\n if (currentIndex + 1 >= currentLength) {\n return;\n }\n\n dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex + 1 });\n } else {\n dispatchPath({ type: 'opened_first_level' });\n dispatchFocusedPath({ type: 'set_initial_focus' });\n handleGlobalToggle(true, event);\n }\n }\n\n if (code === keys.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 === keys.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 === keys.Enter || code === keys.Space) {\n event.preventDefault();\n\n if (path[0]) {\n const currentItem = getFurtherPath(focusedPath, focusedToValueMap);\n\n if (currentItem?.disabled || currentItem?.isDisabled) {\n return;\n }\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 === keys.Tab || code === keys.Escape) {\n dispatchFocusedPath({ type: 'reset' });\n dispatchPath({ type: 'reset' });\n\n handleGlobalToggle(false, event);\n }\n\n if (code === keys.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 === keys.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 === keys.PageUp) {\n if (path[0]) {\n if (currentIndex <= JUMP_SIZE) {\n dispatchFocusedPath({ type: 'change_last_focus', value: 0 });\n } else {\n dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex - JUMP_SIZE });\n }\n }\n }\n\n if (code === keys.PageDown) {\n if (path[0]) {\n if (currentLength - currentIndex <= JUMP_SIZE) {\n dispatchFocusedPath({ type: 'change_last_focus', value: currentLength - 1 });\n } else {\n dispatchFocusedPath({ type: 'change_last_focus', value: currentIndex + JUMP_SIZE });\n }\n }\n }\n };\n\n return { onKeyDown };\n};\n"],"names":["JUMP_SIZE","keys","Enter","Space","Tab","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","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","type","value","currentItem","items","toString","preventDefault","disabled","isDisabled"],"mappings":"AASA,IAAMA,SAAS,GAAG,EAAE,CAAA;AAEb,IAAMC,IAAI,GAAG;AAChBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,SAAS,EAAE,WAAW;AACtBC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,SAAS,EAAE,WAAW;AACtBC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,QAAQ,EAAE,UAAA;AACd,EAAC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A,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;;;;"}