@lidofinance/lido-ui 3.9.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (565) hide show
  1. package/dist/cjs/accordion/Accordion.js +30 -11
  2. package/dist/cjs/accordion/Accordion.js.map +1 -1
  3. package/dist/cjs/accordion/types.js +0 -2
  4. package/dist/cjs/accordion/types.js.map +1 -1
  5. package/dist/cjs/accordion/useExpanded.js.map +1 -1
  6. package/dist/cjs/address/Address.js +16 -8
  7. package/dist/cjs/address/Address.js.map +1 -1
  8. package/dist/cjs/addressBadge/AddressBadge.js +5 -5
  9. package/dist/cjs/addressBadge/AddressBadge.js.map +1 -1
  10. package/dist/cjs/block/Block.js +8 -8
  11. package/dist/cjs/block/Block.js.map +1 -1
  12. package/dist/cjs/button/Button.js +21 -13
  13. package/dist/cjs/button/Button.js.map +1 -1
  14. package/dist/cjs/button/ButtonIcon.js +20 -12
  15. package/dist/cjs/button/ButtonIcon.js.map +1 -1
  16. package/dist/cjs/button/useRipple.js +5 -6
  17. package/dist/cjs/button/useRipple.js.map +1 -1
  18. package/dist/cjs/checkbox/Checkbox.js +26 -22
  19. package/dist/cjs/checkbox/Checkbox.js.map +1 -1
  20. package/dist/cjs/checkbox/types.js +0 -2
  21. package/dist/cjs/checkbox/types.js.map +1 -1
  22. package/dist/cjs/chip/Chip.js +10 -10
  23. package/dist/cjs/chip/Chip.js.map +1 -1
  24. package/dist/cjs/chip/types.js +0 -2
  25. package/dist/cjs/chip/types.js.map +1 -1
  26. package/dist/cjs/container/Container.js +8 -8
  27. package/dist/cjs/container/Container.js.map +1 -1
  28. package/dist/cjs/content-theme/content-theme.js +11 -3
  29. package/dist/cjs/content-theme/content-theme.js.map +1 -1
  30. package/dist/cjs/content-theme/types.js +0 -2
  31. package/dist/cjs/content-theme/types.js.map +1 -1
  32. package/dist/cjs/cookie-theme-toggler/cookie-theme-toggler.js +8 -5
  33. package/dist/cjs/cookie-theme-toggler/cookie-theme-toggler.js.map +1 -1
  34. package/dist/cjs/cookies-tooltip/cookies-tooltip.js +42 -19
  35. package/dist/cjs/cookies-tooltip/cookies-tooltip.js.map +1 -1
  36. package/dist/cjs/data-table/DataTable.js +30 -18
  37. package/dist/cjs/data-table/DataTable.js.map +1 -1
  38. package/dist/cjs/data-table/types.js +0 -2
  39. package/dist/cjs/data-table/types.js.map +1 -1
  40. package/dist/cjs/divider/Divider.js +8 -8
  41. package/dist/cjs/divider/Divider.js.map +1 -1
  42. package/dist/cjs/heading/Heading.js +26 -23
  43. package/dist/cjs/heading/Heading.js.map +1 -1
  44. package/dist/cjs/hooks/useMergeRefs.js +0 -2
  45. package/dist/cjs/hooks/useMergeRefs.js.map +1 -1
  46. package/dist/cjs/hooks/useOutsideClick.js +1 -2
  47. package/dist/cjs/hooks/useOutsideClick.js.map +1 -1
  48. package/dist/cjs/icons/index.js +8747 -6483
  49. package/dist/cjs/icons/index.js.map +1 -1
  50. package/dist/cjs/identicon/Identicon.js +14 -14
  51. package/dist/cjs/identicon/Identicon.js.map +1 -1
  52. package/dist/cjs/identicon/IdenticonBadge.js +23 -19
  53. package/dist/cjs/identicon/IdenticonBadge.js.map +1 -1
  54. package/dist/cjs/identicon/types.js +0 -2
  55. package/dist/cjs/identicon/types.js.map +1 -1
  56. package/dist/cjs/input/Input.js +59 -38
  57. package/dist/cjs/input/Input.js.map +1 -1
  58. package/dist/cjs/input/InputGroup.js +22 -14
  59. package/dist/cjs/input/InputGroup.js.map +1 -1
  60. package/dist/cjs/input/OptionsSlider.js +2 -2
  61. package/dist/cjs/input/OptionsSlider.js.map +1 -1
  62. package/dist/cjs/input/SliderInput.js +41 -24
  63. package/dist/cjs/input/SliderInput.js.map +1 -1
  64. package/dist/cjs/input/Textarea.js +50 -37
  65. package/dist/cjs/input/Textarea.js.map +1 -1
  66. package/dist/cjs/input/types.js +0 -2
  67. package/dist/cjs/input/types.js.map +1 -1
  68. package/dist/cjs/lido-logo/LidoLogo.js +27 -21
  69. package/dist/cjs/lido-logo/LidoLogo.js.map +1 -1
  70. package/dist/cjs/link/Link.js +6 -6
  71. package/dist/cjs/link/Link.js.map +1 -1
  72. package/dist/cjs/loaders/InlineLoader.js +13 -11
  73. package/dist/cjs/loaders/InlineLoader.js.map +1 -1
  74. package/dist/cjs/loaders/Loader.js +28 -24
  75. package/dist/cjs/loaders/Loader.js.map +1 -1
  76. package/dist/cjs/main-menu/MainMenu.js +9 -8
  77. package/dist/cjs/main-menu/MainMenu.js.map +1 -1
  78. package/dist/cjs/main-menu/MainMenuItem.js +14 -8
  79. package/dist/cjs/main-menu/MainMenuItem.js.map +1 -1
  80. package/dist/cjs/modal/Modal.js +52 -27
  81. package/dist/cjs/modal/Modal.js.map +1 -1
  82. package/dist/cjs/modal/ModalButton.js +17 -9
  83. package/dist/cjs/modal/ModalButton.js.map +1 -1
  84. package/dist/cjs/modal/ModalExtra.js +5 -5
  85. package/dist/cjs/modal/ModalExtra.js.map +1 -1
  86. package/dist/cjs/modal/ModalOverlay.js +18 -15
  87. package/dist/cjs/modal/ModalOverlay.js.map +1 -1
  88. package/dist/cjs/modal/ModalStyles.js +3 -4
  89. package/dist/cjs/modal/ModalStyles.js.map +1 -1
  90. package/dist/cjs/modal/types.js +0 -2
  91. package/dist/cjs/modal/types.js.map +1 -1
  92. package/dist/cjs/modal/useModalClose.js +1 -2
  93. package/dist/cjs/modal/useModalClose.js.map +1 -1
  94. package/dist/cjs/modal/useModalFocus.js +1 -2
  95. package/dist/cjs/modal/useModalFocus.js.map +1 -1
  96. package/dist/cjs/pagination/Pagination.js +28 -23
  97. package/dist/cjs/pagination/Pagination.js.map +1 -1
  98. package/dist/cjs/pagination/PaginationItem.js +8 -8
  99. package/dist/cjs/pagination/PaginationItem.js.map +1 -1
  100. package/dist/cjs/pagination/types.js +0 -2
  101. package/dist/cjs/pagination/types.js.map +1 -1
  102. package/dist/cjs/popover/Popover.js +8 -9
  103. package/dist/cjs/popover/Popover.js.map +1 -1
  104. package/dist/cjs/popover/PopoverRoot.js +20 -16
  105. package/dist/cjs/popover/PopoverRoot.js.map +1 -1
  106. package/dist/cjs/popover/PopoverStyles.js +2 -2
  107. package/dist/cjs/popover/PopoverStyles.js.map +1 -1
  108. package/dist/cjs/popover/types.js +0 -2
  109. package/dist/cjs/popover/types.js.map +1 -1
  110. package/dist/cjs/popover/usePopoverPosition.js +4 -5
  111. package/dist/cjs/popover/usePopoverPosition.js.map +1 -1
  112. package/dist/cjs/popup-menu/PopupMenu.js +17 -13
  113. package/dist/cjs/popup-menu/PopupMenu.js.map +1 -1
  114. package/dist/cjs/popup-menu/PopupMenuItem.js +21 -12
  115. package/dist/cjs/popup-menu/PopupMenuItem.js.map +1 -1
  116. package/dist/cjs/popup-menu/PopupMenuProvider.js +8 -8
  117. package/dist/cjs/popup-menu/PopupMenuProvider.js.map +1 -1
  118. package/dist/cjs/popup-menu/types.js +0 -2
  119. package/dist/cjs/popup-menu/types.js.map +1 -1
  120. package/dist/cjs/popup-menu/usePopupFocus.js +3 -4
  121. package/dist/cjs/popup-menu/usePopupFocus.js.map +1 -1
  122. package/dist/cjs/section/Section.js +21 -8
  123. package/dist/cjs/section/Section.js.map +1 -1
  124. package/dist/cjs/section/types.js +0 -2
  125. package/dist/cjs/section/types.js.map +1 -1
  126. package/dist/cjs/select/Option.js +8 -8
  127. package/dist/cjs/select/Option.js.map +1 -1
  128. package/dist/cjs/select/Select.js +43 -31
  129. package/dist/cjs/select/Select.js.map +1 -1
  130. package/dist/cjs/select/SelectArrow.js +9 -7
  131. package/dist/cjs/select/SelectArrow.js.map +1 -1
  132. package/dist/cjs/select/SelectIcon.js +10 -8
  133. package/dist/cjs/select/SelectIcon.js.map +1 -1
  134. package/dist/cjs/select/types.js +0 -2
  135. package/dist/cjs/select/types.js.map +1 -1
  136. package/dist/cjs/select/useSelect.js +5 -6
  137. package/dist/cjs/select/useSelect.js.map +1 -1
  138. package/dist/cjs/select/useSelectWidth.js +1 -2
  139. package/dist/cjs/select/useSelectWidth.js.map +1 -1
  140. package/dist/cjs/service-page/ServicePage.js +19 -10
  141. package/dist/cjs/service-page/ServicePage.js.map +1 -1
  142. package/dist/cjs/service-page/types.js +0 -2
  143. package/dist/cjs/service-page/types.js.map +1 -1
  144. package/dist/cjs/stack/HStack.js +8 -8
  145. package/dist/cjs/stack/HStack.js.map +1 -1
  146. package/dist/cjs/stack/Stack.js +12 -10
  147. package/dist/cjs/stack/Stack.js.map +1 -1
  148. package/dist/cjs/stack/StackItem.js +8 -8
  149. package/dist/cjs/stack/StackItem.js.map +1 -1
  150. package/dist/cjs/stack/StackProvider.js +8 -8
  151. package/dist/cjs/stack/StackProvider.js.map +1 -1
  152. package/dist/cjs/stack/VStack.js +8 -8
  153. package/dist/cjs/stack/VStack.js.map +1 -1
  154. package/dist/cjs/styled-system/withStyledSystem.js +0 -1
  155. package/dist/cjs/styled-system/withStyledSystem.js.map +1 -1
  156. package/dist/cjs/table/Table.js +6 -6
  157. package/dist/cjs/table/Table.js.map +1 -1
  158. package/dist/cjs/table/Tbody.js +6 -6
  159. package/dist/cjs/table/Tbody.js.map +1 -1
  160. package/dist/cjs/table/Td.js +11 -8
  161. package/dist/cjs/table/Td.js.map +1 -1
  162. package/dist/cjs/table/Tfoot.js +6 -6
  163. package/dist/cjs/table/Tfoot.js.map +1 -1
  164. package/dist/cjs/table/Th.js +15 -8
  165. package/dist/cjs/table/Th.js.map +1 -1
  166. package/dist/cjs/table/Thead.js +8 -8
  167. package/dist/cjs/table/Thead.js.map +1 -1
  168. package/dist/cjs/table/Tr.js +8 -8
  169. package/dist/cjs/table/Tr.js.map +1 -1
  170. package/dist/cjs/text/Text.js +8 -8
  171. package/dist/cjs/text/Text.js.map +1 -1
  172. package/dist/cjs/text/TextStyles.js +4 -4
  173. package/dist/cjs/text/TextStyles.js.map +1 -1
  174. package/dist/cjs/theme/cookie-theme-provider.js +20 -14
  175. package/dist/cjs/theme/cookie-theme-provider.js.map +1 -1
  176. package/dist/cjs/theme/document-head-contents/element-fonts.js +4 -3
  177. package/dist/cjs/theme/document-head-contents/element-fonts.js.map +1 -1
  178. package/dist/cjs/theme/document-head-contents/element-theme-colors.js +4 -7
  179. package/dist/cjs/theme/document-head-contents/element-theme-colors.js.map +1 -1
  180. package/dist/cjs/theme/document-head-contents/element-theme-script.js +2 -3
  181. package/dist/cjs/theme/document-head-contents/element-theme-script.js.map +1 -1
  182. package/dist/cjs/theme/document-head-contents/index.js +8 -3
  183. package/dist/cjs/theme/document-head-contents/index.js.map +1 -1
  184. package/dist/cjs/theme/theme-provider.js +15 -10
  185. package/dist/cjs/theme/theme-provider.js.map +1 -1
  186. package/dist/cjs/toast/ToastPending.js +9 -3
  187. package/dist/cjs/toast/ToastPending.js.map +1 -1
  188. package/dist/cjs/tooltip/Tooltip.js +31 -25
  189. package/dist/cjs/tooltip/Tooltip.js.map +1 -1
  190. package/dist/cjs/tooltip/types.js +0 -2
  191. package/dist/cjs/tooltip/types.js.map +1 -1
  192. package/dist/cjs/transition/withTransition.js +14 -12
  193. package/dist/cjs/transition/withTransition.js.map +1 -1
  194. package/dist/esm/accordion/Accordion.js +30 -10
  195. package/dist/esm/accordion/Accordion.js.map +1 -1
  196. package/dist/esm/accordion/types.js +1 -1
  197. package/dist/esm/accordion/types.js.map +1 -1
  198. package/dist/esm/accordion/useExpanded.js.map +1 -1
  199. package/dist/esm/address/Address.js +16 -7
  200. package/dist/esm/address/Address.js.map +1 -1
  201. package/dist/esm/addressBadge/AddressBadge.js +5 -4
  202. package/dist/esm/addressBadge/AddressBadge.js.map +1 -1
  203. package/dist/esm/block/Block.js +8 -7
  204. package/dist/esm/block/Block.js.map +1 -1
  205. package/dist/esm/button/Button.js +21 -12
  206. package/dist/esm/button/Button.js.map +1 -1
  207. package/dist/esm/button/ButtonIcon.js +20 -11
  208. package/dist/esm/button/ButtonIcon.js.map +1 -1
  209. package/dist/esm/button/useRipple.js +5 -5
  210. package/dist/esm/button/useRipple.js.map +1 -1
  211. package/dist/esm/checkbox/Checkbox.js +26 -21
  212. package/dist/esm/checkbox/Checkbox.js.map +1 -1
  213. package/dist/esm/checkbox/types.js +1 -1
  214. package/dist/esm/checkbox/types.js.map +1 -1
  215. package/dist/esm/chip/Chip.js +10 -9
  216. package/dist/esm/chip/Chip.js.map +1 -1
  217. package/dist/esm/chip/types.js +0 -1
  218. package/dist/esm/chip/types.js.map +1 -1
  219. package/dist/esm/container/Container.js +8 -7
  220. package/dist/esm/container/Container.js.map +1 -1
  221. package/dist/esm/content-theme/content-theme.js +11 -2
  222. package/dist/esm/content-theme/content-theme.js.map +1 -1
  223. package/dist/esm/content-theme/types.js +1 -1
  224. package/dist/esm/content-theme/types.js.map +1 -1
  225. package/dist/esm/cookie-theme-toggler/cookie-theme-toggler.js +8 -4
  226. package/dist/esm/cookie-theme-toggler/cookie-theme-toggler.js.map +1 -1
  227. package/dist/esm/cookies-tooltip/cookies-tooltip.js +42 -18
  228. package/dist/esm/cookies-tooltip/cookies-tooltip.js.map +1 -1
  229. package/dist/esm/data-table/DataTable.js +30 -17
  230. package/dist/esm/data-table/DataTable.js.map +1 -1
  231. package/dist/esm/data-table/types.js +1 -1
  232. package/dist/esm/data-table/types.js.map +1 -1
  233. package/dist/esm/divider/Divider.js +8 -7
  234. package/dist/esm/divider/Divider.js.map +1 -1
  235. package/dist/esm/heading/Heading.js +26 -22
  236. package/dist/esm/heading/Heading.js.map +1 -1
  237. package/dist/esm/hooks/useMergeRefs.js +0 -1
  238. package/dist/esm/hooks/useMergeRefs.js.map +1 -1
  239. package/dist/esm/hooks/useOutsideClick.js +1 -1
  240. package/dist/esm/hooks/useOutsideClick.js.map +1 -1
  241. package/dist/esm/icons/index.js +8747 -6483
  242. package/dist/esm/icons/index.js.map +1 -1
  243. package/dist/esm/identicon/Identicon.js +14 -14
  244. package/dist/esm/identicon/Identicon.js.map +1 -1
  245. package/dist/esm/identicon/IdenticonBadge.js +23 -18
  246. package/dist/esm/identicon/IdenticonBadge.js.map +1 -1
  247. package/dist/esm/identicon/types.js +0 -1
  248. package/dist/esm/identicon/types.js.map +1 -1
  249. package/dist/esm/input/Input.js +59 -37
  250. package/dist/esm/input/Input.js.map +1 -1
  251. package/dist/esm/input/InputGroup.js +22 -13
  252. package/dist/esm/input/InputGroup.js.map +1 -1
  253. package/dist/esm/input/OptionsSlider.js +2 -2
  254. package/dist/esm/input/OptionsSlider.js.map +1 -1
  255. package/dist/esm/input/SliderInput.js +41 -23
  256. package/dist/esm/input/SliderInput.js.map +1 -1
  257. package/dist/esm/input/Textarea.js +50 -36
  258. package/dist/esm/input/Textarea.js.map +1 -1
  259. package/dist/esm/input/types.js +0 -1
  260. package/dist/esm/input/types.js.map +1 -1
  261. package/dist/esm/lido-logo/LidoLogo.js +27 -20
  262. package/dist/esm/lido-logo/LidoLogo.js.map +1 -1
  263. package/dist/esm/link/Link.js +6 -5
  264. package/dist/esm/link/Link.js.map +1 -1
  265. package/dist/esm/loaders/InlineLoader.js +13 -10
  266. package/dist/esm/loaders/InlineLoader.js.map +1 -1
  267. package/dist/esm/loaders/Loader.js +28 -23
  268. package/dist/esm/loaders/Loader.js.map +1 -1
  269. package/dist/esm/main-menu/MainMenu.js +9 -7
  270. package/dist/esm/main-menu/MainMenu.js.map +1 -1
  271. package/dist/esm/main-menu/MainMenuItem.js +14 -7
  272. package/dist/esm/main-menu/MainMenuItem.js.map +1 -1
  273. package/dist/esm/modal/Modal.js +52 -26
  274. package/dist/esm/modal/Modal.js.map +1 -1
  275. package/dist/esm/modal/ModalButton.js +17 -8
  276. package/dist/esm/modal/ModalButton.js.map +1 -1
  277. package/dist/esm/modal/ModalExtra.js +5 -4
  278. package/dist/esm/modal/ModalExtra.js.map +1 -1
  279. package/dist/esm/modal/ModalOverlay.js +18 -14
  280. package/dist/esm/modal/ModalOverlay.js.map +1 -1
  281. package/dist/esm/modal/ModalStyles.js +3 -3
  282. package/dist/esm/modal/ModalStyles.js.map +1 -1
  283. package/dist/esm/modal/types.js +1 -1
  284. package/dist/esm/modal/types.js.map +1 -1
  285. package/dist/esm/modal/useModalClose.js +1 -1
  286. package/dist/esm/modal/useModalClose.js.map +1 -1
  287. package/dist/esm/modal/useModalFocus.js +1 -1
  288. package/dist/esm/modal/useModalFocus.js.map +1 -1
  289. package/dist/esm/pagination/Pagination.js +28 -22
  290. package/dist/esm/pagination/Pagination.js.map +1 -1
  291. package/dist/esm/pagination/PaginationItem.js +8 -7
  292. package/dist/esm/pagination/PaginationItem.js.map +1 -1
  293. package/dist/esm/pagination/types.js +0 -1
  294. package/dist/esm/pagination/types.js.map +1 -1
  295. package/dist/esm/popover/Popover.js +8 -8
  296. package/dist/esm/popover/Popover.js.map +1 -1
  297. package/dist/esm/popover/PopoverRoot.js +20 -15
  298. package/dist/esm/popover/PopoverRoot.js.map +1 -1
  299. package/dist/esm/popover/PopoverStyles.js +2 -2
  300. package/dist/esm/popover/PopoverStyles.js.map +1 -1
  301. package/dist/esm/popover/types.js +0 -1
  302. package/dist/esm/popover/types.js.map +1 -1
  303. package/dist/esm/popover/usePopoverPosition.js +4 -4
  304. package/dist/esm/popover/usePopoverPosition.js.map +1 -1
  305. package/dist/esm/popup-menu/PopupMenu.js +17 -12
  306. package/dist/esm/popup-menu/PopupMenu.js.map +1 -1
  307. package/dist/esm/popup-menu/PopupMenuItem.js +21 -11
  308. package/dist/esm/popup-menu/PopupMenuItem.js.map +1 -1
  309. package/dist/esm/popup-menu/PopupMenuProvider.js +8 -7
  310. package/dist/esm/popup-menu/PopupMenuProvider.js.map +1 -1
  311. package/dist/esm/popup-menu/types.js +0 -1
  312. package/dist/esm/popup-menu/types.js.map +1 -1
  313. package/dist/esm/popup-menu/usePopupFocus.js +3 -3
  314. package/dist/esm/popup-menu/usePopupFocus.js.map +1 -1
  315. package/dist/esm/section/Section.js +21 -7
  316. package/dist/esm/section/Section.js.map +1 -1
  317. package/dist/esm/section/types.js +1 -1
  318. package/dist/esm/section/types.js.map +1 -1
  319. package/dist/esm/select/Option.js +8 -7
  320. package/dist/esm/select/Option.js.map +1 -1
  321. package/dist/esm/select/Select.js +43 -30
  322. package/dist/esm/select/Select.js.map +1 -1
  323. package/dist/esm/select/SelectArrow.js +9 -6
  324. package/dist/esm/select/SelectArrow.js.map +1 -1
  325. package/dist/esm/select/SelectIcon.js +10 -7
  326. package/dist/esm/select/SelectIcon.js.map +1 -1
  327. package/dist/esm/select/types.js +0 -1
  328. package/dist/esm/select/types.js.map +1 -1
  329. package/dist/esm/select/useSelect.js +5 -5
  330. package/dist/esm/select/useSelect.js.map +1 -1
  331. package/dist/esm/select/useSelectWidth.js +1 -1
  332. package/dist/esm/select/useSelectWidth.js.map +1 -1
  333. package/dist/esm/service-page/ServicePage.js +19 -9
  334. package/dist/esm/service-page/ServicePage.js.map +1 -1
  335. package/dist/esm/service-page/types.js +1 -1
  336. package/dist/esm/service-page/types.js.map +1 -1
  337. package/dist/esm/stack/HStack.js +8 -7
  338. package/dist/esm/stack/HStack.js.map +1 -1
  339. package/dist/esm/stack/Stack.js +12 -9
  340. package/dist/esm/stack/Stack.js.map +1 -1
  341. package/dist/esm/stack/StackItem.js +8 -7
  342. package/dist/esm/stack/StackItem.js.map +1 -1
  343. package/dist/esm/stack/StackProvider.js +8 -7
  344. package/dist/esm/stack/StackProvider.js.map +1 -1
  345. package/dist/esm/stack/VStack.js +8 -7
  346. package/dist/esm/stack/VStack.js.map +1 -1
  347. package/dist/esm/styled-system/withStyledSystem.js +0 -1
  348. package/dist/esm/styled-system/withStyledSystem.js.map +1 -1
  349. package/dist/esm/table/Table.js +6 -5
  350. package/dist/esm/table/Table.js.map +1 -1
  351. package/dist/esm/table/Tbody.js +6 -5
  352. package/dist/esm/table/Tbody.js.map +1 -1
  353. package/dist/esm/table/Td.js +11 -7
  354. package/dist/esm/table/Td.js.map +1 -1
  355. package/dist/esm/table/Tfoot.js +6 -5
  356. package/dist/esm/table/Tfoot.js.map +1 -1
  357. package/dist/esm/table/Th.js +15 -7
  358. package/dist/esm/table/Th.js.map +1 -1
  359. package/dist/esm/table/Thead.js +8 -7
  360. package/dist/esm/table/Thead.js.map +1 -1
  361. package/dist/esm/table/Tr.js +8 -7
  362. package/dist/esm/table/Tr.js.map +1 -1
  363. package/dist/esm/text/Text.js +8 -7
  364. package/dist/esm/text/Text.js.map +1 -1
  365. package/dist/esm/text/TextStyles.js +4 -4
  366. package/dist/esm/text/TextStyles.js.map +1 -1
  367. package/dist/esm/theme/cookie-theme-provider.js +20 -13
  368. package/dist/esm/theme/cookie-theme-provider.js.map +1 -1
  369. package/dist/esm/theme/document-head-contents/element-fonts.js +4 -2
  370. package/dist/esm/theme/document-head-contents/element-fonts.js.map +1 -1
  371. package/dist/esm/theme/document-head-contents/element-theme-colors.js +4 -6
  372. package/dist/esm/theme/document-head-contents/element-theme-colors.js.map +1 -1
  373. package/dist/esm/theme/document-head-contents/element-theme-script.js +2 -2
  374. package/dist/esm/theme/document-head-contents/element-theme-script.js.map +1 -1
  375. package/dist/esm/theme/document-head-contents/index.js +8 -2
  376. package/dist/esm/theme/document-head-contents/index.js.map +1 -1
  377. package/dist/esm/theme/theme-provider.js +15 -9
  378. package/dist/esm/theme/theme-provider.js.map +1 -1
  379. package/dist/esm/toast/ToastPending.js +9 -2
  380. package/dist/esm/toast/ToastPending.js.map +1 -1
  381. package/dist/esm/tooltip/Tooltip.js +31 -24
  382. package/dist/esm/tooltip/Tooltip.js.map +1 -1
  383. package/dist/esm/tooltip/types.js +1 -1
  384. package/dist/esm/tooltip/types.js.map +1 -1
  385. package/dist/esm/transition/withTransition.js +14 -11
  386. package/dist/esm/transition/withTransition.js.map +1 -1
  387. package/dist/types/accordion/Accordion.d.ts +5 -5
  388. package/dist/types/accordion/Accordion.d.ts.map +1 -1
  389. package/dist/types/accordion/types.d.ts +2 -2
  390. package/dist/types/accordion/types.d.ts.map +1 -1
  391. package/dist/types/accordion/useExpanded.d.ts +1 -1
  392. package/dist/types/accordion/useExpanded.d.ts.map +1 -1
  393. package/dist/types/address/Address.d.ts +4 -4
  394. package/dist/types/address/Address.d.ts.map +1 -1
  395. package/dist/types/addressBadge/AddressBadge.d.ts +4 -4
  396. package/dist/types/addressBadge/AddressBadge.d.ts.map +1 -1
  397. package/dist/types/block/Block.d.ts +4 -4
  398. package/dist/types/block/Block.d.ts.map +1 -1
  399. package/dist/types/button/Button.d.ts +4 -4
  400. package/dist/types/button/Button.d.ts.map +1 -1
  401. package/dist/types/button/ButtonIcon.d.ts +4 -4
  402. package/dist/types/button/ButtonIcon.d.ts.map +1 -1
  403. package/dist/types/button/useRipple.d.ts +4 -4
  404. package/dist/types/button/useRipple.d.ts.map +1 -1
  405. package/dist/types/checkbox/Checkbox.d.ts +5 -5
  406. package/dist/types/checkbox/Checkbox.d.ts.map +1 -1
  407. package/dist/types/checkbox/types.d.ts +2 -2
  408. package/dist/types/checkbox/types.d.ts.map +1 -1
  409. package/dist/types/chip/Chip.d.ts +5 -5
  410. package/dist/types/chip/Chip.d.ts.map +1 -1
  411. package/dist/types/chip/types.d.ts +2 -2
  412. package/dist/types/chip/types.d.ts.map +1 -1
  413. package/dist/types/container/Container.d.ts +4 -4
  414. package/dist/types/container/Container.d.ts.map +1 -1
  415. package/dist/types/content-theme/content-theme.d.ts.map +1 -1
  416. package/dist/types/content-theme/types.d.ts +3 -3
  417. package/dist/types/content-theme/types.d.ts.map +1 -1
  418. package/dist/types/cookie-theme-toggler/cookie-theme-toggler.d.ts.map +1 -1
  419. package/dist/types/cookies-tooltip/cookies-tooltip.d.ts.map +1 -1
  420. package/dist/types/data-table/DataTable.d.ts +8 -8
  421. package/dist/types/data-table/DataTable.d.ts.map +1 -1
  422. package/dist/types/data-table/types.d.ts +3 -3
  423. package/dist/types/data-table/types.d.ts.map +1 -1
  424. package/dist/types/divider/Divider.d.ts +4 -4
  425. package/dist/types/divider/Divider.d.ts.map +1 -1
  426. package/dist/types/heading/Heading.d.ts +13 -13
  427. package/dist/types/heading/Heading.d.ts.map +1 -1
  428. package/dist/types/hooks/useMergeRefs.d.ts +2 -2
  429. package/dist/types/hooks/useMergeRefs.d.ts.map +1 -1
  430. package/dist/types/hooks/useOutsideClick.d.ts +2 -2
  431. package/dist/types/hooks/useOutsideClick.d.ts.map +1 -1
  432. package/dist/types/identicon/Identicon.d.ts +6 -6
  433. package/dist/types/identicon/Identicon.d.ts.map +1 -1
  434. package/dist/types/identicon/IdenticonBadge.d.ts +6 -6
  435. package/dist/types/identicon/IdenticonBadge.d.ts.map +1 -1
  436. package/dist/types/identicon/types.d.ts +3 -3
  437. package/dist/types/identicon/types.d.ts.map +1 -1
  438. package/dist/types/input/Input.d.ts +16 -16
  439. package/dist/types/input/Input.d.ts.map +1 -1
  440. package/dist/types/input/InputGroup.d.ts +6 -6
  441. package/dist/types/input/InputGroup.d.ts.map +1 -1
  442. package/dist/types/input/OptionsSlider.d.ts +0 -1
  443. package/dist/types/input/OptionsSlider.d.ts.map +1 -1
  444. package/dist/types/input/SliderInput.d.ts +2 -2
  445. package/dist/types/input/SliderInput.d.ts.map +1 -1
  446. package/dist/types/input/Textarea.d.ts +14 -14
  447. package/dist/types/input/Textarea.d.ts.map +1 -1
  448. package/dist/types/input/types.d.ts +15 -15
  449. package/dist/types/input/types.d.ts.map +1 -1
  450. package/dist/types/lido-logo/LidoLogo.d.ts +3 -3
  451. package/dist/types/lido-logo/LidoLogo.d.ts.map +1 -1
  452. package/dist/types/link/Link.d.ts +3 -3
  453. package/dist/types/link/Link.d.ts.map +1 -1
  454. package/dist/types/loaders/InlineLoader.d.ts +4 -4
  455. package/dist/types/loaders/InlineLoader.d.ts.map +1 -1
  456. package/dist/types/loaders/Loader.d.ts +4 -4
  457. package/dist/types/loaders/Loader.d.ts.map +1 -1
  458. package/dist/types/main-menu/MainMenu.d.ts +3 -3
  459. package/dist/types/main-menu/MainMenu.d.ts.map +1 -1
  460. package/dist/types/main-menu/MainMenuItem.d.ts +4 -4
  461. package/dist/types/main-menu/MainMenuItem.d.ts.map +1 -1
  462. package/dist/types/modal/Modal.d.ts +7 -7
  463. package/dist/types/modal/Modal.d.ts.map +1 -1
  464. package/dist/types/modal/ModalButton.d.ts +5 -5
  465. package/dist/types/modal/ModalButton.d.ts.map +1 -1
  466. package/dist/types/modal/ModalExtra.d.ts +3 -3
  467. package/dist/types/modal/ModalExtra.d.ts.map +1 -1
  468. package/dist/types/modal/ModalOverlay.d.ts +4 -4
  469. package/dist/types/modal/ModalOverlay.d.ts.map +1 -1
  470. package/dist/types/modal/ModalStyles.d.ts +7 -7
  471. package/dist/types/modal/ModalStyles.d.ts.map +1 -1
  472. package/dist/types/modal/types.d.ts +6 -6
  473. package/dist/types/modal/types.d.ts.map +1 -1
  474. package/dist/types/modal/useModalClose.d.ts +3 -3
  475. package/dist/types/modal/useModalClose.d.ts.map +1 -1
  476. package/dist/types/modal/useModalFocus.d.ts +2 -2
  477. package/dist/types/modal/useModalFocus.d.ts.map +1 -1
  478. package/dist/types/pagination/Pagination.d.ts +2 -2
  479. package/dist/types/pagination/Pagination.d.ts.map +1 -1
  480. package/dist/types/pagination/PaginationItem.d.ts +2 -2
  481. package/dist/types/pagination/PaginationItem.d.ts.map +1 -1
  482. package/dist/types/pagination/types.d.ts +3 -3
  483. package/dist/types/pagination/types.d.ts.map +1 -1
  484. package/dist/types/popover/Popover.d.ts +3 -3
  485. package/dist/types/popover/Popover.d.ts.map +1 -1
  486. package/dist/types/popover/PopoverRoot.d.ts +6 -6
  487. package/dist/types/popover/PopoverRoot.d.ts.map +1 -1
  488. package/dist/types/popover/PopoverStyles.d.ts.map +1 -1
  489. package/dist/types/popover/types.d.ts +3 -3
  490. package/dist/types/popover/types.d.ts.map +1 -1
  491. package/dist/types/popover/usePopoverPosition.d.ts +4 -4
  492. package/dist/types/popover/usePopoverPosition.d.ts.map +1 -1
  493. package/dist/types/popup-menu/PopupMenu.d.ts +3 -3
  494. package/dist/types/popup-menu/PopupMenu.d.ts.map +1 -1
  495. package/dist/types/popup-menu/PopupMenuItem.d.ts +6 -6
  496. package/dist/types/popup-menu/PopupMenuItem.d.ts.map +1 -1
  497. package/dist/types/popup-menu/PopupMenuProvider.d.ts.map +1 -1
  498. package/dist/types/popup-menu/types.d.ts +3 -3
  499. package/dist/types/popup-menu/types.d.ts.map +1 -1
  500. package/dist/types/popup-menu/usePopupFocus.d.ts +5 -5
  501. package/dist/types/popup-menu/usePopupFocus.d.ts.map +1 -1
  502. package/dist/types/section/Section.d.ts +6 -6
  503. package/dist/types/section/Section.d.ts.map +1 -1
  504. package/dist/types/section/types.d.ts +3 -3
  505. package/dist/types/section/types.d.ts.map +1 -1
  506. package/dist/types/select/Option.d.ts +3 -3
  507. package/dist/types/select/Option.d.ts.map +1 -1
  508. package/dist/types/select/Select.d.ts +4 -4
  509. package/dist/types/select/Select.d.ts.map +1 -1
  510. package/dist/types/select/SelectArrow.d.ts.map +1 -1
  511. package/dist/types/select/SelectIcon.d.ts +4 -4
  512. package/dist/types/select/SelectIcon.d.ts.map +1 -1
  513. package/dist/types/select/types.d.ts +3 -3
  514. package/dist/types/select/types.d.ts.map +1 -1
  515. package/dist/types/select/useSelect.d.ts +5 -5
  516. package/dist/types/select/useSelect.d.ts.map +1 -1
  517. package/dist/types/select/useSelectWidth.d.ts +2 -2
  518. package/dist/types/select/useSelectWidth.d.ts.map +1 -1
  519. package/dist/types/service-page/ServicePage.d.ts +5 -5
  520. package/dist/types/service-page/ServicePage.d.ts.map +1 -1
  521. package/dist/types/service-page/types.d.ts +2 -2
  522. package/dist/types/service-page/types.d.ts.map +1 -1
  523. package/dist/types/stack/HStack.d.ts +3 -3
  524. package/dist/types/stack/HStack.d.ts.map +1 -1
  525. package/dist/types/stack/Stack.d.ts +4 -4
  526. package/dist/types/stack/Stack.d.ts.map +1 -1
  527. package/dist/types/stack/StackItem.d.ts +4 -4
  528. package/dist/types/stack/StackItem.d.ts.map +1 -1
  529. package/dist/types/stack/StackProvider.d.ts.map +1 -1
  530. package/dist/types/stack/VStack.d.ts +3 -3
  531. package/dist/types/stack/VStack.d.ts.map +1 -1
  532. package/dist/types/styled-system/withStyledSystem.d.ts +2 -2
  533. package/dist/types/styled-system/withStyledSystem.d.ts.map +1 -1
  534. package/dist/types/table/Table.d.ts +3 -3
  535. package/dist/types/table/Table.d.ts.map +1 -1
  536. package/dist/types/table/Tbody.d.ts +3 -3
  537. package/dist/types/table/Tbody.d.ts.map +1 -1
  538. package/dist/types/table/Td.d.ts +4 -4
  539. package/dist/types/table/Td.d.ts.map +1 -1
  540. package/dist/types/table/Tfoot.d.ts +3 -3
  541. package/dist/types/table/Tfoot.d.ts.map +1 -1
  542. package/dist/types/table/Th.d.ts +4 -4
  543. package/dist/types/table/Th.d.ts.map +1 -1
  544. package/dist/types/table/Thead.d.ts +4 -4
  545. package/dist/types/table/Thead.d.ts.map +1 -1
  546. package/dist/types/table/Tr.d.ts +4 -4
  547. package/dist/types/table/Tr.d.ts.map +1 -1
  548. package/dist/types/text/Text.d.ts +4 -4
  549. package/dist/types/text/Text.d.ts.map +1 -1
  550. package/dist/types/text/TextStyles.d.ts.map +1 -1
  551. package/dist/types/theme/cookie-theme-provider.d.ts +2 -2
  552. package/dist/types/theme/cookie-theme-provider.d.ts.map +1 -1
  553. package/dist/types/theme/document-head-contents/element-fonts.d.ts.map +1 -1
  554. package/dist/types/theme/document-head-contents/element-theme-colors.d.ts.map +1 -1
  555. package/dist/types/theme/document-head-contents/element-theme-script.d.ts.map +1 -1
  556. package/dist/types/theme/document-head-contents/index.d.ts.map +1 -1
  557. package/dist/types/theme/theme-provider.d.ts.map +1 -1
  558. package/dist/types/toast/ToastPending.d.ts.map +1 -1
  559. package/dist/types/tooltip/Tooltip.d.ts +5 -5
  560. package/dist/types/tooltip/Tooltip.d.ts.map +1 -1
  561. package/dist/types/tooltip/types.d.ts +3 -3
  562. package/dist/types/tooltip/types.d.ts.map +1 -1
  563. package/dist/types/transition/withTransition.d.ts +2 -2
  564. package/dist/types/transition/withTransition.d.ts.map +1 -1
  565. package/package.json +20 -15
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "usePopoverPosition", {
6
6
  enumerable: true,
7
7
  get: ()=>usePopoverPosition
8
8
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
9
+ const _react = require("react");
11
10
  const _hooks = require("../hooks/index");
12
11
  const _constants = require("./constants");
13
12
  const _calculatePosition = require("./calculatePosition");
14
- const usePopoverPosition = (props)=>{
15
- const { placement =_constants.DEFAULT_PLACEMENT , anchorRef } = props;
13
+ const usePopoverPosition = (param)=>{
14
+ let { placement =_constants.DEFAULT_PLACEMENT , anchorRef , style: propsStyle } = param;
16
15
  const popoverRef = (0, _react.useRef)(null);
17
16
  const wrapperRef = (0, _react.useRef)(null);
18
17
  const [popoverStyle, setPopoverStyle] = (0, _react.useState)(_constants.INITIAL_STYLE);
@@ -31,7 +30,7 @@ const usePopoverPosition = (props)=>{
31
30
  windowHeight
32
31
  ]);
33
32
  const style = {
34
- ...props.style,
33
+ ...propsStyle,
35
34
  ...popoverStyle
36
35
  };
37
36
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/popover/usePopoverPosition.ts"],"sourcesContent":["import React, { useRef, useLayoutEffect, useState, CSSProperties } from 'react'\nimport { useWindowSize } from '@lidofinance/hooks'\nimport { PopoverRootProps } from './types'\nimport { INITIAL_STYLE, DEFAULT_PLACEMENT } from './constants'\nimport { calculatePosition } from './calculatePosition'\n\nexport const usePopoverPosition = <\n P extends HTMLDivElement,\n W extends HTMLDivElement,\n>(\n props: PopoverRootProps,\n): {\n popoverRef: React.RefObject<P>\n wrapperRef: React.RefObject<W>\n style: CSSProperties\n} => {\n const { placement = DEFAULT_PLACEMENT, anchorRef } = props\n\n const popoverRef = useRef<P>(null)\n const wrapperRef = useRef<W>(null)\n\n const [popoverStyle, setPopoverStyle] = useState<CSSProperties>(INITIAL_STYLE)\n const [windowWidth, windowHeight] = useWindowSize()\n\n useLayoutEffect(() => {\n if (!anchorRef.current || !popoverRef.current || !wrapperRef.current) return\n\n const anchorRect = anchorRef.current.getBoundingClientRect()\n const popoverRect = popoverRef.current.getBoundingClientRect()\n const wrapperRect = wrapperRef.current.getBoundingClientRect()\n\n const position = calculatePosition(\n anchorRect,\n popoverRect,\n wrapperRect,\n placement,\n )\n setPopoverStyle(position)\n }, [anchorRef, placement, windowWidth, windowHeight])\n\n const style = {\n ...props.style,\n ...popoverStyle,\n }\n\n return {\n popoverRef,\n wrapperRef,\n style,\n }\n}\n"],"names":["usePopoverPosition","props","placement","DEFAULT_PLACEMENT","anchorRef","popoverRef","useRef","wrapperRef","popoverStyle","setPopoverStyle","useState","INITIAL_STYLE","windowWidth","windowHeight","useWindowSize","useLayoutEffect","current","anchorRect","getBoundingClientRect","popoverRect","wrapperRect","position","calculatePosition","style"],"mappings":"AAAA;;;;+BAMaA,oBAAkB;;aAAlBA,kBAAkB;;;6DANyC,OAAO;uBACjD,gBAAoB;2BAED,aAAa;mCAC5B,qBAAqB;AAEhD,MAAMA,kBAAkB,GAAG,CAIhCC,KAAuB,GAKpB;IACH,MAAM,EAAEC,SAAS,EAAGC,UAAiB,kBAAA,CAAA,EAAEC,SAAS,CAAA,EAAE,GAAGH,KAAK;IAE1D,MAAMI,UAAU,GAAGC,IAAAA,MAAM,OAAA,EAAI,IAAI,CAAC;IAClC,MAAMC,UAAU,GAAGD,IAAAA,MAAM,OAAA,EAAI,IAAI,CAAC;IAElC,MAAM,CAACE,YAAY,EAAEC,eAAe,CAAC,GAAGC,IAAAA,MAAQ,SAAA,EAAgBC,UAAa,cAAA,CAAC;IAC9E,MAAM,CAACC,WAAW,EAAEC,YAAY,CAAC,GAAGC,IAAAA,MAAa,cAAA,GAAE;IAEnDC,IAAAA,MAAe,gBAAA,EAAC,IAAM;QACpB,IAAI,CAACX,SAAS,CAACY,OAAO,IAAI,CAACX,UAAU,CAACW,OAAO,IAAI,CAACT,UAAU,CAACS,OAAO,EAAE,OAAM;QAE5E,MAAMC,UAAU,GAAGb,SAAS,CAACY,OAAO,CAACE,qBAAqB,EAAE;QAC5D,MAAMC,WAAW,GAAGd,UAAU,CAACW,OAAO,CAACE,qBAAqB,EAAE;QAC9D,MAAME,WAAW,GAAGb,UAAU,CAACS,OAAO,CAACE,qBAAqB,EAAE;QAE9D,MAAMG,QAAQ,GAAGC,IAAAA,kBAAiB,kBAAA,EAChCL,UAAU,EACVE,WAAW,EACXC,WAAW,EACXlB,SAAS,CACV;QACDO,eAAe,CAACY,QAAQ,CAAC;IAC3B,CAAC,EAAE;QAACjB,SAAS;QAAEF,SAAS;QAAEU,WAAW;QAAEC,YAAY;KAAC,CAAC;IAErD,MAAMU,KAAK,GAAG;QACZ,GAAGtB,KAAK,CAACsB,KAAK;QACd,GAAGf,YAAY;KAChB;IAED,OAAO;QACLH,UAAU;QACVE,UAAU;QACVgB,KAAK;KACN,CAAA;AACH,CAAC"}
1
+ {"version":3,"sources":["../../../packages/popover/usePopoverPosition.ts"],"sourcesContent":["import {\n useRef,\n useLayoutEffect,\n useState,\n CSSProperties,\n RefObject,\n} from 'react'\nimport { useWindowSize } from '@lidofinance/hooks'\nimport { PopoverRootProps } from './types'\nimport { INITIAL_STYLE, DEFAULT_PLACEMENT } from './constants'\nimport { calculatePosition } from './calculatePosition'\n\nexport const usePopoverPosition = <\n P extends HTMLDivElement,\n W extends HTMLDivElement,\n>({\n placement = DEFAULT_PLACEMENT,\n anchorRef,\n style: propsStyle,\n}: Pick<PopoverRootProps, 'placement' | 'anchorRef' | 'style'>): {\n popoverRef: RefObject<P>\n wrapperRef: RefObject<W>\n style: CSSProperties\n} => {\n const popoverRef = useRef<P>(null)\n const wrapperRef = useRef<W>(null)\n\n const [popoverStyle, setPopoverStyle] = useState<CSSProperties>(INITIAL_STYLE)\n const [windowWidth, windowHeight] = useWindowSize()\n\n useLayoutEffect(() => {\n if (!anchorRef.current || !popoverRef.current || !wrapperRef.current) return\n\n const anchorRect = anchorRef.current.getBoundingClientRect()\n const popoverRect = popoverRef.current.getBoundingClientRect()\n const wrapperRect = wrapperRef.current.getBoundingClientRect()\n\n const position = calculatePosition(\n anchorRect,\n popoverRect,\n wrapperRect,\n placement,\n )\n setPopoverStyle(position)\n }, [anchorRef, placement, windowWidth, windowHeight])\n\n const style = {\n ...propsStyle,\n ...popoverStyle,\n }\n\n return {\n popoverRef,\n wrapperRef,\n style,\n }\n}\n"],"names":["usePopoverPosition","placement","DEFAULT_PLACEMENT","anchorRef","style","propsStyle","popoverRef","useRef","wrapperRef","popoverStyle","setPopoverStyle","useState","INITIAL_STYLE","windowWidth","windowHeight","useWindowSize","useLayoutEffect","current","anchorRect","getBoundingClientRect","popoverRect","wrapperRect","position","calculatePosition"],"mappings":"AAAA;;;;+BAYaA,oBAAkB;;aAAlBA,kBAAkB;;uBANxB,OAAO;uBACgB,gBAAoB;2BAED,aAAa;mCAC5B,qBAAqB;AAEhD,MAAMA,kBAAkB,GAAG,SAW7B;QARH,EACAC,SAAS,EAAGC,UAAiB,kBAAA,CAAA,EAC7BC,SAAS,CAAA,EACTC,KAAK,EAAEC,UAAU,CAAA,EAC2C;IAK5D,MAAMC,UAAU,GAAGC,IAAAA,MAAM,OAAA,EAAI,IAAI,CAAC;IAClC,MAAMC,UAAU,GAAGD,IAAAA,MAAM,OAAA,EAAI,IAAI,CAAC;IAElC,MAAM,CAACE,YAAY,EAAEC,eAAe,CAAC,GAAGC,IAAAA,MAAQ,SAAA,EAAgBC,UAAa,cAAA,CAAC;IAC9E,MAAM,CAACC,WAAW,EAAEC,YAAY,CAAC,GAAGC,IAAAA,MAAa,cAAA,GAAE;IAEnDC,IAAAA,MAAe,gBAAA,EAAC,IAAM;QACpB,IAAI,CAACb,SAAS,CAACc,OAAO,IAAI,CAACX,UAAU,CAACW,OAAO,IAAI,CAACT,UAAU,CAACS,OAAO,EAAE,OAAM;QAE5E,MAAMC,UAAU,GAAGf,SAAS,CAACc,OAAO,CAACE,qBAAqB,EAAE;QAC5D,MAAMC,WAAW,GAAGd,UAAU,CAACW,OAAO,CAACE,qBAAqB,EAAE;QAC9D,MAAME,WAAW,GAAGb,UAAU,CAACS,OAAO,CAACE,qBAAqB,EAAE;QAE9D,MAAMG,QAAQ,GAAGC,IAAAA,kBAAiB,kBAAA,EAChCL,UAAU,EACVE,WAAW,EACXC,WAAW,EACXpB,SAAS,CACV;QACDS,eAAe,CAACY,QAAQ,CAAC;IAC3B,CAAC,EAAE;QAACnB,SAAS;QAAEF,SAAS;QAAEY,WAAW;QAAEC,YAAY;KAAC,CAAC;IAErD,MAAMV,KAAK,GAAG;QACZ,GAAGC,UAAU;QACb,GAAGI,YAAY;KAChB;IAED,OAAO;QACLH,UAAU;QACVE,UAAU;QACVJ,KAAK;KACN,CAAA;AACH,CAAC"}
@@ -6,32 +6,36 @@ Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
7
  get: ()=>_default
8
8
  });
9
- const _extends = require("@swc/helpers/lib/_extends.js").default;
10
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
11
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
9
+ const _jsxRuntime = require("react/jsx-runtime");
10
+ const _react = require("react");
12
11
  const _hooks = require("../hooks/index");
13
12
  const _popupMenuProvider = require("./PopupMenuProvider");
14
13
  const _popupMenuStyles = require("./PopupMenuStyles");
15
14
  const _usePopupFocus = require("./usePopupFocus");
16
- function PopupMenu(props, externalRef) {
17
- const { variant , children , onKeyDown , onMouseMove , ...rest } = props;
18
- const { ref: controlRef , handleMouseMove , handleKeyDown , handleEnter , handleExit , } = (0, _usePopupFocus.usePopupFocus)(props);
15
+ function PopupMenu(param, externalRef) {
16
+ let { variant , children , onKeyDown , onMouseMove , ...rest } = param;
17
+ const { ref: controlRef , handleMouseMove , handleKeyDown , handleEnter , handleExit , } = (0, _usePopupFocus.usePopupFocus)({
18
+ onMouseMove,
19
+ onKeyDown
20
+ });
19
21
  const popupRef = (0, _hooks.useMergeRefs)([
20
22
  controlRef,
21
23
  externalRef
22
24
  ]);
23
- return /*#__PURE__*/ _react.default.createElement(_popupMenuStyles.PopupMenuStyle, _extends({
25
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_popupMenuStyles.PopupMenuStyle, {
24
26
  onMouseMove: handleMouseMove,
25
27
  onKeyDown: handleKeyDown,
26
28
  onEnter: handleEnter,
27
29
  onExit: handleExit,
28
30
  tabIndex: -1,
29
- role: "listbox"
30
- }, rest, {
31
- ref: popupRef
32
- }), /*#__PURE__*/ _react.default.createElement(_popupMenuProvider.PopupMenuProvider, {
33
- variant: variant
34
- }, children));
31
+ role: "listbox",
32
+ ...rest,
33
+ ref: popupRef,
34
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_popupMenuProvider.PopupMenuProvider, {
35
+ variant: variant,
36
+ children: children
37
+ })
38
+ });
35
39
  }
36
40
  const _default = /*#__PURE__*/ (0, _react.forwardRef)(PopupMenu);
37
41
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/popup-menu/PopupMenu.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef } from 'react'\nimport { useMergeRefs } from '@lidofinance/hooks'\nimport { PopupMenuProvider } from './PopupMenuProvider'\nimport { PopupMenuStyle } from './PopupMenuStyles'\nimport { PopupMenuProps } from './types'\nimport { usePopupFocus } from './usePopupFocus'\n\nfunction PopupMenu(\n props: PopupMenuProps,\n externalRef?: ForwardedRef<HTMLDivElement>,\n) {\n const { variant, children, onKeyDown, onMouseMove, ...rest } = props\n\n const {\n ref: controlRef,\n handleMouseMove,\n handleKeyDown,\n handleEnter,\n handleExit,\n } = usePopupFocus(props)\n const popupRef = useMergeRefs([controlRef, externalRef])\n\n return (\n <PopupMenuStyle\n onMouseMove={handleMouseMove}\n onKeyDown={handleKeyDown}\n onEnter={handleEnter}\n onExit={handleExit}\n tabIndex={-1}\n role='listbox'\n {...rest}\n ref={popupRef}\n >\n <PopupMenuProvider variant={variant}>{children}</PopupMenuProvider>\n </PopupMenuStyle>\n )\n}\n\nexport default forwardRef(PopupMenu)\n"],"names":["PopupMenu","props","externalRef","variant","children","onKeyDown","onMouseMove","rest","ref","controlRef","handleMouseMove","handleKeyDown","handleEnter","handleExit","usePopupFocus","popupRef","useMergeRefs","PopupMenuStyle","onEnter","onExit","tabIndex","role","PopupMenuProvider","forwardRef"],"mappings":"AAAA;;;;+BAsCA,SAAoC;;aAApC,QAAoC;;;;6DAtCY,OAAO;uBAC1B,gBAAoB;mCACf,qBAAqB;iCACxB,mBAAmB;+BAEpB,iBAAiB;AAE/C,SAASA,SAAS,CAChBC,KAAqB,EACrBC,WAA0C,EAC1C;IACA,MAAM,EAAEC,OAAO,CAAA,EAAEC,QAAQ,CAAA,EAAEC,SAAS,CAAA,EAAEC,WAAW,CAAA,EAAE,GAAGC,IAAI,EAAE,GAAGN,KAAK;IAEpE,MAAM,EACJO,GAAG,EAAEC,UAAU,CAAA,EACfC,eAAe,CAAA,EACfC,aAAa,CAAA,EACbC,WAAW,CAAA,EACXC,UAAU,CAAA,IACX,GAAGC,IAAAA,cAAa,cAAA,EAACb,KAAK,CAAC;IACxB,MAAMc,QAAQ,GAAGC,IAAAA,MAAY,aAAA,EAAC;QAACP,UAAU;QAAEP,WAAW;KAAC,CAAC;IAExD,qBACE,6BAACe,gBAAc,eAAA;QACbX,WAAW,EAAEI,eAAe;QAC5BL,SAAS,EAAEM,aAAa;QACxBO,OAAO,EAAEN,WAAW;QACpBO,MAAM,EAAEN,UAAU;QAClBO,QAAQ,EAAE,CAAC,CAAC;QACZC,IAAI,EAAC,SAAS;OACVd,IAAI;QACRC,GAAG,EAAEO,QAAQ;sBAEb,6BAACO,kBAAiB,kBAAA;QAACnB,OAAO,EAAEA,OAAO;OAAGC,QAAQ,CAAqB,CACpD,CAClB;AACH,CAAC;MAED,QAAoC,iBAArBmB,IAAAA,MAAU,WAAA,EAACvB,SAAS,CAAC"}
1
+ {"version":3,"sources":["../../../packages/popup-menu/PopupMenu.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef } from 'react'\nimport { useMergeRefs } from '@lidofinance/hooks'\nimport { PopupMenuProvider } from './PopupMenuProvider'\nimport { PopupMenuStyle } from './PopupMenuStyles'\nimport { PopupMenuProps } from './types'\nimport { usePopupFocus } from './usePopupFocus'\n\nfunction PopupMenu(\n { variant, children, onKeyDown, onMouseMove, ...rest }: PopupMenuProps,\n externalRef?: ForwardedRef<HTMLDivElement>,\n) {\n const {\n ref: controlRef,\n handleMouseMove,\n handleKeyDown,\n handleEnter,\n handleExit,\n } = usePopupFocus({ onMouseMove, onKeyDown })\n const popupRef = useMergeRefs([controlRef, externalRef])\n\n return (\n <PopupMenuStyle\n onMouseMove={handleMouseMove}\n onKeyDown={handleKeyDown}\n onEnter={handleEnter}\n onExit={handleExit}\n tabIndex={-1}\n role='listbox'\n {...rest}\n ref={popupRef}\n >\n <PopupMenuProvider variant={variant}>{children}</PopupMenuProvider>\n </PopupMenuStyle>\n )\n}\n\nexport default forwardRef(PopupMenu)\n"],"names":["PopupMenu","externalRef","variant","children","onKeyDown","onMouseMove","rest","ref","controlRef","handleMouseMove","handleKeyDown","handleEnter","handleExit","usePopupFocus","popupRef","useMergeRefs","PopupMenuStyle","onEnter","onExit","tabIndex","role","PopupMenuProvider","forwardRef"],"mappings":"AAAA;;;;+BAoCA,SAAoC;;aAApC,QAAoC;;;uBApCK,OAAO;uBACnB,gBAAoB;mCACf,qBAAqB;iCACxB,mBAAmB;+BAEpB,iBAAiB;AAE/C,SAASA,SAAS,CAChB,KAAsE,EACtEC,WAA0C,EAC1C;QAFA,EAAEC,OAAO,CAAA,EAAEC,QAAQ,CAAA,EAAEC,SAAS,CAAA,EAAEC,WAAW,CAAA,EAAE,GAAGC,IAAI,EAAkB,GAAtE,KAAsE;IAGtE,MAAM,EACJC,GAAG,EAAEC,UAAU,CAAA,EACfC,eAAe,CAAA,EACfC,aAAa,CAAA,EACbC,WAAW,CAAA,EACXC,UAAU,CAAA,IACX,GAAGC,IAAAA,cAAa,cAAA,EAAC;QAAER,WAAW;QAAED,SAAS;KAAE,CAAC;IAC7C,MAAMU,QAAQ,GAAGC,IAAAA,MAAY,aAAA,EAAC;QAACP,UAAU;QAAEP,WAAW;KAAC,CAAC;IAExD,qBACE,qBAACe,gBAAc,eAAA;QACbX,WAAW,EAAEI,eAAe;QAC5BL,SAAS,EAAEM,aAAa;QACxBO,OAAO,EAAEN,WAAW;QACpBO,MAAM,EAAEN,UAAU;QAClBO,QAAQ,EAAE,CAAC,CAAC;QACZC,IAAI,EAAC,SAAS;QACb,GAAGd,IAAI;QACRC,GAAG,EAAEO,QAAQ;kBAEb,cAAA,qBAACO,kBAAiB,kBAAA;YAACnB,OAAO,EAAEA,OAAO;sBAAGC,QAAQ;UAAqB;MACpD,CAClB;AACH,CAAC;MAED,QAAoC,iBAArBmB,IAAAA,MAAU,WAAA,EAACtB,SAAS,CAAC"}
@@ -6,25 +6,34 @@ Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
7
  get: ()=>_default
8
8
  });
9
- const _extends = require("@swc/helpers/lib/_extends.js").default;
10
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
11
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
9
+ const _jsxRuntime = require("react/jsx-runtime");
10
+ const _react = require("react");
12
11
  const _popupMenuItemStyles = require("./PopupMenuItemStyles");
13
12
  const _popupMenuProvider = require("./PopupMenuProvider");
14
- function PopupMenuItem(props, ref) {
15
- const { active =false , leftDecorator , rightDecorator , children , ...rest } = props;
13
+ function PopupMenuItem(param, ref) {
14
+ let { active =false , leftDecorator , rightDecorator , children , ...rest } = param;
16
15
  const { variant ='default' } = (0, _popupMenuProvider.usePopupMenuContext)();
17
16
  const hasLeftDecorator = !!leftDecorator;
18
17
  const hasRightDecorator = !!rightDecorator;
19
- return /*#__PURE__*/ _react.default.createElement(_popupMenuItemStyles.PopupMenuItemStyle, _extends({
18
+ return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_popupMenuItemStyles.PopupMenuItemStyle, {
20
19
  $active: active,
21
20
  role: "option",
22
- "aria-selected": active
23
- }, rest, {
24
- ref: ref
25
- }), hasLeftDecorator && /*#__PURE__*/ _react.default.createElement(_popupMenuItemStyles.PopupMenuItemLeftDecoratorStyle, null, leftDecorator), /*#__PURE__*/ _react.default.createElement(_popupMenuItemStyles.PopupMenuItemContentStyle, {
26
- $variant: variant
27
- }, children), hasRightDecorator && /*#__PURE__*/ _react.default.createElement(_popupMenuItemStyles.PopupMenuItemRightDecoratorStyle, null, rightDecorator));
21
+ "aria-selected": active,
22
+ ...rest,
23
+ ref: ref,
24
+ children: [
25
+ hasLeftDecorator && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_popupMenuItemStyles.PopupMenuItemLeftDecoratorStyle, {
26
+ children: leftDecorator
27
+ }),
28
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_popupMenuItemStyles.PopupMenuItemContentStyle, {
29
+ $variant: variant,
30
+ children: children
31
+ }),
32
+ hasRightDecorator && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_popupMenuItemStyles.PopupMenuItemRightDecoratorStyle, {
33
+ children: rightDecorator
34
+ })
35
+ ]
36
+ });
28
37
  }
29
38
  const _default = /*#__PURE__*/ (0, _react.forwardRef)(PopupMenuItem);
30
39
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/popup-menu/PopupMenuItem.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef } from 'react'\nimport {\n PopupMenuItemStyle,\n PopupMenuItemContentStyle,\n PopupMenuItemLeftDecoratorStyle,\n PopupMenuItemRightDecoratorStyle,\n} from './PopupMenuItemStyles'\nimport { usePopupMenuContext } from './PopupMenuProvider'\nimport { PopupMenuItemProps } from './types'\n\nfunction PopupMenuItem(\n props: PopupMenuItemProps,\n ref?: ForwardedRef<HTMLButtonElement>,\n) {\n const {\n active = false,\n leftDecorator,\n rightDecorator,\n children,\n ...rest\n } = props\n const { variant = 'default' } = usePopupMenuContext()\n\n const hasLeftDecorator = !!leftDecorator\n const hasRightDecorator = !!rightDecorator\n\n return (\n <PopupMenuItemStyle\n $active={active}\n role='option'\n aria-selected={active}\n {...rest}\n ref={ref}\n >\n {hasLeftDecorator && (\n <PopupMenuItemLeftDecoratorStyle>\n {leftDecorator}\n </PopupMenuItemLeftDecoratorStyle>\n )}\n\n <PopupMenuItemContentStyle $variant={variant}>\n {children}\n </PopupMenuItemContentStyle>\n\n {hasRightDecorator && (\n <PopupMenuItemRightDecoratorStyle>\n {rightDecorator}\n </PopupMenuItemRightDecoratorStyle>\n )}\n </PopupMenuItemStyle>\n )\n}\n\nexport default forwardRef(PopupMenuItem)\n"],"names":["PopupMenuItem","props","ref","active","leftDecorator","rightDecorator","children","rest","variant","usePopupMenuContext","hasLeftDecorator","hasRightDecorator","PopupMenuItemStyle","$active","role","aria-selected","PopupMenuItemLeftDecoratorStyle","PopupMenuItemContentStyle","$variant","PopupMenuItemRightDecoratorStyle","forwardRef"],"mappings":"AAAA;;;;+BAqDA,SAAwC;;aAAxC,QAAwC;;;;6DArDQ,OAAO;qCAMhD,uBAAuB;mCACM,qBAAqB;AAGzD,SAASA,aAAa,CACpBC,KAAyB,EACzBC,GAAqC,EACrC;IACA,MAAM,EACJC,MAAM,EAAG,KAAK,CAAA,EACdC,aAAa,CAAA,EACbC,cAAc,CAAA,EACdC,QAAQ,CAAA,EACR,GAAGC,IAAI,EACR,GAAGN,KAAK;IACT,MAAM,EAAEO,OAAO,EAAG,SAAS,CAAA,EAAE,GAAGC,IAAAA,kBAAmB,oBAAA,GAAE;IAErD,MAAMC,gBAAgB,GAAG,CAAC,CAACN,aAAa;IACxC,MAAMO,iBAAiB,GAAG,CAAC,CAACN,cAAc;IAE1C,qBACE,6BAACO,oBAAkB,mBAAA;QACjBC,OAAO,EAAEV,MAAM;QACfW,IAAI,EAAC,QAAQ;QACbC,eAAa,EAAEZ,MAAM;OACjBI,IAAI;QACRL,GAAG,EAAEA,GAAG;QAEPQ,gBAAgB,kBACf,6BAACM,oBAA+B,gCAAA,QAC7BZ,aAAa,CACkB,AACnC,gBAED,6BAACa,oBAAyB,0BAAA;QAACC,QAAQ,EAAEV,OAAO;OACzCF,QAAQ,CACiB,EAE3BK,iBAAiB,kBAChB,6BAACQ,oBAAgC,iCAAA,QAC9Bd,cAAc,CACkB,AACpC,CACkB,CACtB;AACH,CAAC;MAED,QAAwC,iBAAzBe,IAAAA,MAAU,WAAA,EAACpB,aAAa,CAAC"}
1
+ {"version":3,"sources":["../../../packages/popup-menu/PopupMenuItem.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef } from 'react'\nimport {\n PopupMenuItemStyle,\n PopupMenuItemContentStyle,\n PopupMenuItemLeftDecoratorStyle,\n PopupMenuItemRightDecoratorStyle,\n} from './PopupMenuItemStyles'\nimport { usePopupMenuContext } from './PopupMenuProvider'\nimport { PopupMenuItemProps } from './types'\n\nfunction PopupMenuItem(\n {\n active = false,\n leftDecorator,\n rightDecorator,\n children,\n ...rest\n }: PopupMenuItemProps,\n ref?: ForwardedRef<HTMLButtonElement>,\n) {\n const { variant = 'default' } = usePopupMenuContext()\n\n const hasLeftDecorator = !!leftDecorator\n const hasRightDecorator = !!rightDecorator\n\n return (\n <PopupMenuItemStyle\n $active={active}\n role='option'\n aria-selected={active}\n {...rest}\n ref={ref}\n >\n {hasLeftDecorator && (\n <PopupMenuItemLeftDecoratorStyle>\n {leftDecorator}\n </PopupMenuItemLeftDecoratorStyle>\n )}\n\n <PopupMenuItemContentStyle $variant={variant}>\n {children}\n </PopupMenuItemContentStyle>\n\n {hasRightDecorator && (\n <PopupMenuItemRightDecoratorStyle>\n {rightDecorator}\n </PopupMenuItemRightDecoratorStyle>\n )}\n </PopupMenuItemStyle>\n )\n}\n\nexport default forwardRef(PopupMenuItem)\n"],"names":["PopupMenuItem","ref","active","leftDecorator","rightDecorator","children","rest","variant","usePopupMenuContext","hasLeftDecorator","hasRightDecorator","PopupMenuItemStyle","$active","role","aria-selected","PopupMenuItemLeftDecoratorStyle","PopupMenuItemContentStyle","$variant","PopupMenuItemRightDecoratorStyle","forwardRef"],"mappings":"AAAA;;;;+BAoDA,SAAwC;;aAAxC,QAAwC;;;uBApDC,OAAO;qCAMzC,uBAAuB;mCACM,qBAAqB;AAGzD,SAASA,aAAa,CACpB,KAMqB,EACrBC,GAAqC,EACrC;QARA,EACEC,MAAM,EAAG,KAAK,CAAA,EACdC,aAAa,CAAA,EACbC,cAAc,CAAA,EACdC,QAAQ,CAAA,EACR,GAAGC,IAAI,EACY,GANrB,KAMqB;IAGrB,MAAM,EAAEC,OAAO,EAAG,SAAS,CAAA,EAAE,GAAGC,IAAAA,kBAAmB,oBAAA,GAAE;IAErD,MAAMC,gBAAgB,GAAG,CAAC,CAACN,aAAa;IACxC,MAAMO,iBAAiB,GAAG,CAAC,CAACN,cAAc;IAE1C,qBACE,sBAACO,oBAAkB,mBAAA;QACjBC,OAAO,EAAEV,MAAM;QACfW,IAAI,EAAC,QAAQ;QACbC,eAAa,EAAEZ,MAAM;QACpB,GAAGI,IAAI;QACRL,GAAG,EAAEA,GAAG;;YAEPQ,gBAAgB,kBACf,qBAACM,oBAA+B,gCAAA;0BAC7BZ,aAAa;cACkB,AACnC;0BAED,qBAACa,oBAAyB,0BAAA;gBAACC,QAAQ,EAAEV,OAAO;0BACzCF,QAAQ;cACiB;YAE3BK,iBAAiB,kBAChB,qBAACQ,oBAAgC,iCAAA;0BAC9Bd,cAAc;cACkB,AACpC;;MACkB,CACtB;AACH,CAAC;MAED,QAAwC,iBAAzBe,IAAAA,MAAU,WAAA,EAACnB,aAAa,CAAC"}
@@ -12,20 +12,20 @@ _export(exports, {
12
12
  usePopupMenuContext: ()=>usePopupMenuContext,
13
13
  PopupMenuProvider: ()=>PopupMenuProvider
14
14
  });
15
- const _extends = require("@swc/helpers/lib/_extends.js").default;
16
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
17
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
15
+ const _jsxRuntime = require("react/jsx-runtime");
16
+ const _react = require("react");
18
17
  const Context = /*#__PURE__*/ (0, _react.createContext)({});
19
18
  const usePopupMenuContext = ()=>{
20
19
  return (0, _react.useContext)(Context);
21
20
  };
22
- const PopupMenuProvider = (props)=>{
23
- const { variant , ...rest } = props;
24
- return /*#__PURE__*/ _react.default.createElement(Context.Provider, _extends({
21
+ const PopupMenuProvider = (param)=>{
22
+ let { variant , ...rest } = param;
23
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(Context.Provider, {
25
24
  value: {
26
25
  variant
27
- }
28
- }, rest));
26
+ },
27
+ ...rest
28
+ });
29
29
  };
30
30
 
31
31
  //# sourceMappingURL=PopupMenuProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/popup-menu/PopupMenuProvider.tsx"],"sourcesContent":["import React, { PropsWithChildren, createContext, useContext, FC } from 'react'\nimport { PopupMenuVariants } from './types'\n\nexport interface PopupMenuContext {\n variant?: PopupMenuVariants\n}\n\nconst Context = createContext({} as PopupMenuContext)\n\nexport const usePopupMenuContext = (): PopupMenuContext => {\n return useContext(Context)\n}\n\nexport const PopupMenuProvider: FC<PropsWithChildren<PopupMenuContext>> = (\n props,\n) => {\n const { variant, ...rest } = props\n\n return <Context.Provider value={{ variant }} {...rest} />\n}\n"],"names":["usePopupMenuContext","PopupMenuProvider","Context","createContext","useContext","props","variant","rest","Provider","value"],"mappings":"AAAA;;;;;;;;;;;IASaA,mBAAmB,MAAnBA,mBAAmB;IAInBC,iBAAiB,MAAjBA,iBAAiB;;;;6DAb0C,OAAO;AAO/E,MAAMC,OAAO,iBAAGC,IAAAA,MAAa,cAAA,EAAC,EAAE,CAAqB;AAE9C,MAAMH,mBAAmB,GAAG,IAAwB;IACzD,OAAOI,IAAAA,MAAU,WAAA,EAACF,OAAO,CAAC,CAAA;AAC5B,CAAC;AAEM,MAAMD,iBAAiB,GAA4C,CACxEI,KAAK,GACF;IACH,MAAM,EAAEC,OAAO,CAAA,EAAE,GAAGC,IAAI,EAAE,GAAGF,KAAK;IAElC,qBAAO,6BAACH,OAAO,CAACM,QAAQ;QAACC,KAAK,EAAE;YAAEH,OAAO;SAAE;OAAMC,IAAI,EAAI,CAAA;AAC3D,CAAC"}
1
+ {"version":3,"sources":["../../../packages/popup-menu/PopupMenuProvider.tsx"],"sourcesContent":["import { PropsWithChildren, createContext, useContext, FC } from 'react'\nimport { PopupMenuVariants } from './types'\n\nexport interface PopupMenuContext {\n variant?: PopupMenuVariants\n}\n\nconst Context = createContext({} as PopupMenuContext)\n\nexport const usePopupMenuContext = (): PopupMenuContext => {\n return useContext(Context)\n}\n\nexport const PopupMenuProvider: FC<PropsWithChildren<PopupMenuContext>> = ({\n variant,\n ...rest\n}) => {\n return <Context.Provider value={{ variant }} {...rest} />\n}\n"],"names":["usePopupMenuContext","PopupMenuProvider","Context","createContext","useContext","variant","rest","Provider","value"],"mappings":"AAAA;;;;;;;;;;;IASaA,mBAAmB,MAAnBA,mBAAmB;IAInBC,iBAAiB,MAAjBA,iBAAiB;;;uBAbmC,OAAO;AAOxE,MAAMC,OAAO,iBAAGC,IAAAA,MAAa,cAAA,EAAC,EAAE,CAAqB;AAE9C,MAAMH,mBAAmB,GAAG,IAAwB;IACzD,OAAOI,IAAAA,MAAU,WAAA,EAACF,OAAO,CAAC,CAAA;AAC5B,CAAC;AAEM,MAAMD,iBAAiB,GAA4C,SAGpE;QAHqE,EACzEI,OAAO,CAAA,EACP,GAAGC,IAAI,EACR;IACC,qBAAO,qBAACJ,OAAO,CAACK,QAAQ;QAACC,KAAK,EAAE;YAAEH,OAAO;SAAE;QAAG,GAAGC,IAAI;MAAI,CAAA;AAC3D,CAAC"}
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "PopupMenuVariant", {
6
6
  enumerable: true,
7
7
  get: ()=>PopupMenuVariant
8
8
  });
9
- const _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
11
9
  var PopupMenuVariant;
12
10
  (function(PopupMenuVariant) {
13
11
  PopupMenuVariant[PopupMenuVariant["small"] = 0] = "small";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/popup-menu/types.ts"],"sourcesContent":["import { LidoComponentProps } from '@lidofinance/utils'\nimport { PopoverProps } from '@lidofinance/popover'\nimport React from 'react'\nexport type { Theme } from '@lidofinance/theme'\n\nexport enum PopupMenuVariant {\n small,\n default,\n}\nexport type PopupMenuVariants = keyof typeof PopupMenuVariant\n\nexport type PopupMenuProps = {\n variant?: PopupMenuVariants\n} & PopoverProps\n\nexport type PopupMenuItemProps = LidoComponentProps<\n 'button',\n {\n leftDecorator?: React.ReactNode\n rightDecorator?: React.ReactNode\n active?: boolean\n }\n>\n"],"names":["PopupMenuVariant","small","default"],"mappings":"AAAA;;;;;;;;;4DAEkB,OAAO;IAGlB,gBAGN;UAHWA,gBAAgB;IAAhBA,gBAAgB,CAAhBA,gBAAgB,CAC1BC,OAAK,IAALA,CAAK,IAALA,OAAK;IADKD,gBAAgB,CAAhBA,gBAAgB,CAE1BE,SAAO,IAAPA,CAAO,IAAPA,SAAO;GAFGF,gBAAgB,KAAhBA,gBAAgB"}
1
+ {"version":3,"sources":["../../../packages/popup-menu/types.ts"],"sourcesContent":["import { LidoComponentProps } from '@lidofinance/utils'\nimport { PopoverProps } from '@lidofinance/popover'\nimport { ReactNode } from 'react'\nexport type { Theme } from '@lidofinance/theme'\n\nexport enum PopupMenuVariant {\n small,\n default,\n}\nexport type PopupMenuVariants = keyof typeof PopupMenuVariant\n\nexport type PopupMenuProps = {\n variant?: PopupMenuVariants\n} & PopoverProps\n\nexport type PopupMenuItemProps = LidoComponentProps<\n 'button',\n {\n leftDecorator?: ReactNode\n rightDecorator?: ReactNode\n active?: boolean\n }\n>\n"],"names":["PopupMenuVariant","small","default"],"mappings":"AAAA;;;;;;;;IAKO,gBAGN;UAHWA,gBAAgB;IAAhBA,gBAAgB,CAAhBA,gBAAgB,CAC1BC,OAAK,IAALA,CAAK,IAALA,OAAK;IADKD,gBAAgB,CAAhBA,gBAAgB,CAE1BE,SAAO,IAAPA,CAAO,IAAPA,SAAO;GAFGF,gBAAgB,KAAhBA,gBAAgB"}
@@ -6,12 +6,11 @@ Object.defineProperty(exports, "usePopupFocus", {
6
6
  enumerable: true,
7
7
  get: ()=>usePopupFocus
8
8
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
9
+ const _react = require("react");
11
10
  const _hooks = require("../hooks/index");
12
11
  const _constants = require("./constants");
13
- const usePopupFocus = (props)=>{
14
- const { onMouseMove , onKeyDown } = props;
12
+ const usePopupFocus = (param)=>{
13
+ let { onMouseMove , onKeyDown } = param;
15
14
  const ref = (0, _react.useRef)(null);
16
15
  const getFocusableNodes = (0, _react.useCallback)(()=>{
17
16
  var ref1;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/popup-menu/usePopupFocus.ts"],"sourcesContent":["import React, { useCallback, useRef } from 'react'\nimport { useInterceptFocus } from '@lidofinance/hooks'\nimport { FOCUSABLE_ELEMENTS } from './constants'\nimport { PopupMenuProps } from './types'\n\nexport const usePopupFocus = <T extends HTMLDivElement>(\n props: PopupMenuProps,\n): {\n ref: React.RefObject<T>\n handleMouseMove: React.MouseEventHandler<T>\n handleKeyDown: React.KeyboardEventHandler<T>\n handleEnter: () => void\n handleExit: () => void\n} => {\n const { onMouseMove, onKeyDown } = props\n const ref = useRef<T>(null)\n\n const getFocusableNodes = useCallback(() => {\n const nodes =\n ref.current?.querySelectorAll(FOCUSABLE_ELEMENTS.join(',')) ?? []\n\n return Array.from(nodes).filter(\n (node): node is HTMLElement =>\n node && node instanceof HTMLElement && node.offsetParent !== null,\n )\n }, [])\n\n const handleFocusTo = useCallback(\n (event: React.KeyboardEvent<T>, offset = 1) => {\n const focusableNodes = getFocusableNodes()\n\n if (focusableNodes.length === 0) return\n\n const currentElement = document.activeElement\n const focusedItemIndex =\n currentElement instanceof HTMLElement\n ? focusableNodes.indexOf(currentElement)\n : -1\n\n const activeItemIndex = focusableNodes.findIndex(\n (node) => node.getAttribute('aria-selected') === 'true',\n )\n\n const currentIndex =\n focusedItemIndex === -1 ? activeItemIndex : focusedItemIndex\n\n let nextIndex = currentIndex + offset\n if (nextIndex < 0) nextIndex = focusableNodes.length - 1\n if (nextIndex >= focusableNodes.length) nextIndex = 0\n\n focusableNodes[nextIndex].focus()\n event.preventDefault()\n },\n [getFocusableNodes],\n )\n\n const handleMouseMove: React.MouseEventHandler<T> = useCallback(\n (event) => {\n onMouseMove?.(event)\n\n const { target } = event\n if (!(target instanceof HTMLElement)) return\n\n const focusableNodes = getFocusableNodes()\n const overed = target.closest(FOCUSABLE_ELEMENTS.join(','))\n\n if (!(overed instanceof HTMLElement)) return\n\n const isNotFocusable = !focusableNodes.includes(overed)\n const isActive = overed === document.activeElement\n\n if (isActive || isNotFocusable) return\n\n overed.focus()\n },\n [getFocusableNodes, onMouseMove],\n )\n\n const handleKeyDown: React.KeyboardEventHandler<T> = useCallback(\n (event) => {\n onKeyDown?.(event)\n const code = event.code ?? event.key\n\n if (code === 'Tab') event.preventDefault()\n if (code === 'ArrowDown') handleFocusTo(event, +1)\n if (code === 'ArrowUp') handleFocusTo(event, -1)\n },\n [handleFocusTo, onKeyDown],\n )\n\n const [interceptFocus, restoreFocus] = useInterceptFocus()\n\n const handleEnter = useCallback(() => {\n if (ref.current) interceptFocus(ref.current)\n }, [interceptFocus])\n\n const handleExit = useCallback(() => {\n restoreFocus()\n }, [restoreFocus])\n\n return {\n ref,\n handleMouseMove,\n handleKeyDown,\n handleEnter,\n handleExit,\n }\n}\n"],"names":["usePopupFocus","props","onMouseMove","onKeyDown","ref","useRef","getFocusableNodes","useCallback","nodes","current","querySelectorAll","FOCUSABLE_ELEMENTS","join","Array","from","filter","node","HTMLElement","offsetParent","handleFocusTo","event","offset","focusableNodes","length","currentElement","document","activeElement","focusedItemIndex","indexOf","activeItemIndex","findIndex","getAttribute","currentIndex","nextIndex","focus","preventDefault","handleMouseMove","target","overed","closest","isNotFocusable","includes","isActive","handleKeyDown","code","key","interceptFocus","restoreFocus","useInterceptFocus","handleEnter","handleExit"],"mappings":"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"}
1
+ {"version":3,"sources":["../../../packages/popup-menu/usePopupFocus.ts"],"sourcesContent":["import {\n KeyboardEvent,\n KeyboardEventHandler,\n MouseEventHandler,\n RefObject,\n useCallback,\n useRef,\n} from 'react'\nimport { useInterceptFocus } from '@lidofinance/hooks'\nimport { FOCUSABLE_ELEMENTS } from './constants'\nimport { PopupMenuProps } from './types'\n\nexport const usePopupFocus = <T extends HTMLDivElement>({\n onMouseMove,\n onKeyDown,\n}: Pick<PopupMenuProps, 'onMouseMove' | 'onKeyDown'>): {\n ref: RefObject<T>\n handleMouseMove: MouseEventHandler<T>\n handleKeyDown: KeyboardEventHandler<T>\n handleEnter: () => void\n handleExit: () => void\n} => {\n const ref = useRef<T>(null)\n\n const getFocusableNodes = useCallback(() => {\n const nodes =\n ref.current?.querySelectorAll(FOCUSABLE_ELEMENTS.join(',')) ?? []\n\n return Array.from(nodes).filter(\n (node): node is HTMLElement =>\n node && node instanceof HTMLElement && node.offsetParent !== null,\n )\n }, [])\n\n const handleFocusTo = useCallback(\n (event: KeyboardEvent<T>, offset = 1) => {\n const focusableNodes = getFocusableNodes()\n\n if (focusableNodes.length === 0) return\n\n const currentElement = document.activeElement\n const focusedItemIndex =\n currentElement instanceof HTMLElement\n ? focusableNodes.indexOf(currentElement)\n : -1\n\n const activeItemIndex = focusableNodes.findIndex(\n (node) => node.getAttribute('aria-selected') === 'true',\n )\n\n const currentIndex =\n focusedItemIndex === -1 ? activeItemIndex : focusedItemIndex\n\n let nextIndex = currentIndex + offset\n if (nextIndex < 0) nextIndex = focusableNodes.length - 1\n if (nextIndex >= focusableNodes.length) nextIndex = 0\n\n focusableNodes[nextIndex].focus()\n event.preventDefault()\n },\n [getFocusableNodes],\n )\n\n const handleMouseMove: MouseEventHandler<T> = useCallback(\n (event) => {\n onMouseMove?.(event)\n\n const { target } = event\n if (!(target instanceof HTMLElement)) return\n\n const focusableNodes = getFocusableNodes()\n const overed = target.closest(FOCUSABLE_ELEMENTS.join(','))\n\n if (!(overed instanceof HTMLElement)) return\n\n const isNotFocusable = !focusableNodes.includes(overed)\n const isActive = overed === document.activeElement\n\n if (isActive || isNotFocusable) return\n\n overed.focus()\n },\n [getFocusableNodes, onMouseMove],\n )\n\n const handleKeyDown: KeyboardEventHandler<T> = useCallback(\n (event) => {\n onKeyDown?.(event)\n const code = event.code ?? event.key\n\n if (code === 'Tab') event.preventDefault()\n if (code === 'ArrowDown') handleFocusTo(event, +1)\n if (code === 'ArrowUp') handleFocusTo(event, -1)\n },\n [handleFocusTo, onKeyDown],\n )\n\n const [interceptFocus, restoreFocus] = useInterceptFocus()\n\n const handleEnter = useCallback(() => {\n if (ref.current) interceptFocus(ref.current)\n }, [interceptFocus])\n\n const handleExit = useCallback(() => {\n restoreFocus()\n }, [restoreFocus])\n\n return {\n ref,\n handleMouseMove,\n handleKeyDown,\n handleEnter,\n handleExit,\n }\n}\n"],"names":["usePopupFocus","onMouseMove","onKeyDown","ref","useRef","getFocusableNodes","useCallback","nodes","current","querySelectorAll","FOCUSABLE_ELEMENTS","join","Array","from","filter","node","HTMLElement","offsetParent","handleFocusTo","event","offset","focusableNodes","length","currentElement","document","activeElement","focusedItemIndex","indexOf","activeItemIndex","findIndex","getAttribute","currentIndex","nextIndex","focus","preventDefault","handleMouseMove","target","overed","closest","isNotFocusable","includes","isActive","handleKeyDown","code","key","interceptFocus","restoreFocus","useInterceptFocus","handleEnter","handleExit"],"mappings":"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"}
@@ -6,15 +6,28 @@ Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
7
  get: ()=>_default
8
8
  });
9
- const _extends = require("@swc/helpers/lib/_extends.js").default;
10
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
11
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
9
+ const _jsxRuntime = require("react/jsx-runtime");
10
+ const _react = require("react");
12
11
  const _sectionStyles = require("./SectionStyles");
13
- function Section(props, ref) {
14
- const { title , headerDecorator , children , ...rest } = props;
15
- return /*#__PURE__*/ _react.default.createElement(_sectionStyles.SectionStyle, _extends({}, rest, {
16
- ref: ref
17
- }), title && /*#__PURE__*/ _react.default.createElement(_sectionStyles.SectionHeaderStyle, null, /*#__PURE__*/ _react.default.createElement(_sectionStyles.SectionTitleStyle, null, title), headerDecorator && /*#__PURE__*/ _react.default.createElement(_sectionStyles.SectionHeaderDecoratorStyle, null, headerDecorator)), children);
12
+ function Section(param, ref) {
13
+ let { title , headerDecorator , children , ...rest } = param;
14
+ return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_sectionStyles.SectionStyle, {
15
+ ...rest,
16
+ ref: ref,
17
+ children: [
18
+ title && /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_sectionStyles.SectionHeaderStyle, {
19
+ children: [
20
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_sectionStyles.SectionTitleStyle, {
21
+ children: title
22
+ }),
23
+ headerDecorator && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_sectionStyles.SectionHeaderDecoratorStyle, {
24
+ children: headerDecorator
25
+ })
26
+ ]
27
+ }),
28
+ children
29
+ ]
30
+ });
18
31
  }
19
32
  const _default = /*#__PURE__*/ (0, _react.forwardRef)(Section);
20
33
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/section/Section.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef } from 'react'\nimport { SectionProps } from './types'\nimport {\n SectionStyle,\n SectionHeaderStyle,\n SectionTitleStyle,\n SectionHeaderDecoratorStyle,\n} from './SectionStyles'\n\nfunction Section(props: SectionProps, ref?: ForwardedRef<HTMLDivElement>) {\n const { title, headerDecorator, children, ...rest } = props\n\n return (\n <SectionStyle {...rest} ref={ref}>\n {title && (\n <SectionHeaderStyle>\n <SectionTitleStyle>{title}</SectionTitleStyle>\n {headerDecorator && (\n <SectionHeaderDecoratorStyle>\n {headerDecorator}\n </SectionHeaderDecoratorStyle>\n )}\n </SectionHeaderStyle>\n )}\n {children}\n </SectionStyle>\n )\n}\n\nexport default forwardRef(Section)\n"],"names":["Section","props","ref","title","headerDecorator","children","rest","SectionStyle","SectionHeaderStyle","SectionTitleStyle","SectionHeaderDecoratorStyle","forwardRef"],"mappings":"AAAA;;;;+BA6BA,SAAkC;;aAAlC,QAAkC;;;;6DA7Bc,OAAO;+BAOhD,iBAAiB;AAExB,SAASA,OAAO,CAACC,KAAmB,EAAEC,GAAkC,EAAE;IACxE,MAAM,EAAEC,KAAK,CAAA,EAAEC,eAAe,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAGC,IAAI,EAAE,GAAGL,KAAK;IAE3D,qBACE,6BAACM,cAAY,aAAA,eAAKD,IAAI;QAAEJ,GAAG,EAAEA,GAAG;QAC7BC,KAAK,kBACJ,6BAACK,cAAkB,mBAAA,sBACjB,6BAACC,cAAiB,kBAAA,QAAEN,KAAK,CAAqB,EAC7CC,eAAe,kBACd,6BAACM,cAA2B,4BAAA,QACzBN,eAAe,CACY,AAC/B,CACkB,AACtB,EACAC,QAAQ,CACI,CAChB;AACH,CAAC;MAED,QAAkC,iBAAnBM,IAAAA,MAAU,WAAA,EAACX,OAAO,CAAC"}
1
+ {"version":3,"sources":["../../../packages/section/Section.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef } from 'react'\nimport { SectionProps } from './types'\nimport {\n SectionStyle,\n SectionHeaderStyle,\n SectionTitleStyle,\n SectionHeaderDecoratorStyle,\n} from './SectionStyles'\n\nfunction Section(\n { title, headerDecorator, children, ...rest }: SectionProps,\n ref?: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <SectionStyle {...rest} ref={ref}>\n {title && (\n <SectionHeaderStyle>\n <SectionTitleStyle>{title}</SectionTitleStyle>\n {headerDecorator && (\n <SectionHeaderDecoratorStyle>\n {headerDecorator}\n </SectionHeaderDecoratorStyle>\n )}\n </SectionHeaderStyle>\n )}\n {children}\n </SectionStyle>\n )\n}\n\nexport default forwardRef(Section)\n"],"names":["Section","ref","title","headerDecorator","children","rest","SectionStyle","SectionHeaderStyle","SectionTitleStyle","SectionHeaderDecoratorStyle","forwardRef"],"mappings":"AAAA;;;;+BA8BA,SAAkC;;aAAlC,QAAkC;;;uBA9BO,OAAO;+BAOzC,iBAAiB;AAExB,SAASA,OAAO,CACd,KAA2D,EAC3DC,GAAkC,EAClC;QAFA,EAAEC,KAAK,CAAA,EAAEC,eAAe,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAGC,IAAI,EAAgB,GAA3D,KAA2D;IAG3D,qBACE,sBAACC,cAAY,aAAA;QAAE,GAAGD,IAAI;QAAEJ,GAAG,EAAEA,GAAG;;YAC7BC,KAAK,kBACJ,sBAACK,cAAkB,mBAAA;;kCACjB,qBAACC,cAAiB,kBAAA;kCAAEN,KAAK;sBAAqB;oBAC7CC,eAAe,kBACd,qBAACM,cAA2B,4BAAA;kCACzBN,eAAe;sBACY,AAC/B;;cACkB,AACtB;YACAC,QAAQ;;MACI,CAChB;AACH,CAAC;MAED,QAAkC,iBAAnBM,IAAAA,MAAU,WAAA,EAACV,OAAO,CAAC"}
@@ -2,7 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
6
- const _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
7
5
 
8
6
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/section/types.ts"],"sourcesContent":["import React from 'react'\nimport { LidoComponentProps } from '@lidofinance/utils'\n\nexport type SectionProps = LidoComponentProps<\n 'div',\n {\n title?: React.ReactNode\n headerDecorator?: React.ReactNode\n }\n>\n"],"names":[],"mappings":"AAAA;;;;;4DAAkB,OAAO"}
1
+ {"version":3,"sources":["../../../packages/section/types.ts"],"sourcesContent":["import { LidoComponentProps } from '@lidofinance/utils'\nimport { ReactNode } from 'react'\n\nexport type SectionProps = LidoComponentProps<\n 'div',\n {\n title?: ReactNode\n headerDecorator?: ReactNode\n }\n>\n"],"names":[],"mappings":"AAAA"}
@@ -6,12 +6,11 @@ Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
7
  get: ()=>_default
8
8
  });
9
- const _extends = require("@swc/helpers/lib/_extends.js").default;
10
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
11
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
9
+ const _jsxRuntime = require("react/jsx-runtime");
10
+ const _react = require("react");
12
11
  const _popupMenu = require("../popup-menu/index");
13
- function Option(props, ref) {
14
- const { value , onClick , onChange , ...rest } = props;
12
+ function Option(param, ref) {
13
+ let { value , onClick , onChange , ...rest } = param;
15
14
  const handleClick = (0, _react.useCallback)((event)=>{
16
15
  onChange === null || onChange === void 0 ? void 0 : onChange(value);
17
16
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
@@ -20,10 +19,11 @@ function Option(props, ref) {
20
19
  onChange,
21
20
  onClick
22
21
  ]);
23
- return /*#__PURE__*/ _react.default.createElement(_popupMenu.PopupMenuItem, _extends({
22
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_popupMenu.PopupMenuItem, {
24
23
  onClick: handleClick,
25
- ref: ref
26
- }, rest));
24
+ ref: ref,
25
+ ...rest
26
+ });
27
27
  }
28
28
  const _default = /*#__PURE__*/ (0, _react.forwardRef)(Option);
29
29
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/select/Option.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef, useCallback } from 'react'\nimport { PopupMenuItem } from '@lidofinance/popup-menu'\nimport { OptionProps } from './types'\n\nfunction Option(props: OptionProps, ref?: ForwardedRef<HTMLButtonElement>) {\n const { value, onClick, onChange, ...rest } = props\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n onChange?.(value)\n onClick?.(event)\n },\n [value, onChange, onClick],\n )\n\n return <PopupMenuItem onClick={handleClick} ref={ref} {...rest} />\n}\n\nexport default forwardRef(Option)\n"],"names":["Option","props","ref","value","onClick","onChange","rest","handleClick","useCallback","event","PopupMenuItem","forwardRef"],"mappings":"AAAA;;;;+BAkBA,SAAiC;;aAAjC,QAAiC;;;;6DAlB4B,OAAO;2BACtC,qBAAyB;AAGvD,SAASA,MAAM,CAACC,KAAkB,EAAEC,GAAqC,EAAE;IACzE,MAAM,EAAEC,KAAK,CAAA,EAAEC,OAAO,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAGC,IAAI,EAAE,GAAGL,KAAK;IAEnD,MAAMM,WAAW,GAAGC,IAAAA,MAAW,YAAA,EAC7B,CAACC,KAA0C,GAAK;QAC9CJ,QAAQ,aAARA,QAAQ,WAAS,GAAjBA,KAAAA,CAAiB,GAAjBA,QAAQ,CAAGF,KAAK,CAAC,CAAA;QACjBC,OAAO,aAAPA,OAAO,WAAS,GAAhBA,KAAAA,CAAgB,GAAhBA,OAAO,CAAGK,KAAK,CAAC,CAAA;IAClB,CAAC,EACD;QAACN,KAAK;QAAEE,QAAQ;QAAED,OAAO;KAAC,CAC3B;IAED,qBAAO,6BAACM,UAAa,cAAA;QAACN,OAAO,EAAEG,WAAW;QAAEL,GAAG,EAAEA,GAAG;OAAMI,IAAI,EAAI,CAAA;AACpE,CAAC;MAED,QAAiC,iBAAlBK,IAAAA,MAAU,WAAA,EAACX,MAAM,CAAC"}
1
+ {"version":3,"sources":["../../../packages/select/Option.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef, MouseEvent, useCallback } from 'react'\nimport { PopupMenuItem } from '@lidofinance/popup-menu'\nimport { OptionProps } from './types'\n\nfunction Option(\n { value, onClick, onChange, ...rest }: OptionProps,\n ref?: ForwardedRef<HTMLButtonElement>,\n) {\n const handleClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n onChange?.(value)\n onClick?.(event)\n },\n [value, onChange, onClick],\n )\n\n return <PopupMenuItem onClick={handleClick} ref={ref} {...rest} />\n}\n\nexport default forwardRef(Option)\n"],"names":["Option","ref","value","onClick","onChange","rest","handleClick","useCallback","event","PopupMenuItem","forwardRef"],"mappings":"AAAA;;;;+BAmBA,SAAiC;;aAAjC,QAAiC;;;uBAnBiC,OAAO;2BAC3C,qBAAyB;AAGvD,SAASA,MAAM,CACb,KAAkD,EAClDC,GAAqC,EACrC;QAFA,EAAEC,KAAK,CAAA,EAAEC,OAAO,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAGC,IAAI,EAAe,GAAlD,KAAkD;IAGlD,MAAMC,WAAW,GAAGC,IAAAA,MAAW,YAAA,EAC7B,CAACC,KAAoC,GAAK;QACxCJ,QAAQ,aAARA,QAAQ,WAAS,GAAjBA,KAAAA,CAAiB,GAAjBA,QAAQ,CAAGF,KAAK,CAAC,CAAA;QACjBC,OAAO,aAAPA,OAAO,WAAS,GAAhBA,KAAAA,CAAgB,GAAhBA,OAAO,CAAGK,KAAK,CAAC,CAAA;IAClB,CAAC,EACD;QAACN,KAAK;QAAEE,QAAQ;QAAED,OAAO;KAAC,CAC3B;IAED,qBAAO,qBAACM,UAAa,cAAA;QAACN,OAAO,EAAEG,WAAW;QAAEL,GAAG,EAAEA,GAAG;QAAG,GAAGI,IAAI;MAAI,CAAA;AACpE,CAAC;MAED,QAAiC,iBAAlBK,IAAAA,MAAU,WAAA,EAACV,MAAM,CAAC"}
@@ -6,50 +6,62 @@ Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
7
  get: ()=>_default
8
8
  });
9
- const _extends = require("@swc/helpers/lib/_extends.js").default;
10
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
11
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
9
+ const _jsxRuntime = require("react/jsx-runtime");
10
+ const _react = require("react");
12
11
  const _selectStyles = require("./SelectStyles");
13
12
  const _selectArrow = require("./SelectArrow");
14
13
  const _hooks = require("../hooks/index");
15
14
  const _popupMenu = require("../popup-menu/index");
16
15
  const _useSelect = require("./useSelect");
17
16
  const _useSelectWidth = require("./useSelectWidth");
18
- function Select(props, ref) {
19
- const { wrapperRef: externalWrapperRef , anchorRef: externalAnchorRef , arrow ='default' , variant , value , defaultValue , children , onChange , ...rest } = props;
20
- const { disabled } = props;
17
+ function Select(param, ref) {
18
+ let { wrapperRef: externalWrapperRef , anchorRef: externalAnchorRef , arrow ='default' , variant , value , defaultValue , disabled , children , onClick , onKeyDown , onChange , ...rest } = param;
21
19
  const localAnchorRef = (0, _react.useRef)(null);
22
20
  const wrapperRef = (0, _hooks.useMergeRefs)([
23
21
  localAnchorRef,
24
22
  externalWrapperRef
25
23
  ]);
26
24
  const anchorRef = externalAnchorRef || localAnchorRef;
27
- const { opened , options , title , handleClick , handleClose , handleKeyDown } = (0, _useSelect.useSelect)(props);
25
+ const { opened , options , title , handleClick , handleClose , handleKeyDown } = (0, _useSelect.useSelect)({
26
+ value,
27
+ defaultValue,
28
+ disabled,
29
+ onClick,
30
+ onChange,
31
+ onKeyDown,
32
+ children
33
+ });
28
34
  const width = (0, _useSelectWidth.useSelectWidth)(opened, anchorRef);
29
- return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement(_selectStyles.SelectWrapperStyle, _extends({
30
- onClick: handleClick,
31
- onKeyDown: handleKeyDown,
32
- active: opened,
33
- value: title,
34
- rightDecorator: /*#__PURE__*/ _react.default.createElement(_selectArrow.SelectArrow, {
35
- arrow: arrow,
36
- disabled: disabled,
37
- opened: opened
38
- }),
39
- wrapperRef: wrapperRef,
40
- variant: variant
41
- }, rest, {
42
- ref: ref,
43
- readOnly: true
44
- })), /*#__PURE__*/ _react.default.createElement(_popupMenu.PopupMenu, {
45
- open: opened,
46
- variant: variant,
47
- anchorRef: anchorRef,
48
- style: {
49
- minWidth: width
50
- },
51
- onClose: handleClose
52
- }, options));
35
+ return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
36
+ children: [
37
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_selectStyles.SelectWrapperStyle, {
38
+ onClick: handleClick,
39
+ onKeyDown: handleKeyDown,
40
+ active: opened,
41
+ value: title,
42
+ rightDecorator: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_selectArrow.SelectArrow, {
43
+ arrow: arrow,
44
+ disabled: disabled,
45
+ opened: opened
46
+ }),
47
+ wrapperRef: wrapperRef,
48
+ variant: variant,
49
+ ...rest,
50
+ ref: ref,
51
+ readOnly: true
52
+ }),
53
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_popupMenu.PopupMenu, {
54
+ open: opened,
55
+ variant: variant,
56
+ anchorRef: anchorRef,
57
+ style: {
58
+ minWidth: width
59
+ },
60
+ onClose: handleClose,
61
+ children: options
62
+ })
63
+ ]
64
+ });
53
65
  }
54
66
  const _default = /*#__PURE__*/ (0, _react.forwardRef)(Select);
55
67
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/select/Select.tsx"],"sourcesContent":["import React, { ForwardedRef, forwardRef, useRef } from 'react'\nimport { SelectWrapperStyle } from './SelectStyles'\nimport { SelectArrow } from './SelectArrow'\nimport { useMergeRefs } from '@lidofinance/hooks'\nimport { PopupMenu } from '@lidofinance/popup-menu'\nimport { SelectProps } from './types'\nimport { useSelect } from './useSelect'\nimport { useSelectWidth } from './useSelectWidth'\n\nfunction Select(props: SelectProps, ref?: ForwardedRef<HTMLInputElement>) {\n const {\n wrapperRef: externalWrapperRef,\n anchorRef: externalAnchorRef,\n arrow = 'default',\n variant,\n value,\n defaultValue,\n children,\n onChange,\n ...rest\n } = props\n\n const { disabled } = props\n\n const localAnchorRef = useRef<HTMLLabelElement>(null)\n const wrapperRef = useMergeRefs([localAnchorRef, externalWrapperRef])\n const anchorRef = externalAnchorRef || localAnchorRef\n\n const { opened, options, title, handleClick, handleClose, handleKeyDown } =\n useSelect(props)\n const width = useSelectWidth(opened, anchorRef)\n\n return (\n <>\n <SelectWrapperStyle\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n active={opened}\n value={title}\n rightDecorator={\n <SelectArrow arrow={arrow} disabled={disabled} opened={opened} />\n }\n wrapperRef={wrapperRef}\n variant={variant}\n {...rest}\n ref={ref}\n readOnly\n />\n <PopupMenu\n open={opened}\n variant={variant}\n anchorRef={anchorRef}\n style={{ minWidth: width }}\n onClose={handleClose}\n >\n {options}\n </PopupMenu>\n </>\n )\n}\n\nexport default forwardRef(Select)\n"],"names":["Select","props","ref","wrapperRef","externalWrapperRef","anchorRef","externalAnchorRef","arrow","variant","value","defaultValue","children","onChange","rest","disabled","localAnchorRef","useRef","useMergeRefs","opened","options","title","handleClick","handleClose","handleKeyDown","useSelect","width","useSelectWidth","SelectWrapperStyle","onClick","onKeyDown","active","rightDecorator","SelectArrow","readOnly","PopupMenu","open","style","minWidth","onClose","forwardRef"],"mappings":"AAAA;;;;+BA6DA,SAAiC;;aAAjC,QAAiC;;;;6DA7DuB,OAAO;8BAC5B,gBAAgB;6BACvB,eAAe;uBACd,gBAAoB;2BACvB,qBAAyB;2BAEzB,aAAa;gCACR,kBAAkB;AAEjD,SAASA,MAAM,CAACC,KAAkB,EAAEC,GAAoC,EAAE;IACxE,MAAM,EACJC,UAAU,EAAEC,kBAAkB,CAAA,EAC9BC,SAAS,EAAEC,iBAAiB,CAAA,EAC5BC,KAAK,EAAG,SAAS,CAAA,EACjBC,OAAO,CAAA,EACPC,KAAK,CAAA,EACLC,YAAY,CAAA,EACZC,QAAQ,CAAA,EACRC,QAAQ,CAAA,EACR,GAAGC,IAAI,EACR,GAAGZ,KAAK;IAET,MAAM,EAAEa,QAAQ,CAAA,EAAE,GAAGb,KAAK;IAE1B,MAAMc,cAAc,GAAGC,IAAAA,MAAM,OAAA,EAAmB,IAAI,CAAC;IACrD,MAAMb,UAAU,GAAGc,IAAAA,MAAY,aAAA,EAAC;QAACF,cAAc;QAAEX,kBAAkB;KAAC,CAAC;IACrE,MAAMC,SAAS,GAAGC,iBAAiB,IAAIS,cAAc;IAErD,MAAM,EAAEG,MAAM,CAAA,EAAEC,OAAO,CAAA,EAAEC,KAAK,CAAA,EAAEC,WAAW,CAAA,EAAEC,WAAW,CAAA,EAAEC,aAAa,CAAA,EAAE,GACvEC,IAAAA,UAAS,UAAA,EAACvB,KAAK,CAAC;IAClB,MAAMwB,KAAK,GAAGC,IAAAA,eAAc,eAAA,EAACR,MAAM,EAAEb,SAAS,CAAC;IAE/C,qBACE,0EACE,6BAACsB,aAAkB,mBAAA;QACjBC,OAAO,EAAEP,WAAW;QACpBQ,SAAS,EAAEN,aAAa;QACxBO,MAAM,EAAEZ,MAAM;QACdT,KAAK,EAAEW,KAAK;QACZW,cAAc,gBACZ,6BAACC,YAAW,YAAA;YAACzB,KAAK,EAAEA,KAAK;YAAEO,QAAQ,EAAEA,QAAQ;YAAEI,MAAM,EAAEA,MAAM;UAAI;QAEnEf,UAAU,EAAEA,UAAU;QACtBK,OAAO,EAAEA,OAAO;OACZK,IAAI;QACRX,GAAG,EAAEA,GAAG;QACR+B,QAAQ,EAARA,IAAQ;OACR,gBACF,6BAACC,UAAS,UAAA;QACRC,IAAI,EAAEjB,MAAM;QACZV,OAAO,EAAEA,OAAO;QAChBH,SAAS,EAAEA,SAAS;QACpB+B,KAAK,EAAE;YAAEC,QAAQ,EAAEZ,KAAK;SAAE;QAC1Ba,OAAO,EAAEhB,WAAW;OAEnBH,OAAO,CACE,CACX,CACJ;AACH,CAAC;MAED,QAAiC,iBAAlBoB,IAAAA,MAAU,WAAA,EAACvC,MAAM,CAAC"}
1
+ {"version":3,"sources":["../../../packages/select/Select.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef, useRef } from 'react'\nimport { SelectWrapperStyle } from './SelectStyles'\nimport { SelectArrow } from './SelectArrow'\nimport { useMergeRefs } from '@lidofinance/hooks'\nimport { PopupMenu } from '@lidofinance/popup-menu'\nimport { SelectProps } from './types'\nimport { useSelect } from './useSelect'\nimport { useSelectWidth } from './useSelectWidth'\n\nfunction Select(\n {\n wrapperRef: externalWrapperRef,\n anchorRef: externalAnchorRef,\n arrow = 'default',\n variant,\n value,\n defaultValue,\n disabled,\n children,\n onClick,\n onKeyDown,\n onChange,\n ...rest\n }: SelectProps,\n ref?: ForwardedRef<HTMLInputElement>,\n) {\n const localAnchorRef = useRef<HTMLLabelElement>(null)\n const wrapperRef = useMergeRefs([localAnchorRef, externalWrapperRef])\n const anchorRef = externalAnchorRef || localAnchorRef\n\n const { opened, options, title, handleClick, handleClose, handleKeyDown } =\n useSelect({\n value,\n defaultValue,\n disabled,\n onClick,\n onChange,\n onKeyDown,\n children,\n })\n const width = useSelectWidth(opened, anchorRef)\n\n return (\n <>\n <SelectWrapperStyle\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n active={opened}\n value={title}\n rightDecorator={\n <SelectArrow arrow={arrow} disabled={disabled} opened={opened} />\n }\n wrapperRef={wrapperRef}\n variant={variant}\n {...rest}\n ref={ref}\n readOnly\n />\n <PopupMenu\n open={opened}\n variant={variant}\n anchorRef={anchorRef}\n style={{ minWidth: width }}\n onClose={handleClose}\n >\n {options}\n </PopupMenu>\n </>\n )\n}\n\nexport default forwardRef(Select)\n"],"names":["Select","ref","wrapperRef","externalWrapperRef","anchorRef","externalAnchorRef","arrow","variant","value","defaultValue","disabled","children","onClick","onKeyDown","onChange","rest","localAnchorRef","useRef","useMergeRefs","opened","options","title","handleClick","handleClose","handleKeyDown","useSelect","width","useSelectWidth","SelectWrapperStyle","active","rightDecorator","SelectArrow","readOnly","PopupMenu","open","style","minWidth","onClose","forwardRef"],"mappings":"AAAA;;;;+BAuEA,SAAiC;;aAAjC,QAAiC;;;uBAvEgB,OAAO;8BACrB,gBAAgB;6BACvB,eAAe;uBACd,gBAAoB;2BACvB,qBAAyB;2BAEzB,aAAa;gCACR,kBAAkB;AAEjD,SAASA,MAAM,CACb,KAac,EACdC,GAAoC,EACpC;QAfA,EACEC,UAAU,EAAEC,kBAAkB,CAAA,EAC9BC,SAAS,EAAEC,iBAAiB,CAAA,EAC5BC,KAAK,EAAG,SAAS,CAAA,EACjBC,OAAO,CAAA,EACPC,KAAK,CAAA,EACLC,YAAY,CAAA,EACZC,QAAQ,CAAA,EACRC,QAAQ,CAAA,EACRC,OAAO,CAAA,EACPC,SAAS,CAAA,EACTC,QAAQ,CAAA,EACR,GAAGC,IAAI,EACK,GAbd,KAac;IAGd,MAAMC,cAAc,GAAGC,IAAAA,MAAM,OAAA,EAAmB,IAAI,CAAC;IACrD,MAAMf,UAAU,GAAGgB,IAAAA,MAAY,aAAA,EAAC;QAACF,cAAc;QAAEb,kBAAkB;KAAC,CAAC;IACrE,MAAMC,SAAS,GAAGC,iBAAiB,IAAIW,cAAc;IAErD,MAAM,EAAEG,MAAM,CAAA,EAAEC,OAAO,CAAA,EAAEC,KAAK,CAAA,EAAEC,WAAW,CAAA,EAAEC,WAAW,CAAA,EAAEC,aAAa,CAAA,EAAE,GACvEC,IAAAA,UAAS,UAAA,EAAC;QACRjB,KAAK;QACLC,YAAY;QACZC,QAAQ;QACRE,OAAO;QACPE,QAAQ;QACRD,SAAS;QACTF,QAAQ;KACT,CAAC;IACJ,MAAMe,KAAK,GAAGC,IAAAA,eAAc,eAAA,EAACR,MAAM,EAAEf,SAAS,CAAC;IAE/C,qBACE;;0BACE,qBAACwB,aAAkB,mBAAA;gBACjBhB,OAAO,EAAEU,WAAW;gBACpBT,SAAS,EAAEW,aAAa;gBACxBK,MAAM,EAAEV,MAAM;gBACdX,KAAK,EAAEa,KAAK;gBACZS,cAAc,gBACZ,qBAACC,YAAW,YAAA;oBAACzB,KAAK,EAAEA,KAAK;oBAAEI,QAAQ,EAAEA,QAAQ;oBAAES,MAAM,EAAEA,MAAM;kBAAI;gBAEnEjB,UAAU,EAAEA,UAAU;gBACtBK,OAAO,EAAEA,OAAO;gBACf,GAAGQ,IAAI;gBACRd,GAAG,EAAEA,GAAG;gBACR+B,QAAQ;cACR;0BACF,qBAACC,UAAS,UAAA;gBACRC,IAAI,EAAEf,MAAM;gBACZZ,OAAO,EAAEA,OAAO;gBAChBH,SAAS,EAAEA,SAAS;gBACpB+B,KAAK,EAAE;oBAAEC,QAAQ,EAAEV,KAAK;iBAAE;gBAC1BW,OAAO,EAAEd,WAAW;0BAEnBH,OAAO;cACE;;MACX,CACJ;AACH,CAAC;MAED,QAAiC,iBAAlBkB,IAAAA,MAAU,WAAA,EAACtC,MAAM,CAAC"}
@@ -12,18 +12,20 @@ _export(exports, {
12
12
  SelectArrow: ()=>SelectArrow,
13
13
  default: ()=>_default
14
14
  });
15
- const _extends = require("@swc/helpers/lib/_extends.js").default;
16
- const _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
17
- const _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
15
+ const _jsxRuntime = require("react/jsx-runtime");
18
16
  const _selectArrowStyles = require("./SelectArrowStyles");
19
- const SelectArrow = (props)=>{
20
- const { arrow , disabled =false , opened } = props;
17
+ const SelectArrow = (param)=>{
18
+ let { arrow , disabled =false , opened , } = param;
21
19
  const commonProps = {
22
20
  $opened: opened,
23
21
  $disabled: disabled
24
22
  };
25
- if (arrow === 'default') return /*#__PURE__*/ _react.default.createElement(_selectArrowStyles.SelectArrowBigStyle, _extends({}, commonProps));
26
- if (arrow === 'small') return /*#__PURE__*/ _react.default.createElement(_selectArrowStyles.SelectArrowSmallStyle, _extends({}, commonProps));
23
+ if (arrow === 'default') return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_selectArrowStyles.SelectArrowBigStyle, {
24
+ ...commonProps
25
+ });
26
+ if (arrow === 'small') return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_selectArrowStyles.SelectArrowSmallStyle, {
27
+ ...commonProps
28
+ });
27
29
  return null;
28
30
  };
29
31
  const _default = SelectArrow;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/select/SelectArrow.tsx"],"sourcesContent":["import React, { FC } from 'react'\nimport { SelectArrowBigStyle, SelectArrowSmallStyle } from './SelectArrowStyles'\nimport { SelectArrows } from './types'\n\ntype SelectArrowProps = {\n arrow: SelectArrows\n disabled?: boolean\n opened: boolean\n children?: never\n}\n\nexport const SelectArrow: FC<SelectArrowProps> = (props) => {\n const { arrow, disabled = false, opened } = props\n\n const commonProps = {\n $opened: opened,\n $disabled: disabled,\n }\n\n if (arrow === 'default') return <SelectArrowBigStyle {...commonProps} />\n if (arrow === 'small') return <SelectArrowSmallStyle {...commonProps} />\n\n return null\n}\n\nexport default SelectArrow\n"],"names":["SelectArrow","props","arrow","disabled","opened","commonProps","$opened","$disabled","SelectArrowBigStyle","SelectArrowSmallStyle"],"mappings":"AAAA;;;;;;;;;;;IAWaA,WAAW,MAAXA,WAAW;IAcxB,OAA0B,MAA1B,QAA0B;;;;4DAzBA,OAAO;mCAC0B,qBAAqB;AAUzE,MAAMA,WAAW,GAAyB,CAACC,KAAK,GAAK;IAC1D,MAAM,EAAEC,KAAK,CAAA,EAAEC,QAAQ,EAAG,KAAK,CAAA,EAAEC,MAAM,CAAA,EAAE,GAAGH,KAAK;IAEjD,MAAMI,WAAW,GAAG;QAClBC,OAAO,EAAEF,MAAM;QACfG,SAAS,EAAEJ,QAAQ;KACpB;IAED,IAAID,KAAK,KAAK,SAAS,EAAE,qBAAO,6BAACM,kBAAmB,oBAAA,eAAKH,WAAW,EAAI,CAAA;IACxE,IAAIH,KAAK,KAAK,OAAO,EAAE,qBAAO,6BAACO,kBAAqB,sBAAA,eAAKJ,WAAW,EAAI,CAAA;IAExE,OAAO,IAAI,CAAA;AACb,CAAC;MAED,QAA0B,GAAXL,WAAW"}
1
+ {"version":3,"sources":["../../../packages/select/SelectArrow.tsx"],"sourcesContent":["import { FC } from 'react'\nimport { SelectArrowBigStyle, SelectArrowSmallStyle } from './SelectArrowStyles'\nimport { SelectArrows } from './types'\n\ntype SelectArrowProps = {\n arrow: SelectArrows\n disabled?: boolean\n opened: boolean\n children?: never\n}\n\nexport const SelectArrow: FC<SelectArrowProps> = ({\n arrow,\n disabled = false,\n opened,\n}) => {\n const commonProps = {\n $opened: opened,\n $disabled: disabled,\n }\n\n if (arrow === 'default') return <SelectArrowBigStyle {...commonProps} />\n if (arrow === 'small') return <SelectArrowSmallStyle {...commonProps} />\n\n return null\n}\n\nexport default SelectArrow\n"],"names":["SelectArrow","arrow","disabled","opened","commonProps","$opened","$disabled","SelectArrowBigStyle","SelectArrowSmallStyle"],"mappings":"AAAA;;;;;;;;;;;IAWaA,WAAW,MAAXA,WAAW;IAgBxB,OAA0B,MAA1B,QAA0B;;;mCA1BiC,qBAAqB;AAUzE,MAAMA,WAAW,GAAyB,SAI3C;QAJ4C,EAChDC,KAAK,CAAA,EACLC,QAAQ,EAAG,KAAK,CAAA,EAChBC,MAAM,CAAA,IACP;IACC,MAAMC,WAAW,GAAG;QAClBC,OAAO,EAAEF,MAAM;QACfG,SAAS,EAAEJ,QAAQ;KACpB;IAED,IAAID,KAAK,KAAK,SAAS,EAAE,qBAAO,qBAACM,kBAAmB,oBAAA;QAAE,GAAGH,WAAW;MAAI,CAAA;IACxE,IAAIH,KAAK,KAAK,OAAO,EAAE,qBAAO,qBAACO,kBAAqB,sBAAA;QAAE,GAAGJ,WAAW;MAAI,CAAA;IAExE,OAAO,IAAI,CAAA;AACb,CAAC;MAED,QAA0B,GAAXJ,WAAW"}
@@ -6,18 +6,20 @@ Object.defineProperty(exports, "default", {
6
6
  enumerable: true,
7
7
  get: ()=>_default
8
8
  });
9
- const _extends = require("@swc/helpers/lib/_extends.js").default;
10
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
11
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
9
+ const _jsxRuntime = require("react/jsx-runtime");
10
+ const _react = require("react");
12
11
  const _selectIconStyles = require("./SelectIconStyles");
13
- function SelectIcon(props, ref) {
14
- const { icon , ...rest } = props;
15
- return /*#__PURE__*/ _react.default.createElement(_selectIconStyles.SelectIconStyle, _extends({}, rest, {
12
+ function SelectIcon(param, ref) {
13
+ let { icon , ...rest } = param;
14
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_selectIconStyles.SelectIconStyle, {
15
+ ...rest,
16
16
  fullwidth: false,
17
17
  arrow: "small",
18
- leftDecorator: /*#__PURE__*/ _react.default.createElement(_selectIconStyles.SelectIconDecoratorStyle, null, icon),
18
+ leftDecorator: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_selectIconStyles.SelectIconDecoratorStyle, {
19
+ children: icon
20
+ }),
19
21
  ref: ref
20
- }));
22
+ });
21
23
  }
22
24
  const _default = /*#__PURE__*/ (0, _react.forwardRef)(SelectIcon);
23
25