@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,61 +0,0 @@
|
|
|
1
|
-
import { FinalityProviderLogo } from "./FinalityProviderLogo";
|
|
2
|
-
const meta = {
|
|
3
|
-
component: FinalityProviderLogo,
|
|
4
|
-
tags: ["autodocs"],
|
|
5
|
-
};
|
|
6
|
-
export default meta;
|
|
7
|
-
export const WithImage = {
|
|
8
|
-
args: {
|
|
9
|
-
logoUrl: "/images/fps/lombard.jpeg",
|
|
10
|
-
rank: 1,
|
|
11
|
-
moniker: "Lombard Protocol",
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
export const WithImageLarge = {
|
|
15
|
-
args: {
|
|
16
|
-
logoUrl: "/images/fps/pumpbtc.jpeg",
|
|
17
|
-
rank: 2,
|
|
18
|
-
moniker: "PumpBTC",
|
|
19
|
-
size: "lg",
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
export const WithImageSmall = {
|
|
23
|
-
args: {
|
|
24
|
-
logoUrl: "/images/fps/solv.jpeg",
|
|
25
|
-
rank: 3,
|
|
26
|
-
moniker: "Solv Protocol",
|
|
27
|
-
size: "sm",
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
export const FallbackWithMoniker = {
|
|
31
|
-
args: {
|
|
32
|
-
rank: 1,
|
|
33
|
-
moniker: "Babylon Network",
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
export const FallbackWithoutMoniker = {
|
|
37
|
-
args: {
|
|
38
|
-
rank: 5,
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
export const FallbackLarge = {
|
|
42
|
-
args: {
|
|
43
|
-
rank: 2,
|
|
44
|
-
moniker: "Large Provider",
|
|
45
|
-
size: "lg",
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
export const FallbackSmall = {
|
|
49
|
-
args: {
|
|
50
|
-
rank: 3,
|
|
51
|
-
moniker: "Small Provider",
|
|
52
|
-
size: "sm",
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
export const InvalidImage = {
|
|
56
|
-
args: {
|
|
57
|
-
logoUrl: "/invalid-image-url.jpg",
|
|
58
|
-
rank: 4,
|
|
59
|
-
moniker: "Provider with Invalid Image",
|
|
60
|
-
},
|
|
61
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FinalityProviderLogo } from "./FinalityProviderLogo";
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export const ChevronRightIcon = () => (_jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M9 18L15 12L9 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export const SettingsIcon = () => (_jsx("svg", { width: "29", height: "28", viewBox: "0 0 29 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M24.9127 15.3708C24.9711 14.9333 25.0002 14.4812 25.0002 14C25.0002 13.5333 24.9711 13.0667 24.8982 12.6292L27.8586 10.325C28.1211 10.1208 28.194 9.72708 28.0336 9.43542L25.2336 4.59375C25.0586 4.27292 24.694 4.17083 24.3732 4.27292L20.8877 5.67292C20.1586 5.11875 19.3857 4.65208 18.5252 4.30208L18.0002 0.597916C17.9419 0.247916 17.6502 0 17.3002 0H11.7002C11.3502 0 11.0732 0.247916 11.0148 0.597916L10.4898 4.30208C9.62941 4.65208 8.84191 5.13333 8.12732 5.67292L4.64191 4.27292C4.32107 4.15625 3.95649 4.27292 3.78149 4.59375L0.996075 9.43542C0.821075 9.74167 0.879408 10.1208 1.17107 10.325L4.13149 12.6292C4.05857 13.0667 4.00024 13.5479 4.00024 14C4.00024 14.4521 4.02941 14.9333 4.10232 15.3708L1.14191 17.675C0.879408 17.8792 0.806491 18.2729 0.966908 18.5646L3.76691 23.4062C3.94191 23.7271 4.30649 23.8292 4.62732 23.7271L8.11274 22.3271C8.84191 22.8812 9.61482 23.3479 10.4752 23.6979L11.0002 27.4021C11.0732 27.7521 11.3502 28 11.7002 28H17.3002C17.6502 28 17.9419 27.7521 17.9857 27.4021L18.5107 23.6979C19.3711 23.3479 20.1586 22.8812 20.8732 22.3271L24.3586 23.7271C24.6794 23.8438 25.044 23.7271 25.219 23.4062L28.019 18.5646C28.194 18.2437 28.1211 17.8792 27.844 17.675L24.9127 15.3708ZM14.5002 19.25C11.6127 19.25 9.25024 16.8875 9.25024 14C9.25024 11.1125 11.6127 8.75 14.5002 8.75C17.3877 8.75 19.7502 11.1125 19.7502 14C19.7502 16.8875 17.3877 19.25 14.5002 19.25Z", fill: "#9E9E9E" }) }));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import { FinalityProviderItem } from "../FinalityProviderItem/FinalityProviderItem";
|
|
4
|
-
export function ProvidersList({ items, onRemove, showChain = true }) {
|
|
5
|
-
const values = useMemo(() => items, [items]);
|
|
6
|
-
if (values.length === 0)
|
|
7
|
-
return null;
|
|
8
|
-
return (_jsx("div", { className: "flex flex-col gap-8", children: values.map(({ bsnId, bsnName, bsnLogoUrl, provider }) => (_jsx(FinalityProviderItem, { bsnId: bsnId, bsnName: bsnName, bsnLogoUrl: bsnLogoUrl, provider: provider, onRemove: onRemove, showChain: showChain }, `${bsnId}-${provider.rank}`))) }));
|
|
9
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { ProvidersList } from "./ProvidersList";
|
|
3
|
-
declare const meta: Meta<typeof ProvidersList>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const SingleProvider: Story;
|
|
8
|
-
export declare const EmptyList: Story;
|
|
9
|
-
export declare const WithoutLogos: Story;
|
|
10
|
-
export declare const MixedProviders: Story;
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { ProvidersList } from "./ProvidersList";
|
|
2
|
-
const meta = {
|
|
3
|
-
component: ProvidersList,
|
|
4
|
-
tags: ["autodocs"],
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: "centered",
|
|
7
|
-
},
|
|
8
|
-
};
|
|
9
|
-
export default meta;
|
|
10
|
-
const mockProviders = [
|
|
11
|
-
{
|
|
12
|
-
bsnId: "bsn123",
|
|
13
|
-
bsnName: "Babylon",
|
|
14
|
-
bsnLogoUrl: "/images/fps/pumpbtc.jpeg",
|
|
15
|
-
provider: {
|
|
16
|
-
logo_url: "/images/fps/lombard.jpeg",
|
|
17
|
-
rank: 1,
|
|
18
|
-
description: {
|
|
19
|
-
moniker: "Lombard Protocol",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
bsnId: "bsn456",
|
|
25
|
-
bsnName: "Babylon Chain",
|
|
26
|
-
bsnLogoUrl: "/images/fps/solv.jpeg",
|
|
27
|
-
provider: {
|
|
28
|
-
logo_url: "/images/fps/pumpbtc.jpeg",
|
|
29
|
-
rank: 2,
|
|
30
|
-
description: {
|
|
31
|
-
moniker: "PumpBTC Provider",
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
bsnId: "bsn789",
|
|
37
|
-
bsnName: "Babylon Network",
|
|
38
|
-
bsnLogoUrl: undefined,
|
|
39
|
-
provider: {
|
|
40
|
-
logo_url: "/images/fps/solv.jpeg",
|
|
41
|
-
rank: 3,
|
|
42
|
-
description: {
|
|
43
|
-
moniker: "Solv Protocol",
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
];
|
|
48
|
-
export const Default = {
|
|
49
|
-
args: {
|
|
50
|
-
items: mockProviders,
|
|
51
|
-
onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
export const SingleProvider = {
|
|
55
|
-
args: {
|
|
56
|
-
items: [mockProviders[0]],
|
|
57
|
-
onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
export const EmptyList = {
|
|
61
|
-
args: {
|
|
62
|
-
items: [],
|
|
63
|
-
onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
export const WithoutLogos = {
|
|
67
|
-
args: {
|
|
68
|
-
items: [
|
|
69
|
-
{
|
|
70
|
-
bsnId: "bsn111",
|
|
71
|
-
bsnName: "Babylon",
|
|
72
|
-
bsnLogoUrl: undefined,
|
|
73
|
-
provider: {
|
|
74
|
-
logo_url: undefined,
|
|
75
|
-
rank: 1,
|
|
76
|
-
description: {
|
|
77
|
-
moniker: "Provider Without Logo",
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
bsnId: "bsn222",
|
|
83
|
-
bsnName: "Babylon Chain",
|
|
84
|
-
bsnLogoUrl: undefined,
|
|
85
|
-
provider: {
|
|
86
|
-
logo_url: undefined,
|
|
87
|
-
rank: 2,
|
|
88
|
-
description: {
|
|
89
|
-
moniker: "Another Provider",
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
export const MixedProviders = {
|
|
98
|
-
args: {
|
|
99
|
-
items: [
|
|
100
|
-
{
|
|
101
|
-
bsnId: "bsn001",
|
|
102
|
-
bsnName: "Babylon Premium",
|
|
103
|
-
bsnLogoUrl: "/images/fps/lombard.jpeg",
|
|
104
|
-
provider: {
|
|
105
|
-
logo_url: "/images/fps/pumpbtc.jpeg",
|
|
106
|
-
rank: 1,
|
|
107
|
-
description: {
|
|
108
|
-
moniker: "Top Ranked Provider",
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
bsnId: "bsn002",
|
|
114
|
-
bsnName: "Babylon Standard",
|
|
115
|
-
bsnLogoUrl: undefined,
|
|
116
|
-
provider: {
|
|
117
|
-
logo_url: "/images/fps/solv.jpeg",
|
|
118
|
-
rank: 15,
|
|
119
|
-
description: {
|
|
120
|
-
moniker: "Mid Tier Provider",
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
bsnId: "bsn003",
|
|
126
|
-
bsnName: "Babylon Basic",
|
|
127
|
-
bsnLogoUrl: "/images/fps/pumpbtc.jpeg",
|
|
128
|
-
provider: {
|
|
129
|
-
logo_url: undefined,
|
|
130
|
-
rank: 99,
|
|
131
|
-
description: {
|
|
132
|
-
moniker: "Basic Provider Service",
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
|
|
138
|
-
},
|
|
139
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ProvidersList } from "./ProvidersList";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from "@/components/Card";
|
|
3
|
-
import { Text } from "@/components/Text";
|
|
4
|
-
export const Table = ({ data }) => {
|
|
5
|
-
if (!data || data.length === 0)
|
|
6
|
-
return null;
|
|
7
|
-
const headers = data[0];
|
|
8
|
-
const rows = data.slice(1);
|
|
9
|
-
const columnCount = headers.length;
|
|
10
|
-
const gridStyle = {
|
|
11
|
-
gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))`,
|
|
12
|
-
};
|
|
13
|
-
return (_jsx(Card, { className: "p-6 pt-4", children: _jsxs("div", { className: "flex flex-col", children: [_jsx("div", { className: "items-center gap-4 pb-4 grid", style: gridStyle, children: headers.map((header, idx) => (_jsx(Text, { variant: "caption", className: "text-secondary px-2.5", children: header }, `header-${idx}`))) }), rows.map((row, rowIdx) => (_jsx("div", { className: "items-center gap-4 rounded bg-primary-contrast p-1 grid", style: gridStyle, children: row.map((cell, cellIdx) => (_jsx("div", { className: "flex w-full items-center gap-2 py-1 px-2.5", children: cell }, `cell-${rowIdx}-${cellIdx}`))) }, `row-${rowIdx}`)))] }) }));
|
|
14
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Table } from "./Table";
|
|
3
|
-
declare const meta: Meta<typeof Table>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const SinglePair: Story;
|
|
7
|
-
export declare const MultiplePairs: Story;
|
|
8
|
-
export declare const LongNames: Story;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Table } from "./Table";
|
|
3
|
-
import { Avatar } from "../../components/Avatar/Avatar";
|
|
4
|
-
const meta = {
|
|
5
|
-
component: Table,
|
|
6
|
-
tags: ["autodocs"],
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: "centered",
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
export default meta;
|
|
12
|
-
const BsnAvatar = (url, alt) => (_jsx(Avatar, { url: url, alt: alt, size: "small", variant: "circular" }));
|
|
13
|
-
export const SinglePair = {
|
|
14
|
-
render: () => (_jsx(Table, { data: [
|
|
15
|
-
[
|
|
16
|
-
"BSNs",
|
|
17
|
-
"Finality Provider",
|
|
18
|
-
],
|
|
19
|
-
[
|
|
20
|
-
_jsxs(_Fragment, { children: [BsnAvatar("/images/fps/pumpbtc.jpeg", "Babylon"), " Babylon"] }),
|
|
21
|
-
_jsxs(_Fragment, { children: [BsnAvatar("/images/fps/lombard.jpeg", "Lombard"), " Lombard Protocol"] }),
|
|
22
|
-
],
|
|
23
|
-
] })),
|
|
24
|
-
};
|
|
25
|
-
export const MultiplePairs = {
|
|
26
|
-
render: () => (_jsx(Table, { data: [
|
|
27
|
-
["BSNs", "Finality Provider"],
|
|
28
|
-
[
|
|
29
|
-
_jsxs(_Fragment, { children: [BsnAvatar("/images/fps/pumpbtc.jpeg", "Babylon"), " Babylon"] }),
|
|
30
|
-
_jsxs(_Fragment, { children: [BsnAvatar("/images/fps/lombard.jpeg", "Lombard"), " Lombard Protocol"] }),
|
|
31
|
-
],
|
|
32
|
-
[
|
|
33
|
-
_jsxs(_Fragment, { children: [BsnAvatar("/images/fps/solv.jpeg", "Solv"), " Solv"] }),
|
|
34
|
-
_jsxs(_Fragment, { children: [BsnAvatar("/images/fps/lombard.jpeg", "Provider X"), " Provider X"] }),
|
|
35
|
-
],
|
|
36
|
-
] })),
|
|
37
|
-
};
|
|
38
|
-
export const LongNames = {
|
|
39
|
-
render: () => (_jsx(Table, { data: [
|
|
40
|
-
["BSNs", "Finality Provider"],
|
|
41
|
-
[
|
|
42
|
-
_jsxs(_Fragment, { children: [BsnAvatar("/images/fps/pumpbtc.jpeg", "VeryLongBSNName"), " Very Long Name for Babylon Network That Might Wrap"] }),
|
|
43
|
-
_jsxs(_Fragment, { children: [BsnAvatar("/images/fps/lombard.jpeg", "LongFPName"), " Very Long Finality Provider Name That Should Handle Text Overflow Correctly"] }),
|
|
44
|
-
],
|
|
45
|
-
[
|
|
46
|
-
_jsxs(_Fragment, { children: [BsnAvatar("/images/fps/solv.jpeg", "AnotherLongBSNName"), " Another Extremely Long BSN Name to Test Wrapping Capability"] }),
|
|
47
|
-
_jsxs(_Fragment, { children: [BsnAvatar("/images/fps/lombard.jpeg", "AnotherLongFPName"), " Another Really Long Finality Provider Name for Layout Testing"] }),
|
|
48
|
-
],
|
|
49
|
-
] })),
|
|
50
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Table } from "./Table";
|
package/dist/hooks/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { useCopy } from './useCopy';
|
|
2
|
-
export { useIsMobile } from './useIsMobile';
|
|
3
|
-
export { useDrawerAnimation } from './useDrawerAnimation';
|
|
4
|
-
export { useClickOutside } from './useClickOutside';
|
|
5
|
-
export { useControlledState } from './useControlledState';
|
|
6
|
-
export { useMemoizedArray } from './useMemoizedArray';
|
|
7
|
-
export { useModalManager } from './useModalManager';
|
|
8
|
-
export { useResizeObserver } from './useResizeObserver';
|
|
9
|
-
export { useTableScroll } from './useTableScroll';
|
|
10
|
-
export { useTableSort } from './useTableSort';
|
|
11
|
-
export { useFrozenColumns } from './useFrozenColumns';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import { useMemoizedArray } from "./useMemoizedArray";
|
|
3
|
-
export function useClickOutside(targetElement, handler = () => null, { enabled = true } = {}) {
|
|
4
|
-
const targetElements = Array.isArray(targetElement) ? targetElement : [targetElement];
|
|
5
|
-
const memoizedElements = useMemoizedArray(targetElements);
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
function handleClickOutside(event) {
|
|
8
|
-
if (enabled && memoizedElements.every((element) => !element?.contains(event.target))) {
|
|
9
|
-
handler();
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
13
|
-
return () => {
|
|
14
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
15
|
-
};
|
|
16
|
-
}, [memoizedElements, enabled, handler]);
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useState, useRef, useCallback } from "react";
|
|
2
|
-
export function useControlledState({ value: controlledState, defaultValue: defaultState, onStateChange, } = {}) {
|
|
3
|
-
const [uncontrolledState, setUncontrolledState] = useState(defaultState);
|
|
4
|
-
const { current: isControlled } = useRef(controlledState != null);
|
|
5
|
-
const state = isControlled ? controlledState : uncontrolledState;
|
|
6
|
-
const handleStateChange = useCallback((newValue) => {
|
|
7
|
-
if (!isControlled) {
|
|
8
|
-
setUncontrolledState(newValue);
|
|
9
|
-
}
|
|
10
|
-
onStateChange?.(newValue);
|
|
11
|
-
}, [isControlled, onStateChange, setUncontrolledState]);
|
|
12
|
-
return [state, handleStateChange];
|
|
13
|
-
}
|
package/dist/hooks/useCopy.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
export function useCopy(options = {}) {
|
|
3
|
-
const { copiedText: copiedLabel = 'Copied ✓', timeout = 2000 } = options;
|
|
4
|
-
const [copiedStates, setCopiedStates] = useState({});
|
|
5
|
-
const timersRef = useRef({});
|
|
6
|
-
const reset = useCallback((id) => {
|
|
7
|
-
if (!id)
|
|
8
|
-
return;
|
|
9
|
-
setCopiedStates((prev) => ({ ...prev, [id]: false }));
|
|
10
|
-
}, []);
|
|
11
|
-
const handleCopy = useCallback((id, value) => {
|
|
12
|
-
if (!id || !value)
|
|
13
|
-
return;
|
|
14
|
-
void navigator.clipboard.writeText(value).catch(() => { });
|
|
15
|
-
setCopiedStates((prev) => ({ ...prev, [id]: true }));
|
|
16
|
-
const existing = timersRef.current[id];
|
|
17
|
-
if (existing)
|
|
18
|
-
clearTimeout(existing);
|
|
19
|
-
if (timeout > 0) {
|
|
20
|
-
timersRef.current[id] = setTimeout(() => {
|
|
21
|
-
timersRef.current[id] = undefined;
|
|
22
|
-
reset(id);
|
|
23
|
-
}, timeout);
|
|
24
|
-
}
|
|
25
|
-
}, [timeout, reset]);
|
|
26
|
-
const isCopied = useCallback((id) => {
|
|
27
|
-
if (!id)
|
|
28
|
-
return false;
|
|
29
|
-
return copiedStates[id] || false;
|
|
30
|
-
}, [copiedStates]);
|
|
31
|
-
const getText = useCallback((id) => (id && copiedStates[id] ? copiedLabel : ''), [copiedStates, copiedLabel]);
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
return () => {
|
|
34
|
-
Object.values(timersRef.current).forEach((t) => t && clearTimeout(t));
|
|
35
|
-
timersRef.current = {};
|
|
36
|
-
};
|
|
37
|
-
}, []);
|
|
38
|
-
return {
|
|
39
|
-
isCopied,
|
|
40
|
-
copiedText: getText,
|
|
41
|
-
copyToClipboard: handleCopy,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useCallback } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Custom hook for managing drawer animations with proper timing
|
|
4
|
-
* Ensures Portal mounts → closed state → animate to open → animate to closed → unmount
|
|
5
|
-
*/
|
|
6
|
-
export function useDrawerAnimation({ isOpen, }) {
|
|
7
|
-
const [mounted, setMounted] = useState(false);
|
|
8
|
-
const [shouldShowOpen, setShouldShowOpen] = useState(false);
|
|
9
|
-
// Handle opening: mount → wait for DOM → trigger open animation
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (isOpen && !mounted) {
|
|
12
|
-
// Step 1: Mount the Portal
|
|
13
|
-
setMounted(true);
|
|
14
|
-
setShouldShowOpen(false);
|
|
15
|
-
// Step 2: Next frame, trigger the open animation
|
|
16
|
-
requestAnimationFrame(() => {
|
|
17
|
-
requestAnimationFrame(() => {
|
|
18
|
-
setShouldShowOpen(true);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}, [isOpen, mounted]);
|
|
23
|
-
// Handle closing: trigger close animation
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (!isOpen && mounted) {
|
|
26
|
-
setShouldShowOpen(false);
|
|
27
|
-
// Don't unmount here - wait for animation to complete
|
|
28
|
-
}
|
|
29
|
-
}, [isOpen, mounted]);
|
|
30
|
-
// Callback for when animation completes
|
|
31
|
-
const handleAnimationEnd = useCallback(() => {
|
|
32
|
-
if (!isOpen && mounted) {
|
|
33
|
-
// Animation finished and we're closing - unmount
|
|
34
|
-
setMounted(false);
|
|
35
|
-
}
|
|
36
|
-
}, [isOpen, mounted]);
|
|
37
|
-
return {
|
|
38
|
-
mounted,
|
|
39
|
-
shouldShowOpen,
|
|
40
|
-
handleAnimationEnd,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
export function useFrozenColumns(containerRef) {
|
|
3
|
-
const [isLeftScrolled, setIsLeftScrolled] = useState(false);
|
|
4
|
-
const [isRightScrolled, setIsRightScrolled] = useState(false);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
const container = containerRef.current;
|
|
7
|
-
if (!container)
|
|
8
|
-
return;
|
|
9
|
-
const handleScroll = () => {
|
|
10
|
-
const { scrollLeft, scrollWidth, clientWidth } = container;
|
|
11
|
-
// Show left shadow when scrolled right (content is under left frozen column)
|
|
12
|
-
setIsLeftScrolled(scrollLeft > 0);
|
|
13
|
-
// Show right shadow when scrolled left from the rightmost position (content is under right frozen column)
|
|
14
|
-
const maxScrollLeft = scrollWidth - clientWidth;
|
|
15
|
-
setIsRightScrolled(maxScrollLeft > 0 && scrollLeft < maxScrollLeft);
|
|
16
|
-
};
|
|
17
|
-
// Initial check
|
|
18
|
-
handleScroll();
|
|
19
|
-
container.addEventListener("scroll", handleScroll);
|
|
20
|
-
return () => container.removeEventListener("scroll", handleScroll);
|
|
21
|
-
}, [containerRef]);
|
|
22
|
-
return { isLeftScrolled, isRightScrolled };
|
|
23
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useCallback, useRef } from "react";
|
|
2
|
-
import throttle from "lodash.throttle";
|
|
3
|
-
/**
|
|
4
|
-
* Hook to detect if the viewport is in mobile size
|
|
5
|
-
* @param breakpoint - The breakpoint in pixels (default: 768)
|
|
6
|
-
* @param throttleMs - The throttle delay in milliseconds (default: 100)
|
|
7
|
-
* @returns boolean indicating if viewport is mobile size
|
|
8
|
-
*/
|
|
9
|
-
export function useIsMobile(breakpoint = 768, throttleMs = 100) {
|
|
10
|
-
const [isMobile, setIsMobile] = useState(() => {
|
|
11
|
-
// Initial state based on current window width
|
|
12
|
-
if (typeof window !== "undefined") {
|
|
13
|
-
return window.innerWidth < breakpoint;
|
|
14
|
-
}
|
|
15
|
-
return false;
|
|
16
|
-
});
|
|
17
|
-
const throttledCheckMobile = useRef();
|
|
18
|
-
const checkMobile = useCallback(() => {
|
|
19
|
-
setIsMobile(window.innerWidth < breakpoint);
|
|
20
|
-
}, [breakpoint]);
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
throttledCheckMobile.current = throttle(checkMobile, throttleMs);
|
|
23
|
-
checkMobile();
|
|
24
|
-
window.addEventListener("resize", throttledCheckMobile.current);
|
|
25
|
-
return () => {
|
|
26
|
-
if (throttledCheckMobile.current) {
|
|
27
|
-
window.removeEventListener("resize", throttledCheckMobile.current);
|
|
28
|
-
throttledCheckMobile.current.cancel();
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}, [checkMobile, throttleMs]);
|
|
32
|
-
return isMobile;
|
|
33
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
2
|
-
function areArraysEqual(arrA, arrB) {
|
|
3
|
-
if (arrA === arrB) {
|
|
4
|
-
return true;
|
|
5
|
-
}
|
|
6
|
-
if (arrA.length !== arrB.length) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
for (let i = 0; i < arrA.length; i++) {
|
|
10
|
-
if (arrA[i] !== arrB[i]) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
export function useMemoizedArray(array) {
|
|
17
|
-
const ref = useRef(array);
|
|
18
|
-
if (!areArraysEqual(ref.current, array)) {
|
|
19
|
-
ref.current = array;
|
|
20
|
-
}
|
|
21
|
-
return ref.current;
|
|
22
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { DialogContext } from "@/context/Dialog.context";
|
|
2
|
-
import { useCallback, useContext, useEffect, useId, useState } from "react";
|
|
3
|
-
export function useModalManager({ open = false } = {}) {
|
|
4
|
-
const modalId = useId();
|
|
5
|
-
const [mounted, setMounted] = useState(open);
|
|
6
|
-
const { updateDialog, removeDialog } = useContext(DialogContext);
|
|
7
|
-
const visible = open || mounted;
|
|
8
|
-
useEffect(() => () => {
|
|
9
|
-
removeDialog(modalId);
|
|
10
|
-
}, [modalId]);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
updateDialog(modalId, visible);
|
|
13
|
-
}, [modalId, visible, updateDialog]);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (open) {
|
|
16
|
-
setMounted(true);
|
|
17
|
-
}
|
|
18
|
-
}, [open]);
|
|
19
|
-
const unmount = useCallback(() => {
|
|
20
|
-
if (!open) {
|
|
21
|
-
setMounted(false);
|
|
22
|
-
}
|
|
23
|
-
}, [open]);
|
|
24
|
-
return {
|
|
25
|
-
mounted,
|
|
26
|
-
unmount,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
export function useResizeObserver(element) {
|
|
3
|
-
const [dimentions, setDimentions] = useState({ width: 0, height: 0 });
|
|
4
|
-
useEffect(() => {
|
|
5
|
-
if (!element) {
|
|
6
|
-
setDimentions({ width: 0, height: 0 });
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const observer = new ResizeObserver(([entry]) => {
|
|
10
|
-
setDimentions({
|
|
11
|
-
width: entry.target.clientWidth,
|
|
12
|
-
height: entry.target.clientHeight,
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
observer.observe(element);
|
|
16
|
-
return () => {
|
|
17
|
-
observer.unobserve(element);
|
|
18
|
-
};
|
|
19
|
-
}, [element]);
|
|
20
|
-
return dimentions;
|
|
21
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import throttle from "lodash.throttle";
|
|
3
|
-
export function useTableScroll(tableRef, { onLoadMore, hasMore = false, loading = false } = {}) {
|
|
4
|
-
const [isScrolledTop, setIsScrolledTop] = useState(false);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
const handleScroll = throttle((e) => {
|
|
7
|
-
const target = e.target;
|
|
8
|
-
setIsScrolledTop(target.scrollTop > 0);
|
|
9
|
-
if (!loading && hasMore && target.scrollHeight - target.scrollTop <= target.clientHeight + 100) {
|
|
10
|
-
onLoadMore?.();
|
|
11
|
-
}
|
|
12
|
-
}, 100);
|
|
13
|
-
const tableWrapper = tableRef.current;
|
|
14
|
-
if (tableWrapper) {
|
|
15
|
-
tableWrapper.addEventListener("scroll", handleScroll);
|
|
16
|
-
return () => tableWrapper.removeEventListener("scroll", handleScroll);
|
|
17
|
-
}
|
|
18
|
-
}, [loading, hasMore, onLoadMore, tableRef]);
|
|
19
|
-
return {
|
|
20
|
-
isScrolledTop,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { useCallback, useMemo, useState } from "react";
|
|
2
|
-
export function useTableSort(data, columns) {
|
|
3
|
-
const [sortStates, setSortStates] = useState({});
|
|
4
|
-
const handleColumnSort = useCallback((columnKey, sorter) => {
|
|
5
|
-
if (!sorter)
|
|
6
|
-
return;
|
|
7
|
-
setSortStates((prev) => {
|
|
8
|
-
const currentState = prev[columnKey]?.direction ?? null;
|
|
9
|
-
const nextDirection = currentState === null ? "asc" : currentState === "asc" ? "desc" : null;
|
|
10
|
-
if (nextDirection === null) {
|
|
11
|
-
return Object.fromEntries(Object.entries(prev)
|
|
12
|
-
.filter(([key]) => key !== columnKey)
|
|
13
|
-
.map(([key, value]) => [
|
|
14
|
-
key,
|
|
15
|
-
{ ...value, priority: value.priority > prev[columnKey].priority ? value.priority - 1 : value.priority },
|
|
16
|
-
]));
|
|
17
|
-
}
|
|
18
|
-
const highestPriority = Math.max(0, ...Object.values(prev).map((s) => s.priority));
|
|
19
|
-
return {
|
|
20
|
-
...prev,
|
|
21
|
-
[columnKey]: { direction: nextDirection, priority: highestPriority + 1 },
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
}, []);
|
|
25
|
-
const sortedData = useMemo(() => {
|
|
26
|
-
const activeSorters = Object.entries(sortStates)
|
|
27
|
-
.filter(([, state]) => state.direction !== null)
|
|
28
|
-
.toSorted((a, b) => b[1].priority - a[1].priority)
|
|
29
|
-
.map(([key, state]) => ({
|
|
30
|
-
column: columns.find((col) => col.key === key),
|
|
31
|
-
direction: state.direction,
|
|
32
|
-
}))
|
|
33
|
-
.filter(({ column }) => column?.sorter);
|
|
34
|
-
if (activeSorters.length === 0)
|
|
35
|
-
return data;
|
|
36
|
-
return data.toSorted((a, b) => {
|
|
37
|
-
for (const { column, direction } of activeSorters) {
|
|
38
|
-
const result = column.sorter(a, b);
|
|
39
|
-
if (result !== 0)
|
|
40
|
-
return direction === "asc" ? result : -result;
|
|
41
|
-
}
|
|
42
|
-
return 0;
|
|
43
|
-
});
|
|
44
|
-
}, [data, columns, sortStates]);
|
|
45
|
-
return { sortStates, handleColumnSort, sortedData };
|
|
46
|
-
}
|