@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,190 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { RewardsPreviewModal } from "./RewardsPreviewModal";
|
|
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: RewardsPreviewModal,
|
|
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
|
-
tokens: [
|
|
16
|
-
{
|
|
17
|
-
icon: _jsx(PlaceholderIcon, { text: "B1", bgColor: "bg-black" }),
|
|
18
|
-
name: "Babylon Genesis",
|
|
19
|
-
amount: {
|
|
20
|
-
token: "1000 BABY",
|
|
21
|
-
usd: "~ $5,677.39 USD",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
icon: _jsx(PlaceholderIcon, { text: "C", bgColor: "bg-blue-500" }),
|
|
26
|
-
name: "Cosmos",
|
|
27
|
-
amount: {
|
|
28
|
-
token: "500 ATOM",
|
|
29
|
-
usd: "~ $2,621.78 USD",
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "Sui",
|
|
34
|
-
amount: {
|
|
35
|
-
token: "100 SUI",
|
|
36
|
-
usd: "~ $399.79 USD",
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
transactionFees: {
|
|
41
|
-
token: "10 BABY",
|
|
42
|
-
usd: "$0.56 USD",
|
|
43
|
-
},
|
|
44
|
-
title: "Claim Rewards",
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
export const OneReceivingToken = {
|
|
48
|
-
args: {
|
|
49
|
-
open: true,
|
|
50
|
-
processing: false,
|
|
51
|
-
onClose: () => { },
|
|
52
|
-
onProceed: () => { },
|
|
53
|
-
tokens: [
|
|
54
|
-
{
|
|
55
|
-
icon: _jsx(PlaceholderIcon, { text: "B1", bgColor: "bg-black" }),
|
|
56
|
-
name: "Babylon Genesis",
|
|
57
|
-
amount: {
|
|
58
|
-
token: "1000 BABY",
|
|
59
|
-
usd: "~ $5,677.39 USD",
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
transactionFees: {
|
|
64
|
-
token: "10 BABY",
|
|
65
|
-
usd: "$0.56 USD",
|
|
66
|
-
},
|
|
67
|
-
title: "Claim BABY Rewards",
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
export const TokensWithoutIcons = {
|
|
71
|
-
args: {
|
|
72
|
-
open: true,
|
|
73
|
-
processing: false,
|
|
74
|
-
onClose: () => { },
|
|
75
|
-
onProceed: () => { },
|
|
76
|
-
tokens: [
|
|
77
|
-
{
|
|
78
|
-
name: "Babylon Genesis",
|
|
79
|
-
amount: {
|
|
80
|
-
token: "1000 BABY",
|
|
81
|
-
usd: "~ $5,677.39 USD",
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: "Cosmos",
|
|
86
|
-
amount: {
|
|
87
|
-
token: "500 ATOM",
|
|
88
|
-
usd: "~ $2,621.78 USD",
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
transactionFees: {
|
|
93
|
-
token: "10 BABY",
|
|
94
|
-
usd: "$0.56 USD",
|
|
95
|
-
},
|
|
96
|
-
title: "Claim Rewards - No Icons",
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
export const LongTokenList = {
|
|
100
|
-
args: {
|
|
101
|
-
open: true,
|
|
102
|
-
processing: false,
|
|
103
|
-
onClose: () => { },
|
|
104
|
-
onProceed: () => { },
|
|
105
|
-
tokens: [
|
|
106
|
-
{
|
|
107
|
-
icon: _jsx(PlaceholderIcon, { text: "B", bgColor: "bg-black" }),
|
|
108
|
-
name: "Babylon Genesis",
|
|
109
|
-
amount: {
|
|
110
|
-
token: "1000 BABY",
|
|
111
|
-
usd: "~ $5,677.39 USD",
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
icon: _jsx(PlaceholderIcon, { text: "C", bgColor: "bg-blue-500" }),
|
|
116
|
-
name: "Cosmos",
|
|
117
|
-
amount: {
|
|
118
|
-
token: "500 ATOM",
|
|
119
|
-
usd: "~ $2,621.78 USD",
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
icon: _jsx(PlaceholderIcon, { text: "S", bgColor: "bg-green-500" }),
|
|
124
|
-
name: "Sui",
|
|
125
|
-
amount: {
|
|
126
|
-
token: "100 SUI",
|
|
127
|
-
usd: "~ $399.79 USD",
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
icon: _jsx(PlaceholderIcon, { text: "E", bgColor: "bg-purple-500" }),
|
|
132
|
-
name: "Ethereum",
|
|
133
|
-
amount: {
|
|
134
|
-
token: "2.5 ETH",
|
|
135
|
-
usd: "~ $8,250.00 USD",
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
icon: _jsx(PlaceholderIcon, { text: "B", bgColor: "bg-orange-500" }),
|
|
140
|
-
name: "Bitcoin",
|
|
141
|
-
amount: {
|
|
142
|
-
token: "0.15 BTC",
|
|
143
|
-
usd: "~ $6,450.00 USD",
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: "Polygon",
|
|
148
|
-
amount: {
|
|
149
|
-
token: "2000 MATIC",
|
|
150
|
-
usd: "~ $1,800.00 USD",
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
icon: _jsx(PlaceholderIcon, { text: "A", bgColor: "bg-red-500" }),
|
|
155
|
-
name: "Avalanche",
|
|
156
|
-
amount: {
|
|
157
|
-
token: "150 AVAX",
|
|
158
|
-
usd: "~ $5,250.00 USD",
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
name: "Solana",
|
|
163
|
-
amount: {
|
|
164
|
-
token: "25 SOL",
|
|
165
|
-
usd: "~ $2,750.00 USD",
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
icon: _jsx(PlaceholderIcon, { text: "D", bgColor: "bg-yellow-500" }),
|
|
170
|
-
name: "Dogecoin",
|
|
171
|
-
amount: {
|
|
172
|
-
token: "10000 DOGE",
|
|
173
|
-
usd: "~ $800.00 USD",
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
name: "Cardano",
|
|
178
|
-
amount: {
|
|
179
|
-
token: "5000 ADA",
|
|
180
|
-
usd: "~ $2,000.00 USD",
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
],
|
|
184
|
-
transactionFees: {
|
|
185
|
-
token: "15 BABY",
|
|
186
|
-
usd: "$0.84 USD",
|
|
187
|
-
},
|
|
188
|
-
title: "Claim Large Rewards - Scrollable List",
|
|
189
|
-
},
|
|
190
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RewardsPreviewModal } from "./RewardsPreviewModal";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { SubSection } from "@/components/SubSection";
|
|
3
|
-
import { calculateTokenValueInCurrency } from "@/utils/helpers";
|
|
4
|
-
import { AmountItem } from "../../../components/AmountItem";
|
|
5
|
-
import { Button } from "../../../components/Button";
|
|
6
|
-
export const RewardsSubsection = ({ rewards, onClick, disabled }) => {
|
|
7
|
-
return (_jsxs(SubSection, { className: "flex w-full flex-col content-center justify-between gap-4", children: [rewards.map((reward, index) => {
|
|
8
|
-
const amountValue = parseFloat(String(reward.amount));
|
|
9
|
-
const amountUsd = calculateTokenValueInCurrency(amountValue, reward.balanceDetails?.price ?? 0, { zeroDisplay: "$0.00" });
|
|
10
|
-
return (_jsx(AmountItem, { amount: reward.amount, currencyIcon: reward.currencyIcon, currencyName: reward.currencyName, placeholder: reward.placeholder ?? "Enter Amount", displayBalance: reward.displayBalance, balanceDetails: reward.balanceDetails, min: reward.min ?? "0", step: reward.step ?? "any", autoFocus: false, onChange: () => { }, onKeyDown: () => { }, amountUsd: amountUsd, disabled: true, subtitle: reward.chainName }, index));
|
|
11
|
-
}), _jsx(Button, { onClick: onClick, disabled: disabled, children: "Claim" })] }));
|
|
12
|
-
};
|
|
13
|
-
export default RewardsSubsection;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { RewardsSubsection } from "./RewardsSubsection";
|
|
3
|
-
declare const meta: Meta<typeof RewardsSubsection>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const MultipleRewards: Story;
|
|
8
|
-
export declare const DisabledClaim: Story;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { action } from "@storybook/addon-actions";
|
|
2
|
-
import { RewardsSubsection } from "./RewardsSubsection";
|
|
3
|
-
const meta = {
|
|
4
|
-
component: RewardsSubsection,
|
|
5
|
-
tags: ["autodocs"],
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
export const Default = {
|
|
9
|
-
args: {
|
|
10
|
-
rewards: [
|
|
11
|
-
{
|
|
12
|
-
amount: 123,
|
|
13
|
-
currencyIcon: "https://placehold.co/40x40",
|
|
14
|
-
currencyName: "BBN",
|
|
15
|
-
displayBalance: true,
|
|
16
|
-
chainName: "Babylon",
|
|
17
|
-
balanceDetails: {
|
|
18
|
-
balance: 1234.56789,
|
|
19
|
-
symbol: "BBN",
|
|
20
|
-
price: 0.25,
|
|
21
|
-
displayUSD: true,
|
|
22
|
-
decimals: 8,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
onClick: () => {
|
|
27
|
-
action("claim-button-clicked")();
|
|
28
|
-
alert("Claim button clicked!");
|
|
29
|
-
},
|
|
30
|
-
disabled: false,
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
export const MultipleRewards = {
|
|
34
|
-
args: {
|
|
35
|
-
rewards: [
|
|
36
|
-
{
|
|
37
|
-
amount: 123,
|
|
38
|
-
currencyIcon: "https://placehold.co/40x40",
|
|
39
|
-
currencyName: "BBN",
|
|
40
|
-
displayBalance: true,
|
|
41
|
-
chainName: "Babylon",
|
|
42
|
-
balanceDetails: {
|
|
43
|
-
balance: 1234.56789,
|
|
44
|
-
symbol: "BBN",
|
|
45
|
-
price: 0.25,
|
|
46
|
-
displayUSD: true,
|
|
47
|
-
decimals: 8,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
amount: 45,
|
|
52
|
-
currencyIcon: "https://placehold.co/40x40",
|
|
53
|
-
currencyName: "BTC",
|
|
54
|
-
displayBalance: true,
|
|
55
|
-
chainName: "Bitcoin",
|
|
56
|
-
balanceDetails: {
|
|
57
|
-
balance: 10,
|
|
58
|
-
symbol: "BTC",
|
|
59
|
-
price: 30000,
|
|
60
|
-
displayUSD: true,
|
|
61
|
-
decimals: 8,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
onClick: () => {
|
|
66
|
-
action("claim-button-clicked")();
|
|
67
|
-
alert("Claim button clicked!");
|
|
68
|
-
},
|
|
69
|
-
disabled: false,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
export const DisabledClaim = {
|
|
73
|
-
args: {
|
|
74
|
-
rewards: [
|
|
75
|
-
{
|
|
76
|
-
amount: 123,
|
|
77
|
-
currencyIcon: "https://placehold.co/40x40",
|
|
78
|
-
currencyName: "BBN",
|
|
79
|
-
displayBalance: true,
|
|
80
|
-
chainName: "Babylon",
|
|
81
|
-
balanceDetails: {
|
|
82
|
-
balance: 1234.56789,
|
|
83
|
-
symbol: "BBN",
|
|
84
|
-
price: 0.25,
|
|
85
|
-
displayUSD: true,
|
|
86
|
-
decimals: 8,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
onClick: () => {
|
|
91
|
-
action("claim-button-clicked")();
|
|
92
|
-
alert("This should not appear - button is disabled!");
|
|
93
|
-
},
|
|
94
|
-
disabled: true,
|
|
95
|
-
},
|
|
96
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RewardsSubsection } from "./RewardsSubsection";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Menu } from "@/components/Menu";
|
|
3
|
-
import { Spacer } from "@/components/Spacer";
|
|
4
|
-
import { SettingsIcon } from "@/elements/Icons";
|
|
5
|
-
import { SettingMenuTitle, SettingMenuGroup, SettingMenuItem, SettingMenuSubMenu, SettingMenuDescription, SettingMenuCustomContent, } from "./components";
|
|
6
|
-
import { twJoin } from "tailwind-merge";
|
|
7
|
-
const SettingMenuBase = ({ trigger, open, onOpenChange, placement = "bottom-end", className, offset = [0, 8], children, }) => {
|
|
8
|
-
const defaultTrigger = (_jsx("button", { className: "flex h-10 w-10 items-center justify-center rounded-lg transition-colors hover:bg-accent-primary/10", "aria-label": "Settings menu", children: _jsx(SettingsIcon, {}) }));
|
|
9
|
-
return (_jsx(Menu, { trigger: trigger || defaultTrigger, open: open, onOpenChange: onOpenChange, placement: placement, className: twJoin("relative", className), offset: offset, mobileMode: "drawer", children: children }));
|
|
10
|
-
};
|
|
11
|
-
export const SettingMenu = SettingMenuBase;
|
|
12
|
-
SettingMenu.Title = SettingMenuTitle;
|
|
13
|
-
SettingMenu.Group = SettingMenuGroup;
|
|
14
|
-
SettingMenu.Item = SettingMenuItem;
|
|
15
|
-
SettingMenu.SubMenu = SettingMenuSubMenu;
|
|
16
|
-
SettingMenu.Description = SettingMenuDescription;
|
|
17
|
-
SettingMenu.CustomContent = SettingMenuCustomContent;
|
|
18
|
-
SettingMenu.Spacer = Spacer;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { FaSun, FaMoon } from "react-icons/fa";
|
|
4
|
-
import { SettingMenu } from "./SettingMenu";
|
|
5
|
-
import { Button } from "@/components/Button";
|
|
6
|
-
import { useIsMobile } from "@/hooks/useIsMobile";
|
|
7
|
-
import { ThemeIcon } from "@/components/Icons";
|
|
8
|
-
export default {
|
|
9
|
-
title: "Widgets/sections/SettingMenu",
|
|
10
|
-
component: SettingMenu,
|
|
11
|
-
argTypes: {
|
|
12
|
-
onOpenChange: { action: "open state changed" },
|
|
13
|
-
},
|
|
14
|
-
tags: ["autodocs"],
|
|
15
|
-
};
|
|
16
|
-
const ReportABugIcon = () => (_jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("rect", { width: "40", height: "40", rx: "20", fill: "#387085", fillOpacity: "0.12" }), _jsx("path", { d: "M23.73 11H16.27L11 16.27V23.73L16.27 29H23.73L29 23.73V16.27L23.73 11ZM20 25.3C19.28 25.3 18.7 24.72 18.7 24C18.7 23.28 19.28 22.7 20 22.7C20.72 22.7 21.3 23.28 21.3 24C21.3 24.72 20.72 25.3 20 25.3ZM21 21H19V15H21V21Z", fill: "#387085" })] }));
|
|
17
|
-
export const Default = () => {
|
|
18
|
-
const [selectedTheme, setSelectedTheme] = useState("auto");
|
|
19
|
-
const isMobile = useIsMobile();
|
|
20
|
-
const handleThemeChange = (theme) => {
|
|
21
|
-
setSelectedTheme(theme);
|
|
22
|
-
};
|
|
23
|
-
const getThemeDescription = () => {
|
|
24
|
-
switch (selectedTheme) {
|
|
25
|
-
case "light":
|
|
26
|
-
return "Light";
|
|
27
|
-
case "dark":
|
|
28
|
-
return "Dark";
|
|
29
|
-
case "auto":
|
|
30
|
-
return "Auto";
|
|
31
|
-
default:
|
|
32
|
-
return "Auto";
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
return (_jsx("div", { className: "p-4", children: _jsxs(SettingMenu, { children: [_jsx(SettingMenu.Title, { children: "Settings" }), _jsxs(SettingMenu.Group, { background: "secondary", children: [_jsxs(SettingMenu.SubMenu, { icon: _jsx(ThemeIcon, {}), children: ["Theme", _jsx(SettingMenu.Description, { children: getThemeDescription() }), _jsx(SettingMenu.Item, { selected: selectedTheme === "light", onClick: () => handleThemeChange("light"), children: "Light" }), _jsx(SettingMenu.Item, { selected: selectedTheme === "dark", onClick: () => handleThemeChange("dark"), children: "Dark" }), _jsx(SettingMenu.Item, { selected: selectedTheme === "auto", onClick: () => handleThemeChange("auto"), children: "Auto" })] }), _jsx(SettingMenu.Item, { icon: _jsx(ReportABugIcon, {}), onClick: () => console.log("Report bug clicked"), children: "Report a Bug" })] }), isMobile && _jsx(SettingMenu.Spacer, {}), _jsxs(SettingMenu.Group, { background: "secondary", children: [_jsx(SettingMenu.Item, { onClick: () => window.open("https://example.com/terms", "_blank"), children: "Terms of Use" }), _jsx(SettingMenu.Item, { onClick: () => window.open("https://example.com/privacy", "_blank"), children: "Privacy Policy" })] }), _jsx(SettingMenu.Spacer, {}), _jsx(SettingMenu.CustomContent, { className: "my-4 flex justify-center", children: _jsx(Button, { className: "!bg-[#D5FCE8] !text-black", variant: "contained", children: "Switch to BABY Staking" }) })] }) }));
|
|
36
|
-
};
|
|
37
|
-
export const WithThemeToggle = () => {
|
|
38
|
-
const [isLightMode, setIsLightMode] = useState(false);
|
|
39
|
-
const isMobile = useIsMobile();
|
|
40
|
-
return (_jsx("div", { className: "p-4", children: _jsxs(SettingMenu, { children: [_jsx(SettingMenu.Title, { children: "Settings" }), _jsxs(SettingMenu.Group, { background: "secondary", children: [_jsxs(SettingMenu.Item, { icon: _jsx(ThemeIcon, {}), toggle: {
|
|
41
|
-
value: isLightMode,
|
|
42
|
-
onChange: (value) => {
|
|
43
|
-
setIsLightMode(value);
|
|
44
|
-
console.log("Theme changed to:", value ? "Light" : "Dark");
|
|
45
|
-
},
|
|
46
|
-
activeIcon: _jsx(FaSun, { size: 10 }),
|
|
47
|
-
inactiveIcon: _jsx(FaMoon, { size: 10 })
|
|
48
|
-
}, children: ["Theme", _jsx(SettingMenu.Description, { children: "Light mode" })] }), _jsx(SettingMenu.Item, { icon: _jsx(ReportABugIcon, {}), onClick: () => console.log("Report bug clicked"), children: "Report a Bug" })] }), isMobile && _jsx(SettingMenu.Spacer, {}), _jsxs(SettingMenu.Group, { background: "secondary", children: [_jsx(SettingMenu.Item, { onClick: () => window.open("https://example.com/terms", "_blank"), children: "Terms of Use" }), _jsx(SettingMenu.Item, { onClick: () => window.open("https://example.com/privacy", "_blank"), children: "Privacy Policy" })] }), _jsx(SettingMenu.Spacer, {}), _jsx(SettingMenu.CustomContent, { className: "my-4 flex justify-center", children: _jsx(Button, { className: "!bg-[#D5FCE8] !text-black", variant: "contained", children: "Switch to BABY Staking" }) })] }) }));
|
|
49
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
export const SettingMenuGroup = ({ background = "none", backgroundClassName = "", className = "", children, }) => {
|
|
4
|
-
const getBackgroundClass = () => {
|
|
5
|
-
switch (background) {
|
|
6
|
-
case "secondary":
|
|
7
|
-
return "mx-[21px] rounded-lg bg-secondary-highlight md:mx-0 md:bg-transparent";
|
|
8
|
-
case "custom":
|
|
9
|
-
return backgroundClassName;
|
|
10
|
-
default:
|
|
11
|
-
return "";
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
return _jsx("div", { className: twJoin(getBackgroundClass(), className), children: children });
|
|
15
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { MenuItem } from "@/components/Menu/MenuItem";
|
|
4
|
-
import { ChevronRightIcon } from "@/elements/Icons";
|
|
5
|
-
import { SettingMenuDescription } from "./SettingMenuDescription";
|
|
6
|
-
export const SettingMenuItem = ({ icon, suffix, onClick, disabled = false, selected = false, className = "", toggle, children, }) => {
|
|
7
|
-
const childrenArray = React.Children.toArray(children);
|
|
8
|
-
const label = childrenArray.find((child) => typeof child === "string" || (React.isValidElement(child) && child.type !== SettingMenuDescription));
|
|
9
|
-
const description = childrenArray.find((child) => React.isValidElement(child) && child.type === SettingMenuDescription);
|
|
10
|
-
const labelText = typeof label === "string" ? label : "";
|
|
11
|
-
const defaultSuffix = onClick && !toggle ? _jsx(ChevronRightIcon, {}) : undefined;
|
|
12
|
-
return (_jsx(MenuItem, { icon: icon, name: labelText, description: description ? description.props.children : undefined, onClick: onClick, disabled: disabled, selected: selected, className: className, suffix: suffix || defaultSuffix, toggle: toggle }));
|
|
13
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { SubMenu } from "@/components/Menu/SubMenu";
|
|
4
|
-
import { ChevronRightIcon } from "@/elements/Icons";
|
|
5
|
-
import { SettingMenuDescription } from "./SettingMenuDescription";
|
|
6
|
-
import { SettingMenuItem } from "./SettingMenuItem";
|
|
7
|
-
export const SettingMenuSubMenu = ({ icon, className = "", children }) => {
|
|
8
|
-
const childrenArray = React.Children.toArray(children);
|
|
9
|
-
const label = childrenArray.find((child) => typeof child === "string" || (React.isValidElement(child) && child.type !== SettingMenuDescription));
|
|
10
|
-
const description = childrenArray.find((child) => React.isValidElement(child) && child.type === SettingMenuDescription);
|
|
11
|
-
const subMenuItems = childrenArray.filter((child) => React.isValidElement(child) && child.type === SettingMenuItem);
|
|
12
|
-
const labelText = typeof label === "string" ? label : "";
|
|
13
|
-
return (_jsx(SubMenu, { icon: icon, name: labelText, description: description ? description.props.children : undefined, className: className, suffix: _jsx(ChevronRightIcon, {}), children: subMenuItems }));
|
|
14
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
import { Text } from "@/components/Text";
|
|
4
|
-
export const SettingMenuTitle = ({ children, className = "" }) => (_jsx(Text, { variant: "body1", className: twJoin("px-7 pb-6 text-accent-primary md:hidden", className), children: children }));
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { SettingMenuTitle } from "./SettingMenuTitle";
|
|
2
|
-
export { SettingMenuGroup } from "./SettingMenuGroup";
|
|
3
|
-
export { SettingMenuItem } from "./SettingMenuItem";
|
|
4
|
-
export { SettingMenuSubMenu } from "./SettingMenuSubMenu";
|
|
5
|
-
export { SettingMenuDescription } from "./SettingMenuDescription";
|
|
6
|
-
export { SettingMenuCustomContent } from "./SettingMenuCustomContent";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { SettingMenu } from "./SettingMenu";
|
|
2
|
-
export { SettingMenuTitle } from "./components";
|
|
3
|
-
export { SettingMenuGroup } from "./components";
|
|
4
|
-
export { SettingMenuItem } from "./components";
|
|
5
|
-
export { SettingMenuSubMenu } from "./components";
|
|
6
|
-
export { SettingMenuDescription } from "./components";
|
|
7
|
-
export { SettingMenuCustomContent } from "./components";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from "../../../components/Button";
|
|
3
|
-
import { FinalityProviderItem } from "../../../elements/FinalityProviderItem/FinalityProviderItem";
|
|
4
|
-
export const TableElement = ({ attributes, providerItemProps, isSelected = false, isSelectable = true, onSelect, }) => {
|
|
5
|
-
return (_jsxs("div", { className: "bg-secondary-highlight h-[316px] overflow-hidden p-4 flex flex-col rounded justify-between", children: [_jsx(FinalityProviderItem, { ...providerItemProps }), _jsx("div", { className: "w-full h-px bg-secondary-strokeLight" }), Object.entries(attributes).map(([label, value]) => (_jsxs("div", { className: "text-sm flex flex-row justify-between first:mt-0 mt-1", children: [_jsx("div", { className: "text-accent-secondary", children: label }), _jsx("div", { className: "text-accent-primary font-medium", children: value })] }, label))), onSelect && (_jsx(Button, { className: "mt-4", onClick: onSelect, disabled: !isSelectable, variant: isSelected ? "contained" : "outlined", children: isSelected ? "Selected" : "Select" }))] }));
|
|
6
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { TableElement } from "./TableElement";
|
|
3
|
-
declare const meta: Meta<typeof TableElement>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const Selected: Story;
|
|
8
|
-
export declare const NotSelectable: Story;
|
|
9
|
-
export declare const WithoutHeader: Story;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { TableElement } from "./TableElement";
|
|
2
|
-
const meta = {
|
|
3
|
-
component: TableElement,
|
|
4
|
-
tags: ["autodocs"],
|
|
5
|
-
};
|
|
6
|
-
export default meta;
|
|
7
|
-
const sampleAttributes = {
|
|
8
|
-
Balance: "100.123 BTC",
|
|
9
|
-
"USD Value": "$4,567.89",
|
|
10
|
-
Status: "Active",
|
|
11
|
-
};
|
|
12
|
-
const mockProvider = {
|
|
13
|
-
logo_url: undefined,
|
|
14
|
-
rank: 1,
|
|
15
|
-
description: {
|
|
16
|
-
moniker: "Lombard Protocol",
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
const providerItem = {
|
|
20
|
-
bsnId: "bsn123",
|
|
21
|
-
bsnName: "Babylon",
|
|
22
|
-
address: "dfe19b1234567890f732de",
|
|
23
|
-
provider: mockProvider,
|
|
24
|
-
// No onRemove to showcase address/noRemove mode
|
|
25
|
-
};
|
|
26
|
-
export const Default = {
|
|
27
|
-
args: {
|
|
28
|
-
providerItemProps: providerItem,
|
|
29
|
-
attributes: sampleAttributes,
|
|
30
|
-
onSelect: () => alert("Select clicked"),
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
export const Selected = {
|
|
34
|
-
args: {
|
|
35
|
-
providerItemProps: providerItem,
|
|
36
|
-
attributes: sampleAttributes,
|
|
37
|
-
isSelected: true,
|
|
38
|
-
onSelect: () => alert("Select clicked"),
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
export const NotSelectable = {
|
|
42
|
-
args: {
|
|
43
|
-
providerItemProps: providerItem,
|
|
44
|
-
attributes: sampleAttributes,
|
|
45
|
-
isSelectable: false,
|
|
46
|
-
onSelect: () => alert("Select clicked"),
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
export const WithoutHeader = {
|
|
50
|
-
args: {
|
|
51
|
-
providerItemProps: providerItem,
|
|
52
|
-
attributes: sampleAttributes,
|
|
53
|
-
},
|
|
54
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TableElement } from "./TableElement";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Dialog, MobileDialog, DialogBody, DialogHeader, DialogFooter } from "@/components/Dialog";
|
|
3
|
-
import { Text } from "@/components/Text";
|
|
4
|
-
import { AmountItem } from "@/components/AmountItem";
|
|
5
|
-
import { SubSection } from "@/components/SubSection";
|
|
6
|
-
import { Warning } from "@/components/Warning";
|
|
7
|
-
import { Button } from "@/components/Button";
|
|
8
|
-
import { WINDOW_BREAKPOINT, MAX_WINDOW_HEIGHT } from "../../../utils/constants";
|
|
9
|
-
import { useIsMobile } from "@/hooks/useIsMobile";
|
|
10
|
-
import { twMerge } from "tailwind-merge";
|
|
11
|
-
function ResponsiveDialog({ className, ...restProps }) {
|
|
12
|
-
const isMobileView = useIsMobile(WINDOW_BREAKPOINT);
|
|
13
|
-
const DialogComponent = isMobileView ? MobileDialog : Dialog;
|
|
14
|
-
return _jsx(DialogComponent, { ...restProps, className: twMerge("w-[41.25rem] max-w-full", className) });
|
|
15
|
-
}
|
|
16
|
-
export const UnbondingModal = ({ open, onClose, title = "Unbonding", description, reward, amountUsd = "", onChange = () => { }, onKeyDown = () => { }, disabled = false, warningText, actionButtonText = "Unbond", onActionClick, }) => {
|
|
17
|
-
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 whitespace-pre-line", children: description }) })), _jsx(SubSection, { className: "flex w-full flex-col content-center justify-between gap-4", children: _jsx(AmountItem, { amount: reward.amount, currencyIcon: reward.currencyIcon, currencyName: reward.currencyName, placeholder: reward.placeholder ?? "Enter Amount", displayBalance: reward.displayBalance, balanceDetails: reward.balanceDetails, min: reward.min ?? "0", step: reward.step ?? "any", autoFocus: false, onChange: onChange, onKeyDown: onKeyDown, amountUsd: amountUsd, disabled: disabled, subtitle: `Staked: ${reward.stakedAmount || 0} ${reward.stakedTokenName || reward.currencyName}` }) }), warningText && (_jsx(Warning, { children: warningText }))] }), actionButtonText && (_jsx(DialogFooter, { className: "flex justify-end mt-[80px]", children: _jsx(Button, { onClick: onActionClick, children: actionButtonText }) }))] }));
|
|
18
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { UnbondingModal } from "./UnbondingModal";
|
|
3
|
-
declare const meta: Meta<typeof UnbondingModal>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const BABYUnbonding: Story;
|