@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,210 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useCallback } from "react";
|
|
3
|
-
import { Table } from ".";
|
|
4
|
-
import { Avatar } from "../Avatar";
|
|
5
|
-
import { Select } from "../Form";
|
|
6
|
-
import { Button } from "../Button";
|
|
7
|
-
const meta = {
|
|
8
|
-
component: Table,
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
};
|
|
11
|
-
export default meta;
|
|
12
|
-
const data = [
|
|
13
|
-
{
|
|
14
|
-
id: "1",
|
|
15
|
-
name: "Lombard",
|
|
16
|
-
icon: "/images/fps/lombard.jpeg",
|
|
17
|
-
status: "Active",
|
|
18
|
-
btcPk: "1234...4321",
|
|
19
|
-
totalDelegation: 10,
|
|
20
|
-
commission: 1,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: "2",
|
|
24
|
-
name: "Solv Protocol",
|
|
25
|
-
icon: "/images/fps/solv.jpeg",
|
|
26
|
-
status: "Inactive",
|
|
27
|
-
btcPk: "1234...4321",
|
|
28
|
-
totalDelegation: 20,
|
|
29
|
-
commission: 3,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: "3",
|
|
33
|
-
name: "PumpBTC",
|
|
34
|
-
icon: "/images/fps/pumpbtc.jpeg",
|
|
35
|
-
status: "Active",
|
|
36
|
-
btcPk: "1234...4321",
|
|
37
|
-
totalDelegation: 30,
|
|
38
|
-
commission: 5,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: "4",
|
|
42
|
-
name: "Solv Protocol",
|
|
43
|
-
icon: "/images/fps/solv.jpeg",
|
|
44
|
-
status: "Active",
|
|
45
|
-
btcPk: "1234...4321",
|
|
46
|
-
totalDelegation: 20,
|
|
47
|
-
commission: 3,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
id: "5",
|
|
51
|
-
name: "PumpBTC",
|
|
52
|
-
icon: "/images/fps/pumpbtc.jpeg",
|
|
53
|
-
status: "Active",
|
|
54
|
-
btcPk: "1234...4321",
|
|
55
|
-
totalDelegation: 30,
|
|
56
|
-
commission: 5,
|
|
57
|
-
},
|
|
58
|
-
];
|
|
59
|
-
const columns = [
|
|
60
|
-
{
|
|
61
|
-
key: "name",
|
|
62
|
-
header: "Finality Provider",
|
|
63
|
-
render: (value, row) => {
|
|
64
|
-
void value;
|
|
65
|
-
void row;
|
|
66
|
-
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Avatar, { size: "small", url: row.icon, alt: row.name }), _jsx("span", { children: row.name })] }));
|
|
67
|
-
},
|
|
68
|
-
sorter: (a, b) => a.name.localeCompare(b.name),
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
key: "status",
|
|
72
|
-
header: "Status",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
key: "btcPk",
|
|
76
|
-
header: "BTC PK",
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
key: "totalDelegation",
|
|
80
|
-
header: "Total Delegation",
|
|
81
|
-
render: (value, row) => {
|
|
82
|
-
void value;
|
|
83
|
-
void row;
|
|
84
|
-
return `${row.totalDelegation} sBTC`;
|
|
85
|
-
},
|
|
86
|
-
sorter: (a, b) => a.totalDelegation - b.totalDelegation,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
key: "commission",
|
|
90
|
-
header: "Commission",
|
|
91
|
-
render: (value, row) => {
|
|
92
|
-
void value;
|
|
93
|
-
void row;
|
|
94
|
-
return `${row.commission}%`;
|
|
95
|
-
},
|
|
96
|
-
sorter: (a, b) => a.commission - b.commission,
|
|
97
|
-
},
|
|
98
|
-
];
|
|
99
|
-
const columnsWithActions = [
|
|
100
|
-
{
|
|
101
|
-
key: "name",
|
|
102
|
-
header: "Finality Provider",
|
|
103
|
-
frozen: "left",
|
|
104
|
-
render: (value, row) => {
|
|
105
|
-
void value;
|
|
106
|
-
void row;
|
|
107
|
-
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Avatar, { size: "small", url: row.icon, alt: row.name }), _jsx("span", { children: row.name })] }));
|
|
108
|
-
},
|
|
109
|
-
sorter: (a, b) => a.name.localeCompare(b.name),
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
key: "status",
|
|
113
|
-
header: "Status",
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
key: "btcPk",
|
|
117
|
-
header: "BTC PK",
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
key: "totalDelegation",
|
|
121
|
-
header: "Total Delegation",
|
|
122
|
-
render: (value, row) => {
|
|
123
|
-
void value;
|
|
124
|
-
void row;
|
|
125
|
-
return `${row.totalDelegation} sBTC`;
|
|
126
|
-
},
|
|
127
|
-
sorter: (a, b) => a.totalDelegation - b.totalDelegation,
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
key: "commission",
|
|
131
|
-
header: "Commission",
|
|
132
|
-
render: (value, row) => {
|
|
133
|
-
void value;
|
|
134
|
-
void row;
|
|
135
|
-
return `${row.commission}%`;
|
|
136
|
-
},
|
|
137
|
-
sorter: (a, b) => a.commission - b.commission,
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
key: "actions",
|
|
141
|
-
header: "Actions",
|
|
142
|
-
frozen: "right",
|
|
143
|
-
render: (value, row) => {
|
|
144
|
-
void value;
|
|
145
|
-
void row;
|
|
146
|
-
return (_jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { size: "small", variant: "contained", children: "Delegate" }), _jsx(Button, { size: "small", variant: "outlined", children: "Unbond" })] }));
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
];
|
|
150
|
-
export const Default = {
|
|
151
|
-
render: () => {
|
|
152
|
-
const [tableData, setTableData] = useState(data);
|
|
153
|
-
const [loading, setLoading] = useState(false);
|
|
154
|
-
const [hasMore, setHasMore] = useState(true);
|
|
155
|
-
const [selectedProvider, setSelectedProvider] = useState(null);
|
|
156
|
-
const handleLoadMore = useCallback(async () => {
|
|
157
|
-
setLoading(true);
|
|
158
|
-
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
159
|
-
const nextItems = data.slice(tableData.length, tableData.length + 3);
|
|
160
|
-
setTableData((prev) => [...prev, ...nextItems]);
|
|
161
|
-
setHasMore(tableData.length + nextItems.length < data.length);
|
|
162
|
-
setLoading(false);
|
|
163
|
-
}, [tableData]);
|
|
164
|
-
const handleRowSelect = useCallback((row) => {
|
|
165
|
-
setSelectedProvider(row);
|
|
166
|
-
}, []);
|
|
167
|
-
const isRowSelectable = useCallback((row) => {
|
|
168
|
-
return row.status === "Active";
|
|
169
|
-
}, []);
|
|
170
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx("div", { children: _jsx(Table, { data: tableData, hasMore: hasMore, loading: loading, onLoadMore: handleLoadMore, columns: columns, onRowSelect: handleRowSelect, isRowSelectable: isRowSelectable, defaultSelectedRow: "1" }) }), selectedProvider && (_jsxs("div", { className: "rounded bg-primary-contrast p-4", children: ["Selected Provider: ", selectedProvider.name, " (Commission: ", selectedProvider.commission, "%)"] }))] }));
|
|
171
|
-
},
|
|
172
|
-
};
|
|
173
|
-
export const FrozenColumns = {
|
|
174
|
-
render: () => {
|
|
175
|
-
const [selectedProvider, setSelectedProvider] = useState(null);
|
|
176
|
-
const handleRowSelect = useCallback((row) => {
|
|
177
|
-
setSelectedProvider(row);
|
|
178
|
-
}, []);
|
|
179
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx("div", { children: _jsx(Table, { data: data, columns: columnsWithActions, onRowSelect: handleRowSelect, defaultSelectedRow: "1" }) }), selectedProvider && (_jsxs("div", { className: "rounded bg-primary-contrast p-4", children: ["Selected Provider: ", selectedProvider.name, " (Commission: ", selectedProvider.commission, "%)"] }))] }));
|
|
180
|
-
},
|
|
181
|
-
};
|
|
182
|
-
export const ControlledSelection = {
|
|
183
|
-
render: () => {
|
|
184
|
-
const [selectedId, setSelectedId] = useState("2");
|
|
185
|
-
const [selectedProvider, setSelectedProvider] = useState(null);
|
|
186
|
-
const handleRowSelect = useCallback((row) => {
|
|
187
|
-
setSelectedId(row?.id ?? null);
|
|
188
|
-
setSelectedProvider(row);
|
|
189
|
-
}, []);
|
|
190
|
-
const selectOptions = [
|
|
191
|
-
{ value: "", label: "None" },
|
|
192
|
-
...data.map((provider) => ({
|
|
193
|
-
value: provider.id,
|
|
194
|
-
label: provider.name,
|
|
195
|
-
})),
|
|
196
|
-
];
|
|
197
|
-
const handleSelect = useCallback((value) => {
|
|
198
|
-
const selectedRow = value ? (data.find((row) => row.id === value) ?? null) : null;
|
|
199
|
-
setSelectedId(value);
|
|
200
|
-
setSelectedProvider(selectedRow);
|
|
201
|
-
}, []);
|
|
202
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Select, { value: selectedId ?? "", options: selectOptions, onSelect: (value) => handleSelect(value), placeholder: "Select a provider" }), _jsx("div", { className: "h-[150px]", children: _jsx(Table, { data: data, columns: columns, selectedRow: selectedId, onSelectedRowChange: setSelectedId, onRowSelect: handleRowSelect }) }), selectedProvider && (_jsxs("div", { className: "rounded bg-primary-contrast p-4", children: ["Selected Provider: ", selectedProvider.name, " (Commission: ", selectedProvider.commission, "%)"] }))] }));
|
|
203
|
-
},
|
|
204
|
-
};
|
|
205
|
-
export const HeaderVisibility = {
|
|
206
|
-
render: () => {
|
|
207
|
-
const noHeaderColumns = columns.map((col) => ({ ...col, header: "" }));
|
|
208
|
-
return (_jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("div", { children: "With header" }), _jsx(Table, { data: data, columns: columns })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("div", { children: "Without header (hidden)" }), _jsx(Table, { data: data, columns: noHeaderColumns })] })] }));
|
|
209
|
-
},
|
|
210
|
-
};
|
|
@@ -1,8 +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 function Cell({ className, render, value, columnName, frozen, showFrozenShadow, ...restProps }) {
|
|
5
|
-
const frozenClasses = frozen ? `bbn-table-frozen bbn-table-frozen-${frozen}` : '';
|
|
6
|
-
const shadowClass = frozen && showFrozenShadow ? 'bbn-frozen-shadow' : '';
|
|
7
|
-
return (_jsx(Text, { variant: "body2", as: "td", className: twJoin(`bbn-cell-left`, frozenClasses, shadowClass, className), "data-column": columnName, ...restProps, children: render ? render(value) : value }));
|
|
8
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useContext } from "react";
|
|
3
|
-
import { twJoin } from "tailwind-merge";
|
|
4
|
-
import { RiArrowUpSFill, RiArrowDownSFill } from "react-icons/ri";
|
|
5
|
-
import { TableContext } from "../../../context/Table.context";
|
|
6
|
-
import { Text } from "@/components/Text";
|
|
7
|
-
export function Column({ name, className, children, sorter, frozen, showFrozenShadow, ...restProps }) {
|
|
8
|
-
const { columns, sortStates, onColumnSort } = useContext(TableContext);
|
|
9
|
-
const sortState = sortStates[name ?? ""];
|
|
10
|
-
const sortDirection = sortState?.direction;
|
|
11
|
-
const frozenClasses = frozen ? `bbn-table-frozen bbn-table-frozen-${frozen}` : '';
|
|
12
|
-
const shadowClass = frozen && showFrozenShadow ? 'bbn-frozen-shadow' : '';
|
|
13
|
-
return (_jsx(Text, { variant: "caption", as: "th", className: twJoin(`bbn-cell-left`, sorter && "bbn-table-sortable", frozenClasses, shadowClass, className), onClick: () => {
|
|
14
|
-
if (sorter && name) {
|
|
15
|
-
const column = columns.find((col) => col.key === name);
|
|
16
|
-
onColumnSort?.(name, column?.sorter);
|
|
17
|
-
}
|
|
18
|
-
}, "data-column": name, ...restProps, children: _jsxs("div", { className: "flex items-center justify-between gap-1", children: [_jsx("span", { children: children }), sorter && (_jsxs("span", { className: "bbn-table-sort-icons", children: [_jsx(RiArrowUpSFill, { className: twJoin("bbn-sort-icon bbn-sort-icon-up", sortDirection === "asc" ? "bbn-sort-icon-active" : "bbn-sort-icon-inactive") }), _jsx(RiArrowDownSFill, { className: twJoin("bbn-sort-icon bbn-sort-icon-down", sortDirection === "desc" ? "bbn-sort-icon-active" : "bbn-sort-icon-inactive") })] }))] }) }));
|
|
19
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
import { Cell } from "./Cell";
|
|
4
|
-
export function Row({ row, columns, isSelected, isSelectable, onSelect, isLeftScrolled, isRightScrolled, }) {
|
|
5
|
-
return (_jsx("tr", { className: twJoin(isSelected && "selected", !!onSelect && isSelectable && "cursor-pointer", !isSelectable && "opacity-50"), onClick: () => onSelect(row), children: columns.map((column) => (_jsx(Cell, { value: row[column.key], columnName: column.key, className: column.cellClassName, frozen: column.frozen, showFrozenShadow: (column.frozen === 'left' && isLeftScrolled) ||
|
|
6
|
-
(column.frozen === 'right' && isRightScrolled), render: column.render ? (value) => column.render(value, row) : undefined }, column.key))) }));
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createElement, forwardRef } from "react";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
import "./Text.css";
|
|
4
|
-
export const Text = forwardRef(({ variant = "body1", as = "p", children, className, ...restProps }, ref) => {
|
|
5
|
-
return createElement(as, {
|
|
6
|
-
...restProps,
|
|
7
|
-
ref,
|
|
8
|
-
className: twJoin(`bbn-text-${variant}`, className),
|
|
9
|
-
}, children);
|
|
10
|
-
});
|
|
11
|
-
Text.displayName = "Text";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Text } from "./Text";
|
|
3
|
-
const meta = {
|
|
4
|
-
component: Text,
|
|
5
|
-
tags: ["autodocs"],
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
export const Default = {
|
|
9
|
-
render: (args) => args.variant ? (_jsxs(Text, { ...args, children: ["Text--", args.variant] })) : (_jsxs("div", { className: "text-accent-secondary", children: [_jsx(Text, { ...args, variant: "body1", className: "my-4", children: "Text--Body1" }), _jsx(Text, { ...args, variant: "body2", className: "my-4", children: "Text--Body2" }), _jsx(Text, { ...args, variant: "subtitle1", className: "my-4", children: "Text--subtitle1" }), _jsx(Text, { ...args, variant: "subtitle2", className: "my-4", children: "Text--subtitle2" }), _jsx(Text, { ...args, variant: "overline", className: "my-4", children: "Text--overline" }), _jsx(Text, { ...args, variant: "caption", className: "my-4", children: "Text--caption" })] })),
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Text";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
import { useControlledState } from "@/hooks/useControlledState";
|
|
4
|
-
import "./Toggle.css";
|
|
5
|
-
export function Toggle(props) {
|
|
6
|
-
const [value = false, setValue] = useControlledState({
|
|
7
|
-
value: props.value,
|
|
8
|
-
defaultValue: props.defaultValue,
|
|
9
|
-
onStateChange: props.onChange,
|
|
10
|
-
});
|
|
11
|
-
return (_jsxs("div", { className: "bbn-toggle", onClick: () => void setValue(!value), children: [_jsx("span", { className: "bbn-toggle-bg", children: props.activeIcon }), _jsx("span", { className: twJoin("bbn-toggle-control", value && "bbn-toggle-control-active") }), _jsx("span", { className: "bbn-toggle-bg", children: props.inactiveIcon })] }));
|
|
12
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { FaLock, FaLockOpen } from "react-icons/fa";
|
|
3
|
-
import { Toggle } from "./Toggle";
|
|
4
|
-
const meta = {
|
|
5
|
-
component: Toggle,
|
|
6
|
-
tags: ["autodocs"],
|
|
7
|
-
};
|
|
8
|
-
export default meta;
|
|
9
|
-
export const Default = {
|
|
10
|
-
args: {
|
|
11
|
-
activeIcon: _jsx(FaLockOpen, { size: 10 }),
|
|
12
|
-
inactiveIcon: _jsx(FaLock, { size: 10 }),
|
|
13
|
-
},
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Toggle";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
import { WarningIcon } from "../Icons";
|
|
4
|
-
import "./Warning.css";
|
|
5
|
-
export function Warning({ children, className, iconClassName, messageClassName }) {
|
|
6
|
-
return (_jsxs("div", { className: twJoin("bbn-warning", className), children: [_jsx(WarningIcon, { variant: "secondary", size: 22, className: twJoin("bbn-warning-icon", iconClassName) }), _jsx("p", { className: twJoin("bbn-warning-message", messageClassName), children: children })] }));
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Warning } from "./Warning";
|
|
3
|
-
declare const meta: Meta<typeof Warning>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const LongText: Story;
|
|
8
|
-
export declare const CustomAltText: Story;
|
|
9
|
-
export declare const CustomStyled: Story;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Warning } from "./Warning";
|
|
2
|
-
const meta = {
|
|
3
|
-
component: Warning,
|
|
4
|
-
tags: ["autodocs"],
|
|
5
|
-
};
|
|
6
|
-
export default meta;
|
|
7
|
-
export const Default = {
|
|
8
|
-
args: {
|
|
9
|
-
children: "Processing your claim will take approximately 2 blocks to complete. BABY is a test token without any real world value.",
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
export const LongText = {
|
|
13
|
-
args: {
|
|
14
|
-
children: "This is a very long warning message meant to test how the component behaves when the text spans multiple lines. It should wrap correctly and keep the icon aligned at the top of the message. You can also include more details here for the user to read without breaking the layout of the warning component.",
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export const CustomAltText = {
|
|
18
|
-
args: {
|
|
19
|
-
children: "Custom alt text is provided for better accessibility.",
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
export const CustomStyled = {
|
|
23
|
-
args: {
|
|
24
|
-
children: "This warning box has a custom max-width and is centered using Tailwind utility classes.",
|
|
25
|
-
},
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Warning } from "./Warning";
|
package/dist/components/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useState, useMemo, useCallback, useEffect } from "react";
|
|
3
|
-
import { toPixels } from "@/utils/css";
|
|
4
|
-
export const DialogContext = createContext({
|
|
5
|
-
removeDialog: () => null,
|
|
6
|
-
updateDialog: () => null,
|
|
7
|
-
});
|
|
8
|
-
export function ScrollLocker({ children }) {
|
|
9
|
-
const [dialogs, setDialogs] = useState({});
|
|
10
|
-
const bodyLocked = useMemo(() => Object.values(dialogs).some((v) => v), [dialogs]);
|
|
11
|
-
useEffect(function lockBody() {
|
|
12
|
-
if (bodyLocked) {
|
|
13
|
-
const width = document.body.offsetWidth;
|
|
14
|
-
document.body.style.overflow = "hidden";
|
|
15
|
-
document.body.style.paddingRight =
|
|
16
|
-
document.body.offsetWidth - width >= 1
|
|
17
|
-
? (toPixels(document.body.offsetWidth - width) ?? "")
|
|
18
|
-
: document.body.style.paddingRight;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
document.body.style.overflow = "";
|
|
22
|
-
document.body.style.paddingRight = "";
|
|
23
|
-
}
|
|
24
|
-
}, [bodyLocked]);
|
|
25
|
-
const removeDialog = useCallback((id) => {
|
|
26
|
-
setDialogs((state) => (Reflect.deleteProperty(state, id) ? { ...state } : state));
|
|
27
|
-
}, []);
|
|
28
|
-
const updateDialog = useCallback((id, value) => {
|
|
29
|
-
setDialogs((state) => ({ ...state, [id]: value }));
|
|
30
|
-
}, []);
|
|
31
|
-
const value = useMemo(() => ({ removeDialog, updateDialog }), [removeDialog, updateDialog]);
|
|
32
|
-
return _jsx(DialogContext.Provider, { value: value, children: children });
|
|
33
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Avatar } from "../../components/Avatar";
|
|
3
|
-
import { Text } from "../../components/Text";
|
|
4
|
-
import { CloseIcon, CopyIcon } from "../../components/Icons";
|
|
5
|
-
import { FinalityProviderLogo } from "../FinalityProviderLogo/FinalityProviderLogo";
|
|
6
|
-
import { Copy } from "../../components/Copy";
|
|
7
|
-
export function FinalityProviderItem({ bsnId, bsnName, bsnLogoUrl, address, provider, onRemove, showChain = true }) {
|
|
8
|
-
if (!provider)
|
|
9
|
-
return null;
|
|
10
|
-
const bsnPlaceholderLetter = bsnName?.charAt(0).toUpperCase() || "?";
|
|
11
|
-
const shortenAddress = (value) => {
|
|
12
|
-
const visibleChars = 6;
|
|
13
|
-
if (!value || value.length <= visibleChars * 2)
|
|
14
|
-
return value;
|
|
15
|
-
return `${value.slice(0, visibleChars)}...${value.slice(-visibleChars)}`;
|
|
16
|
-
};
|
|
17
|
-
const renderProviderSmall = () => {
|
|
18
|
-
return (_jsxs("div", { className: "flex items-center text-xs text-accent-secondary", children: [_jsx(FinalityProviderLogo, { logoUrl: provider.logo_url, rank: provider.rank, moniker: provider.description?.moniker, size: "sm", className: "mr-1" }), provider.description?.moniker] }));
|
|
19
|
-
};
|
|
20
|
-
const renderChainOrAddress = () => {
|
|
21
|
-
if (!showChain)
|
|
22
|
-
return null;
|
|
23
|
-
if (address) {
|
|
24
|
-
return (_jsxs(Text, { as: "div", className: "flex items-center gap-1 text-base font-medium text-accent-primary", children: [shortenAddress(address), _jsx(Copy, { value: address, className: "cursor-pointer", copiedText: "\u2713", children: _jsx(CopyIcon, { size: 12 }) })] }));
|
|
25
|
-
}
|
|
26
|
-
return (_jsx(Text, { as: "div", className: "text-base font-medium text-accent-primary", children: bsnName }));
|
|
27
|
-
};
|
|
28
|
-
return (_jsxs("div", { className: "flex flex-row items-center justify-between", children: [_jsxs("div", { className: "flex h-10 flex-row gap-2", children: [_jsx("div", { className: "shrink-0", children: bsnLogoUrl ? (_jsx(Avatar, { url: bsnLogoUrl, alt: bsnName, variant: "rounded", size: "large" })) : (_jsx(Avatar, { variant: "rounded", size: "large", children: _jsx(Text, { as: "span", className: "inline-flex h-full w-full items-center justify-center bg-secondary-main text-xs text-accent-contrast", children: bsnPlaceholderLetter }) })) }), _jsxs("div", { className: "flex flex-col justify-center text-accent-primary", children: [renderProviderSmall(), renderChainOrAddress()] })] }), onRemove ?
|
|
29
|
-
_jsx("button", { onClick: () => onRemove(bsnId), className: "ml-[10px] flex items-center justify-center cursor-pointer p-1", children: _jsx(CloseIcon, { size: 12 }) }) : null] }));
|
|
30
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { FinalityProviderItem } from "./FinalityProviderItem";
|
|
3
|
-
declare const meta: Meta<typeof FinalityProviderItem>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const WithoutBsnLogo: Story;
|
|
8
|
-
export declare const WithoutProviderLogo: Story;
|
|
9
|
-
export declare const HighRankProvider: Story;
|
|
10
|
-
export declare const LongNames: Story;
|
|
11
|
-
export declare const WithoutRemove: Story;
|
|
12
|
-
export declare const AddressOnly: Story;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { FinalityProviderItem } from "./FinalityProviderItem";
|
|
2
|
-
const meta = {
|
|
3
|
-
component: FinalityProviderItem,
|
|
4
|
-
tags: ["autodocs"],
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: "centered",
|
|
7
|
-
},
|
|
8
|
-
};
|
|
9
|
-
export default meta;
|
|
10
|
-
const mockProvider = {
|
|
11
|
-
logo_url: "/images/fps/lombard.jpeg",
|
|
12
|
-
rank: 1,
|
|
13
|
-
description: {
|
|
14
|
-
moniker: "Lombard Protocol",
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
const mockProviderWithoutLogo = {
|
|
18
|
-
logo_url: undefined,
|
|
19
|
-
rank: 5,
|
|
20
|
-
description: {
|
|
21
|
-
moniker: "Bitcoin Staking Provider",
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
export const Default = {
|
|
25
|
-
args: {
|
|
26
|
-
bsnId: "bsn123",
|
|
27
|
-
bsnName: "Babylon",
|
|
28
|
-
bsnLogoUrl: "/images/fps/pumpbtc.jpeg",
|
|
29
|
-
provider: mockProvider,
|
|
30
|
-
onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
export const WithoutBsnLogo = {
|
|
34
|
-
args: {
|
|
35
|
-
bsnId: "bsn456",
|
|
36
|
-
bsnName: "Babylon Chain",
|
|
37
|
-
bsnLogoUrl: undefined,
|
|
38
|
-
provider: mockProvider,
|
|
39
|
-
onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
export const WithoutProviderLogo = {
|
|
43
|
-
args: {
|
|
44
|
-
bsnId: "bsn789",
|
|
45
|
-
bsnName: "Babylon Network",
|
|
46
|
-
bsnLogoUrl: "/images/fps/solv.jpeg",
|
|
47
|
-
provider: mockProviderWithoutLogo,
|
|
48
|
-
onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
export const HighRankProvider = {
|
|
52
|
-
args: {
|
|
53
|
-
bsnId: "bsn999",
|
|
54
|
-
bsnName: "Babylon Testnet",
|
|
55
|
-
bsnLogoUrl: "/images/fps/pumpbtc.jpeg",
|
|
56
|
-
provider: {
|
|
57
|
-
logo_url: "/images/fps/solv.jpeg",
|
|
58
|
-
rank: 99,
|
|
59
|
-
description: {
|
|
60
|
-
moniker: "High Rank Provider",
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
export const LongNames = {
|
|
67
|
-
args: {
|
|
68
|
-
bsnId: "bsn_very_long_id_123456789",
|
|
69
|
-
bsnName: "Very Long Babylon Network Name That Might Wrap",
|
|
70
|
-
bsnLogoUrl: "/images/fps/lombard.jpeg",
|
|
71
|
-
provider: {
|
|
72
|
-
logo_url: "/images/fps/pumpbtc.jpeg",
|
|
73
|
-
rank: 42,
|
|
74
|
-
description: {
|
|
75
|
-
moniker: "Very Long Finality Provider Name That Should Handle Text Overflow",
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
export const WithoutRemove = {
|
|
82
|
-
args: {
|
|
83
|
-
bsnId: "bsn321",
|
|
84
|
-
bsnName: "Babylon Network",
|
|
85
|
-
bsnLogoUrl: "/images/fps/lombard.jpeg",
|
|
86
|
-
provider: mockProvider,
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
export const AddressOnly = {
|
|
90
|
-
args: {
|
|
91
|
-
bsnId: "bsnAddr",
|
|
92
|
-
bsnName: "",
|
|
93
|
-
bsnLogoUrl: undefined,
|
|
94
|
-
address: "dfe19b1234567890f732de",
|
|
95
|
-
provider: mockProvider,
|
|
96
|
-
},
|
|
97
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./FinalityProviderItem";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Text } from "../../components/Text";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { twMerge } from "tailwind-merge";
|
|
5
|
-
const STYLES = {
|
|
6
|
-
lg: {
|
|
7
|
-
logo: "size-10",
|
|
8
|
-
subLogo: "text-[0.8rem]",
|
|
9
|
-
},
|
|
10
|
-
md: {
|
|
11
|
-
logo: "size-6",
|
|
12
|
-
subLogo: "text-[0.5rem]",
|
|
13
|
-
},
|
|
14
|
-
sm: {
|
|
15
|
-
logo: "size-5",
|
|
16
|
-
subLogo: "text-[0.4rem]",
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
export const FinalityProviderLogo = ({ logoUrl, rank, moniker, size = "md", className }) => {
|
|
20
|
-
const [imageError, setImageError] = useState(false);
|
|
21
|
-
const styles = STYLES[size];
|
|
22
|
-
const fallbackLabel = moniker?.charAt(0).toUpperCase() ?? String(rank);
|
|
23
|
-
return (_jsx("span", { className: twMerge("relative inline-block", styles.logo, className), children: logoUrl && !imageError ? (_jsx("img", { src: logoUrl, alt: moniker || `Finality Provider ${rank}`, className: "h-full w-full rounded-full object-cover", onError: () => setImageError(true) })) : (_jsx(Text, { as: "span", className: "inline-flex h-full w-full items-center justify-center rounded-full bg-secondary-main text-[1rem] text-accent-contrast", children: fallbackLabel })) }));
|
|
24
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { FinalityProviderLogo } from "./FinalityProviderLogo";
|
|
3
|
-
declare const meta: Meta<typeof FinalityProviderLogo>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const WithImage: Story;
|
|
7
|
-
export declare const WithImageLarge: Story;
|
|
8
|
-
export declare const WithImageSmall: Story;
|
|
9
|
-
export declare const FallbackWithMoniker: Story;
|
|
10
|
-
export declare const FallbackWithoutMoniker: Story;
|
|
11
|
-
export declare const FallbackLarge: Story;
|
|
12
|
-
export declare const FallbackSmall: Story;
|
|
13
|
-
export declare const InvalidImage: Story;
|