@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.
- package/dist/components/Accordion/Accordion.d.ts +2 -2
- package/dist/components/Accordion/components/AccordionDetails.d.ts +1 -1
- package/dist/components/Accordion/components/AccordionSummary.d.ts +2 -2
- package/dist/components/Accordion/hooks/useHeightObserver.d.ts +1 -1
- package/dist/components/Accordion/index.d.ts +3 -4
- package/dist/components/AmountItem/AmountItem.d.ts +1 -1
- package/dist/components/AmountItem/index.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -2
- package/dist/components/Avatar/AvatarGroup.d.ts +2 -3
- package/dist/components/Avatar/ValidatorAvatar.d.ts +1 -1
- package/dist/components/Avatar/index.d.ts +3 -3
- package/dist/components/Badge/Badge.d.ts +1 -2
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -3
- package/dist/components/Button/IconButton.d.ts +2 -3
- package/dist/components/Button/WalletDisconnectButton.d.ts +2 -2
- package/dist/components/Button/index.d.ts +3 -3
- package/dist/components/Card/Card.d.ts +3 -4
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Chip/Chip.d.ts +1 -2
- package/dist/components/Chip/index.d.ts +1 -1
- package/dist/components/Copy/Copy.d.ts +1 -1
- package/dist/components/CounterButton/index.d.ts +1 -1
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/MobileDialog.d.ts +1 -1
- package/dist/components/Dialog/components/Backdrop.d.ts +1 -2
- package/dist/components/Dialog/components/DialogBody.d.ts +1 -1
- package/dist/components/Dialog/components/DialogFooter.d.ts +1 -1
- package/dist/components/Dialog/components/DialogHeader.d.ts +1 -1
- package/dist/components/Dialog/index.d.ts +5 -6
- package/dist/components/DisplayHash/DisplayHash.d.ts +1 -1
- package/dist/components/FeeItem/FeeItem.d.ts +1 -1
- package/dist/components/Form/Checkbox.d.ts +2 -2
- package/dist/components/Form/FormControl.d.ts +1 -2
- package/dist/components/Form/Input.d.ts +2 -3
- package/dist/components/Form/Radio.d.ts +2 -2
- package/dist/components/Form/Select.d.ts +2 -3
- package/dist/components/Form/components/Toggle.d.ts +2 -3
- package/dist/components/Form/index.d.ts +5 -5
- package/dist/components/Heading/Heading.d.ts +2 -3
- package/dist/components/Heading/index.d.ts +1 -1
- package/dist/components/Hint/Hint.d.ts +1 -1
- package/dist/components/Icons/common/BugReportIcon.d.ts +1 -1
- package/dist/components/Icons/common/ChevronLeftIcon.d.ts +1 -1
- package/dist/components/Icons/common/CloseIcon.d.ts +1 -1
- package/dist/components/Icons/common/CollapseIcon.d.ts +1 -1
- package/dist/components/Icons/common/CopyIcon.d.ts +1 -1
- package/dist/components/Icons/common/InfoIcon.d.ts +1 -1
- package/dist/components/Icons/common/OpenIcon.d.ts +1 -1
- package/dist/components/Icons/common/ThemeIcon.d.ts +1 -1
- package/dist/components/Icons/common/WarningIcon.d.ts +1 -1
- package/dist/components/Icons/index.d.ts +13 -13
- package/dist/components/Icons/wallet/BitcoinPublicKeyIcon.d.ts +1 -1
- package/dist/components/Icons/wallet/LinkWalletIcon.d.ts +1 -1
- package/dist/components/Icons/wallet/UsingInscriptionIcon.d.ts +1 -1
- package/dist/components/List/List.d.ts +2 -3
- package/dist/components/List/StatItem.d.ts +2 -2
- package/dist/components/List/index.d.ts +3 -3
- package/dist/components/ListLegacy/ListLegacy.d.ts +2 -3
- package/dist/components/ListLegacy/index.d.ts +2 -2
- package/dist/components/Loader/Loader.d.ts +0 -1
- package/dist/components/Loader/index.d.ts +1 -1
- package/dist/components/Menu/Menu.d.ts +2 -2
- package/dist/components/Menu/MenuContext.d.ts +1 -1
- package/dist/components/Menu/MenuDrawer.d.ts +1 -1
- package/dist/components/Menu/MenuItem.d.ts +1 -1
- package/dist/components/Menu/SubMenu.d.ts +1 -1
- package/dist/components/Menu/SubMenuItem.d.ts +1 -1
- package/dist/components/Menu/index.d.ts +6 -6
- package/dist/components/Popover/Popover.d.ts +2 -3
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/Portal/Portal.d.ts +2 -2
- package/dist/components/Portal/index.d.ts +1 -1
- package/dist/components/Spacer/Spacer.d.ts +1 -1
- package/dist/components/SubSection/SubSection.d.ts +1 -2
- package/dist/components/SubSection/index.d.ts +1 -1
- package/dist/components/Table/Table.d.ts +1 -2
- package/dist/components/Table/components/Cell.d.ts +1 -1
- package/dist/components/Table/components/Column.d.ts +1 -1
- package/dist/components/Table/components/Row.d.ts +1 -1
- package/dist/components/Table/index.d.ts +4 -4
- package/dist/components/Table/types/index.d.ts +1 -1
- package/dist/components/Text/Text.d.ts +2 -3
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Toggle/Toggle.d.ts +0 -1
- package/dist/components/Toggle/index.d.ts +1 -1
- package/dist/components/Warning/Warning.d.ts +1 -2
- package/dist/components/Warning/index.d.ts +1 -1
- package/dist/context/Dialog.context.d.ts +2 -2
- package/dist/context/Table.context.d.ts +2 -2
- package/dist/elements/FinalityProviderItem/index.d.ts +1 -1
- package/dist/elements/FinalityProviderLogo/index.d.ts +1 -1
- package/dist/elements/Icons/ChevronRightIcon.d.ts +1 -1
- package/dist/elements/Icons/SettingsIcon.d.ts +1 -1
- package/dist/elements/ProvidersList/index.d.ts +1 -1
- package/dist/elements/Table/Table.d.ts +1 -1
- package/dist/elements/Table/index.d.ts +1 -1
- package/dist/hooks/useFrozenColumns.d.ts +1 -1
- package/dist/hooks/useTableScroll.d.ts +1 -1
- package/dist/hooks/useTableSort.d.ts +1 -1
- package/dist/index.d.ts +52 -54
- package/dist/widgets/form/CheckboxField/CheckboxField.d.ts +1 -1
- package/dist/widgets/form/CheckboxField/index.d.ts +1 -1
- package/dist/widgets/form/Form/Form.d.ts +3 -3
- package/dist/widgets/form/Form/index.d.ts +1 -1
- package/dist/widgets/form/HiddenField/HiddenField.d.ts +1 -1
- package/dist/widgets/form/HiddenField/index.d.ts +1 -1
- package/dist/widgets/form/NumberField/NumberField.d.ts +2 -2
- package/dist/widgets/form/NumberField/index.d.ts +1 -1
- package/dist/widgets/form/RadioField/RadioField.d.ts +1 -1
- package/dist/widgets/form/RadioField/index.d.ts +1 -1
- package/dist/widgets/form/SelectField/SelectField.d.ts +3 -3
- package/dist/widgets/form/SelectField/index.d.ts +1 -1
- package/dist/widgets/form/TextField/TextField.d.ts +2 -2
- package/dist/widgets/form/TextField/index.d.ts +1 -1
- package/dist/widgets/form/hooks.d.ts +3 -3
- package/dist/widgets/sections/ActivityCard/components/ActivityCardActionSection.d.ts +1 -1
- package/dist/widgets/sections/ActivityCard/components/ActivityCardDetailsSection.d.ts +1 -1
- package/dist/widgets/sections/ActivityCard/index.d.ts +5 -5
- package/dist/widgets/sections/AmountSubsection/index.d.ts +1 -1
- package/dist/widgets/sections/FeesSection/index.d.ts +6 -6
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.d.ts +1 -1
- package/dist/widgets/sections/FinalityProviderSubsection/index.d.ts +1 -1
- package/dist/widgets/sections/PreviewModal/PreviewModal.d.ts +1 -1
- package/dist/widgets/sections/PreviewModal/index.d.ts +1 -1
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.d.ts +1 -1
- package/dist/widgets/sections/RewardsPreviewModal/index.d.ts +1 -1
- package/dist/widgets/sections/RewardsSubsection/index.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/SettingMenu.d.ts +3 -3
- package/dist/widgets/sections/SettingMenu/components/SettingMenuCustomContent.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuDescription.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuGroup.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuItem.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuSubMenu.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuTitle.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/index.d.ts +12 -12
- package/dist/widgets/sections/SettingMenu/index.d.ts +14 -14
- package/dist/widgets/sections/TableElement/TableElement.d.ts +1 -1
- package/dist/widgets/sections/TableElement/index.d.ts +1 -1
- package/dist/widgets/sections/UnbondingModal/index.d.ts +1 -1
- package/dist/widgets/sections/ValidatorSelector/ValidatorSelector.d.ts +2 -2
- package/dist/widgets/sections/ValidatorSelector/index.d.ts +1 -1
- package/dist/widgets/sections/WalletMenu/WalletMenu.d.ts +2 -2
- package/dist/widgets/sections/WalletMenu/components/WalletMenuCard.d.ts +1 -1
- package/dist/widgets/sections/WalletMenu/components/WalletMenuInfoItem.d.ts +1 -1
- package/dist/widgets/sections/WalletMenu/components/WalletMenuSettingItem.d.ts +1 -1
- package/dist/widgets/sections/WalletMenu/components/WalletToggle.d.ts +1 -1
- package/package.json +6 -6
- package/dist/components/Accordion/Accordion.js +0 -25
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -6
- package/dist/components/Accordion/Accordion.stories.js +0 -16
- package/dist/components/Accordion/components/AccordionDetails.js +0 -29
- package/dist/components/Accordion/components/AccordionSummary.js +0 -10
- package/dist/components/Accordion/hooks/useHeightObserver.js +0 -24
- package/dist/components/Accordion/index.js +0 -4
- package/dist/components/AmountItem/AmountItem.js +0 -5
- package/dist/components/AmountItem/AmountItem.stories.d.ts +0 -6
- package/dist/components/AmountItem/AmountItem.stories.js +0 -29
- package/dist/components/AmountItem/index.js +0 -1
- package/dist/components/Avatar/Avatar.js +0 -6
- package/dist/components/Avatar/Avatar.stories.d.ts +0 -7
- package/dist/components/Avatar/Avatar.stories.js +0 -18
- package/dist/components/Avatar/AvatarGroup.js +0 -15
- package/dist/components/Avatar/AvatarGroup.stories.d.ts +0 -6
- package/dist/components/Avatar/AvatarGroup.stories.js +0 -21
- package/dist/components/Avatar/ValidatorAvatar.js +0 -6
- package/dist/components/Avatar/ValidatorAvatar.stories.d.ts +0 -7
- package/dist/components/Avatar/ValidatorAvatar.stories.js +0 -21
- package/dist/components/Avatar/index.js +0 -3
- package/dist/components/Badge/Badge.js +0 -10
- package/dist/components/Badge/Badge.stories.d.ts +0 -6
- package/dist/components/Badge/Badge.stories.js +0 -14
- package/dist/components/Badge/index.js +0 -1
- package/dist/components/Button/Button.js +0 -8
- package/dist/components/Button/Button.stories.d.ts +0 -6
- package/dist/components/Button/Button.stories.js +0 -9
- package/dist/components/Button/IconButton.js +0 -7
- package/dist/components/Button/IconButton.stories.d.ts +0 -12
- package/dist/components/Button/IconButton.stories.js +0 -55
- package/dist/components/Button/WalletDisconnectButton.js +0 -8
- package/dist/components/Button/index.js +0 -3
- package/dist/components/Card/Card.js +0 -6
- package/dist/components/Card/Card.stories.d.ts +0 -8
- package/dist/components/Card/Card.stories.js +0 -29
- package/dist/components/Card/index.js +0 -1
- package/dist/components/Chip/Chip.js +0 -6
- package/dist/components/Chip/Chip.stories.d.ts +0 -6
- package/dist/components/Chip/Chip.stories.js +0 -9
- package/dist/components/Chip/index.js +0 -1
- package/dist/components/Copy/Copy.js +0 -29
- package/dist/components/Copy/index.js +0 -1
- package/dist/components/CounterButton/CounterButton.js +0 -8
- package/dist/components/CounterButton/CounterButton.stories.d.ts +0 -10
- package/dist/components/CounterButton/CounterButton.stories.js +0 -41
- package/dist/components/CounterButton/index.js +0 -1
- package/dist/components/Dialog/Dialog.js +0 -9
- package/dist/components/Dialog/Dialog.stories.d.ts +0 -7
- package/dist/components/Dialog/Dialog.stories.js +0 -42
- package/dist/components/Dialog/MobileDialog.js +0 -10
- package/dist/components/Dialog/MobileDialog.stories.d.ts +0 -6
- package/dist/components/Dialog/MobileDialog.stories.js +0 -27
- package/dist/components/Dialog/components/Backdrop.js +0 -4
- package/dist/components/Dialog/components/DialogBody.js +0 -3
- package/dist/components/Dialog/components/DialogFooter.js +0 -3
- package/dist/components/Dialog/components/DialogHeader.js +0 -5
- package/dist/components/Dialog/index.js +0 -6
- package/dist/components/DisplayHash/DisplayHash.js +0 -10
- package/dist/components/DisplayHash/index.js +0 -1
- package/dist/components/FeeItem/FeeItem.js +0 -6
- package/dist/components/FeeItem/FeeItem.stories.d.ts +0 -7
- package/dist/components/FeeItem/FeeItem.stories.js +0 -19
- package/dist/components/Form/Checkbox.js +0 -10
- package/dist/components/Form/Checkbox.stories.d.ts +0 -6
- package/dist/components/Form/Checkbox.stories.js +0 -13
- package/dist/components/Form/FormControl.js +0 -6
- package/dist/components/Form/FormControl.stories.d.ts +0 -8
- package/dist/components/Form/FormControl.stories.js +0 -30
- package/dist/components/Form/Input.js +0 -8
- package/dist/components/Form/Input.stories.d.ts +0 -10
- package/dist/components/Form/Input.stories.js +0 -43
- package/dist/components/Form/Radio.js +0 -10
- package/dist/components/Form/Radio.stories.d.ts +0 -6
- package/dist/components/Form/Radio.stories.js +0 -13
- package/dist/components/Form/Select.js +0 -47
- package/dist/components/Form/Select.stories.d.ts +0 -11
- package/dist/components/Form/Select.stories.js +0 -69
- package/dist/components/Form/components/Toggle.js +0 -22
- package/dist/components/Form/index.js +0 -5
- package/dist/components/Heading/Heading.js +0 -9
- package/dist/components/Heading/Heading.stories.d.ts +0 -6
- package/dist/components/Heading/Heading.stories.js +0 -10
- package/dist/components/Heading/index.js +0 -1
- package/dist/components/Hint/Hint.js +0 -53
- package/dist/components/Hint/Hint.stories.d.ts +0 -12
- package/dist/components/Hint/Hint.stories.js +0 -52
- package/dist/components/Hint/index.js +0 -1
- package/dist/components/Icons/ThemedIcon.js +0 -25
- package/dist/components/Icons/common/BugReportIcon.js +0 -7
- package/dist/components/Icons/common/ChevronLeftIcon.js +0 -7
- package/dist/components/Icons/common/CloseIcon.js +0 -7
- package/dist/components/Icons/common/CollapseIcon.js +0 -7
- package/dist/components/Icons/common/CopyIcon.js +0 -7
- package/dist/components/Icons/common/InfoIcon.js +0 -8
- package/dist/components/Icons/common/OpenIcon.js +0 -7
- package/dist/components/Icons/common/ThemeIcon.js +0 -7
- package/dist/components/Icons/common/WarningIcon.js +0 -8
- package/dist/components/Icons/index.js +0 -25
- package/dist/components/Icons/wallet/BitcoinPublicKeyIcon.js +0 -8
- package/dist/components/Icons/wallet/LinkWalletIcon.js +0 -8
- package/dist/components/Icons/wallet/UsingInscriptionIcon.js +0 -8
- package/dist/components/List/List.js +0 -16
- package/dist/components/List/List.stories.d.ts +0 -12
- package/dist/components/List/List.stories.js +0 -81
- package/dist/components/List/StatItem.js +0 -24
- package/dist/components/List/components/ListItem.js +0 -6
- package/dist/components/List/index.js +0 -3
- package/dist/components/ListLegacy/ListLegacy.js +0 -16
- package/dist/components/ListLegacy/ListLegacy.stories.d.ts +0 -11
- package/dist/components/ListLegacy/ListLegacy.stories.js +0 -71
- package/dist/components/ListLegacy/components/ListItemLegacy.js +0 -6
- package/dist/components/ListLegacy/index.js +0 -2
- package/dist/components/Loader/Loader.js +0 -6
- package/dist/components/Loader/Loader.stories.d.ts +0 -6
- package/dist/components/Loader/Loader.stories.js +0 -11
- package/dist/components/Loader/index.js +0 -1
- package/dist/components/Menu/Menu.js +0 -29
- package/dist/components/Menu/Menu.stories.d.ts +0 -6
- package/dist/components/Menu/Menu.stories.js +0 -38
- package/dist/components/Menu/MenuContext.js +0 -9
- package/dist/components/Menu/MenuDrawer.js +0 -24
- package/dist/components/Menu/MenuItem.js +0 -27
- package/dist/components/Menu/SubMenu.js +0 -12
- package/dist/components/Menu/SubMenuItem.js +0 -6
- package/dist/components/Menu/index.js +0 -6
- package/dist/components/Popover/Popover.js +0 -16
- package/dist/components/Popover/Popover.stories.d.ts +0 -6
- package/dist/components/Popover/Popover.stories.js +0 -25
- package/dist/components/Popover/index.js +0 -1
- package/dist/components/Portal/Portal.js +0 -44
- package/dist/components/Portal/index.js +0 -1
- package/dist/components/Spacer/Spacer.js +0 -9
- package/dist/components/Spacer/index.js +0 -1
- package/dist/components/SubSection/SubSection.js +0 -4
- package/dist/components/SubSection/SubSection.stories.d.ts +0 -6
- package/dist/components/SubSection/SubSection.stories.js +0 -13
- package/dist/components/SubSection/index.js +0 -1
- package/dist/components/Table/Table.js +0 -43
- package/dist/components/Table/Table.stories.d.ts +0 -9
- package/dist/components/Table/Table.stories.js +0 -210
- package/dist/components/Table/components/Cell.js +0 -8
- package/dist/components/Table/components/Column.js +0 -19
- package/dist/components/Table/components/Row.js +0 -7
- package/dist/components/Table/index.js +0 -4
- package/dist/components/Table/types/index.js +0 -1
- package/dist/components/Text/Text.js +0 -11
- package/dist/components/Text/Text.stories.d.ts +0 -6
- package/dist/components/Text/Text.stories.js +0 -10
- package/dist/components/Text/index.js +0 -1
- package/dist/components/Toggle/Toggle.js +0 -12
- package/dist/components/Toggle/Toggle.stories.d.ts +0 -6
- package/dist/components/Toggle/Toggle.stories.js +0 -14
- package/dist/components/Toggle/index.js +0 -1
- package/dist/components/Warning/Warning.js +0 -7
- package/dist/components/Warning/Warning.stories.d.ts +0 -9
- package/dist/components/Warning/Warning.stories.js +0 -26
- package/dist/components/Warning/index.js +0 -1
- package/dist/components/index.js +0 -5
- package/dist/context/Dialog.context.js +0 -33
- package/dist/context/Table.context.js +0 -8
- package/dist/elements/FinalityProviderItem/FinalityProviderItem.js +0 -30
- package/dist/elements/FinalityProviderItem/FinalityProviderItem.stories.d.ts +0 -12
- package/dist/elements/FinalityProviderItem/FinalityProviderItem.stories.js +0 -97
- package/dist/elements/FinalityProviderItem/index.js +0 -1
- package/dist/elements/FinalityProviderLogo/FinalityProviderLogo.js +0 -24
- package/dist/elements/FinalityProviderLogo/FinalityProviderLogo.stories.d.ts +0 -13
- package/dist/elements/FinalityProviderLogo/FinalityProviderLogo.stories.js +0 -61
- package/dist/elements/FinalityProviderLogo/index.js +0 -1
- package/dist/elements/Icons/ChevronRightIcon.js +0 -2
- package/dist/elements/Icons/SettingsIcon.js +0 -2
- package/dist/elements/Icons/index.js +0 -2
- package/dist/elements/ProvidersList/ProvidersList.js +0 -9
- package/dist/elements/ProvidersList/ProvidersList.stories.d.ts +0 -10
- package/dist/elements/ProvidersList/ProvidersList.stories.js +0 -139
- package/dist/elements/ProvidersList/index.js +0 -1
- package/dist/elements/Table/Table.js +0 -14
- package/dist/elements/Table/Table.stories.d.ts +0 -8
- package/dist/elements/Table/Table.stories.js +0 -50
- package/dist/elements/Table/index.js +0 -1
- package/dist/hooks/index.js +0 -11
- package/dist/hooks/useClickOutside.js +0 -17
- package/dist/hooks/useControlledState.js +0 -13
- package/dist/hooks/useCopy.js +0 -43
- package/dist/hooks/useDrawerAnimation.js +0 -42
- package/dist/hooks/useFrozenColumns.js +0 -23
- package/dist/hooks/useIsMobile.js +0 -33
- package/dist/hooks/useMemoizedArray.js +0 -22
- package/dist/hooks/useModalManager.js +0 -28
- package/dist/hooks/useResizeObserver.js +0 -21
- package/dist/hooks/useTableScroll.js +0 -22
- package/dist/hooks/useTableSort.js +0 -46
- package/dist/index.js +0 -54
- package/dist/providers/CoreUIProvider.js +0 -9
- package/dist/tsconfig.lib.tsbuildinfo +0 -1
- package/dist/utils/constants.js +0 -4
- package/dist/utils/css.js +0 -6
- package/dist/utils/helpers.js +0 -110
- package/dist/utils/trim.js +0 -14
- package/dist/widgets/form/CheckboxField/CheckboxField.js +0 -7
- package/dist/widgets/form/CheckboxField/CheckboxField.stories.d.ts +0 -6
- package/dist/widgets/form/CheckboxField/CheckboxField.stories.js +0 -17
- package/dist/widgets/form/CheckboxField/index.js +0 -1
- package/dist/widgets/form/Form/Form.js +0 -20
- package/dist/widgets/form/Form/Form.stories.d.ts +0 -6
- package/dist/widgets/form/Form/Form.stories.js +0 -27
- package/dist/widgets/form/Form/index.js +0 -1
- package/dist/widgets/form/HiddenField/HiddenField.js +0 -13
- package/dist/widgets/form/HiddenField/HiddenField.stories.d.ts +0 -6
- package/dist/widgets/form/HiddenField/HiddenField.stories.js +0 -17
- package/dist/widgets/form/HiddenField/index.js +0 -1
- package/dist/widgets/form/NumberField/NumberField.js +0 -15
- package/dist/widgets/form/NumberField/NumberField.stories.d.ts +0 -6
- package/dist/widgets/form/NumberField/NumberField.stories.js +0 -31
- package/dist/widgets/form/NumberField/index.js +0 -1
- package/dist/widgets/form/RadioField/RadioField.js +0 -7
- package/dist/widgets/form/RadioField/RadioField.stories.d.ts +0 -6
- package/dist/widgets/form/RadioField/RadioField.stories.js +0 -14
- package/dist/widgets/form/RadioField/index.js +0 -1
- package/dist/widgets/form/SelectField/SelectField.js +0 -13
- package/dist/widgets/form/SelectField/SelectField.stories.d.ts +0 -6
- package/dist/widgets/form/SelectField/SelectField.stories.js +0 -33
- package/dist/widgets/form/SelectField/index.js +0 -1
- package/dist/widgets/form/TextField/TextField.js +0 -9
- package/dist/widgets/form/TextField/TextField.stories.d.ts +0 -6
- package/dist/widgets/form/TextField/TextField.stories.js +0 -28
- package/dist/widgets/form/TextField/index.js +0 -1
- package/dist/widgets/form/hooks.js +0 -29
- package/dist/widgets/form/types.js +0 -1
- package/dist/widgets/sections/ActivityCard/ActivityCard.js +0 -8
- package/dist/widgets/sections/ActivityCard/ActivityCard.stories.d.ts +0 -14
- package/dist/widgets/sections/ActivityCard/ActivityCard.stories.js +0 -265
- package/dist/widgets/sections/ActivityCard/components/ActivityCardActionSection.js +0 -5
- package/dist/widgets/sections/ActivityCard/components/ActivityCardAmountSection.js +0 -6
- package/dist/widgets/sections/ActivityCard/components/ActivityCardDetailsSection.js +0 -19
- package/dist/widgets/sections/ActivityCard/components/ActivityListItem.js +0 -5
- package/dist/widgets/sections/ActivityCard/index.js +0 -5
- package/dist/widgets/sections/AmountSubsection/AmountSubsection.js +0 -53
- package/dist/widgets/sections/AmountSubsection/AmountSubsection.stories.d.ts +0 -16
- package/dist/widgets/sections/AmountSubsection/AmountSubsection.stories.js +0 -230
- package/dist/widgets/sections/AmountSubsection/index.js +0 -1
- package/dist/widgets/sections/FeesSection/BBNFeeAmount.js +0 -7
- package/dist/widgets/sections/FeesSection/BTCFeeAmount.js +0 -19
- package/dist/widgets/sections/FeesSection/BTCFeeRate.js +0 -7
- package/dist/widgets/sections/FeesSection/FeesSection.js +0 -10
- package/dist/widgets/sections/FeesSection/FeesSection.stories.d.ts +0 -7
- package/dist/widgets/sections/FeesSection/FeesSection.stories.js +0 -18
- package/dist/widgets/sections/FeesSection/Total.js +0 -20
- package/dist/widgets/sections/FeesSection/index.js +0 -6
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.js +0 -9
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.stories.d.ts +0 -14
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.stories.js +0 -212
- package/dist/widgets/sections/FinalityProviderSubsection/index.js +0 -1
- package/dist/widgets/sections/PreviewModal/PreviewModal.js +0 -48
- package/dist/widgets/sections/PreviewModal/PreviewModal.stories.d.ts +0 -8
- package/dist/widgets/sections/PreviewModal/PreviewModal.stories.js +0 -115
- package/dist/widgets/sections/PreviewModal/index.js +0 -1
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.js +0 -15
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.stories.d.ts +0 -9
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.stories.js +0 -190
- package/dist/widgets/sections/RewardsPreviewModal/index.js +0 -1
- package/dist/widgets/sections/RewardsSubsection/RewardsSubsection.js +0 -13
- package/dist/widgets/sections/RewardsSubsection/RewardsSubsection.stories.d.ts +0 -8
- package/dist/widgets/sections/RewardsSubsection/RewardsSubsection.stories.js +0 -96
- package/dist/widgets/sections/RewardsSubsection/index.js +0 -1
- package/dist/widgets/sections/SettingMenu/SettingMenu.js +0 -18
- package/dist/widgets/sections/SettingMenu/SettingMenu.stories.d.ts +0 -6
- package/dist/widgets/sections/SettingMenu/SettingMenu.stories.js +0 -49
- package/dist/widgets/sections/SettingMenu/components/SettingMenuCustomContent.js +0 -2
- package/dist/widgets/sections/SettingMenu/components/SettingMenuDescription.js +0 -4
- package/dist/widgets/sections/SettingMenu/components/SettingMenuGroup.js +0 -15
- package/dist/widgets/sections/SettingMenu/components/SettingMenuItem.js +0 -13
- package/dist/widgets/sections/SettingMenu/components/SettingMenuSubMenu.js +0 -14
- package/dist/widgets/sections/SettingMenu/components/SettingMenuTitle.js +0 -4
- package/dist/widgets/sections/SettingMenu/components/index.js +0 -6
- package/dist/widgets/sections/SettingMenu/index.js +0 -7
- package/dist/widgets/sections/TableElement/TableElement.js +0 -6
- package/dist/widgets/sections/TableElement/TableElement.stories.d.ts +0 -9
- package/dist/widgets/sections/TableElement/TableElement.stories.js +0 -54
- package/dist/widgets/sections/TableElement/index.js +0 -1
- package/dist/widgets/sections/UnbondingModal/UnbondingModal.js +0 -18
- package/dist/widgets/sections/UnbondingModal/UnbondingModal.stories.d.ts +0 -7
- package/dist/widgets/sections/UnbondingModal/UnbondingModal.stories.js +0 -81
- package/dist/widgets/sections/UnbondingModal/index.js +0 -1
- package/dist/widgets/sections/ValidatorSelector/ValidatorSelector.js +0 -34
- package/dist/widgets/sections/ValidatorSelector/ValidatorSelector.stories.d.ts +0 -6
- package/dist/widgets/sections/ValidatorSelector/ValidatorSelector.stories.js +0 -52
- package/dist/widgets/sections/ValidatorSelector/index.js +0 -1
- package/dist/widgets/sections/WalletMenu/WalletMenu.js +0 -33
- package/dist/widgets/sections/WalletMenu/WalletMenu.stories.d.ts +0 -7
- package/dist/widgets/sections/WalletMenu/WalletMenu.stories.js +0 -70
- package/dist/widgets/sections/WalletMenu/components/WalletMenuCard.js +0 -32
- package/dist/widgets/sections/WalletMenu/components/WalletMenuInfoItem.js +0 -8
- package/dist/widgets/sections/WalletMenu/components/WalletMenuSettingItem.js +0 -8
- package/dist/widgets/sections/WalletMenu/components/WalletToggle.js +0 -12
- package/dist/widgets/sections/WalletMenu/components/index.js +0 -4
- package/dist/widgets/sections/WalletMenu/index.js +0 -5
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { UnbondingModal } from "./UnbondingModal";
|
|
4
|
-
import { ScrollLocker } from "@/context/Dialog.context";
|
|
5
|
-
import { Button } from "@/components/Button";
|
|
6
|
-
const meta = {
|
|
7
|
-
component: UnbondingModal,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
export const Default = {
|
|
12
|
-
args: {
|
|
13
|
-
reward: {
|
|
14
|
-
amount: "",
|
|
15
|
-
currencyIcon: "/images/fps/lombard.jpeg",
|
|
16
|
-
currencyName: "BTC",
|
|
17
|
-
placeholder: "Enter Amount",
|
|
18
|
-
displayBalance: true,
|
|
19
|
-
balanceDetails: {
|
|
20
|
-
balance: "1.5",
|
|
21
|
-
symbol: "BTC",
|
|
22
|
-
price: 65000,
|
|
23
|
-
displayUSD: true,
|
|
24
|
-
decimals: 8,
|
|
25
|
-
},
|
|
26
|
-
min: "0",
|
|
27
|
-
step: "any",
|
|
28
|
-
chainName: "Bitcoin Network",
|
|
29
|
-
stakedAmount: "1.2",
|
|
30
|
-
stakedTokenName: "BTC",
|
|
31
|
-
},
|
|
32
|
-
amountUsd: "$0.00",
|
|
33
|
-
warningText: "Once the unstaking period begins:\n• You will not receive staking rewards\n• It will take 50 hours for the amount to be liquid\n• But you will be able to cancel the unstaking process anytime, as this chain currently supports the function",
|
|
34
|
-
actionButtonText: "Unbond",
|
|
35
|
-
onActionClick: () => alert("Unbond clicked!"),
|
|
36
|
-
},
|
|
37
|
-
render: (props) => {
|
|
38
|
-
const [visible, setVisibility] = useState(false);
|
|
39
|
-
return (_jsxs(ScrollLocker, { children: [_jsx(Button, { onClick: () => {
|
|
40
|
-
setVisibility(true);
|
|
41
|
-
}, children: "Open Unbonding Modal" }), _jsx(UnbondingModal, { reward: props.reward, amountUsd: props.amountUsd, warningText: props.warningText, actionButtonText: props.actionButtonText, onActionClick: props.onActionClick, open: visible, onClose: () => {
|
|
42
|
-
setVisibility(false);
|
|
43
|
-
} })] }));
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
export const BABYUnbonding = {
|
|
47
|
-
args: {
|
|
48
|
-
title: "Unbond Babylon Labs 0",
|
|
49
|
-
description: "Choose how much BABY you'd like to unbond from your current delegation.\nUnbonded tokens will enter a waiting period before they become available to withdraw. Your remaining stake will continue earning rewards.",
|
|
50
|
-
reward: {
|
|
51
|
-
amount: "",
|
|
52
|
-
currencyIcon: "/images/fps/lombard.jpeg",
|
|
53
|
-
currencyName: "BABY",
|
|
54
|
-
placeholder: "Enter Amount",
|
|
55
|
-
displayBalance: true,
|
|
56
|
-
balanceDetails: {
|
|
57
|
-
balance: "1000",
|
|
58
|
-
symbol: "BABY",
|
|
59
|
-
price: 0.05,
|
|
60
|
-
displayUSD: true,
|
|
61
|
-
decimals: 18,
|
|
62
|
-
},
|
|
63
|
-
min: "0",
|
|
64
|
-
step: "any",
|
|
65
|
-
stakedAmount: "30",
|
|
66
|
-
stakedTokenName: "BABY",
|
|
67
|
-
},
|
|
68
|
-
amountUsd: "$0.00",
|
|
69
|
-
warningText: "Once the unstaking period begins:\n• You will not receive staking rewards\n• It will take 50 hours for the amount to be liquid\n• But you will be able to cancel the unstaking process anytime, as this chain currently supports the function",
|
|
70
|
-
actionButtonText: "Unbond BABY",
|
|
71
|
-
onActionClick: () => alert("Unbond BABY clicked!"),
|
|
72
|
-
},
|
|
73
|
-
render: (props) => {
|
|
74
|
-
const [visible, setVisibility] = useState(false);
|
|
75
|
-
return (_jsxs(ScrollLocker, { children: [_jsx(Button, { onClick: () => {
|
|
76
|
-
setVisibility(true);
|
|
77
|
-
}, children: "Open Unbonding Modal with Title & Description" }), _jsx(UnbondingModal, { title: props.title, description: props.description, reward: props.reward, amountUsd: props.amountUsd, warningText: props.warningText, actionButtonText: props.actionButtonText, onActionClick: props.onActionClick, open: visible, onClose: () => {
|
|
78
|
-
setVisibility(false);
|
|
79
|
-
} })] }));
|
|
80
|
-
},
|
|
81
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { UnbondingModal } from "./UnbondingModal";
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Dialog, MobileDialog, DialogBody, DialogHeader } from "@/components/Dialog";
|
|
3
|
-
import { Table } from "@/components/Table";
|
|
4
|
-
import { Input } from "@/components/Form/Input";
|
|
5
|
-
import { Text } from "@/components/Text";
|
|
6
|
-
import { WINDOW_BREAKPOINT, MAX_WINDOW_HEIGHT } from "../../../utils/constants";
|
|
7
|
-
import { useIsMobile } from "@/hooks/useIsMobile";
|
|
8
|
-
import { useState, useMemo } from "react";
|
|
9
|
-
import { twMerge } from "tailwind-merge";
|
|
10
|
-
import { MdCancel } from "react-icons/md";
|
|
11
|
-
import { RiSearchLine } from "react-icons/ri";
|
|
12
|
-
function ResponsiveDialog({ className, ...restProps }) {
|
|
13
|
-
const isMobileView = useIsMobile(WINDOW_BREAKPOINT);
|
|
14
|
-
const DialogComponent = isMobileView ? MobileDialog : Dialog;
|
|
15
|
-
return _jsx(DialogComponent, { ...restProps, className: twMerge("w-[41.25rem] max-w-full", className) });
|
|
16
|
-
}
|
|
17
|
-
export const ValidatorSelector = ({ open, validators, columns, onClose, onSelect, title = "", description, }) => {
|
|
18
|
-
const [searchTerm, setSearchTerm] = useState("");
|
|
19
|
-
const onClearSearch = () => {
|
|
20
|
-
setSearchTerm("");
|
|
21
|
-
};
|
|
22
|
-
const searchPrefix = searchTerm ? (_jsx("button", { onClick: onClearSearch, className: "opacity-60 hover:opacity-100 transition-opacity", children: _jsx(MdCancel, { size: 18, className: "text-secondary-strokeDark" }) })) : (_jsx("span", { className: "text-secondary-strokeDark", children: _jsx(RiSearchLine, { size: 20 }) }));
|
|
23
|
-
const filteredValidators = useMemo(() => {
|
|
24
|
-
if (!searchTerm.trim())
|
|
25
|
-
return validators;
|
|
26
|
-
return validators.filter((validator) => validator.name.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
27
|
-
}, [validators, searchTerm]);
|
|
28
|
-
return (_jsxs(ResponsiveDialog, { open: open, onClose: onClose, children: [_jsx(DialogHeader, { title: title, onClose: onClose, className: "text-accent-primary" }), _jsxs(DialogBody, { style: { maxHeight: MAX_WINDOW_HEIGHT }, className: "no-scrollbar mt-4 flex flex-col gap-6 overflow-y-auto text-accent-primary", children: [description && (_jsx("div", { children: _jsx(Text, { variant: "body2", className: "text-accent-secondary", children: description }) })), _jsx("div", { children: _jsx(Input, { placeholder: "Search", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), prefix: searchPrefix, className: "w-full" }) }), _jsx(Table, { data: filteredValidators, columns: columns, className: "w-full", wrapperClassName: "w-full", onRowSelect: (row) => {
|
|
29
|
-
if (row) {
|
|
30
|
-
onSelect(row);
|
|
31
|
-
onClose();
|
|
32
|
-
}
|
|
33
|
-
} })] })] }));
|
|
34
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ValidatorSelector } from "./ValidatorSelector";
|
|
3
|
-
import { FinalityProviderLogo } from "@/elements/FinalityProviderLogo";
|
|
4
|
-
const sampleValidators = Array.from({ length: 15 }, (_, i) => {
|
|
5
|
-
const index = i + 1;
|
|
6
|
-
return {
|
|
7
|
-
id: index,
|
|
8
|
-
icon: (_jsx(FinalityProviderLogo, { rank: index, moniker: `V${index}`, size: "sm" })),
|
|
9
|
-
name: `Validator ${index}`,
|
|
10
|
-
apr: `${25 + (index % 6)}.${(index * 7) % 100}`.padEnd(6, "0") + "%", // simple varied APR
|
|
11
|
-
votingPower: `${(Math.random() * 1).toFixed(6)} sBTC`,
|
|
12
|
-
commission: `${2 + (index % 5)}%`,
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
|
-
const columns = [
|
|
16
|
-
{
|
|
17
|
-
key: "name",
|
|
18
|
-
header: "Validator",
|
|
19
|
-
sorter: (a, b) => a.name.localeCompare(b.name),
|
|
20
|
-
render: (_value, row) => (_jsxs("div", { className: "flex items-center gap-2", children: [row.icon, _jsx("span", { children: row.name })] })),
|
|
21
|
-
},
|
|
22
|
-
{ key: "apr", header: "Expected APR" },
|
|
23
|
-
{
|
|
24
|
-
key: "votingPower",
|
|
25
|
-
header: "Voting Power",
|
|
26
|
-
sorter: (a, b) => {
|
|
27
|
-
const parse = (str) => parseFloat(str.split(" ")[0]);
|
|
28
|
-
return parse(a.votingPower) - parse(b.votingPower);
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
key: "commission",
|
|
33
|
-
header: "Commission",
|
|
34
|
-
sorter: (a, b) => parseFloat(a.commission) - parseFloat(b.commission),
|
|
35
|
-
},
|
|
36
|
-
];
|
|
37
|
-
const meta = {
|
|
38
|
-
component: ValidatorSelector,
|
|
39
|
-
tags: ["autodocs"],
|
|
40
|
-
};
|
|
41
|
-
export default meta;
|
|
42
|
-
export const Default = {
|
|
43
|
-
args: {
|
|
44
|
-
open: true,
|
|
45
|
-
validators: sampleValidators,
|
|
46
|
-
columns,
|
|
47
|
-
title: "Select Validator",
|
|
48
|
-
description: "Validators are responsible for verifying transactions, proposing and confirming new blocks, and helping maintain the security and consensus of Babylon Genesis.",
|
|
49
|
-
onClose: () => { },
|
|
50
|
-
onSelect: (validator) => alert(`Selected ${validator.name}`),
|
|
51
|
-
},
|
|
52
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ValidatorSelector } from "./ValidatorSelector";
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useCallback } from "react";
|
|
3
|
-
import { Menu } from "../../../components/Menu";
|
|
4
|
-
import { WalletDisconnectButton } from "../../../components/Button";
|
|
5
|
-
import { WalletMenuCard } from "./components/WalletMenuCard";
|
|
6
|
-
import { WalletMenuSettingItem } from "./components/WalletMenuSettingItem";
|
|
7
|
-
import { WalletMenuInfoItem } from "./components/WalletMenuInfoItem";
|
|
8
|
-
import { UsingInscriptionIcon, LinkWalletIcon, BitcoinPublicKeyIcon, InfoIcon } from "../../../components/Icons";
|
|
9
|
-
import { ThemedIcon } from "../../../components/Icons/ThemedIcon";
|
|
10
|
-
import { useCopy } from "../../../hooks/useCopy";
|
|
11
|
-
import { twJoin } from "tailwind-merge";
|
|
12
|
-
export const WalletMenu = ({ trigger, btcAddress, bbnAddress, selectedWallets, ordinalsExcluded, linkedDelegationsVisibility, onIncludeOrdinals, onExcludeOrdinals, onDisplayLinkedDelegations, publicKeyNoCoord, onDisconnect, forceOpen = false, onOpenChange, btcBalances, bbnBalances, btcCoinSymbol, bbnCoinSymbol, balancesLoading = false, hasUnconfirmedTransactions = false, formatBalance, className, mobileMode = "dialog", copy, }) => {
|
|
13
|
-
const { copyToClipboard: internalCopy, isCopied: internalIsCopied } = useCopy({ timeout: copy?.timeout });
|
|
14
|
-
const isCopied = copy?.isCopied ?? internalIsCopied;
|
|
15
|
-
const copyToClipboard = copy?.copyToClipboard ?? internalCopy;
|
|
16
|
-
const [isOpen, setIsOpen] = useState(forceOpen);
|
|
17
|
-
const handleOpenChange = useCallback((open) => {
|
|
18
|
-
setIsOpen(open);
|
|
19
|
-
onOpenChange?.(open);
|
|
20
|
-
}, [onOpenChange]);
|
|
21
|
-
const handleDisconnect = useCallback(() => {
|
|
22
|
-
setIsOpen(false);
|
|
23
|
-
onDisconnect();
|
|
24
|
-
}, [onDisconnect]);
|
|
25
|
-
const createFormatBalance = (coinSymbol) => {
|
|
26
|
-
if (!formatBalance || !coinSymbol)
|
|
27
|
-
return undefined;
|
|
28
|
-
return (amount) => formatBalance(amount, coinSymbol);
|
|
29
|
-
};
|
|
30
|
-
const btcSymbol = btcCoinSymbol || "BTC";
|
|
31
|
-
const bbnSymbol = bbnCoinSymbol || "BABY";
|
|
32
|
-
return (_jsx(Menu, { trigger: trigger, open: isOpen, onOpenChange: handleOpenChange, mobileMode: mobileMode, className: twJoin("shadow-lg border border-[#38708533] bg-[#FFFFFF] dark:bg-[#252525] dark:border-[#404040] rounded-lg", className), children: _jsxs("div", { className: "p-4 space-y-6 w-full text-primary-main", children: [_jsxs("div", { className: "flex flex-row gap-2 w-full md:flex-col", children: [btcAddress && (_jsx(WalletMenuCard, { walletType: "Bitcoin", walletName: selectedWallets["BTC"]?.name, walletIcon: selectedWallets["BTC"]?.icon, address: btcAddress, isCopied: isCopied("btc"), onCopy: () => copyToClipboard("btc", btcAddress), balances: btcBalances, coinSymbol: btcSymbol, isBalanceLoading: balancesLoading, hasUnconfirmedTransactions: hasUnconfirmedTransactions, formatBalance: createFormatBalance(btcSymbol) })), _jsx(WalletMenuCard, { walletType: "Babylon", walletName: selectedWallets["BBN"]?.name, walletIcon: selectedWallets["BBN"]?.icon, address: bbnAddress, isCopied: isCopied("bbn"), onCopy: () => copyToClipboard("bbn", bbnAddress), balances: bbnBalances, coinSymbol: bbnSymbol, isBalanceLoading: balancesLoading, formatBalance: createFormatBalance(bbnSymbol) })] }), _jsxs("div", { className: "flex flex-col w-full bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-lg md:bg-transparent md:dark:bg-transparent md:border-none md:gap-8", children: [_jsx(WalletMenuSettingItem, { icon: _jsx(ThemedIcon, { variant: "primary", background: true, rounded: true, children: _jsx(UsingInscriptionIcon, {}) }), title: "Using Inscriptions", status: ordinalsExcluded ? "Off" : "On", value: !ordinalsExcluded, onChange: (value) => value ? onIncludeOrdinals() : onExcludeOrdinals() }), _jsx(WalletMenuSettingItem, { icon: _jsx(ThemedIcon, { variant: "primary", background: true, rounded: true, children: _jsx(LinkWalletIcon, {}) }), title: _jsxs(_Fragment, { children: ["Linked Wallet", _jsx("br", { className: "hidden md:block" }), _jsx("span", { className: "md:hidden", children: " " }), "Stakes"] }), status: linkedDelegationsVisibility ? "On" : "Off", value: linkedDelegationsVisibility, onChange: onDisplayLinkedDelegations, tooltip: "Linked Wallet Stakes show all stakes created with the same Bitcoin wallet, even if different BABY wallets were used. It helps you track and manage them in one place.", infoIcon: _jsx(InfoIcon, { size: 14, variant: "secondary" }) }), _jsx(WalletMenuInfoItem, { title: "Bitcoin Public Key", value: publicKeyNoCoord, isCopied: isCopied("publicKey"), onCopy: () => copyToClipboard("publicKey", publicKeyNoCoord), icon: _jsx(ThemedIcon, { variant: "primary", background: true, rounded: true, children: _jsx(BitcoinPublicKeyIcon, {}) }), className: "rounded-b-lg rounded-t-none md:rounded-none" })] }), _jsx("div", { className: "pt-2", children: _jsx(WalletDisconnectButton, { onClick: handleDisconnect, fluid: true, children: "Disconnect Wallets" }) })] }) }));
|
|
33
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { WalletMenu } from "./WalletMenu";
|
|
3
|
-
declare const meta: Meta<typeof WalletMenu>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const WithoutBitcoin: Story;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { WalletMenu } from "./WalletMenu";
|
|
4
|
-
import { AvatarGroup, Avatar } from "../../../components/Avatar";
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "Widgets/sections/WalletMenu",
|
|
7
|
-
component: WalletMenu,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
// Example wallet data
|
|
12
|
-
const mockWalletData = {
|
|
13
|
-
btcAddress: "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
|
|
14
|
-
bbnAddress: "bbn1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
|
|
15
|
-
selectedWallets: {
|
|
16
|
-
BTC: {
|
|
17
|
-
name: "Binance Wallet",
|
|
18
|
-
icon: "/images/wallets/binance.webp",
|
|
19
|
-
},
|
|
20
|
-
BBN: {
|
|
21
|
-
name: "Binance Wallet",
|
|
22
|
-
icon: "/images/wallets/binance.webp",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
publicKeyNoCoord: "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
|
|
26
|
-
btcBalances: {
|
|
27
|
-
staked: 0.15,
|
|
28
|
-
stakable: 0.85,
|
|
29
|
-
available: 1.0,
|
|
30
|
-
total: 1.05,
|
|
31
|
-
inscriptions: 0.05,
|
|
32
|
-
},
|
|
33
|
-
bbnBalances: {
|
|
34
|
-
available: 250.5,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
export const Default = {
|
|
38
|
-
render: () => {
|
|
39
|
-
const [ordinalsExcluded, setOrdinalsExcluded] = useState(false);
|
|
40
|
-
const [linkedDelegationsVisibility, setLinkedDelegationsVisibility] = useState(true);
|
|
41
|
-
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
42
|
-
const [balancesLoading, setBalancesLoading] = useState(false);
|
|
43
|
-
const [hasUnconfirmedTx, setHasUnconfirmedTx] = useState(false);
|
|
44
|
-
const trigger = (_jsx("div", { className: "cursor-pointer", children: _jsxs(AvatarGroup, { max: 2, variant: "circular", children: [_jsx(Avatar, { alt: mockWalletData.selectedWallets.BTC.name, url: mockWalletData.selectedWallets.BTC.icon, size: "large", className: `object-contain bg-accent-contrast box-content ${isMenuOpen ? "outline outline-[2px] outline-accent-primary" : ""}` }), _jsx(Avatar, { alt: mockWalletData.selectedWallets.BBN.name, url: mockWalletData.selectedWallets.BBN.icon, size: "large", className: `object-contain bg-accent-contrast box-content ${isMenuOpen ? "outline outline-[2px] outline-accent-primary" : ""}` })] }) }));
|
|
45
|
-
const customFormatBalance = (amount, coinSymbol) => {
|
|
46
|
-
return `${amount.toLocaleString(undefined, {
|
|
47
|
-
minimumFractionDigits: 2,
|
|
48
|
-
maximumFractionDigits: 8,
|
|
49
|
-
})} ${coinSymbol}`;
|
|
50
|
-
};
|
|
51
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx(WalletMenu, { trigger: trigger, btcAddress: mockWalletData.btcAddress, bbnAddress: mockWalletData.bbnAddress, selectedWallets: mockWalletData.selectedWallets, ordinalsExcluded: ordinalsExcluded, linkedDelegationsVisibility: linkedDelegationsVisibility, onIncludeOrdinals: () => setOrdinalsExcluded(false), onExcludeOrdinals: () => setOrdinalsExcluded(true), onDisplayLinkedDelegations: setLinkedDelegationsVisibility, publicKeyNoCoord: mockWalletData.publicKeyNoCoord, onDisconnect: () => console.log("Disconnect wallets"), onOpenChange: setIsMenuOpen, btcBalances: mockWalletData.btcBalances, bbnBalances: mockWalletData.bbnBalances, btcCoinSymbol: "BTC", bbnCoinSymbol: "BABY", balancesLoading: balancesLoading, hasUnconfirmedTransactions: hasUnconfirmedTx, formatBalance: customFormatBalance }), _jsxs("div", { className: "flex flex-col gap-4 p-4 border border-gray-300 rounded-lg max-w-md", children: [_jsx("h4", { className: "font-semibold", children: "State Controls" }), _jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "checkbox", checked: balancesLoading, onChange: (e) => setBalancesLoading(e.target.checked) }), "Loading State"] }), _jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "checkbox", checked: hasUnconfirmedTx, onChange: (e) => setHasUnconfirmedTx(e.target.checked) }), "Has Unconfirmed Transactions (BTC only)"] })] })] }));
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
export const WithoutBitcoin = {
|
|
55
|
-
render: () => {
|
|
56
|
-
const [ordinalsExcluded, setOrdinalsExcluded] = useState(false);
|
|
57
|
-
const [linkedDelegationsVisibility, setLinkedDelegationsVisibility] = useState(true);
|
|
58
|
-
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
59
|
-
const [balancesLoading, setBalancesLoading] = useState(false);
|
|
60
|
-
const [hasUnconfirmedTx, setHasUnconfirmedTx] = useState(false);
|
|
61
|
-
const trigger = (_jsx("div", { className: "cursor-pointer", children: _jsx(AvatarGroup, { max: 1, variant: "circular", children: _jsx(Avatar, { alt: mockWalletData.selectedWallets.BBN.name, url: mockWalletData.selectedWallets.BBN.icon, size: "large", className: `object-contain bg-accent-contrast box-content ${isMenuOpen ? "outline outline-[2px] outline-accent-primary" : ""}` }) }) }));
|
|
62
|
-
const customFormatBalance = (amount, coinSymbol) => {
|
|
63
|
-
return `${amount.toLocaleString(undefined, {
|
|
64
|
-
minimumFractionDigits: 2,
|
|
65
|
-
maximumFractionDigits: 8,
|
|
66
|
-
})} ${coinSymbol}`;
|
|
67
|
-
};
|
|
68
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx(WalletMenu, { trigger: trigger, btcAddress: "", bbnAddress: mockWalletData.bbnAddress, selectedWallets: mockWalletData.selectedWallets, ordinalsExcluded: ordinalsExcluded, linkedDelegationsVisibility: linkedDelegationsVisibility, onIncludeOrdinals: () => setOrdinalsExcluded(false), onExcludeOrdinals: () => setOrdinalsExcluded(true), onDisplayLinkedDelegations: setLinkedDelegationsVisibility, publicKeyNoCoord: mockWalletData.publicKeyNoCoord, onDisconnect: () => console.log("Disconnect wallets"), onOpenChange: setIsMenuOpen, bbnBalances: mockWalletData.bbnBalances, btcCoinSymbol: "BTC", bbnCoinSymbol: "BABY", balancesLoading: balancesLoading, hasUnconfirmedTransactions: hasUnconfirmedTx, formatBalance: customFormatBalance }), _jsxs("div", { className: "flex flex-col gap-4 p-4 border border-gray-300 rounded-lg max-w-md", children: [_jsx("h4", { className: "font-semibold", children: "State Controls" }), _jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "checkbox", checked: balancesLoading, onChange: (e) => setBalancesLoading(e.target.checked) }), "Loading State"] }), _jsxs("label", { className: "flex items-center gap-2", children: [_jsx("input", { type: "checkbox", checked: hasUnconfirmedTx, onChange: (e) => setHasUnconfirmedTx(e.target.checked) }), "Has Unconfirmed Transactions (BTC only)"] })] })] }));
|
|
69
|
-
},
|
|
70
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Avatar } from '../../../../components/Avatar';
|
|
3
|
-
import { Text } from '../../../../components/Text';
|
|
4
|
-
import { DisplayHash } from '../../../../components/DisplayHash';
|
|
5
|
-
import { CopyIcon } from '../../../../components/Icons';
|
|
6
|
-
import { Loader } from '../../../../components/Loader';
|
|
7
|
-
import { twJoin } from 'tailwind-merge';
|
|
8
|
-
import { formatCryptoBalance } from '../../../../utils/helpers';
|
|
9
|
-
export const WalletMenuCard = ({ walletType, walletName, walletIcon, address, isCopied, onCopy, className, balances, coinSymbol, isBalanceLoading: loading = false, hasUnconfirmedTransactions = false, formatBalance, }) => {
|
|
10
|
-
// Default balance formatter
|
|
11
|
-
const defaultFormatBalance = (amount) => {
|
|
12
|
-
if (!coinSymbol)
|
|
13
|
-
return amount.toString();
|
|
14
|
-
return formatCryptoBalance(amount, coinSymbol);
|
|
15
|
-
};
|
|
16
|
-
const formatBalanceFn = formatBalance || defaultFormatBalance;
|
|
17
|
-
// Render balance value with loading state
|
|
18
|
-
const renderBalanceValue = (value, showLoader = false) => {
|
|
19
|
-
if (loading || showLoader) {
|
|
20
|
-
return _jsx(Loader, { size: 20, className: "text-accent-primary" });
|
|
21
|
-
}
|
|
22
|
-
if (value === undefined) {
|
|
23
|
-
return _jsx(Text, { className: "text-accent-secondary text-sm", children: "N/A" });
|
|
24
|
-
}
|
|
25
|
-
return (_jsx(Text, { variant: "body1", className: "text-accent-primary !text-sm", children: formatBalanceFn(value) }));
|
|
26
|
-
};
|
|
27
|
-
// Render Bitcoin-specific balance sections
|
|
28
|
-
const renderBitcoinBalances = () => (_jsxs(_Fragment, { children: [balances?.staked !== undefined && (_jsxs("div", { className: "flex flex-col mb-1", children: [_jsx(Text, { variant: "body1", className: "text-accent-secondary font-medium !text-xs", children: "Staked Balance" }), renderBalanceValue(balances.staked)] })), balances?.stakable !== undefined && (_jsxs("div", { className: "flex flex-col", children: [_jsx(Text, { variant: "body1", className: "text-accent-secondary font-medium !text-xs", children: "Stakable Balance" }), _jsx("div", { className: "flex items-center gap-2", children: renderBalanceValue(balances.stakable, loading || hasUnconfirmedTransactions) })] }))] }));
|
|
29
|
-
// Render Babylon-specific balance sections
|
|
30
|
-
const renderBabylonBalances = () => (_jsx(_Fragment, { children: balances?.available !== undefined && (_jsxs("div", { className: "flex flex-col", children: [_jsx(Text, { variant: "body1", className: "text-accent-secondary font-medium !text-xs", children: "Balance" }), renderBalanceValue(balances.available)] })) }));
|
|
31
|
-
return (_jsx("div", { className: twJoin("bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-[4px] p-3 flex-1 md:p-4", className), children: _jsxs("div", { className: "flex flex-col w-full", children: [_jsxs("div", { className: "flex items-center gap-2.5 mb-2 md:mb-3", children: [_jsx(Avatar, { alt: walletName || walletType, url: walletIcon || '', size: "large", className: "w-8 h-8 md:w-10 md:h-10 flex-shrink-0" }), _jsxs("div", { className: "flex flex-1 flex-col items-start min-w-0", children: [_jsxs(Text, { variant: "body1", className: "text-accent-primary font-medium text-xs", children: [walletType, " Wallet"] }), _jsxs("div", { className: "flex items-center gap-1", children: [isCopied ? (_jsx(Text, { className: "text-accent-secondary text-xs", children: "Copied \u2713" })) : (_jsx(DisplayHash, { className: "text-accent-secondary text-xs", value: address, symbols: 6 })), _jsx("button", { onClick: onCopy, className: "flex-shrink-0 p-1 rounded hover:bg-[#d7e1e7] dark:hover:bg-[#252525] transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80", children: _jsx(CopyIcon, { size: 14, className: "md:w-4 md:h-4" }) })] })] })] }), balances && coinSymbol && (_jsx("div", { className: "space-y-2", children: walletType === 'Bitcoin' ? renderBitcoinBalances() : renderBabylonBalances() }))] }) }));
|
|
32
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Text } from '../../../../components/Text';
|
|
3
|
-
import { DisplayHash } from '../../../../components/DisplayHash';
|
|
4
|
-
import { CopyIcon } from '../../../../components/Icons';
|
|
5
|
-
import { twJoin } from 'tailwind-merge';
|
|
6
|
-
export const WalletMenuInfoItem = ({ title, value, isCopied, onCopy, className, icon, }) => {
|
|
7
|
-
return (_jsx("div", { className: twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0", className), children: _jsx("div", { className: "flex flex-col w-full", children: _jsxs("div", { className: "flex items-center gap-4", children: [icon && (_jsx("div", { className: "flex-shrink-0", children: icon })), _jsxs("div", { className: "flex w-full", children: [_jsxs("div", { className: "flex flex-col w-full", children: [_jsx(Text, { variant: "body2", className: "text-accent-primary font-medium text-sm", children: title }), _jsx("div", { className: "flex items-center justify-between w-full", children: _jsx("div", { className: "flex-1 min-w-0", children: isCopied ? (_jsx(Text, { className: "text-accent-secondary !text-xs truncate whitespace-nowrap", children: "Copied \u2713" })) : (_jsx(DisplayHash, { className: "text-accent-secondary !text-xs", value: value, symbols: 6 })) }) })] }), _jsx("button", { onClick: onCopy, className: "flex-shrink-0 ml-3 p-1 rounded hover:bg-surface-tertiary transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80 self-center", children: _jsx(CopyIcon, { size: 16 }) })] })] }) }) }));
|
|
8
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Text } from '../../../../components/Text';
|
|
3
|
-
import { Hint } from '../../../../components/Hint';
|
|
4
|
-
import { WalletToggle } from './WalletToggle';
|
|
5
|
-
import { twJoin } from 'tailwind-merge';
|
|
6
|
-
export const WalletMenuSettingItem = ({ icon, title, status, value, onChange, className, tooltip, infoIcon, }) => {
|
|
7
|
-
return (_jsxs("div", { className: twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0", className), children: [_jsxs("div", { className: "flex items-center gap-4", children: [icon, _jsxs("div", { className: "flex flex-col", children: [infoIcon && tooltip ? (_jsxs(Text, { as: "span", variant: "body2", className: "text-accent-primary font-medium", children: [title, _jsx(Hint, { tooltip: tooltip, placement: "bottom", attachToChildren: true, offset: [20, 8], children: _jsx("span", { className: "inline-block align-middle text-secondary-strokeDark cursor-pointer ml-1", children: infoIcon }) })] })) : (_jsx(Hint, { tooltip: tooltip, attachToChildren: !!tooltip, placement: "bottom", children: _jsx(Text, { as: "span", variant: "body2", className: "text-accent-primary font-medium", children: title }) })), _jsx(Text, { className: "text-accent-secondary !text-xs", children: status })] })] }), _jsx(WalletToggle, { value: value, onChange: onChange })] }));
|
|
8
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from 'tailwind-merge';
|
|
3
|
-
export const WalletToggle = ({ value, onChange, className = '', disabled = false, }) => {
|
|
4
|
-
const handleClick = () => {
|
|
5
|
-
if (!disabled) {
|
|
6
|
-
onChange(!value);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
return (_jsx("button", { type: "button", onClick: handleClick, disabled: disabled, className: twJoin('relative inline-flex h-[31px] w-[55px] items-center rounded-full transition-colors duration-300 ease-in-out', 'focus:outline-none focus:ring-2 focus:ring-primary-main focus:ring-offset-2', value ? 'bg-primary-main dark:bg-primary-light' : 'bg-[#78788029]', disabled && 'opacity-50 cursor-not-allowed', className), style: {
|
|
10
|
-
border: 'none',
|
|
11
|
-
}, "aria-pressed": value, "aria-label": "Toggle", children: _jsx("span", { className: twJoin('inline-block w-[27px] h-[27px] transform rounded-full bg-white transition-transform duration-300 ease-in-out', 'flex items-center justify-center shadow-sm', value ? 'translate-x-[26px]' : 'translate-x-[2px]') }) }));
|
|
12
|
-
};
|