@salutejs/plasma-new-hope 0.78.0-canary.1185.8913944828.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 (423) hide show
  1. package/cjs/components/Combobox/Combobox.css +7 -12
  2. package/cjs/components/Combobox/Combobox.js +1 -1
  3. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +6 -10
  4. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +3 -3
  5. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +6 -10
  6. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +3 -3
  7. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +6 -10
  8. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +3 -3
  9. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +6 -10
  10. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +3 -3
  11. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.css +23 -4
  12. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +10 -81
  13. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
  14. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +9 -21
  15. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
  16. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +1 -0
  17. package/cjs/components/Dropdown/Dropdown.css +2 -20
  18. package/cjs/components/Dropdown/Dropdown.js +54 -138
  19. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  20. package/cjs/components/Dropdown/Dropdown.styles.js +7 -40
  21. package/cjs/components/Dropdown/Dropdown.styles.js.map +1 -1
  22. package/cjs/components/Dropdown/Dropdown.styles_1daxhqh.css +2 -0
  23. package/cjs/components/Dropdown/Dropdown.tokens.js +24 -12
  24. package/cjs/components/Dropdown/Dropdown.tokens.js.map +1 -1
  25. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -7
  26. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +100 -79
  27. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  28. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +4 -31
  29. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  30. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +4 -0
  31. package/cjs/components/Dropdown/ui/DropdownItem/variations/_size/base.js +9 -0
  32. package/cjs/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +1 -0
  33. package/cjs/components/Dropdown/ui/DropdownItem/variations/_size/base_x642ct.css +1 -0
  34. package/cjs/components/Dropdown/ui/DropdownItem/variations/_view/base.js +9 -0
  35. package/cjs/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +1 -0
  36. package/cjs/components/Dropdown/ui/DropdownItem/variations/_view/base_x642ct.css +1 -0
  37. package/cjs/components/Dropdown/utils/index.js +13 -14
  38. package/cjs/components/Dropdown/utils/index.js.map +1 -1
  39. package/cjs/components/IconButton/IconButton.css +25 -0
  40. package/cjs/components/IconButton/IconButton.js +84 -0
  41. package/cjs/components/IconButton/IconButton.js.map +1 -0
  42. package/cjs/components/IconButton/IconButton.styles.js +25 -0
  43. package/cjs/components/IconButton/IconButton.styles.js.map +1 -0
  44. package/cjs/components/IconButton/IconButton.styles_12iyaye.css +2 -0
  45. package/cjs/components/IconButton/IconButton.tokens.js +36 -0
  46. package/cjs/components/IconButton/IconButton.tokens.js.map +1 -0
  47. package/cjs/components/IconButton/variations/_disabled/base.js +9 -0
  48. package/cjs/components/IconButton/variations/_disabled/base.js.map +1 -0
  49. package/cjs/components/IconButton/variations/_disabled/base_x642ct.css +1 -0
  50. package/cjs/components/IconButton/variations/_focused/base.js +9 -0
  51. package/cjs/components/IconButton/variations/_focused/base.js.map +1 -0
  52. package/cjs/components/IconButton/variations/_focused/base_x642ct.css +1 -0
  53. package/cjs/components/IconButton/variations/_size/base.js +9 -0
  54. package/cjs/components/IconButton/variations/_size/base.js.map +1 -0
  55. package/cjs/components/IconButton/variations/_size/base_x642ct.css +1 -0
  56. package/cjs/components/IconButton/variations/_view/base.js +9 -0
  57. package/cjs/components/IconButton/variations/_view/base.js.map +1 -0
  58. package/cjs/components/IconButton/variations/_view/base_x642ct.css +1 -0
  59. package/cjs/components/Pagination/Pagination.css +7 -39
  60. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +7 -39
  61. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +2 -2
  62. package/cjs/components/Select/Select.css +7 -39
  63. package/cjs/components/Select/Select.js +3 -3
  64. package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +6 -10
  65. package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +3 -3
  66. package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +6 -10
  67. package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +3 -3
  68. package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +6 -10
  69. package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +3 -3
  70. package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +6 -10
  71. package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +3 -3
  72. package/cjs/components/Select/ui/SelectItem/SelectItem.css +7 -59
  73. package/cjs/components/Select/ui/SelectItem/SelectItem.js +4 -4
  74. package/cjs/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
  75. package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +3 -3
  76. package/cjs/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
  77. package/cjs/components/Select/ui/SelectItem/SelectItem.styles_6h17aw.css +1 -0
  78. package/cjs/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  79. package/cjs/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
  80. package/cjs/index.css +11 -13
  81. package/cjs/index.js +8 -5
  82. package/cjs/index.js.map +1 -1
  83. package/es/components/Combobox/Combobox.css +7 -12
  84. package/es/components/Combobox/Combobox.js +1 -1
  85. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +6 -10
  86. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.js +3 -3
  87. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +6 -10
  88. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.js +3 -3
  89. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +6 -10
  90. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.js +3 -3
  91. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +6 -10
  92. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.js +3 -3
  93. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +23 -4
  94. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +11 -82
  95. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js.map +1 -1
  96. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +10 -19
  97. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js.map +1 -1
  98. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_936wgl.css +1 -0
  99. package/es/components/Dropdown/Dropdown.css +2 -20
  100. package/es/components/Dropdown/Dropdown.js +60 -144
  101. package/es/components/Dropdown/Dropdown.js.map +1 -1
  102. package/es/components/Dropdown/Dropdown.styles.js +7 -39
  103. package/es/components/Dropdown/Dropdown.styles.js.map +1 -1
  104. package/es/components/Dropdown/Dropdown.styles_1daxhqh.css +2 -0
  105. package/es/components/Dropdown/Dropdown.tokens.js +24 -12
  106. package/es/components/Dropdown/Dropdown.tokens.js.map +1 -1
  107. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -7
  108. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +100 -80
  109. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  110. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +4 -30
  111. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
  112. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1juhjtq.css +4 -0
  113. package/es/components/Dropdown/ui/DropdownItem/variations/_size/base.js +5 -0
  114. package/es/components/Dropdown/ui/DropdownItem/variations/_size/base.js.map +1 -0
  115. package/es/components/Dropdown/ui/DropdownItem/variations/_size/base_x642ct.css +1 -0
  116. package/es/components/Dropdown/ui/DropdownItem/variations/_view/base.js +5 -0
  117. package/es/components/Dropdown/ui/DropdownItem/variations/_view/base.js.map +1 -0
  118. package/es/components/Dropdown/ui/DropdownItem/variations/_view/base_x642ct.css +1 -0
  119. package/es/components/Dropdown/utils/index.js +14 -14
  120. package/es/components/Dropdown/utils/index.js.map +1 -1
  121. package/es/components/IconButton/IconButton.css +25 -0
  122. package/es/components/IconButton/IconButton.js +79 -0
  123. package/es/components/IconButton/IconButton.js.map +1 -0
  124. package/es/components/IconButton/IconButton.styles.js +20 -0
  125. package/es/components/IconButton/IconButton.styles.js.map +1 -0
  126. package/es/components/IconButton/IconButton.styles_12iyaye.css +2 -0
  127. package/es/components/IconButton/IconButton.tokens.js +31 -0
  128. package/es/components/IconButton/IconButton.tokens.js.map +1 -0
  129. package/es/components/IconButton/variations/_disabled/base.js +5 -0
  130. package/es/components/IconButton/variations/_disabled/base.js.map +1 -0
  131. package/es/components/IconButton/variations/_disabled/base_x642ct.css +1 -0
  132. package/es/components/IconButton/variations/_focused/base.js +5 -0
  133. package/es/components/IconButton/variations/_focused/base.js.map +1 -0
  134. package/es/components/IconButton/variations/_focused/base_x642ct.css +1 -0
  135. package/es/components/IconButton/variations/_size/base.js +5 -0
  136. package/es/components/IconButton/variations/_size/base.js.map +1 -0
  137. package/es/components/IconButton/variations/_size/base_x642ct.css +1 -0
  138. package/es/components/IconButton/variations/_view/base.js +5 -0
  139. package/es/components/IconButton/variations/_view/base.js.map +1 -0
  140. package/es/components/IconButton/variations/_view/base_x642ct.css +1 -0
  141. package/es/components/Pagination/Pagination.css +7 -39
  142. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +7 -39
  143. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.js +2 -2
  144. package/es/components/Select/Select.css +7 -39
  145. package/es/components/Select/Select.js +3 -3
  146. package/es/components/Select/ui/SelectDivider/SelectDivider.css +6 -10
  147. package/es/components/Select/ui/SelectDivider/SelectDivider.js +3 -3
  148. package/es/components/Select/ui/SelectFooter/SelectFooter.css +6 -10
  149. package/es/components/Select/ui/SelectFooter/SelectFooter.js +3 -3
  150. package/es/components/Select/ui/SelectGroup/SelectGroup.css +6 -10
  151. package/es/components/Select/ui/SelectGroup/SelectGroup.js +3 -3
  152. package/es/components/Select/ui/SelectHeader/SelectHeader.css +6 -10
  153. package/es/components/Select/ui/SelectHeader/SelectHeader.js +3 -3
  154. package/es/components/Select/ui/SelectItem/SelectItem.css +7 -59
  155. package/es/components/Select/ui/SelectItem/SelectItem.js +4 -4
  156. package/es/components/Select/ui/SelectItem/SelectItem.js.map +1 -1
  157. package/es/components/Select/ui/SelectItem/SelectItem.styles.js +3 -3
  158. package/es/components/Select/ui/SelectItem/SelectItem.styles.js.map +1 -1
  159. package/es/components/Select/ui/SelectItem/SelectItem.styles_6h17aw.css +1 -0
  160. package/es/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  161. package/es/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
  162. package/es/index.css +11 -13
  163. package/es/index.js +3 -3
  164. package/package.json +2 -2
  165. package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.js +2 -91
  166. package/styled-components/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +7 -27
  167. package/styled-components/cjs/components/Dropdown/Dropdown.js +54 -140
  168. package/styled-components/cjs/components/Dropdown/Dropdown.styles.js +7 -22
  169. package/styled-components/cjs/components/Dropdown/Dropdown.template-doc.mdx +80 -0
  170. package/styled-components/cjs/components/Dropdown/Dropdown.tokens.js +24 -12
  171. package/styled-components/cjs/components/Dropdown/index.js +1 -9
  172. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +105 -77
  173. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +15 -30
  174. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_size/base.js +8 -0
  175. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +19 -0
  176. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_view/base.js +8 -0
  177. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +9 -0
  178. package/styled-components/cjs/components/Dropdown/ui/index.js +13 -14
  179. package/styled-components/cjs/components/Dropdown/utils/index.js +13 -14
  180. package/styled-components/cjs/components/Dropdown/variations/_size/tokens.json +9 -1
  181. package/styled-components/cjs/components/Dropdown/variations/_view/tokens.json +1 -1
  182. package/styled-components/cjs/components/IconButton/IconButton.js +86 -0
  183. package/styled-components/cjs/components/IconButton/IconButton.styles.js +19 -0
  184. package/styled-components/cjs/components/IconButton/IconButton.tokens.js +34 -0
  185. package/styled-components/cjs/components/IconButton/index.js +31 -0
  186. package/styled-components/cjs/components/IconButton/variations/_disabled/base.js +8 -0
  187. package/styled-components/cjs/components/IconButton/variations/_disabled/tokens.json +1 -0
  188. package/styled-components/cjs/components/IconButton/variations/_focused/base.js +8 -0
  189. package/styled-components/cjs/components/IconButton/variations/_focused/tokens.json +1 -0
  190. package/styled-components/cjs/components/IconButton/variations/_size/base.js +8 -0
  191. package/styled-components/cjs/components/IconButton/variations/_size/tokens.json +1 -0
  192. package/styled-components/cjs/components/IconButton/variations/_view/base.js +8 -0
  193. package/styled-components/cjs/components/IconButton/variations/_view/tokens.json +1 -0
  194. package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.js +2 -2
  195. package/styled-components/cjs/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
  196. package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  197. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +27 -0
  198. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +13 -0
  199. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +194 -0
  200. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +27 -0
  201. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +13 -0
  202. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  203. package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.config.js +46 -0
  204. package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.js +11 -0
  205. package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.stories.tsx +65 -0
  206. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +27 -0
  207. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +13 -0
  208. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +195 -0
  209. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +27 -0
  210. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +13 -0
  211. package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  212. package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.config.js +46 -0
  213. package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.js +11 -0
  214. package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.stories.tsx +65 -0
  215. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.config.js +22 -0
  216. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.js +21 -0
  217. package/styled-components/cjs/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +277 -0
  218. package/styled-components/cjs/index.js +11 -0
  219. package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.js +3 -90
  220. package/styled-components/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.js +6 -23
  221. package/styled-components/es/components/Dropdown/Dropdown.js +55 -142
  222. package/styled-components/es/components/Dropdown/Dropdown.styles.js +5 -18
  223. package/styled-components/es/components/Dropdown/Dropdown.template-doc.mdx +80 -0
  224. package/styled-components/es/components/Dropdown/Dropdown.tokens.js +24 -12
  225. package/styled-components/es/components/Dropdown/index.js +0 -1
  226. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +107 -78
  227. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +11 -27
  228. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_size/base.js +2 -0
  229. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_size/tokens.json +19 -0
  230. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_view/base.js +2 -0
  231. package/styled-components/es/components/Dropdown/ui/DropdownItem/variations/_view/tokens.json +9 -0
  232. package/styled-components/es/components/Dropdown/ui/index.js +1 -2
  233. package/styled-components/es/components/Dropdown/utils/index.js +13 -13
  234. package/styled-components/es/components/Dropdown/variations/_size/tokens.json +9 -1
  235. package/styled-components/es/components/Dropdown/variations/_view/tokens.json +1 -1
  236. package/styled-components/es/components/IconButton/IconButton.js +77 -0
  237. package/styled-components/es/components/IconButton/IconButton.styles.js +11 -0
  238. package/styled-components/es/components/IconButton/IconButton.tokens.js +28 -0
  239. package/styled-components/es/components/IconButton/index.js +2 -0
  240. package/styled-components/es/components/IconButton/variations/_disabled/base.js +2 -0
  241. package/styled-components/es/components/IconButton/variations/_disabled/tokens.json +1 -0
  242. package/styled-components/es/components/IconButton/variations/_focused/base.js +2 -0
  243. package/styled-components/es/components/IconButton/variations/_focused/tokens.json +1 -0
  244. package/styled-components/es/components/IconButton/variations/_size/base.js +2 -0
  245. package/styled-components/es/components/IconButton/variations/_size/tokens.json +1 -0
  246. package/styled-components/es/components/IconButton/variations/_view/base.js +2 -0
  247. package/styled-components/es/components/IconButton/variations/_view/tokens.json +1 -0
  248. package/styled-components/es/components/Select/ui/SelectItem/SelectItem.js +2 -2
  249. package/styled-components/es/components/Select/ui/SelectItem/SelectItem.styles.js +2 -2
  250. package/styled-components/es/components/_Icon/Icon.assets/DisclosureRight.js +2 -1
  251. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.js +21 -0
  252. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.js +7 -0
  253. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +194 -0
  254. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.js +21 -0
  255. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.js +7 -0
  256. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  257. package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.config.js +40 -0
  258. package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.js +5 -0
  259. package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.stories.tsx +65 -0
  260. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.js +21 -0
  261. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.js +7 -0
  262. package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +195 -0
  263. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.js +21 -0
  264. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.js +7 -0
  265. package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +195 -0
  266. package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.config.js +40 -0
  267. package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.js +5 -0
  268. package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.stories.tsx +65 -0
  269. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.config.js +16 -0
  270. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.js +15 -0
  271. package/styled-components/es/examples/sds_engineer/components/Dropdown/Dropdown.stories.tsx +277 -0
  272. package/styled-components/es/index.js +1 -0
  273. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts +13 -15
  274. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.d.ts.map +1 -1
  275. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts +1 -5
  276. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.styles.d.ts.map +1 -1
  277. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts +2 -59
  278. package/types/components/Combobox/ui/ComboboxItem/ComboboxItem.type.d.ts.map +1 -1
  279. package/types/components/Dropdown/Dropdown.d.ts +4 -4
  280. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  281. package/types/components/Dropdown/Dropdown.styles.d.ts +1 -8
  282. package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
  283. package/types/components/Dropdown/Dropdown.tokens.d.ts +22 -9
  284. package/types/components/Dropdown/Dropdown.tokens.d.ts.map +1 -1
  285. package/types/components/Dropdown/Dropdown.types.d.ts +40 -64
  286. package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
  287. package/types/components/Dropdown/index.d.ts +1 -3
  288. package/types/components/Dropdown/index.d.ts.map +1 -1
  289. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts +56 -2
  290. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
  291. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +1 -5
  292. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
  293. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +38 -44
  294. package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
  295. package/types/components/Dropdown/ui/DropdownItem/variations/_size/base.d.ts +2 -0
  296. package/types/components/Dropdown/ui/DropdownItem/variations/_size/base.d.ts.map +1 -0
  297. package/types/components/Dropdown/ui/DropdownItem/variations/_view/base.d.ts +2 -0
  298. package/types/components/Dropdown/ui/DropdownItem/variations/_view/base.d.ts.map +1 -0
  299. package/types/components/Dropdown/ui/index.d.ts +1 -2
  300. package/types/components/Dropdown/ui/index.d.ts.map +1 -1
  301. package/types/components/Dropdown/utils/index.d.ts +3 -5
  302. package/types/components/Dropdown/utils/index.d.ts.map +1 -1
  303. package/types/components/IconButton/IconButton.d.ts +30 -0
  304. package/types/components/IconButton/IconButton.d.ts.map +1 -0
  305. package/types/components/IconButton/IconButton.styles.d.ts +4 -0
  306. package/types/components/IconButton/IconButton.styles.d.ts.map +1 -0
  307. package/types/components/IconButton/IconButton.tokens.d.ts +29 -0
  308. package/types/components/IconButton/IconButton.tokens.d.ts.map +1 -0
  309. package/types/components/IconButton/IconButton.types.d.ts +13 -0
  310. package/types/components/IconButton/IconButton.types.d.ts.map +1 -0
  311. package/types/components/IconButton/index.d.ts +4 -0
  312. package/types/components/IconButton/index.d.ts.map +1 -0
  313. package/types/components/IconButton/variations/_disabled/base.d.ts +2 -0
  314. package/types/components/IconButton/variations/_disabled/base.d.ts.map +1 -0
  315. package/types/components/IconButton/variations/_focused/base.d.ts +2 -0
  316. package/types/components/IconButton/variations/_focused/base.d.ts.map +1 -0
  317. package/types/components/IconButton/variations/_size/base.d.ts +2 -0
  318. package/types/components/IconButton/variations/_size/base.d.ts.map +1 -0
  319. package/types/components/IconButton/variations/_view/base.d.ts +2 -0
  320. package/types/components/IconButton/variations/_view/base.d.ts.map +1 -0
  321. package/types/components/Select/ui/SelectItem/SelectItem.d.ts +2 -2
  322. package/types/components/Select/ui/SelectItem/SelectItem.type.d.ts +2 -2
  323. package/types/components/Select/utils/index.d.ts +1 -1
  324. package/types/components/_Icon/Icon.assets/DisclosureRight.d.ts.map +1 -1
  325. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -0
  326. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts +30 -0
  327. package/types/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.d.ts.map +1 -0
  328. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts +18 -0
  329. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -0
  330. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts +30 -0
  331. package/types/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.d.ts.map +1 -0
  332. package/types/examples/plasma_b2c/components/IconButton/IconButton.config.d.ts +39 -0
  333. package/types/examples/plasma_b2c/components/IconButton/IconButton.config.d.ts.map +1 -0
  334. package/types/examples/plasma_b2c/components/IconButton/IconButton.d.ts +33 -0
  335. package/types/examples/plasma_b2c/components/IconButton/IconButton.d.ts.map +1 -0
  336. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts +18 -0
  337. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.config.d.ts.map +1 -0
  338. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts +30 -0
  339. package/types/examples/plasma_web/components/Dropdown/Normal/Dropdown.d.ts.map +1 -0
  340. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts +18 -0
  341. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.d.ts.map +1 -0
  342. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts +30 -0
  343. package/types/examples/plasma_web/components/Dropdown/Tight/Dropdown.d.ts.map +1 -0
  344. package/types/examples/plasma_web/components/IconButton/IconButton.config.d.ts +39 -0
  345. package/types/examples/plasma_web/components/IconButton/IconButton.config.d.ts.map +1 -0
  346. package/types/examples/plasma_web/components/IconButton/IconButton.d.ts +33 -0
  347. package/types/examples/plasma_web/components/IconButton/IconButton.d.ts.map +1 -0
  348. package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts +15 -0
  349. package/types/examples/sds_engineer/components/Dropdown/Dropdown.config.d.ts.map +1 -0
  350. package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts +51 -0
  351. package/types/examples/sds_engineer/components/Dropdown/Dropdown.d.ts.map +1 -0
  352. package/types/index.d.ts +1 -0
  353. package/types/index.d.ts.map +1 -1
  354. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +0 -4
  355. package/cjs/components/Combobox/utils/index.js +0 -23
  356. package/cjs/components/Combobox/utils/index.js.map +0 -1
  357. package/cjs/components/Dropdown/Dropdown.styles_1tihqkp.css +0 -3
  358. package/cjs/components/Dropdown/hooks/useHashMaps.js +0 -31
  359. package/cjs/components/Dropdown/hooks/useHashMaps.js.map +0 -1
  360. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +0 -200
  361. package/cjs/components/Dropdown/hooks/useKeyboardNavigation.js.map +0 -1
  362. package/cjs/components/Dropdown/reducers/focusedPathReducer.js +0 -37
  363. package/cjs/components/Dropdown/reducers/focusedPathReducer.js.map +0 -1
  364. package/cjs/components/Dropdown/reducers/pathReducer.js +0 -41
  365. package/cjs/components/Dropdown/reducers/pathReducer.js.map +0 -1
  366. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -117
  367. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +0 -1
  368. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +0 -5
  369. package/cjs/components/Select/ui/SelectItem/SelectItem.styles_1jgsd1a.css +0 -1
  370. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.styles_s4sk53.css +0 -4
  371. package/es/components/Combobox/utils/index.js +0 -19
  372. package/es/components/Combobox/utils/index.js.map +0 -1
  373. package/es/components/Dropdown/Dropdown.styles_1tihqkp.css +0 -3
  374. package/es/components/Dropdown/hooks/useHashMaps.js +0 -27
  375. package/es/components/Dropdown/hooks/useHashMaps.js.map +0 -1
  376. package/es/components/Dropdown/hooks/useKeyboardNavigation.js +0 -196
  377. package/es/components/Dropdown/hooks/useKeyboardNavigation.js.map +0 -1
  378. package/es/components/Dropdown/reducers/focusedPathReducer.js +0 -33
  379. package/es/components/Dropdown/reducers/focusedPathReducer.js.map +0 -1
  380. package/es/components/Dropdown/reducers/pathReducer.js +0 -37
  381. package/es/components/Dropdown/reducers/pathReducer.js.map +0 -1
  382. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -113
  383. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +0 -1
  384. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles_1o4szyu.css +0 -5
  385. package/es/components/Select/ui/SelectItem/SelectItem.styles_1jgsd1a.css +0 -1
  386. package/styled-components/cjs/components/Combobox/utils/index.js +0 -23
  387. package/styled-components/cjs/components/Dropdown/hooks/useHashMaps.js +0 -29
  388. package/styled-components/cjs/components/Dropdown/hooks/useKeyboardNavigation.js +0 -199
  389. package/styled-components/cjs/components/Dropdown/reducers/focusedPathReducer.js +0 -40
  390. package/styled-components/cjs/components/Dropdown/reducers/pathReducer.js +0 -44
  391. package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -114
  392. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +0 -25
  393. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.js +0 -11
  394. package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +0 -294
  395. package/styled-components/es/components/Combobox/utils/index.js +0 -15
  396. package/styled-components/es/components/Dropdown/hooks/useHashMaps.js +0 -23
  397. package/styled-components/es/components/Dropdown/hooks/useKeyboardNavigation.js +0 -193
  398. package/styled-components/es/components/Dropdown/reducers/focusedPathReducer.js +0 -34
  399. package/styled-components/es/components/Dropdown/reducers/pathReducer.js +0 -38
  400. package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +0 -108
  401. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.config.js +0 -19
  402. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.js +0 -5
  403. package/styled-components/es/examples/plasma_b2c/components/Dropdown/Dropdown.stories.tsx +0 -294
  404. package/types/components/Combobox/utils/index.d.ts +0 -4
  405. package/types/components/Combobox/utils/index.d.ts.map +0 -1
  406. package/types/components/Dropdown/hooks/useHashMaps.d.ts +0 -6
  407. package/types/components/Dropdown/hooks/useHashMaps.d.ts.map +0 -1
  408. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts +0 -23
  409. package/types/components/Dropdown/hooks/useKeyboardNavigation.d.ts.map +0 -1
  410. package/types/components/Dropdown/reducers/focusedPathReducer.d.ts +0 -16
  411. package/types/components/Dropdown/reducers/focusedPathReducer.d.ts.map +0 -1
  412. package/types/components/Dropdown/reducers/pathReducer.d.ts +0 -20
  413. package/types/components/Dropdown/reducers/pathReducer.d.ts.map +0 -1
  414. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts +0 -5
  415. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +0 -1
  416. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +0 -26
  417. package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +0 -1
  418. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.config.d.ts.map +0 -1
  419. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +0 -13
  420. package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +0 -1
  421. /package/styled-components/cjs/components/{Dropdown/ui/DropdownInner/DropdownInner.type.js → IconButton/IconButton.types.js} +0 -0
  422. /package/styled-components/es/components/{Dropdown/ui/DropdownInner/DropdownInner.type.js → IconButton/IconButton.types.js} +0 -0
  423. /package/types/examples/plasma_b2c/components/Dropdown/{Dropdown.config.d.ts → Normal/Dropdown.config.d.ts} +0 -0
@@ -0,0 +1,18 @@
1
+ export declare const config: {
2
+ defaults: {
3
+ view: string;
4
+ size: string;
5
+ };
6
+ variations: {
7
+ size: {
8
+ xs: import("@linaria/core").LinariaClassName;
9
+ s: import("@linaria/core").LinariaClassName;
10
+ m: import("@linaria/core").LinariaClassName;
11
+ l: import("@linaria/core").LinariaClassName;
12
+ };
13
+ view: {
14
+ default: import("@linaria/core").LinariaClassName;
15
+ };
16
+ };
17
+ };
18
+ //# sourceMappingURL=Dropdown.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropdown.config.d.ts","sourceRoot":"","sources":["../../../../../../src/examples/plasma_web/components/Dropdown/Tight/Dropdown.config.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;CA4FlB,CAAC"}
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ export declare const Dropdown: import("react").FunctionComponent<import("../../../../../engines/types").PropsType<{
3
+ size: {
4
+ xs: import("@linaria/core").LinariaClassName;
5
+ s: import("@linaria/core").LinariaClassName;
6
+ m: import("@linaria/core").LinariaClassName;
7
+ l: import("@linaria/core").LinariaClassName;
8
+ };
9
+ view: {
10
+ default: import("@linaria/core").LinariaClassName;
11
+ };
12
+ }> & import("react").HTMLAttributes<HTMLDivElement> & import("../../../../../components/Dropdown/Dropdown.types").CustomDropdownProps & import("react").RefAttributes<HTMLDivElement>>;
13
+ export declare const DropdownItem: import("react").FunctionComponent<import("../../../../../engines/types").PropsType<import("../../../../../engines/types").Variants> & Omit<import("react").HTMLAttributes<HTMLDivElement>, "onSelect"> & {
14
+ id?: string | undefined;
15
+ disabled?: boolean | undefined;
16
+ label?: import("react").ReactNode;
17
+ role?: string | undefined;
18
+ contentLeft?: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactFragment | import("react").ReactPortal | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | null | undefined;
19
+ contentRight?: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactFragment | import("react").ReactPortal | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | null | undefined;
20
+ name?: string | undefined;
21
+ checked?: boolean | undefined;
22
+ text?: string | undefined;
23
+ value?: string | number | boolean | undefined;
24
+ isSelected?: boolean | undefined;
25
+ onClick?: ((event: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
26
+ onSelect?: ((value?: any, text?: any) => void) | undefined;
27
+ size?: string | undefined;
28
+ view?: string | undefined;
29
+ } & import("react").RefAttributes<HTMLDivElement>>;
30
+ //# sourceMappingURL=Dropdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../../../src/examples/plasma_web/components/Dropdown/Tight/Dropdown.ts"],"names":[],"mappings":";AAMA,eAAO,MAAM,QAAQ;;;;;;;;;;sLAA0B,CAAC;AAGhD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;kDAA8B,CAAC"}
@@ -0,0 +1,39 @@
1
+ export declare const config: {
2
+ defaults: {
3
+ view: string;
4
+ focused: string;
5
+ size: string;
6
+ };
7
+ variations: {
8
+ view: {
9
+ default: import("@linaria/core").LinariaClassName;
10
+ primary: import("@linaria/core").LinariaClassName;
11
+ accent: import("@linaria/core").LinariaClassName;
12
+ secondary: import("@linaria/core").LinariaClassName;
13
+ clear: import("@linaria/core").LinariaClassName;
14
+ success: import("@linaria/core").LinariaClassName;
15
+ warning: import("@linaria/core").LinariaClassName;
16
+ critical: import("@linaria/core").LinariaClassName;
17
+ dark: import("@linaria/core").LinariaClassName;
18
+ black: import("@linaria/core").LinariaClassName;
19
+ white: import("@linaria/core").LinariaClassName;
20
+ };
21
+ size: {
22
+ l: import("@linaria/core").LinariaClassName;
23
+ lr: import("@linaria/core").LinariaClassName;
24
+ m: import("@linaria/core").LinariaClassName;
25
+ mr: import("@linaria/core").LinariaClassName;
26
+ s: import("@linaria/core").LinariaClassName;
27
+ sr: import("@linaria/core").LinariaClassName;
28
+ xs: import("@linaria/core").LinariaClassName;
29
+ xsr: import("@linaria/core").LinariaClassName;
30
+ };
31
+ disabled: {
32
+ true: import("@linaria/core").LinariaClassName;
33
+ };
34
+ focused: {
35
+ true: import("@linaria/core").LinariaClassName;
36
+ };
37
+ };
38
+ };
39
+ //# sourceMappingURL=IconButton.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconButton.config.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_web/components/IconButton/IconButton.config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8NlB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /// <reference types="react" />
2
+ export declare const IconButton: import("react").FunctionComponent<import("../../../../engines/types").PropsType<{
3
+ view: {
4
+ default: import("@linaria/core").LinariaClassName;
5
+ primary: import("@linaria/core").LinariaClassName;
6
+ accent: import("@linaria/core").LinariaClassName;
7
+ secondary: import("@linaria/core").LinariaClassName;
8
+ clear: import("@linaria/core").LinariaClassName;
9
+ success: import("@linaria/core").LinariaClassName;
10
+ warning: import("@linaria/core").LinariaClassName;
11
+ critical: import("@linaria/core").LinariaClassName;
12
+ dark: import("@linaria/core").LinariaClassName;
13
+ black: import("@linaria/core").LinariaClassName;
14
+ white: import("@linaria/core").LinariaClassName;
15
+ };
16
+ size: {
17
+ l: import("@linaria/core").LinariaClassName;
18
+ lr: import("@linaria/core").LinariaClassName;
19
+ m: import("@linaria/core").LinariaClassName;
20
+ mr: import("@linaria/core").LinariaClassName;
21
+ s: import("@linaria/core").LinariaClassName;
22
+ sr: import("@linaria/core").LinariaClassName;
23
+ xs: import("@linaria/core").LinariaClassName;
24
+ xsr: import("@linaria/core").LinariaClassName;
25
+ };
26
+ disabled: {
27
+ true: import("@linaria/core").LinariaClassName;
28
+ };
29
+ focused: {
30
+ true: import("@linaria/core").LinariaClassName;
31
+ };
32
+ }> & import("../../../../components/IconButton").IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
33
+ //# sourceMappingURL=IconButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../../src/examples/plasma_web/components/IconButton/IconButton.ts"],"names":[],"mappings":";AAOA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oHAA0B,CAAC"}
@@ -0,0 +1,15 @@
1
+ export declare const config: {
2
+ defaults: {
3
+ view: string;
4
+ size: string;
5
+ };
6
+ variations: {
7
+ size: {
8
+ m: import("@linaria/core").LinariaClassName;
9
+ };
10
+ view: {
11
+ primary: import("@linaria/core").LinariaClassName;
12
+ };
13
+ };
14
+ };
15
+ //# sourceMappingURL=Dropdown.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropdown.config.d.ts","sourceRoot":"","sources":["../../../../../src/examples/sds_engineer/components/Dropdown/Dropdown.config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAgIlB,CAAC"}
@@ -0,0 +1,51 @@
1
+ /// <reference types="react" />
2
+ export declare const Dropdown: import("react").FunctionComponent<import("../../../../engines/types").PropsType<{
3
+ size: {
4
+ m: import("@linaria/core").LinariaClassName;
5
+ };
6
+ view: {
7
+ primary: import("@linaria/core").LinariaClassName;
8
+ };
9
+ }> & import("react").HTMLAttributes<HTMLDivElement> & import("../../../../components/Dropdown/Dropdown.types").CustomDropdownProps & import("react").RefAttributes<HTMLDivElement>>;
10
+ export declare const DropdownDivider: import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("react").HTMLAttributes<HTMLDivElement> & {
11
+ id?: string | undefined;
12
+ size?: string | undefined;
13
+ view?: string | undefined;
14
+ } & import("react").RefAttributes<HTMLDivElement>>;
15
+ export declare const DropdownFooter: import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("react").HTMLAttributes<HTMLDivElement> & {
16
+ id?: string | undefined;
17
+ size?: string | undefined;
18
+ view?: string | undefined;
19
+ } & import("react").RefAttributes<HTMLDivElement>>;
20
+ export declare const DropdownGroup: import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("react").HTMLAttributes<HTMLDivElement> & {
21
+ id?: string | undefined;
22
+ labelClassName?: string | undefined;
23
+ groupClassName?: string | undefined;
24
+ label?: import("react").ReactNode;
25
+ role?: string | undefined;
26
+ size?: string | undefined;
27
+ view?: string | undefined;
28
+ } & import("react").RefAttributes<HTMLDivElement>>;
29
+ export declare const DropdownHeader: import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & import("react").HTMLAttributes<HTMLDivElement> & {
30
+ id?: string | undefined;
31
+ size?: string | undefined;
32
+ view?: string | undefined;
33
+ } & import("react").RefAttributes<HTMLDivElement>>;
34
+ export declare const DropdownItem: import("react").FunctionComponent<import("../../../../engines/types").PropsType<import("../../../../engines/types").Variants> & Omit<import("react").HTMLAttributes<HTMLDivElement>, "onSelect"> & {
35
+ id?: string | undefined;
36
+ disabled?: boolean | undefined;
37
+ label?: import("react").ReactNode;
38
+ role?: string | undefined;
39
+ contentLeft?: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactFragment | import("react").ReactPortal | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | null | undefined;
40
+ contentRight?: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactFragment | import("react").ReactPortal | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | null | undefined;
41
+ name?: string | undefined;
42
+ checked?: boolean | undefined;
43
+ text?: string | undefined;
44
+ value?: string | number | boolean | undefined;
45
+ isSelected?: boolean | undefined;
46
+ onClick?: ((event: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
47
+ onSelect?: ((value?: any, text?: any) => void) | undefined;
48
+ size?: string | undefined;
49
+ view?: string | undefined;
50
+ } & import("react").RefAttributes<HTMLDivElement>>;
51
+ //# sourceMappingURL=Dropdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../../src/examples/sds_engineer/components/Dropdown/Dropdown.ts"],"names":[],"mappings":";AAaA,eAAO,MAAM,QAAQ;;;;;;;mLAA0B,CAAC;AAGhD,eAAO,MAAM,eAAe;;;;kDAAiC,CAAC;AAG9D,eAAO,MAAM,cAAc;;;;kDAAgC,CAAC;AAG5D,eAAO,MAAM,aAAa;;;;;;;;kDAA+B,CAAC;AAG1D,eAAO,MAAM,cAAc;;;;kDAAgC,CAAC;AAG5D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;kDAA8B,CAAC"}
package/types/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './engines';
3
3
  export * from './hooks';
4
4
  export * from './utils';
5
5
  export * from './components/Button';
6
+ export * from './components/IconButton';
6
7
  export * from './components/ButtonGroup';
7
8
  export * from './components/Chip';
8
9
  export * from './components/Cell';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,C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ClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
@@ -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,23 +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
-
8
- var isReactObject = function isReactObject(element) {
9
- return _rollupPluginBabelHelpers.typeof(element) === 'object' || typeof element === 'function';
10
- };
11
- var getValidComponent = function getValidComponent(element, props) {
12
- if ( /*#__PURE__*/React.isValidElement(element)) {
13
- return /*#__PURE__*/React.cloneElement(element, props);
14
- }
15
- if (isReactObject(element)) {
16
- var Component = element;
17
- return /*#__PURE__*/React.createElement(Component, props);
18
- }
19
- return element;
20
- };
21
-
22
- exports.getValidComponent = getValidComponent;
23
- //# 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,gCAAA,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,oBAAc,CAACJ,OAAO,CAAC,EAAE;AACzB,IAAA,oBAAOK,kBAAY,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,31 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
-
7
- var useHashMaps = function useHashMaps(items) {
8
- return React.useMemo(function () {
9
- var pathMap = new Map();
10
- var focusedToValueMap = new Map();
11
- pathMap.set('root', items.length);
12
- var rec = function rec(items) {
13
- var prevIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
14
- items.forEach(function (item, index) {
15
- var value = item.value,
16
- innerItems = item.items;
17
- var currIndex = "".concat(prevIndex, "/").concat(index).replace(/^(\/)/, '');
18
- focusedToValueMap.set(currIndex, item);
19
- if (innerItems) {
20
- pathMap.set(value, innerItems.length);
21
- rec(innerItems, currIndex);
22
- }
23
- });
24
- };
25
- rec(items);
26
- return [pathMap, focusedToValueMap];
27
- }, [items]);
28
- };
29
-
30
- exports.useHashMaps = useHashMaps;
31
- //# 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\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":";;;;;;IAQaA,WAAW,GAAG,SAAdA,WAAWA,CAAIC,KAA6B,EAAK;EAC1D,OAAOC,aAAO,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,200 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var getFurtherPath = function getFurtherPath(focusedPath, focusedToValueMap) {
6
- var focusedPathAsString = focusedPath.reduce(function (acc, n) {
7
- return "".concat(acc, "/").concat(n);
8
- }, '').replace(/^(\/)/, '');
9
- return focusedToValueMap.get(focusedPathAsString);
10
- };
11
- var useKeyNavigation = function useKeyNavigation(_ref) {
12
- var focusedPath = _ref.focusedPath,
13
- dispatchFocusedPath = _ref.dispatchFocusedPath,
14
- path = _ref.path,
15
- dispatchPath = _ref.dispatchPath,
16
- pathMap = _ref.pathMap,
17
- focusedToValueMap = _ref.focusedToValueMap,
18
- handleGlobalToggle = _ref.handleGlobalToggle,
19
- closeOnSelect = _ref.closeOnSelect,
20
- onItemSelect = _ref.onItemSelect,
21
- onItemClick = _ref.onItemClick;
22
- var currentLength = pathMap.get(path === null || path === void 0 ? void 0 : path[path.length - 1]) || 0;
23
- var currentIndex = (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[focusedPath.length - 1]) || 0;
24
- var onKeyDown = function onKeyDown(event) {
25
- var code = event.code;
26
- if (code === 'ArrowUp') {
27
- if (focusedPath.length) {
28
- var newIndex = currentIndex <= 0 ? currentLength - 1 : currentIndex - 1;
29
- dispatchFocusedPath({
30
- type: 'change_last_focus',
31
- value: newIndex
32
- });
33
- } else {
34
- dispatchPath({
35
- type: 'opened_first_level'
36
- });
37
- dispatchFocusedPath({
38
- type: 'set_initial_focus'
39
- });
40
- handleGlobalToggle(true, event);
41
- }
42
- }
43
- if (code === 'ArrowDown') {
44
- if (focusedPath.length) {
45
- var _newIndex = currentIndex + 1 >= currentLength ? 0 : currentIndex + 1;
46
- dispatchFocusedPath({
47
- type: 'change_last_focus',
48
- value: _newIndex
49
- });
50
- } else {
51
- dispatchPath({
52
- type: 'opened_first_level'
53
- });
54
- dispatchFocusedPath({
55
- type: 'set_initial_focus'
56
- });
57
- handleGlobalToggle(true, event);
58
- }
59
- }
60
- if (code === 'ArrowLeft') {
61
- if (focusedPath.length) {
62
- dispatchPath({
63
- type: 'removed_last_level'
64
- });
65
- dispatchFocusedPath({
66
- type: 'return_prev_focus'
67
- });
68
- }
69
- if (focusedPath.length === 1) {
70
- handleGlobalToggle(false, event);
71
- }
72
- }
73
- if (code === 'ArrowRight') {
74
- if (focusedPath.length) {
75
- var currentItem = getFurtherPath(focusedPath, focusedToValueMap);
76
- if (currentItem !== null && currentItem !== void 0 && currentItem.items) {
77
- dispatchPath({
78
- type: 'added_next_level',
79
- value: currentItem.value.toString()
80
- });
81
- dispatchFocusedPath({
82
- type: 'add_focus',
83
- value: 0
84
- });
85
- }
86
- }
87
- }
88
- if (code === 'Enter' || code === 'Space') {
89
- event.preventDefault();
90
- if (path[0]) {
91
- var _currentItem = getFurtherPath(focusedPath, focusedToValueMap);
92
- if (_currentItem !== null && _currentItem !== void 0 && _currentItem.disabled || _currentItem !== null && _currentItem !== void 0 && _currentItem.isDisabled) return;
93
- if (_currentItem !== null && _currentItem !== void 0 && _currentItem.items) {
94
- dispatchPath({
95
- type: 'added_next_level',
96
- value: _currentItem.value.toString()
97
- });
98
- dispatchFocusedPath({
99
- type: 'add_focus',
100
- value: 0
101
- });
102
- } else {
103
- if (closeOnSelect) {
104
- handleGlobalToggle(false, event);
105
- }
106
- if (onItemSelect && _currentItem) {
107
- onItemSelect(_currentItem, event);
108
- }
109
- if (onItemClick && _currentItem) {
110
- onItemClick(_currentItem, event);
111
- }
112
- }
113
- } else {
114
- dispatchPath({
115
- type: 'opened_first_level'
116
- });
117
- dispatchFocusedPath({
118
- type: 'set_initial_focus'
119
- });
120
- }
121
- }
122
- if (code === 'Tab') {
123
- dispatchFocusedPath({
124
- type: 'reset'
125
- });
126
- dispatchPath({
127
- type: 'reset'
128
- });
129
- handleGlobalToggle(false, event);
130
- }
131
- if (code === 'Home') {
132
- if (path[0]) {
133
- dispatchFocusedPath({
134
- type: 'change_last_focus',
135
- value: 0
136
- });
137
- } else {
138
- dispatchPath({
139
- type: 'opened_first_level'
140
- });
141
- dispatchFocusedPath({
142
- type: 'set_initial_focus'
143
- });
144
- handleGlobalToggle(true, event);
145
- }
146
- }
147
- if (code === 'End') {
148
- if (path[0]) {
149
- dispatchFocusedPath({
150
- type: 'change_last_focus',
151
- value: currentLength - 1
152
- });
153
- } else {
154
- dispatchPath({
155
- type: 'opened_first_level'
156
- });
157
- dispatchFocusedPath({
158
- type: 'change_last_focus',
159
- value: (pathMap.get('root') || 0) - 1
160
- });
161
- handleGlobalToggle(true, event);
162
- }
163
- }
164
- if (code === 'PageUp') {
165
- if (path[0]) {
166
- if (currentIndex <= 10) {
167
- dispatchFocusedPath({
168
- type: 'set_initial_focus'
169
- });
170
- } else {
171
- dispatchFocusedPath({
172
- type: 'change_last_focus',
173
- value: currentIndex - 10
174
- });
175
- }
176
- }
177
- }
178
- if (code === 'PageDown') {
179
- if (path[0]) {
180
- if (currentLength - currentIndex <= 10) {
181
- dispatchFocusedPath({
182
- type: 'change_last_focus',
183
- value: currentLength - 1
184
- });
185
- } else {
186
- dispatchFocusedPath({
187
- type: 'change_last_focus',
188
- value: currentIndex + 10
189
- });
190
- }
191
- }
192
- }
193
- };
194
- return {
195
- onKeyDown: onKeyDown
196
- };
197
- };
198
-
199
- exports.useKeyNavigation = useKeyNavigation;
200
- //# 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 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","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CAAC,IAAI,CAAC,IAAI,CAAA;AAAE,SAAC,CAAC,CAAA;AAEzFO,QAAAA,kBAAkB,CAAC,IAAI,EAAEQ,KAAK,CAAC,CAAA;AACnC,OAAA;AACJ,KAAA;IAEA,IAAIC,IAAI,KAAK,QAAQ,EAAE;AACnB,MAAA,IAAIZ,IAAI,CAAC,CAAC,CAAC,EAAE;QACT,IAAIS,YAAY,IAAI,EAAE,EAAE;AACpBV,UAAAA,mBAAmB,CAAC;AAAEe,YAAAA,IAAI,EAAE,mBAAA;AAAoB,WAAC,CAAC,CAAA;AACtD,SAAC,MAAM;AACHf,UAAAA,mBAAmB,CAAC;AAAEe,YAAAA,IAAI,EAAE,mBAAmB;YAAEC,KAAK,EAAEN,YAAY,GAAG,EAAA;AAAG,WAAC,CAAC,CAAA;AAChF,SAAA;AACJ,OAAA;AACJ,KAAA;IAEA,IAAIG,IAAI,KAAK,UAAU,EAAE;AACrB,MAAA,IAAIZ,IAAI,CAAC,CAAC,CAAC,EAAE;AACT,QAAA,IAAIO,aAAa,GAAGE,YAAY,IAAI,EAAE,EAAE;AACpCV,UAAAA,mBAAmB,CAAC;AAAEe,YAAAA,IAAI,EAAE,mBAAmB;YAAEC,KAAK,EAAER,aAAa,GAAG,CAAA;AAAE,WAAC,CAAC,CAAA;AAChF,SAAC,MAAM;AACHR,UAAAA,mBAAmB,CAAC;AAAEe,YAAAA,IAAI,EAAE,mBAAmB;YAAEC,KAAK,EAAEN,YAAY,GAAG,EAAA;AAAG,WAAC,CAAC,CAAA;AAChF,SAAA;AACJ,OAAA;AACJ,KAAA;GACH,CAAA;EAED,OAAO;AAAEC,IAAAA,SAAS,EAATA,SAAAA;GAAW,CAAA;AACxB;;;;"}
@@ -1,37 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
-
7
- function focusedPathReducer(state, action) {
8
- switch (action.type) {
9
- case 'reset':
10
- {
11
- return [];
12
- }
13
- case 'set_initial_focus':
14
- {
15
- return [0];
16
- }
17
- case 'change_last_focus':
18
- {
19
- return [].concat(_rollupPluginBabelHelpers.toConsumableArray(state.slice(0, -1)), [action.value]);
20
- }
21
- case 'add_focus':
22
- {
23
- return [].concat(_rollupPluginBabelHelpers.toConsumableArray(state), [action.value]);
24
- }
25
- case 'return_prev_focus':
26
- {
27
- return _rollupPluginBabelHelpers.toConsumableArray(state.slice(0, -1));
28
- }
29
- default:
30
- {
31
- return state;
32
- }
33
- }
34
- }
35
-
36
- exports.focusedPathReducer = focusedPathReducer;
37
- //# 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,2CAAA,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,2CAAA,CAAWJ,KAAK,CAAEC,EAAAA,CAAAA,MAAM,CAACK,KAAK,CAAA,CAAA,CAAA;AAClC,OAAA;AAEA,IAAA,KAAK,mBAAmB;AAAE,MAAA;QACtB,OAAAF,2CAAA,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,41 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
-
7
- function pathReducer(state, action) {
8
- switch (action.type) {
9
- case 'reset':
10
- {
11
- return [];
12
- }
13
- case 'opened_first_level':
14
- {
15
- return ['root'];
16
- }
17
- case 'added_next_level':
18
- {
19
- return [].concat(_rollupPluginBabelHelpers.toConsumableArray(state), [action.value]);
20
- }
21
- case 'removed_last_level':
22
- {
23
- return _rollupPluginBabelHelpers.toConsumableArray(state.slice(0, -1));
24
- }
25
- case 'changed_on_level':
26
- {
27
- return [].concat(_rollupPluginBabelHelpers.toConsumableArray(state.slice(0, action.level)), [action.value]);
28
- }
29
- case 'cut_by_level':
30
- {
31
- return state.slice(0, action.level);
32
- }
33
- default:
34
- {
35
- return state;
36
- }
37
- }
38
- }
39
-
40
- exports.pathReducer = pathReducer;
41
- //# sourceMappingURL=pathReducer.js.map