@babylonlabs-io/core-ui 1.38.0 → 1.39.0

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 (445) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +2 -2
  2. package/dist/components/Accordion/components/AccordionDetails.d.ts +1 -1
  3. package/dist/components/Accordion/components/AccordionSummary.d.ts +2 -2
  4. package/dist/components/Accordion/hooks/useHeightObserver.d.ts +1 -1
  5. package/dist/components/Accordion/index.d.ts +3 -4
  6. package/dist/components/AmountItem/AmountItem.d.ts +1 -1
  7. package/dist/components/AmountItem/index.d.ts +1 -1
  8. package/dist/components/Avatar/Avatar.d.ts +1 -2
  9. package/dist/components/Avatar/AvatarGroup.d.ts +2 -3
  10. package/dist/components/Avatar/ValidatorAvatar.d.ts +1 -1
  11. package/dist/components/Avatar/index.d.ts +3 -3
  12. package/dist/components/Badge/Badge.d.ts +1 -2
  13. package/dist/components/Badge/index.d.ts +1 -1
  14. package/dist/components/Button/Button.d.ts +2 -3
  15. package/dist/components/Button/IconButton.d.ts +2 -3
  16. package/dist/components/Button/WalletDisconnectButton.d.ts +2 -2
  17. package/dist/components/Button/index.d.ts +3 -3
  18. package/dist/components/Card/Card.d.ts +3 -4
  19. package/dist/components/Card/index.d.ts +1 -1
  20. package/dist/components/Chip/Chip.d.ts +1 -2
  21. package/dist/components/Chip/index.d.ts +1 -1
  22. package/dist/components/Copy/Copy.d.ts +1 -1
  23. package/dist/components/CounterButton/index.d.ts +1 -1
  24. package/dist/components/Dialog/Dialog.d.ts +1 -1
  25. package/dist/components/Dialog/MobileDialog.d.ts +1 -1
  26. package/dist/components/Dialog/components/Backdrop.d.ts +1 -2
  27. package/dist/components/Dialog/components/DialogBody.d.ts +1 -1
  28. package/dist/components/Dialog/components/DialogFooter.d.ts +1 -1
  29. package/dist/components/Dialog/components/DialogHeader.d.ts +1 -1
  30. package/dist/components/Dialog/index.d.ts +5 -6
  31. package/dist/components/DisplayHash/DisplayHash.d.ts +1 -1
  32. package/dist/components/FeeItem/FeeItem.d.ts +1 -1
  33. package/dist/components/Form/Checkbox.d.ts +2 -2
  34. package/dist/components/Form/FormControl.d.ts +1 -2
  35. package/dist/components/Form/Input.d.ts +2 -3
  36. package/dist/components/Form/Radio.d.ts +2 -2
  37. package/dist/components/Form/Select.d.ts +2 -3
  38. package/dist/components/Form/components/Toggle.d.ts +2 -3
  39. package/dist/components/Form/index.d.ts +5 -5
  40. package/dist/components/Heading/Heading.d.ts +2 -3
  41. package/dist/components/Heading/index.d.ts +1 -1
  42. package/dist/components/Hint/Hint.d.ts +1 -1
  43. package/dist/components/Icons/common/BugReportIcon.d.ts +1 -1
  44. package/dist/components/Icons/common/ChevronLeftIcon.d.ts +1 -1
  45. package/dist/components/Icons/common/CloseIcon.d.ts +1 -1
  46. package/dist/components/Icons/common/CollapseIcon.d.ts +1 -1
  47. package/dist/components/Icons/common/CopyIcon.d.ts +1 -1
  48. package/dist/components/Icons/common/InfoIcon.d.ts +1 -1
  49. package/dist/components/Icons/common/OpenIcon.d.ts +1 -1
  50. package/dist/components/Icons/common/ThemeIcon.d.ts +1 -1
  51. package/dist/components/Icons/common/WarningIcon.d.ts +1 -1
  52. package/dist/components/Icons/index.d.ts +13 -13
  53. package/dist/components/Icons/wallet/BitcoinPublicKeyIcon.d.ts +1 -1
  54. package/dist/components/Icons/wallet/LinkWalletIcon.d.ts +1 -1
  55. package/dist/components/Icons/wallet/UsingInscriptionIcon.d.ts +1 -1
  56. package/dist/components/List/List.d.ts +2 -3
  57. package/dist/components/List/StatItem.d.ts +2 -2
  58. package/dist/components/List/index.d.ts +3 -3
  59. package/dist/components/ListLegacy/ListLegacy.d.ts +2 -3
  60. package/dist/components/ListLegacy/index.d.ts +2 -2
  61. package/dist/components/Loader/Loader.d.ts +0 -1
  62. package/dist/components/Loader/index.d.ts +1 -1
  63. package/dist/components/Menu/Menu.d.ts +2 -2
  64. package/dist/components/Menu/MenuContext.d.ts +1 -1
  65. package/dist/components/Menu/MenuDrawer.d.ts +1 -1
  66. package/dist/components/Menu/MenuItem.d.ts +1 -1
  67. package/dist/components/Menu/SubMenu.d.ts +1 -1
  68. package/dist/components/Menu/SubMenuItem.d.ts +1 -1
  69. package/dist/components/Menu/index.d.ts +6 -6
  70. package/dist/components/Popover/Popover.d.ts +2 -3
  71. package/dist/components/Popover/index.d.ts +1 -1
  72. package/dist/components/Portal/Portal.d.ts +2 -2
  73. package/dist/components/Portal/index.d.ts +1 -1
  74. package/dist/components/Spacer/Spacer.d.ts +1 -1
  75. package/dist/components/SubSection/SubSection.d.ts +1 -2
  76. package/dist/components/SubSection/index.d.ts +1 -1
  77. package/dist/components/Table/Table.d.ts +1 -2
  78. package/dist/components/Table/components/Cell.d.ts +1 -1
  79. package/dist/components/Table/components/Column.d.ts +1 -1
  80. package/dist/components/Table/components/Row.d.ts +1 -1
  81. package/dist/components/Table/index.d.ts +4 -4
  82. package/dist/components/Table/types/index.d.ts +1 -1
  83. package/dist/components/Text/Text.d.ts +2 -3
  84. package/dist/components/Text/index.d.ts +1 -1
  85. package/dist/components/Toggle/Toggle.d.ts +0 -1
  86. package/dist/components/Toggle/index.d.ts +1 -1
  87. package/dist/components/Warning/Warning.d.ts +1 -2
  88. package/dist/components/Warning/index.d.ts +1 -1
  89. package/dist/context/Dialog.context.d.ts +2 -2
  90. package/dist/context/Table.context.d.ts +2 -2
  91. package/dist/elements/FinalityProviderItem/index.d.ts +1 -1
  92. package/dist/elements/FinalityProviderLogo/index.d.ts +1 -1
  93. package/dist/elements/Icons/ChevronRightIcon.d.ts +1 -1
  94. package/dist/elements/Icons/SettingsIcon.d.ts +1 -1
  95. package/dist/elements/ProvidersList/index.d.ts +1 -1
  96. package/dist/elements/Table/Table.d.ts +1 -1
  97. package/dist/elements/Table/index.d.ts +1 -1
  98. package/dist/hooks/useFrozenColumns.d.ts +1 -1
  99. package/dist/hooks/useTableScroll.d.ts +1 -1
  100. package/dist/hooks/useTableSort.d.ts +1 -1
  101. package/dist/index.d.ts +52 -54
  102. package/dist/widgets/form/CheckboxField/CheckboxField.d.ts +1 -1
  103. package/dist/widgets/form/CheckboxField/index.d.ts +1 -1
  104. package/dist/widgets/form/Form/Form.d.ts +3 -3
  105. package/dist/widgets/form/Form/index.d.ts +1 -1
  106. package/dist/widgets/form/HiddenField/HiddenField.d.ts +1 -1
  107. package/dist/widgets/form/HiddenField/index.d.ts +1 -1
  108. package/dist/widgets/form/NumberField/NumberField.d.ts +2 -2
  109. package/dist/widgets/form/NumberField/index.d.ts +1 -1
  110. package/dist/widgets/form/RadioField/RadioField.d.ts +1 -1
  111. package/dist/widgets/form/RadioField/index.d.ts +1 -1
  112. package/dist/widgets/form/SelectField/SelectField.d.ts +3 -3
  113. package/dist/widgets/form/SelectField/index.d.ts +1 -1
  114. package/dist/widgets/form/TextField/TextField.d.ts +2 -2
  115. package/dist/widgets/form/TextField/index.d.ts +1 -1
  116. package/dist/widgets/form/hooks.d.ts +3 -3
  117. package/dist/widgets/sections/ActivityCard/components/ActivityCardActionSection.d.ts +1 -1
  118. package/dist/widgets/sections/ActivityCard/components/ActivityCardDetailsSection.d.ts +1 -1
  119. package/dist/widgets/sections/ActivityCard/index.d.ts +5 -5
  120. package/dist/widgets/sections/AmountSubsection/index.d.ts +1 -1
  121. package/dist/widgets/sections/FeesSection/index.d.ts +6 -6
  122. package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.d.ts +1 -1
  123. package/dist/widgets/sections/FinalityProviderSubsection/index.d.ts +1 -1
  124. package/dist/widgets/sections/PreviewModal/PreviewModal.d.ts +1 -1
  125. package/dist/widgets/sections/PreviewModal/index.d.ts +1 -1
  126. package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.d.ts +1 -1
  127. package/dist/widgets/sections/RewardsPreviewModal/index.d.ts +1 -1
  128. package/dist/widgets/sections/RewardsSubsection/index.d.ts +1 -1
  129. package/dist/widgets/sections/SettingMenu/SettingMenu.d.ts +3 -3
  130. package/dist/widgets/sections/SettingMenu/components/SettingMenuCustomContent.d.ts +1 -1
  131. package/dist/widgets/sections/SettingMenu/components/SettingMenuDescription.d.ts +1 -1
  132. package/dist/widgets/sections/SettingMenu/components/SettingMenuGroup.d.ts +1 -1
  133. package/dist/widgets/sections/SettingMenu/components/SettingMenuItem.d.ts +1 -1
  134. package/dist/widgets/sections/SettingMenu/components/SettingMenuSubMenu.d.ts +1 -1
  135. package/dist/widgets/sections/SettingMenu/components/SettingMenuTitle.d.ts +1 -1
  136. package/dist/widgets/sections/SettingMenu/components/index.d.ts +12 -12
  137. package/dist/widgets/sections/SettingMenu/index.d.ts +14 -14
  138. package/dist/widgets/sections/TableElement/TableElement.d.ts +1 -1
  139. package/dist/widgets/sections/TableElement/index.d.ts +1 -1
  140. package/dist/widgets/sections/UnbondingModal/index.d.ts +1 -1
  141. package/dist/widgets/sections/ValidatorSelector/ValidatorSelector.d.ts +2 -2
  142. package/dist/widgets/sections/ValidatorSelector/index.d.ts +1 -1
  143. package/dist/widgets/sections/WalletMenu/WalletMenu.d.ts +2 -2
  144. package/dist/widgets/sections/WalletMenu/components/WalletMenuCard.d.ts +1 -1
  145. package/dist/widgets/sections/WalletMenu/components/WalletMenuInfoItem.d.ts +1 -1
  146. package/dist/widgets/sections/WalletMenu/components/WalletMenuSettingItem.d.ts +1 -1
  147. package/dist/widgets/sections/WalletMenu/components/WalletToggle.d.ts +1 -1
  148. package/package.json +6 -6
  149. package/dist/components/Accordion/Accordion.js +0 -25
  150. package/dist/components/Accordion/Accordion.stories.d.ts +0 -6
  151. package/dist/components/Accordion/Accordion.stories.js +0 -16
  152. package/dist/components/Accordion/components/AccordionDetails.js +0 -29
  153. package/dist/components/Accordion/components/AccordionSummary.js +0 -10
  154. package/dist/components/Accordion/hooks/useHeightObserver.js +0 -24
  155. package/dist/components/Accordion/index.js +0 -4
  156. package/dist/components/AmountItem/AmountItem.js +0 -5
  157. package/dist/components/AmountItem/AmountItem.stories.d.ts +0 -6
  158. package/dist/components/AmountItem/AmountItem.stories.js +0 -29
  159. package/dist/components/AmountItem/index.js +0 -1
  160. package/dist/components/Avatar/Avatar.js +0 -6
  161. package/dist/components/Avatar/Avatar.stories.d.ts +0 -7
  162. package/dist/components/Avatar/Avatar.stories.js +0 -18
  163. package/dist/components/Avatar/AvatarGroup.js +0 -15
  164. package/dist/components/Avatar/AvatarGroup.stories.d.ts +0 -6
  165. package/dist/components/Avatar/AvatarGroup.stories.js +0 -21
  166. package/dist/components/Avatar/ValidatorAvatar.js +0 -6
  167. package/dist/components/Avatar/ValidatorAvatar.stories.d.ts +0 -7
  168. package/dist/components/Avatar/ValidatorAvatar.stories.js +0 -21
  169. package/dist/components/Avatar/index.js +0 -3
  170. package/dist/components/Badge/Badge.js +0 -10
  171. package/dist/components/Badge/Badge.stories.d.ts +0 -6
  172. package/dist/components/Badge/Badge.stories.js +0 -14
  173. package/dist/components/Badge/index.js +0 -1
  174. package/dist/components/Button/Button.js +0 -8
  175. package/dist/components/Button/Button.stories.d.ts +0 -6
  176. package/dist/components/Button/Button.stories.js +0 -9
  177. package/dist/components/Button/IconButton.js +0 -7
  178. package/dist/components/Button/IconButton.stories.d.ts +0 -12
  179. package/dist/components/Button/IconButton.stories.js +0 -55
  180. package/dist/components/Button/WalletDisconnectButton.js +0 -8
  181. package/dist/components/Button/index.js +0 -3
  182. package/dist/components/Card/Card.js +0 -6
  183. package/dist/components/Card/Card.stories.d.ts +0 -8
  184. package/dist/components/Card/Card.stories.js +0 -29
  185. package/dist/components/Card/index.js +0 -1
  186. package/dist/components/Chip/Chip.js +0 -6
  187. package/dist/components/Chip/Chip.stories.d.ts +0 -6
  188. package/dist/components/Chip/Chip.stories.js +0 -9
  189. package/dist/components/Chip/index.js +0 -1
  190. package/dist/components/Copy/Copy.js +0 -29
  191. package/dist/components/Copy/index.js +0 -1
  192. package/dist/components/CounterButton/CounterButton.js +0 -8
  193. package/dist/components/CounterButton/CounterButton.stories.d.ts +0 -10
  194. package/dist/components/CounterButton/CounterButton.stories.js +0 -41
  195. package/dist/components/CounterButton/index.js +0 -1
  196. package/dist/components/Dialog/Dialog.js +0 -9
  197. package/dist/components/Dialog/Dialog.stories.d.ts +0 -7
  198. package/dist/components/Dialog/Dialog.stories.js +0 -42
  199. package/dist/components/Dialog/MobileDialog.js +0 -10
  200. package/dist/components/Dialog/MobileDialog.stories.d.ts +0 -6
  201. package/dist/components/Dialog/MobileDialog.stories.js +0 -27
  202. package/dist/components/Dialog/components/Backdrop.js +0 -4
  203. package/dist/components/Dialog/components/DialogBody.js +0 -3
  204. package/dist/components/Dialog/components/DialogFooter.js +0 -3
  205. package/dist/components/Dialog/components/DialogHeader.js +0 -5
  206. package/dist/components/Dialog/index.js +0 -6
  207. package/dist/components/DisplayHash/DisplayHash.js +0 -10
  208. package/dist/components/DisplayHash/index.js +0 -1
  209. package/dist/components/FeeItem/FeeItem.js +0 -6
  210. package/dist/components/FeeItem/FeeItem.stories.d.ts +0 -7
  211. package/dist/components/FeeItem/FeeItem.stories.js +0 -19
  212. package/dist/components/Form/Checkbox.js +0 -10
  213. package/dist/components/Form/Checkbox.stories.d.ts +0 -6
  214. package/dist/components/Form/Checkbox.stories.js +0 -13
  215. package/dist/components/Form/FormControl.js +0 -6
  216. package/dist/components/Form/FormControl.stories.d.ts +0 -8
  217. package/dist/components/Form/FormControl.stories.js +0 -30
  218. package/dist/components/Form/Input.js +0 -8
  219. package/dist/components/Form/Input.stories.d.ts +0 -10
  220. package/dist/components/Form/Input.stories.js +0 -43
  221. package/dist/components/Form/Radio.js +0 -10
  222. package/dist/components/Form/Radio.stories.d.ts +0 -6
  223. package/dist/components/Form/Radio.stories.js +0 -13
  224. package/dist/components/Form/Select.js +0 -47
  225. package/dist/components/Form/Select.stories.d.ts +0 -11
  226. package/dist/components/Form/Select.stories.js +0 -69
  227. package/dist/components/Form/components/Toggle.js +0 -22
  228. package/dist/components/Form/index.js +0 -5
  229. package/dist/components/Heading/Heading.js +0 -9
  230. package/dist/components/Heading/Heading.stories.d.ts +0 -6
  231. package/dist/components/Heading/Heading.stories.js +0 -10
  232. package/dist/components/Heading/index.js +0 -1
  233. package/dist/components/Hint/Hint.js +0 -53
  234. package/dist/components/Hint/Hint.stories.d.ts +0 -12
  235. package/dist/components/Hint/Hint.stories.js +0 -52
  236. package/dist/components/Hint/index.js +0 -1
  237. package/dist/components/Icons/ThemedIcon.js +0 -25
  238. package/dist/components/Icons/common/BugReportIcon.js +0 -7
  239. package/dist/components/Icons/common/ChevronLeftIcon.js +0 -7
  240. package/dist/components/Icons/common/CloseIcon.js +0 -7
  241. package/dist/components/Icons/common/CollapseIcon.js +0 -7
  242. package/dist/components/Icons/common/CopyIcon.js +0 -7
  243. package/dist/components/Icons/common/InfoIcon.js +0 -8
  244. package/dist/components/Icons/common/OpenIcon.js +0 -7
  245. package/dist/components/Icons/common/ThemeIcon.js +0 -7
  246. package/dist/components/Icons/common/WarningIcon.js +0 -8
  247. package/dist/components/Icons/index.js +0 -25
  248. package/dist/components/Icons/wallet/BitcoinPublicKeyIcon.js +0 -8
  249. package/dist/components/Icons/wallet/LinkWalletIcon.js +0 -8
  250. package/dist/components/Icons/wallet/UsingInscriptionIcon.js +0 -8
  251. package/dist/components/List/List.js +0 -16
  252. package/dist/components/List/List.stories.d.ts +0 -12
  253. package/dist/components/List/List.stories.js +0 -81
  254. package/dist/components/List/StatItem.js +0 -24
  255. package/dist/components/List/components/ListItem.js +0 -6
  256. package/dist/components/List/index.js +0 -3
  257. package/dist/components/ListLegacy/ListLegacy.js +0 -16
  258. package/dist/components/ListLegacy/ListLegacy.stories.d.ts +0 -11
  259. package/dist/components/ListLegacy/ListLegacy.stories.js +0 -71
  260. package/dist/components/ListLegacy/components/ListItemLegacy.js +0 -6
  261. package/dist/components/ListLegacy/index.js +0 -2
  262. package/dist/components/Loader/Loader.js +0 -6
  263. package/dist/components/Loader/Loader.stories.d.ts +0 -6
  264. package/dist/components/Loader/Loader.stories.js +0 -11
  265. package/dist/components/Loader/index.js +0 -1
  266. package/dist/components/Menu/Menu.js +0 -29
  267. package/dist/components/Menu/Menu.stories.d.ts +0 -6
  268. package/dist/components/Menu/Menu.stories.js +0 -38
  269. package/dist/components/Menu/MenuContext.js +0 -9
  270. package/dist/components/Menu/MenuDrawer.js +0 -24
  271. package/dist/components/Menu/MenuItem.js +0 -27
  272. package/dist/components/Menu/SubMenu.js +0 -12
  273. package/dist/components/Menu/SubMenuItem.js +0 -6
  274. package/dist/components/Menu/index.js +0 -6
  275. package/dist/components/Popover/Popover.js +0 -16
  276. package/dist/components/Popover/Popover.stories.d.ts +0 -6
  277. package/dist/components/Popover/Popover.stories.js +0 -25
  278. package/dist/components/Popover/index.js +0 -1
  279. package/dist/components/Portal/Portal.js +0 -44
  280. package/dist/components/Portal/index.js +0 -1
  281. package/dist/components/Spacer/Spacer.js +0 -9
  282. package/dist/components/Spacer/index.js +0 -1
  283. package/dist/components/SubSection/SubSection.js +0 -4
  284. package/dist/components/SubSection/SubSection.stories.d.ts +0 -6
  285. package/dist/components/SubSection/SubSection.stories.js +0 -13
  286. package/dist/components/SubSection/index.js +0 -1
  287. package/dist/components/Table/Table.js +0 -43
  288. package/dist/components/Table/Table.stories.d.ts +0 -9
  289. package/dist/components/Table/Table.stories.js +0 -210
  290. package/dist/components/Table/components/Cell.js +0 -8
  291. package/dist/components/Table/components/Column.js +0 -19
  292. package/dist/components/Table/components/Row.js +0 -7
  293. package/dist/components/Table/index.js +0 -4
  294. package/dist/components/Table/types/index.js +0 -1
  295. package/dist/components/Text/Text.js +0 -11
  296. package/dist/components/Text/Text.stories.d.ts +0 -6
  297. package/dist/components/Text/Text.stories.js +0 -10
  298. package/dist/components/Text/index.js +0 -1
  299. package/dist/components/Toggle/Toggle.js +0 -12
  300. package/dist/components/Toggle/Toggle.stories.d.ts +0 -6
  301. package/dist/components/Toggle/Toggle.stories.js +0 -14
  302. package/dist/components/Toggle/index.js +0 -1
  303. package/dist/components/Warning/Warning.js +0 -7
  304. package/dist/components/Warning/Warning.stories.d.ts +0 -9
  305. package/dist/components/Warning/Warning.stories.js +0 -26
  306. package/dist/components/Warning/index.js +0 -1
  307. package/dist/components/index.js +0 -5
  308. package/dist/context/Dialog.context.js +0 -33
  309. package/dist/context/Table.context.js +0 -8
  310. package/dist/elements/FinalityProviderItem/FinalityProviderItem.js +0 -30
  311. package/dist/elements/FinalityProviderItem/FinalityProviderItem.stories.d.ts +0 -12
  312. package/dist/elements/FinalityProviderItem/FinalityProviderItem.stories.js +0 -97
  313. package/dist/elements/FinalityProviderItem/index.js +0 -1
  314. package/dist/elements/FinalityProviderLogo/FinalityProviderLogo.js +0 -24
  315. package/dist/elements/FinalityProviderLogo/FinalityProviderLogo.stories.d.ts +0 -13
  316. package/dist/elements/FinalityProviderLogo/FinalityProviderLogo.stories.js +0 -61
  317. package/dist/elements/FinalityProviderLogo/index.js +0 -1
  318. package/dist/elements/Icons/ChevronRightIcon.js +0 -2
  319. package/dist/elements/Icons/SettingsIcon.js +0 -2
  320. package/dist/elements/Icons/index.js +0 -2
  321. package/dist/elements/ProvidersList/ProvidersList.js +0 -9
  322. package/dist/elements/ProvidersList/ProvidersList.stories.d.ts +0 -10
  323. package/dist/elements/ProvidersList/ProvidersList.stories.js +0 -139
  324. package/dist/elements/ProvidersList/index.js +0 -1
  325. package/dist/elements/Table/Table.js +0 -14
  326. package/dist/elements/Table/Table.stories.d.ts +0 -8
  327. package/dist/elements/Table/Table.stories.js +0 -50
  328. package/dist/elements/Table/index.js +0 -1
  329. package/dist/hooks/index.js +0 -11
  330. package/dist/hooks/useClickOutside.js +0 -17
  331. package/dist/hooks/useControlledState.js +0 -13
  332. package/dist/hooks/useCopy.js +0 -43
  333. package/dist/hooks/useDrawerAnimation.js +0 -42
  334. package/dist/hooks/useFrozenColumns.js +0 -23
  335. package/dist/hooks/useIsMobile.js +0 -33
  336. package/dist/hooks/useMemoizedArray.js +0 -22
  337. package/dist/hooks/useModalManager.js +0 -28
  338. package/dist/hooks/useResizeObserver.js +0 -21
  339. package/dist/hooks/useTableScroll.js +0 -22
  340. package/dist/hooks/useTableSort.js +0 -46
  341. package/dist/index.js +0 -54
  342. package/dist/providers/CoreUIProvider.js +0 -9
  343. package/dist/tsconfig.lib.tsbuildinfo +0 -1
  344. package/dist/utils/constants.js +0 -4
  345. package/dist/utils/css.js +0 -6
  346. package/dist/utils/helpers.js +0 -110
  347. package/dist/utils/trim.js +0 -14
  348. package/dist/widgets/form/CheckboxField/CheckboxField.js +0 -7
  349. package/dist/widgets/form/CheckboxField/CheckboxField.stories.d.ts +0 -6
  350. package/dist/widgets/form/CheckboxField/CheckboxField.stories.js +0 -17
  351. package/dist/widgets/form/CheckboxField/index.js +0 -1
  352. package/dist/widgets/form/Form/Form.js +0 -20
  353. package/dist/widgets/form/Form/Form.stories.d.ts +0 -6
  354. package/dist/widgets/form/Form/Form.stories.js +0 -27
  355. package/dist/widgets/form/Form/index.js +0 -1
  356. package/dist/widgets/form/HiddenField/HiddenField.js +0 -13
  357. package/dist/widgets/form/HiddenField/HiddenField.stories.d.ts +0 -6
  358. package/dist/widgets/form/HiddenField/HiddenField.stories.js +0 -17
  359. package/dist/widgets/form/HiddenField/index.js +0 -1
  360. package/dist/widgets/form/NumberField/NumberField.js +0 -15
  361. package/dist/widgets/form/NumberField/NumberField.stories.d.ts +0 -6
  362. package/dist/widgets/form/NumberField/NumberField.stories.js +0 -31
  363. package/dist/widgets/form/NumberField/index.js +0 -1
  364. package/dist/widgets/form/RadioField/RadioField.js +0 -7
  365. package/dist/widgets/form/RadioField/RadioField.stories.d.ts +0 -6
  366. package/dist/widgets/form/RadioField/RadioField.stories.js +0 -14
  367. package/dist/widgets/form/RadioField/index.js +0 -1
  368. package/dist/widgets/form/SelectField/SelectField.js +0 -13
  369. package/dist/widgets/form/SelectField/SelectField.stories.d.ts +0 -6
  370. package/dist/widgets/form/SelectField/SelectField.stories.js +0 -33
  371. package/dist/widgets/form/SelectField/index.js +0 -1
  372. package/dist/widgets/form/TextField/TextField.js +0 -9
  373. package/dist/widgets/form/TextField/TextField.stories.d.ts +0 -6
  374. package/dist/widgets/form/TextField/TextField.stories.js +0 -28
  375. package/dist/widgets/form/TextField/index.js +0 -1
  376. package/dist/widgets/form/hooks.js +0 -29
  377. package/dist/widgets/form/types.js +0 -1
  378. package/dist/widgets/sections/ActivityCard/ActivityCard.js +0 -8
  379. package/dist/widgets/sections/ActivityCard/ActivityCard.stories.d.ts +0 -14
  380. package/dist/widgets/sections/ActivityCard/ActivityCard.stories.js +0 -265
  381. package/dist/widgets/sections/ActivityCard/components/ActivityCardActionSection.js +0 -5
  382. package/dist/widgets/sections/ActivityCard/components/ActivityCardAmountSection.js +0 -6
  383. package/dist/widgets/sections/ActivityCard/components/ActivityCardDetailsSection.js +0 -19
  384. package/dist/widgets/sections/ActivityCard/components/ActivityListItem.js +0 -5
  385. package/dist/widgets/sections/ActivityCard/index.js +0 -5
  386. package/dist/widgets/sections/AmountSubsection/AmountSubsection.js +0 -53
  387. package/dist/widgets/sections/AmountSubsection/AmountSubsection.stories.d.ts +0 -16
  388. package/dist/widgets/sections/AmountSubsection/AmountSubsection.stories.js +0 -230
  389. package/dist/widgets/sections/AmountSubsection/index.js +0 -1
  390. package/dist/widgets/sections/FeesSection/BBNFeeAmount.js +0 -7
  391. package/dist/widgets/sections/FeesSection/BTCFeeAmount.js +0 -19
  392. package/dist/widgets/sections/FeesSection/BTCFeeRate.js +0 -7
  393. package/dist/widgets/sections/FeesSection/FeesSection.js +0 -10
  394. package/dist/widgets/sections/FeesSection/FeesSection.stories.d.ts +0 -7
  395. package/dist/widgets/sections/FeesSection/FeesSection.stories.js +0 -18
  396. package/dist/widgets/sections/FeesSection/Total.js +0 -20
  397. package/dist/widgets/sections/FeesSection/index.js +0 -6
  398. package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.js +0 -9
  399. package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.stories.d.ts +0 -14
  400. package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.stories.js +0 -212
  401. package/dist/widgets/sections/FinalityProviderSubsection/index.js +0 -1
  402. package/dist/widgets/sections/PreviewModal/PreviewModal.js +0 -48
  403. package/dist/widgets/sections/PreviewModal/PreviewModal.stories.d.ts +0 -8
  404. package/dist/widgets/sections/PreviewModal/PreviewModal.stories.js +0 -115
  405. package/dist/widgets/sections/PreviewModal/index.js +0 -1
  406. package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.js +0 -15
  407. package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.stories.d.ts +0 -9
  408. package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.stories.js +0 -190
  409. package/dist/widgets/sections/RewardsPreviewModal/index.js +0 -1
  410. package/dist/widgets/sections/RewardsSubsection/RewardsSubsection.js +0 -13
  411. package/dist/widgets/sections/RewardsSubsection/RewardsSubsection.stories.d.ts +0 -8
  412. package/dist/widgets/sections/RewardsSubsection/RewardsSubsection.stories.js +0 -96
  413. package/dist/widgets/sections/RewardsSubsection/index.js +0 -1
  414. package/dist/widgets/sections/SettingMenu/SettingMenu.js +0 -18
  415. package/dist/widgets/sections/SettingMenu/SettingMenu.stories.d.ts +0 -6
  416. package/dist/widgets/sections/SettingMenu/SettingMenu.stories.js +0 -49
  417. package/dist/widgets/sections/SettingMenu/components/SettingMenuCustomContent.js +0 -2
  418. package/dist/widgets/sections/SettingMenu/components/SettingMenuDescription.js +0 -4
  419. package/dist/widgets/sections/SettingMenu/components/SettingMenuGroup.js +0 -15
  420. package/dist/widgets/sections/SettingMenu/components/SettingMenuItem.js +0 -13
  421. package/dist/widgets/sections/SettingMenu/components/SettingMenuSubMenu.js +0 -14
  422. package/dist/widgets/sections/SettingMenu/components/SettingMenuTitle.js +0 -4
  423. package/dist/widgets/sections/SettingMenu/components/index.js +0 -6
  424. package/dist/widgets/sections/SettingMenu/index.js +0 -7
  425. package/dist/widgets/sections/TableElement/TableElement.js +0 -6
  426. package/dist/widgets/sections/TableElement/TableElement.stories.d.ts +0 -9
  427. package/dist/widgets/sections/TableElement/TableElement.stories.js +0 -54
  428. package/dist/widgets/sections/TableElement/index.js +0 -1
  429. package/dist/widgets/sections/UnbondingModal/UnbondingModal.js +0 -18
  430. package/dist/widgets/sections/UnbondingModal/UnbondingModal.stories.d.ts +0 -7
  431. package/dist/widgets/sections/UnbondingModal/UnbondingModal.stories.js +0 -81
  432. package/dist/widgets/sections/UnbondingModal/index.js +0 -1
  433. package/dist/widgets/sections/ValidatorSelector/ValidatorSelector.js +0 -34
  434. package/dist/widgets/sections/ValidatorSelector/ValidatorSelector.stories.d.ts +0 -6
  435. package/dist/widgets/sections/ValidatorSelector/ValidatorSelector.stories.js +0 -52
  436. package/dist/widgets/sections/ValidatorSelector/index.js +0 -1
  437. package/dist/widgets/sections/WalletMenu/WalletMenu.js +0 -33
  438. package/dist/widgets/sections/WalletMenu/WalletMenu.stories.d.ts +0 -7
  439. package/dist/widgets/sections/WalletMenu/WalletMenu.stories.js +0 -70
  440. package/dist/widgets/sections/WalletMenu/components/WalletMenuCard.js +0 -32
  441. package/dist/widgets/sections/WalletMenu/components/WalletMenuInfoItem.js +0 -8
  442. package/dist/widgets/sections/WalletMenu/components/WalletMenuSettingItem.js +0 -8
  443. package/dist/widgets/sections/WalletMenu/components/WalletToggle.js +0 -12
  444. package/dist/widgets/sections/WalletMenu/components/index.js +0 -4
  445. package/dist/widgets/sections/WalletMenu/index.js +0 -5
@@ -1,10 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { twMerge } from "tailwind-merge";
3
- import { SubSection } from "../../../components/SubSection";
4
- import { BTCFeeRate } from "./BTCFeeRate";
5
- import { BTCFeeAmount } from "./BTCFeeAmount";
6
- import { BBNFeeAmount } from "./BBNFeeAmount";
7
- import { Total } from "./Total";
8
- export function FeesSection({ className, feeRate, onFeeRateEdit, feeAmount, coinSymbol, feeAmountHint, total, totalHint, bbnFeeAmount, bbnCoinSymbol, bbnFeeAmountHint, bbnFeeDecimals, }) {
9
- return (_jsx(SubSection, { className: twMerge("flex w-full flex-col content-center justify-between gap-4", className), children: _jsxs("div", { className: "flex flex-col gap-6 p-4", children: [feeRate !== undefined && _jsx(BTCFeeRate, { value: feeRate, onEdit: onFeeRateEdit }), feeAmount !== undefined && coinSymbol !== undefined && (_jsx(BTCFeeAmount, { amount: feeAmount, coinSymbol: coinSymbol, hint: feeAmountHint })), bbnFeeAmount !== undefined && bbnCoinSymbol ? (_jsx(BBNFeeAmount, { amount: bbnFeeAmount, coinSymbol: bbnCoinSymbol, hint: bbnFeeAmountHint, decimals: bbnFeeDecimals })) : null, total !== undefined && coinSymbol !== undefined && _jsx("div", { className: "divider my-4" }), total !== undefined && coinSymbol !== undefined && _jsx(Total, { total: total, coinSymbol: coinSymbol, hint: totalHint })] }) }));
10
- }
@@ -1,7 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { FeesSection } from "./FeesSection";
3
- declare const meta: Meta<typeof FeesSection>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Default: Story;
7
- export declare const BabylonNetworkFee: Story;
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { FeesSection } from "./FeesSection";
3
- const meta = {
4
- component: FeesSection,
5
- tags: ["autodocs"],
6
- };
7
- export default meta;
8
- export const Default = {
9
- args: {
10
- feeRate: 5,
11
- feeAmount: "0.0001",
12
- coinSymbol: "BTC",
13
- total: "0.0001",
14
- },
15
- };
16
- export const BabylonNetworkFee = {
17
- render: () => (_jsx(FeesSection, { bbnFeeAmount: 0, bbnCoinSymbol: "BABY", bbnFeeAmountHint: "$0,00" })),
18
- };
@@ -1,20 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Text } from "../../../components/Text";
3
- import { twMerge } from "tailwind-merge";
4
- import { BTC_DECIMAL_PLACES } from "../../../utils/constants";
5
- export function Total({ total, coinSymbol, hint, title = "Total", className, decimals = BTC_DECIMAL_PLACES }) {
6
- let formattedTotal;
7
- if (typeof total === "number") {
8
- if (total === 0) {
9
- formattedTotal = "0";
10
- }
11
- else {
12
- const str = total.toFixed(decimals);
13
- formattedTotal = str.replace(/0+$/, "").replace(/\.$/, "");
14
- }
15
- }
16
- else {
17
- formattedTotal = total;
18
- }
19
- return (_jsxs("div", { className: twMerge("flex flex-row items-start justify-between text-accent-primary", className), children: [_jsx(Text, { variant: "body1", className: "font-bold", children: title }), _jsxs("div", { className: "flex flex-col items-end justify-center", children: [_jsxs(Text, { variant: "body1", className: "font-bold", children: [formattedTotal, " ", coinSymbol] }), hint && (_jsx(Text, { variant: "body1", className: "text-sm text-accent-secondary", children: hint }))] })] }));
20
- }
@@ -1,6 +0,0 @@
1
- export * from "./FeesSection";
2
- export * from "../../../components/FeeItem/FeeItem";
3
- export * from "./Total";
4
- export * from "./BTCFeeRate";
5
- export * from "./BTCFeeAmount";
6
- export * from "./BBNFeeAmount";
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { SubSection } from "../../../components/SubSection";
3
- import { useMemo } from "react";
4
- import { CounterButton } from "../../../components/CounterButton/CounterButton";
5
- import { ProvidersList } from "../../../elements/ProvidersList/ProvidersList";
6
- export function FinalityProviderSubsection({ max, items = [], actionText, onAdd, onRemove, showChain = true }) {
7
- const count = useMemo(() => items.length, [items]);
8
- return (_jsx(SubSection, { children: _jsxs("div", { className: "flex w-full flex-col gap-4", children: [_jsx("div", { className: "flex flex-row", children: _jsxs("div", { className: "flex w-full flex-row content-center items-center justify-between font-normal", children: [_jsx("span", { className: "text-sm sm:text-base", children: actionText }), _jsx(CounterButton, { counter: count, max: max, onAdd: onAdd })] }) }), count > 0 && _jsx(ProvidersList, { items: items, onRemove: onRemove, showChain: showChain })] }) }));
9
- }
@@ -1,14 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { FinalityProviderSubsection } from "./FinalityProviderSubsection";
3
- declare const meta: Meta<typeof FinalityProviderSubsection>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Default: Story;
7
- export declare const Empty: Story;
8
- export declare const MultipleItems: Story;
9
- export declare const AtMaximumCapacity: Story;
10
- export declare const SingleProviderMode: Story;
11
- export declare const SingleProviderModeWithItem: Story;
12
- export declare const ProvidersWithoutLogos: Story;
13
- export declare const ProvidersWithoutDescriptions: Story;
14
- export declare const SingleProviderWithoutBsnLogo: Story;
@@ -1,212 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { FinalityProviderSubsection } from "./FinalityProviderSubsection";
3
- const sampleItems = [
4
- {
5
- bsnId: "babylon",
6
- bsnName: "Babylon Genesis",
7
- bsnLogoUrl: "https://placehold.co/24x24?text=B",
8
- provider: {
9
- rank: 1,
10
- logo_url: "https://placehold.co/40x40",
11
- description: { moniker: "Provider 1" },
12
- },
13
- },
14
- ];
15
- const multipleItems = [
16
- {
17
- bsnId: "babylon",
18
- bsnName: "Babylon Genesis",
19
- bsnLogoUrl: "https://placehold.co/24x24?text=B",
20
- provider: {
21
- rank: 1,
22
- logo_url: "https://placehold.co/40x40",
23
- description: { moniker: "Babylon Provider" },
24
- },
25
- },
26
- {
27
- bsnId: "ethereum",
28
- bsnName: "Ethereum Bridge",
29
- bsnLogoUrl: "https://placehold.co/24x24?text=E",
30
- provider: {
31
- rank: 2,
32
- logo_url: "https://placehold.co/40x40",
33
- description: { moniker: "Ethereum Provider" },
34
- },
35
- },
36
- ];
37
- const maxCapacityItems = [
38
- {
39
- bsnId: "babylon",
40
- bsnName: "Babylon Genesis",
41
- bsnLogoUrl: "https://placehold.co/24x24?text=B",
42
- provider: {
43
- rank: 1,
44
- logo_url: "https://placehold.co/40x40",
45
- description: { moniker: "Babylon Provider" },
46
- },
47
- },
48
- {
49
- bsnId: "ethereum",
50
- bsnName: "Ethereum Bridge",
51
- bsnLogoUrl: "https://placehold.co/24x24?text=E",
52
- provider: {
53
- rank: 2,
54
- logo_url: "https://placehold.co/40x40",
55
- description: { moniker: "Ethereum Provider" },
56
- },
57
- },
58
- {
59
- bsnId: "polygon",
60
- bsnName: "Polygon Network",
61
- bsnLogoUrl: "https://placehold.co/24x24?text=P",
62
- provider: {
63
- rank: 3,
64
- logo_url: "https://placehold.co/40x40",
65
- description: { moniker: "Polygon Provider" },
66
- },
67
- },
68
- ];
69
- const meta = {
70
- component: FinalityProviderSubsection,
71
- tags: ["autodocs"],
72
- };
73
- export default meta;
74
- export const Default = {
75
- args: {
76
- max: 3,
77
- items: sampleItems,
78
- actionText: "Add BSN and Finality Provider",
79
- onAdd: () => alert("Add clicked"),
80
- onRemove: () => alert("Remove clicked"),
81
- },
82
- render: ({ max, items, actionText, onAdd, onRemove }) => (_jsx(FinalityProviderSubsection, { max: max, items: items, actionText: actionText, onAdd: onAdd, onRemove: onRemove })),
83
- };
84
- export const Empty = {
85
- args: {
86
- max: 3,
87
- items: [],
88
- actionText: "Add BSN and Finality Provider",
89
- onAdd: () => alert("Add clicked"),
90
- onRemove: () => alert("Remove clicked"),
91
- },
92
- render: ({ max, items, actionText, onAdd, onRemove }) => (_jsx(FinalityProviderSubsection, { max: max, items: items, actionText: actionText, onAdd: onAdd, onRemove: onRemove })),
93
- };
94
- export const MultipleItems = {
95
- args: {
96
- max: 5,
97
- items: multipleItems,
98
- actionText: "Add BSN and Finality Provider",
99
- onAdd: () => alert("Add clicked"),
100
- onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
101
- },
102
- render: ({ max, items, actionText, onAdd, onRemove }) => (_jsx(FinalityProviderSubsection, { max: max, items: items, actionText: actionText, onAdd: onAdd, onRemove: onRemove })),
103
- };
104
- export const AtMaximumCapacity = {
105
- args: {
106
- max: 3,
107
- items: maxCapacityItems,
108
- actionText: "Add BSN and Finality Provider",
109
- onAdd: () => alert("Add clicked"),
110
- onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
111
- },
112
- render: ({ max, items, actionText, onAdd, onRemove }) => (_jsx(FinalityProviderSubsection, { max: max, items: items, actionText: actionText, onAdd: onAdd, onRemove: onRemove })),
113
- };
114
- export const SingleProviderMode = {
115
- args: {
116
- max: 1,
117
- items: [],
118
- actionText: "Add Finality Provider",
119
- onAdd: () => alert("Add clicked"),
120
- onRemove: () => alert("Remove clicked"),
121
- },
122
- render: ({ max, items, actionText, onAdd, onRemove }) => (_jsx(FinalityProviderSubsection, { max: max, items: items, actionText: actionText, onAdd: onAdd, onRemove: onRemove })),
123
- };
124
- export const SingleProviderModeWithItem = {
125
- args: {
126
- max: 1,
127
- items: [sampleItems[0]],
128
- actionText: "Add Finality Provider",
129
- onAdd: () => alert("Add clicked"),
130
- onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
131
- },
132
- render: ({ max, items, actionText, onAdd, onRemove }) => (_jsx(FinalityProviderSubsection, { max: max, items: items, actionText: actionText, onAdd: onAdd, onRemove: onRemove })),
133
- };
134
- export const ProvidersWithoutLogos = {
135
- args: {
136
- max: 3,
137
- items: [
138
- {
139
- bsnId: "nologo1",
140
- bsnName: "Provider Without Logo",
141
- provider: {
142
- rank: 1,
143
- description: { moniker: "No Logo Provider" },
144
- },
145
- },
146
- {
147
- bsnId: "nologo2",
148
- bsnName: "Another Provider",
149
- bsnLogoUrl: "https://placehold.co/24x24?text=A",
150
- provider: {
151
- rank: 2,
152
- description: { moniker: "Provider with BSN logo only" },
153
- },
154
- },
155
- ],
156
- actionText: "Add BSN and Finality Provider",
157
- onAdd: () => alert("Add clicked"),
158
- onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
159
- },
160
- render: ({ max, items, actionText, onAdd, onRemove }) => (_jsx(FinalityProviderSubsection, { max: max, items: items, actionText: actionText, onAdd: onAdd, onRemove: onRemove })),
161
- };
162
- export const ProvidersWithoutDescriptions = {
163
- args: {
164
- max: 3,
165
- items: [
166
- {
167
- bsnId: "nodesc1",
168
- bsnName: "Provider Without Description",
169
- bsnLogoUrl: "https://placehold.co/24x24?text=N",
170
- provider: {
171
- rank: 1,
172
- logo_url: "https://placehold.co/40x40",
173
- },
174
- },
175
- {
176
- bsnId: "nodesc2",
177
- bsnName: "Another Provider",
178
- bsnLogoUrl: "https://placehold.co/24x24?text=A",
179
- provider: {
180
- rank: 2,
181
- logo_url: "https://placehold.co/40x40",
182
- description: {},
183
- },
184
- },
185
- ],
186
- actionText: "Add BSN and Finality Provider",
187
- onAdd: () => alert("Add clicked"),
188
- onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
189
- },
190
- render: ({ max, items, actionText, onAdd, onRemove }) => (_jsx(FinalityProviderSubsection, { max: max, items: items, actionText: actionText, onAdd: onAdd, onRemove: onRemove })),
191
- };
192
- export const SingleProviderWithoutBsnLogo = {
193
- args: {
194
- max: 1,
195
- items: [
196
- {
197
- bsnId: "babylon",
198
- bsnName: "Babylon Genesis",
199
- provider: {
200
- rank: 1,
201
- logo_url: "https://placehold.co/40x40",
202
- description: { moniker: "Babylon Provider" },
203
- },
204
- },
205
- ],
206
- actionText: "Select Validator",
207
- onAdd: () => alert("Add clicked"),
208
- onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
209
- showChain: false,
210
- },
211
- render: ({ max, items, actionText, onAdd, onRemove, showChain }) => (_jsx(FinalityProviderSubsection, { max: max, items: items, actionText: actionText, onAdd: onAdd, onRemove: onRemove, showChain: showChain })),
212
- };
@@ -1 +0,0 @@
1
- export { FinalityProviderSubsection } from "./FinalityProviderSubsection";
@@ -1,48 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button } from "@/components/Button";
3
- import { WINDOW_BREAKPOINT } from "../../../utils/constants";
4
- import { Table } from "@/elements/Table";
5
- import { Dialog, MobileDialog, DialogBody, DialogFooter, DialogHeader } from "@/components/Dialog";
6
- import { Heading } from "@/components/Heading";
7
- import { Text } from "@/components/Text";
8
- import { useIsMobile } from "@/hooks/useIsMobile";
9
- import { twMerge } from "tailwind-merge";
10
- function ResponsiveDialog({ className, ...restProps }) {
11
- const isMobileView = useIsMobile(WINDOW_BREAKPOINT);
12
- const DialogComponent = isMobileView ? MobileDialog : Dialog;
13
- return _jsx(DialogComponent, { ...restProps, className: twMerge("w-[41.25rem] max-w-full", className) });
14
- }
15
- export const PreviewModal = ({ open, processing = false, onClose, onProceed, bsns, finalityProviders, details, visibleFields, warnings, proceedLabel = "Proceed to Signing", }) => {
16
- const allFields = [
17
- { label: "Stake Amount", value: details.stakeAmount },
18
- { label: "Fee Rate", value: details.feeRate },
19
- { label: "Transaction Fees", value: details.transactionFees },
20
- {
21
- label: "Term",
22
- value: (_jsxs(_Fragment, { children: [details.term.blocks, _jsx("br", {}), _jsx("span", { className: "text-md text-secondary", children: details.term.duration })] })),
23
- },
24
- { label: "Unbonding", value: details.unbonding },
25
- { label: "Unbonding Fee", value: details.unbondingFee },
26
- ];
27
- const fields = visibleFields && visibleFields.length > 0 ? allFields.filter((f) => visibleFields.includes(f.label)) : allFields;
28
- // If no finality providers are supplied, we display a single-column table labelled "Validator"
29
- const isSingleColumn = !finalityProviders || finalityProviders.length === 0;
30
- const tableData = isSingleColumn
31
- ? [
32
- ["Validator"],
33
- ...bsns.map((item, index) => [
34
- _jsxs("div", { className: "flex w-full items-center gap-2 py-1", children: [item.icon, _jsx(Text, { variant: "body2", className: "font-medium", children: item.name })] }, `validator-${index}`),
35
- ]),
36
- ]
37
- : [
38
- ["BSNs", "Finality Provider"],
39
- ...bsns.map((bsnItem, index) => {
40
- const fpItem = finalityProviders[index];
41
- return [
42
- _jsxs("div", { className: "flex w-full items-center gap-2 py-1", children: [bsnItem.icon, _jsx(Text, { variant: "body2", className: "font-medium", children: bsnItem.name })] }, `bsn-${index}`),
43
- fpItem ? (_jsxs("div", { className: "flex w-full items-center gap-2 py-1", children: [fpItem.icon, _jsx(Text, { variant: "body2", className: "font-medium", children: fpItem.name })] }, `fp-${index}`)) : (_jsx("div", {}, `fp-${index}`)),
44
- ];
45
- }),
46
- ];
47
- return (_jsxs(ResponsiveDialog, { open: open, onClose: onClose, children: [_jsx(DialogHeader, { title: "Preview", onClose: onClose, className: "text-accent-primary" }), _jsxs(DialogBody, { className: "no-scrollbar mb-8 mt-4 flex max-h-[calc(100vh-12rem)] flex-col gap-4 overflow-y-auto text-accent-primary", children: [_jsx(Table, { data: tableData }), _jsx("div", { className: "flex flex-col", children: fields.map((field, index) => (_jsxs("div", { className: "flex flex-row items-center justify-between py-3", children: [_jsx(Text, { variant: "body1", className: "text-secondary font-normal", children: field.label }), _jsx(Text, { variant: "body1", className: "text-right font-normal", children: field.value })] }, index))) }), _jsx("div", { className: "border-divider w-full border-t" }), _jsxs("div", { className: "pt-2", children: [_jsx(Heading, { variant: "h6", className: "text-primary mb-2", children: "Attention!" }), warnings.map((line, idx) => (_jsx(Text, { variant: "body2", className: "text-secondary", children: line }, idx)))] })] }), _jsxs(DialogFooter, { className: "flex flex-col gap-4 pb-8 pt-0 sm:flex-row", children: [_jsx(Button, { variant: "contained", color: "primary", onClick: onProceed, className: "w-full sm:flex-1 sm:order-2", disabled: processing, children: processing ? "Processing..." : proceedLabel }), _jsx(Button, { variant: "outlined", color: "primary", onClick: onClose, className: "w-full sm:flex-1 sm:order-1", children: "Cancel" })] })] }));
48
- };
@@ -1,8 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { PreviewModal } from "./PreviewModal";
3
- declare const meta: Meta<typeof PreviewModal>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Default: Story;
7
- export declare const ValidatorOnly: Story;
8
- export declare const CustomWarnings: Story;
@@ -1,115 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { PreviewModal } from "./PreviewModal";
3
- const PlaceholderIcon = ({ text, bgColor = "bg-primary-300" }) => (_jsx("div", { className: `${bgColor} flex h-6 w-6 items-center justify-center rounded text-xs font-semibold text-white`, children: text }));
4
- const meta = {
5
- component: PreviewModal,
6
- tags: ["autodocs"],
7
- };
8
- export default meta;
9
- export const Default = {
10
- args: {
11
- open: true,
12
- processing: false,
13
- onClose: () => { },
14
- onProceed: () => { },
15
- bsns: [
16
- {
17
- icon: _jsx(PlaceholderIcon, { text: "B1", bgColor: "bg-black" }),
18
- name: "BSN 1",
19
- },
20
- {
21
- icon: _jsx(PlaceholderIcon, { text: "B2", bgColor: "bg-black" }),
22
- name: "BSN 2",
23
- },
24
- ],
25
- finalityProviders: [
26
- {
27
- icon: _jsx(PlaceholderIcon, { text: "F1", bgColor: "bg-black" }),
28
- name: "FP 1",
29
- },
30
- {
31
- icon: _jsx(PlaceholderIcon, { text: "F2", bgColor: "bg-black" }),
32
- name: "FP 2",
33
- },
34
- ],
35
- details: {
36
- stakeAmount: "0.5 BTC",
37
- feeRate: "5 sat/vB",
38
- transactionFees: "0.0001 BTC",
39
- term: {
40
- blocks: "60000 blocks",
41
- duration: "~ 60 weeks",
42
- },
43
- unbonding: "~ 1 day",
44
- unbondingFee: "0 BTC",
45
- },
46
- warnings: [
47
- "1. No third party possesses your staked BTC. You are the only one who can unbond and withdraw your stake.",
48
- "2. Your stake will first be sent to Babylon Genesis for verification (~20 seconds), then you will be prompted to submit it to the Bitcoin ledger. It will be marked as 'Pending' until it receives 10 Bitcoin confirmations.",
49
- ],
50
- },
51
- };
52
- export const ValidatorOnly = {
53
- args: {
54
- open: true,
55
- processing: false,
56
- onClose: () => { },
57
- onProceed: () => { },
58
- bsns: [
59
- {
60
- icon: _jsx(PlaceholderIcon, { text: "K", bgColor: "bg-black" }),
61
- name: "Keplr",
62
- },
63
- ],
64
- finalityProviders: [],
65
- details: {
66
- stakeAmount: "0.5 BTC",
67
- feeRate: "5 sat/vB",
68
- transactionFees: "0.0001 BTC",
69
- term: {
70
- blocks: "60000 blocks",
71
- duration: "~ 60 weeks",
72
- },
73
- unbonding: "~ 1 day",
74
- unbondingFee: "0 BTC",
75
- },
76
- visibleFields: ["Stake Amount", "Transaction Fees"],
77
- warnings: [
78
- "The staking transaction may take up to one (1) hour to process.",
79
- "Funds will not be deducted instantly; maintain sufficient balance until confirmed.",
80
- ],
81
- proceedLabel: "Stake",
82
- },
83
- };
84
- export const CustomWarnings = {
85
- args: {
86
- open: true,
87
- processing: false,
88
- onClose: () => { },
89
- onProceed: () => { },
90
- bsns: [
91
- {
92
- icon: _jsx(PlaceholderIcon, { text: "B", bgColor: "bg-black" }),
93
- name: "Babylon Genesis",
94
- },
95
- ],
96
- finalityProviders: [],
97
- details: {
98
- stakeAmount: "0.25 BTC",
99
- feeRate: "4 sat/vB",
100
- transactionFees: "0.00005 BTC",
101
- term: {
102
- blocks: "40320 blocks",
103
- duration: "~ 4 weeks",
104
- },
105
- unbonding: "~ 1 day",
106
- unbondingFee: "0 BTC",
107
- },
108
- warnings: [
109
- "1. Custom line one for this integration.",
110
- "2. Second line explaining processing behavior.",
111
- "3. Optional extra note about timelock reset in expansions.",
112
- ],
113
- proceedLabel: "Proceed",
114
- },
115
- };
@@ -1 +0,0 @@
1
- export * from "./PreviewModal";
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button } from "@/components/Button";
3
- import { WINDOW_BREAKPOINT } from "../../../utils/constants";
4
- import { Dialog, MobileDialog, DialogBody, DialogFooter, DialogHeader } from "@/components/Dialog";
5
- import { useIsMobile } from "@/hooks/useIsMobile";
6
- import { twMerge } from "tailwind-merge";
7
- import { FeeItem } from "@/components/FeeItem/FeeItem";
8
- function ResponsiveDialog({ className, ...restProps }) {
9
- const isMobileView = useIsMobile(WINDOW_BREAKPOINT);
10
- const DialogComponent = isMobileView ? MobileDialog : Dialog;
11
- return _jsx(DialogComponent, { ...restProps, className: twMerge("w-[41.25rem] max-w-full", className) });
12
- }
13
- export const RewardsPreviewModal = ({ open, processing = false, title, onClose, onProceed, tokens, transactionFees, }) => {
14
- return (_jsxs(ResponsiveDialog, { open: open, onClose: onClose, children: [_jsx(DialogHeader, { title: title, className: "text-accent-primary" }), _jsx(DialogBody, { className: "no-scrollbar mb-[40px] mt-8 flex max-h-[calc(100vh-12rem)] flex-col overflow-y-auto text-accent-primary", children: _jsxs("div", { className: "flex flex-col", children: [_jsx("div", { className: "max-h-[300px] overflow-y-auto", children: tokens.map((token, index) => (_jsxs("div", { children: [_jsx(FeeItem, { title: token.name, hint: token.amount?.usd, children: _jsxs("div", { className: "flex items-center gap-2", children: [token.icon, token.amount?.token] }) }), index < tokens.length - 1 && _jsx("div", { className: "h-4" })] }, `token-${index}`))) }), _jsx("div", { className: "pt-6 pb-6", children: _jsx("div", { className: "border-divider w-full border-t" }) }), _jsx(FeeItem, { title: "Transaction Fees", hint: transactionFees.usd, children: transactionFees.token })] }) }), _jsxs(DialogFooter, { className: "flex flex-col gap-4 pt-0 sm:flex-row", children: [_jsx(Button, { variant: "contained", color: "primary", onClick: onProceed, className: "w-full sm:flex-1 sm:order-2", disabled: processing, children: processing ? "Processing..." : "Proceed" }), _jsx(Button, { variant: "outlined", color: "primary", onClick: onClose, className: "w-full sm:flex-1 sm:order-1", children: "Cancel" })] })] }));
15
- };
@@ -1,9 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { RewardsPreviewModal } from "./RewardsPreviewModal";
3
- declare const meta: Meta<typeof RewardsPreviewModal>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Default: Story;
7
- export declare const OneReceivingToken: Story;
8
- export declare const TokensWithoutIcons: Story;
9
- export declare const LongTokenList: Story;