@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,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useId, useState } from "react";
|
|
3
|
-
import { AiOutlineInfoCircle } from "react-icons/ai";
|
|
4
|
-
import { Button } from "@/components/Button";
|
|
5
|
-
import { ListItem } from "@/components/List";
|
|
6
|
-
import { MobileDialog } from "@/components/Dialog";
|
|
7
|
-
import { useIsMobile } from "@/hooks";
|
|
8
|
-
import { Popover } from "@/components/Popover";
|
|
9
|
-
export const StatItem = ({ hidden = false, loading, title, value, tooltip, loadingStyle = "spinner", ...props }) => {
|
|
10
|
-
const tooltipId = useId();
|
|
11
|
-
const isMobileView = useIsMobile();
|
|
12
|
-
const [dialogOpen, setDialogOpen] = useState(false);
|
|
13
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (!isMobileView && dialogOpen) {
|
|
16
|
-
setDialogOpen(false);
|
|
17
|
-
}
|
|
18
|
-
}, [isMobileView, dialogOpen]);
|
|
19
|
-
if (hidden)
|
|
20
|
-
return null;
|
|
21
|
-
const spinnerEl = (_jsxs("div", { className: "inline-flex items-center gap-2", children: [_jsx("span", { className: "loader size-5" }), loadingStyle === "spinner-and-value" && _jsx("span", { className: "opacity-50", children: value })] }));
|
|
22
|
-
const suffixEl = tooltip ? (isMobileView ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "block size-5 cursor-pointer text-xs", onClick: () => setDialogOpen(true), children: _jsx(AiOutlineInfoCircle, { size: 20 }) }), _jsxs(MobileDialog, { open: dialogOpen, onClose: () => setDialogOpen(false), children: [_jsx("div", { className: "px-4 py-2 text-accent-primary", children: tooltip }), _jsx("div", { className: "p-4", children: _jsx(Button, { variant: "contained", fluid: true, onClick: () => setDialogOpen(false), children: "Done" }) })] })] })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "block size-5 cursor-pointer text-xs", onMouseEnter: (e) => setAnchorEl(e.currentTarget), onMouseLeave: () => setAnchorEl(null), "aria-describedby": tooltipId, children: _jsx(AiOutlineInfoCircle, { size: 20 }) }), _jsx(Popover, { open: !!anchorEl, anchorEl: anchorEl, placement: "top", offset: [0, 8], children: _jsx("div", { className: "tooltip-wrap", children: tooltip }) })] }))) : undefined;
|
|
23
|
-
return (_jsx(ListItem, { ...props, title: title, value: loading ? spinnerEl : value, suffix: suffixEl }));
|
|
24
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
import { Text } from "@/components/Text";
|
|
4
|
-
export function ListItem({ className, orientation = "horizontal", title, value, suffix }) {
|
|
5
|
-
return (_jsxs("div", { className: twJoin("bbn-list-item", `bbn-list-item-${orientation}`, className), children: [_jsx(Text, { as: "div", className: twJoin("bbn-list-title", `bbn-list-title-${orientation}`), variant: orientation === "horizontal" ? "body1" : "body2", children: title }), _jsxs(Text, { as: "div", className: twJoin("bbn-list-value", `bbn-list-value-${orientation}`), variant: "body1", children: [value, suffix] })] }));
|
|
6
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Children, cloneElement, isValidElement } from "react";
|
|
3
|
-
import "./ListLegacy.css";
|
|
4
|
-
import { twMerge } from "tailwind-merge";
|
|
5
|
-
const ROW_ORIENTATION = {
|
|
6
|
-
adaptive: "adaptive",
|
|
7
|
-
horizontal: "vertical",
|
|
8
|
-
vertical: "horizontal",
|
|
9
|
-
};
|
|
10
|
-
export function ListLegacy({ className, orientation = "vertical", children }) {
|
|
11
|
-
return (_jsx("div", { className: twMerge("bbn-list-legacy", `bbn-list-legacy-${orientation}`, className), children: Children.map(children, (item) => isValidElement(item)
|
|
12
|
-
? cloneElement(item, {
|
|
13
|
-
orientation: ROW_ORIENTATION[orientation],
|
|
14
|
-
})
|
|
15
|
-
: item) }));
|
|
16
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { ListLegacy } from "./ListLegacy";
|
|
3
|
-
declare const meta: Meta<typeof ListLegacy>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const HorizontalRegular: Story;
|
|
7
|
-
export declare const VerticalRegular: Story;
|
|
8
|
-
export declare const AdaptiveRegular: Story;
|
|
9
|
-
export declare const LongContentHorizontal: Story;
|
|
10
|
-
export declare const LongContentVertical: Story;
|
|
11
|
-
export declare const SingleItem: Story;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { MdOutlineInfo, MdAccountBalanceWallet, MdTrendingUp } from "react-icons/md";
|
|
3
|
-
import { ListLegacy } from "./ListLegacy";
|
|
4
|
-
import { ListItemLegacy } from "./components/ListItemLegacy";
|
|
5
|
-
const meta = {
|
|
6
|
-
component: ListLegacy,
|
|
7
|
-
tags: ["autodocs"],
|
|
8
|
-
argTypes: {
|
|
9
|
-
orientation: {
|
|
10
|
-
control: { type: "select" },
|
|
11
|
-
options: ["horizontal", "vertical", "adaptive"],
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
export default meta;
|
|
16
|
-
const sampleItems = [
|
|
17
|
-
_jsx(ListItemLegacy, { title: "Bitcoin Balance", value: "100.123456 BTC", suffix: _jsx(MdAccountBalanceWallet, { size: 20 }) }),
|
|
18
|
-
_jsx(ListItemLegacy, { title: "USD Value", value: "$4,567,890.12", suffix: _jsx(MdTrendingUp, { size: 20 }) }),
|
|
19
|
-
_jsx(ListItemLegacy, { title: "Status", value: "Active", suffix: _jsx(MdOutlineInfo, { size: 20 }) }),
|
|
20
|
-
];
|
|
21
|
-
const longContentItems = [
|
|
22
|
-
_jsx(ListItemLegacy, { title: "Very Long Bitcoin Wallet Address", value: "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh" }),
|
|
23
|
-
_jsx(ListItemLegacy, { title: "Transaction Hash with Very Long Text", value: "a1b2c3d4e5f6789012345678901234567890abcdef" }),
|
|
24
|
-
_jsx(ListItemLegacy, { title: "Network Fee Estimation Details", value: "2.5 sats/vB (Medium Priority)", suffix: _jsx(MdOutlineInfo, { size: 20 }) }),
|
|
25
|
-
];
|
|
26
|
-
// Regular Design Stories
|
|
27
|
-
export const HorizontalRegular = {
|
|
28
|
-
name: "Regular Design - Horizontal",
|
|
29
|
-
args: {
|
|
30
|
-
orientation: "horizontal",
|
|
31
|
-
children: sampleItems,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
export const VerticalRegular = {
|
|
35
|
-
name: "Regular Design - Vertical",
|
|
36
|
-
args: {
|
|
37
|
-
orientation: "vertical",
|
|
38
|
-
children: sampleItems,
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
export const AdaptiveRegular = {
|
|
42
|
-
name: "Regular Design - Adaptive",
|
|
43
|
-
args: {
|
|
44
|
-
orientation: "adaptive",
|
|
45
|
-
children: sampleItems,
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
// Content Variation Stories
|
|
49
|
-
export const LongContentHorizontal = {
|
|
50
|
-
name: "Long Content - Horizontal",
|
|
51
|
-
args: {
|
|
52
|
-
orientation: "horizontal",
|
|
53
|
-
children: longContentItems,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
export const LongContentVertical = {
|
|
57
|
-
name: "Long Content - Vertical",
|
|
58
|
-
args: {
|
|
59
|
-
orientation: "vertical",
|
|
60
|
-
children: longContentItems,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
export const SingleItem = {
|
|
64
|
-
name: "Single Item",
|
|
65
|
-
args: {
|
|
66
|
-
orientation: "horizontal",
|
|
67
|
-
children: [
|
|
68
|
-
_jsx(ListItemLegacy, { title: "Single Entry", value: "Only one item in list", suffix: _jsx(MdOutlineInfo, { size: 20 }) }),
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
import { Text } from "@/components/Text";
|
|
4
|
-
export function ListItemLegacy({ className, orientation = "horizontal", title, value, suffix }) {
|
|
5
|
-
return (_jsxs("div", { className: twJoin("bbn-list-item-legacy", `bbn-list-item-legacy-${orientation}`, className), children: [_jsx(Text, { as: "div", className: twJoin("bbn-list-title-legacy", `bbn-list-title-legacy-${orientation}`), variant: orientation === "horizontal" ? "body1" : "body2", children: title }), _jsxs(Text, { as: "div", className: twJoin("bbn-list-value-legacy", `bbn-list-value-legacy-${orientation}`), variant: "body1", children: [value, suffix] })] }));
|
|
6
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { twMerge } from "tailwind-merge";
|
|
3
|
-
import "./Loader.css";
|
|
4
|
-
export function Loader({ size = 40, className }) {
|
|
5
|
-
return (_jsx("span", { className: twMerge("bbn-loader text-current", className), style: { width: size, height: size }, children: _jsx("svg", { viewBox: "22 22 44 44", children: _jsx("circle", { cx: "44", cy: "44", r: "20.2", fill: "none", stroke: "currentColor", strokeWidth: "3.6" }) }) }));
|
|
6
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Loader";
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useState, useRef } from "react";
|
|
3
|
-
import { twJoin } from "tailwind-merge";
|
|
4
|
-
import { Popover } from "../Popover";
|
|
5
|
-
import { MobileDialog } from "../Dialog";
|
|
6
|
-
import { MenuProvider } from "./MenuContext";
|
|
7
|
-
import { MenuDrawer } from "./MenuDrawer";
|
|
8
|
-
import { useIsMobile } from "@/hooks/useIsMobile";
|
|
9
|
-
export const Menu = ({ children, trigger, open: controlledOpen, onOpenChange, placement = "bottom-end", offset = [0, 8], className, mobileMode = "dialog", }) => {
|
|
10
|
-
const [internalOpen, setInternalOpen] = useState(false);
|
|
11
|
-
const triggerRef = useRef(null);
|
|
12
|
-
const isMobile = useIsMobile();
|
|
13
|
-
const isOpen = controlledOpen !== undefined ? controlledOpen : internalOpen;
|
|
14
|
-
const setIsOpen = (open) => {
|
|
15
|
-
if (controlledOpen === undefined) {
|
|
16
|
-
setInternalOpen(open);
|
|
17
|
-
}
|
|
18
|
-
onOpenChange?.(open);
|
|
19
|
-
};
|
|
20
|
-
const onClose = () => setIsOpen(false);
|
|
21
|
-
const menuContent = _jsx("div", { className: "relative w-full overflow-hidden", children: children });
|
|
22
|
-
const triggerElement = trigger || (_jsx("button", { className: "rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-800", onClick: () => setIsOpen(!isOpen), children: "Menu" }));
|
|
23
|
-
return (_jsxs(MenuProvider, { value: { isOpen, setIsOpen, onClose, isMobile }, children: [_jsx("div", { ref: triggerRef, className: "inline-block", children: React.isValidElement(triggerElement) &&
|
|
24
|
-
React.cloneElement(triggerElement, {
|
|
25
|
-
onClick: () => setIsOpen(!isOpen),
|
|
26
|
-
"aria-haspopup": "true",
|
|
27
|
-
"aria-expanded": isOpen,
|
|
28
|
-
}) }), isMobile ? (mobileMode === "dialog" ? (_jsx(MobileDialog, { open: isOpen, onClose: onClose, className: twJoin("bg-[#FFFFFF] dark:bg-[#252525] text-primary-main", className), children: menuContent })) : (_jsx(MenuDrawer, { isOpen: isOpen, onClose: onClose, onBackdropClick: onClose, fullHeight: true, fullWidth: true, showBackButton: true, showDivider: false, children: menuContent }))) : (_jsx(Popover, { anchorEl: triggerRef.current, open: isOpen, offset: offset, placement: placement, onClickOutside: onClose, className: twJoin("rounded-lg border border-[#38708533] bg-[#FFFFFF] shadow-lg dark:border-[#404040] dark:bg-[#252525]", "min-w-[294px]", className), children: menuContent }))] }));
|
|
29
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { Menu } from "./Menu";
|
|
4
|
-
import { MenuItem } from "./MenuItem";
|
|
5
|
-
import { SubMenu } from "./SubMenu";
|
|
6
|
-
import { SubMenuItem } from "./SubMenuItem";
|
|
7
|
-
import { Button } from "../Button";
|
|
8
|
-
import { Text } from "../Text";
|
|
9
|
-
const meta = {
|
|
10
|
-
title: "Components/Menu",
|
|
11
|
-
component: Menu,
|
|
12
|
-
tags: ["autodocs"],
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component: "A menu component with support for nested submenus.",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
export default meta;
|
|
22
|
-
const SettingIcon = () => (_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" }) }));
|
|
23
|
-
const ThemeIcon = () => (_jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("rect", { width: "40", height: "40", rx: "20", fill: "#387085", "fill-opacity": "0.12" }), _jsx("path", { d: "M20 30C25.52 30 30 25.52 30 20C30 14.48 25.52 10 20 10C14.48 10 10 14.48 10 20C10 25.52 14.48 30 20 30ZM21 12.07C24.94 12.56 28 15.92 28 20C28 24.08 24.95 27.44 21 27.93V12.07Z", fill: "#387085" })] }));
|
|
24
|
-
const ReportABugIcon = () => (_jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("rect", { width: "40", height: "40", rx: "20", fill: "#387085", "fill-opacity": "0.12" }), _jsx("path", { d: "M23.73 11H16.27L11 16.27V23.73L16.27 29H23.73L29 23.73V16.27L23.73 11ZM20 25.3C19.28 25.3 18.7 24.72 18.7 24C18.7 23.28 19.28 22.7 20 22.7C20.72 22.7 21.3 23.28 21.3 24C21.3 24.72 20.72 25.3 20 25.3ZM21 21H19V15H21V21Z", fill: "#387085" })] }));
|
|
25
|
-
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", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
|
|
26
|
-
export const Default = {
|
|
27
|
-
render: () => {
|
|
28
|
-
const [selectedTheme, setSelectedTheme] = useState("auto");
|
|
29
|
-
const themes = [
|
|
30
|
-
{ id: "auto", label: "Auto", description: undefined },
|
|
31
|
-
{ id: "light", label: "Light", description: undefined },
|
|
32
|
-
{ id: "dark", label: "Dark", description: undefined },
|
|
33
|
-
];
|
|
34
|
-
return (_jsx("div", { className: "p-4", children: _jsxs(Menu, { trigger: _jsx("button", { children: _jsx(SettingIcon, {}) }), children: [_jsx(Text, { variant: "body1", className: "px-7 pb-6 text-accent-primary md:hidden", children: "Settings" }), _jsxs("div", { className: "mx-[21px] rounded-lg md:mx-0", children: [_jsx(SubMenu, { name: "Theme", description: selectedTheme, icon: _jsx(ThemeIcon, {}), suffix: _jsx(ChevronRightIcon, {}), className: "bg-secondary-highlight md:bg-transparent", children: _jsx("div", { className: "flex flex-col", children: themes.map((theme) => (_jsx(SubMenuItem, { label: theme.label, description: theme?.description ?? "", selected: selectedTheme === theme.id, onClick: () => {
|
|
35
|
-
setSelectedTheme(theme.id);
|
|
36
|
-
} }, theme.id))) }) }), _jsx(MenuItem, { name: "Report a bug", icon: _jsx(ReportABugIcon, {}), suffix: _jsx(ChevronRightIcon, {}), className: "mb-4 bg-secondary-highlight md:mb-0 md:bg-transparent" }), _jsx(MenuItem, { name: "Terms of Use", suffix: _jsx(ChevronRightIcon, {}), className: "bg-secondary-highlight md:bg-transparent" }), _jsx(MenuItem, { name: "Privacy Policy", suffix: _jsx(ChevronRightIcon, {}), className: "bg-secondary-highlight md:bg-transparent" })] }), _jsx("div", { className: "my-4 flex justify-center", children: _jsx(Button, { className: "!bg-[#D5FCE8] !text-black", variant: "contained", children: "Switch to BABY Staking" }) })] }) }));
|
|
37
|
-
},
|
|
38
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext } from "react";
|
|
3
|
-
const MenuContext = createContext(undefined);
|
|
4
|
-
export const useMenuContext = () => {
|
|
5
|
-
return useContext(MenuContext);
|
|
6
|
-
};
|
|
7
|
-
export const MenuProvider = ({ children, value }) => {
|
|
8
|
-
return _jsx(MenuContext.Provider, { value: value, children: children });
|
|
9
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
import { Portal } from "../Portal";
|
|
4
|
-
import { useDrawerAnimation } from "@/hooks/useDrawerAnimation";
|
|
5
|
-
export const MenuDrawer = ({ isOpen, onClose, title, children, className = "", titleAlign = "left", backIcon, fullHeight = false, fullWidth = false, showBackButton = true, showDivider = true, onBackdropClick, }) => {
|
|
6
|
-
const { mounted, shouldShowOpen, handleAnimationEnd } = useDrawerAnimation({ isOpen });
|
|
7
|
-
const titleAlignment = {
|
|
8
|
-
left: "text-left",
|
|
9
|
-
center: "text-center",
|
|
10
|
-
right: "text-right",
|
|
11
|
-
};
|
|
12
|
-
const renderHeader = () => {
|
|
13
|
-
if (!(showBackButton || title))
|
|
14
|
-
return null;
|
|
15
|
-
return (_jsxs("div", { className: twJoin("flex items-center p-4", showDivider && "border-b border-[#38708533] dark:border-[#404040]"), children: [showBackButton && (_jsx("button", { onClick: onClose, className: "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded transition-colors hover:bg-accent-secondary/10", "aria-label": "Go back", children: backIcon || (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-accent-primary", children: _jsx("path", { d: "M10 12L6 8L10 4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })) })), title && (_jsx("h3", { className: twJoin("flex-1 text-sm font-medium text-accent-primary", showBackButton ? "ml-3" : "", titleAlignment[titleAlign]), children: title }))] }));
|
|
16
|
-
};
|
|
17
|
-
const renderContent = () => (_jsxs(_Fragment, { children: [renderHeader(), _jsx("div", { className: "flex-1 overflow-y-auto", children: children })] }));
|
|
18
|
-
// For fullHeight drawers (mobile), use Portal to ensure proper theme sync
|
|
19
|
-
if (fullHeight) {
|
|
20
|
-
return (_jsxs(Portal, { mounted: mounted, rootClassName: "menu-drawer-portal", children: [onBackdropClick && (_jsx("div", { className: twJoin("fixed inset-0 z-40 bg-black/50 transition-opacity duration-300", shouldShowOpen ? "opacity-100" : "pointer-events-none opacity-0"), onClick: onBackdropClick })), _jsx("div", { className: twJoin("transform transition-transform duration-300 ease-in-out", "bg-[#FFFFFF] dark:bg-[#252525]", "fixed inset-y-0 right-0 z-50", fullWidth ? "w-full" : "w-full max-w-sm", shouldShowOpen ? "translate-x-0" : "translate-x-full", className), onTransitionEnd: handleAnimationEnd, children: renderContent() })] }));
|
|
21
|
-
}
|
|
22
|
-
// For non-fullHeight drawers (desktop), render normally
|
|
23
|
-
return (_jsx("div", { className: twJoin("transform transition-transform duration-300 ease-in-out", "bg-[#FFFFFF] dark:bg-[#252525]", "absolute inset-0 rounded-lg", isOpen ? "translate-x-0" : "translate-x-full", className), children: renderContent() }));
|
|
24
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
import { useMenuContext } from "./MenuContext";
|
|
4
|
-
import { Toggle } from "../Toggle/Toggle";
|
|
5
|
-
export const MenuItem = ({ icon, name, description, onClick, disabled = false, className, children, suffix, selected = false, role = "menuitem", toggle, }) => {
|
|
6
|
-
const menuContext = useMenuContext();
|
|
7
|
-
const toggleElement = toggle ? (_jsx(Toggle, { value: toggle.value, defaultValue: toggle.defaultValue, onChange: toggle.onChange })) : null;
|
|
8
|
-
const finalSuffix = toggleElement || suffix;
|
|
9
|
-
const handleClick = () => {
|
|
10
|
-
if (disabled)
|
|
11
|
-
return;
|
|
12
|
-
if (toggleElement)
|
|
13
|
-
return;
|
|
14
|
-
if (onClick) {
|
|
15
|
-
onClick();
|
|
16
|
-
}
|
|
17
|
-
if (menuContext && !finalSuffix) {
|
|
18
|
-
menuContext.onClose();
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
if (children) {
|
|
22
|
-
return (_jsx("button", { onClick: handleClick, disabled: disabled, className: twJoin("w-full text-left", disabled && "cursor-not-allowed opacity-50", className), children: children }));
|
|
23
|
-
}
|
|
24
|
-
return (_jsxs("div", { className: twJoin("flex w-full items-center justify-between p-6", "transition-colors", !toggleElement && "cursor-pointer hover:bg-accent-secondary/5", // Only hover if no toggle
|
|
25
|
-
"text-left", selected && "bg-accent-secondary/10", disabled && "cursor-not-allowed opacity-50", toggleElement && "cursor-default", // Disable pointer cursor when toggle is present
|
|
26
|
-
className), role: role, "aria-selected": selected, onClick: handleClick, children: [_jsxs("div", { className: "flex items-center gap-3", children: [icon && _jsx("div", { className: "flex-shrink-0", children: icon }), _jsxs("div", { className: "flex flex-col", children: [_jsx("div", { className: "text-sm font-medium text-accent-primary", children: name }), description && _jsx("div", { className: "text-xs text-accent-secondary", children: description })] })] }), finalSuffix && (_jsx("div", { className: "flex-shrink-0", children: finalSuffix }))] }));
|
|
27
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { twJoin } from "tailwind-merge";
|
|
4
|
-
import { MenuDrawer } from "./MenuDrawer";
|
|
5
|
-
import { useMenuContext } from "./MenuContext";
|
|
6
|
-
export const SubMenu = ({ children, name, description, icon, backIcon, suffix, className, contentClassName, titleAlign = "left", }) => {
|
|
7
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
8
|
-
const menuContext = useMenuContext();
|
|
9
|
-
const defaultBackIcon = (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-accent-primary", children: _jsx("path", { d: "M10 12L6 8L10 4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
10
|
-
const chevronRightIcon = (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "text-accent-primary", children: _jsx("path", { d: "M6 4L10 8L6 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
11
|
-
return (_jsxs(_Fragment, { children: [_jsxs("button", { onClick: () => setIsOpen(true), className: twJoin("flex w-full items-center justify-between p-6", "transition-colors hover:bg-accent-secondary/5", "text-left focus:outline-none", className), role: "menuitem", children: [_jsxs("div", { className: "flex items-center gap-3", children: [icon && _jsx("div", { className: "flex-shrink-0", children: icon }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "text-sm font-medium text-accent-primary", children: name }), description && _jsx("span", { className: "mt-0.5 text-xs text-accent-secondary", children: description })] })] }), suffix || chevronRightIcon] }), _jsx(MenuDrawer, { isOpen: isOpen, onClose: () => setIsOpen(false), title: name || "", titleAlign: titleAlign, backIcon: backIcon || defaultBackIcon, fullHeight: menuContext?.isMobile, fullWidth: menuContext?.isMobile, onBackdropClick: menuContext?.isMobile ? undefined : () => setIsOpen(false), className: twJoin(menuContext?.isMobile ? "z-60" : "z-50", contentClassName), children: children })] }));
|
|
12
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
export const SubMenuItem = ({ label, description, onClick, selected = false, className, suffix, disabled = false, }) => {
|
|
4
|
-
const defaultCheckmark = (_jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M16.6667 5L7.5 14.1667L3.33333 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
5
|
-
return (_jsxs("button", { role: "menuitem", onClick: onClick, disabled: disabled, className: twJoin("flex w-full items-center justify-between p-4", "transition-colors hover:bg-accent-secondary/5", "text-left focus:outline-none", selected && "bg-accent-secondary/10", disabled && "cursor-not-allowed opacity-50", className), "aria-selected": selected, tabIndex: disabled ? -1 : 0, children: [_jsxs("div", { className: "flex flex-col items-start", children: [_jsx("span", { className: "font-medium text-accent-primary", children: label }), description && _jsx("span", { className: "text-sm text-accent-secondary", children: description })] }), selected && (suffix || defaultCheckmark)] }));
|
|
6
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { twJoin } from "tailwind-merge";
|
|
4
|
-
import { usePopper } from "react-popper";
|
|
5
|
-
import { Portal } from "@/components/Portal";
|
|
6
|
-
import { useClickOutside } from "@/hooks/useClickOutside";
|
|
7
|
-
import "./Popover.css";
|
|
8
|
-
export function Popover({ open = false, className, anchorEl, placement = "bottom-start", offset = [0, 0], children, style, onClickOutside, }) {
|
|
9
|
-
const [tooltipRef, setTooltipRef] = useState(null);
|
|
10
|
-
const { styles } = usePopper(anchorEl, tooltipRef, {
|
|
11
|
-
placement,
|
|
12
|
-
modifiers: [{ name: "offset", options: { offset } }],
|
|
13
|
-
});
|
|
14
|
-
useClickOutside([tooltipRef, anchorEl], onClickOutside, { enabled: open });
|
|
15
|
-
return (_jsx(Portal, { mounted: open, rootClassName: "popover-portal", children: _jsx("div", { ref: setTooltipRef, style: { ...styles.popper, ...style, pointerEvents: 'auto' }, className: twJoin("bbn-popover", className), children: children }) }));
|
|
16
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { Text } from "@/components/Text";
|
|
4
|
-
import { Button } from "@/components/Button";
|
|
5
|
-
import { Popover } from "./Popover";
|
|
6
|
-
const meta = {
|
|
7
|
-
component: Popover,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
export const Default = {
|
|
12
|
-
args: {
|
|
13
|
-
placement: "bottom-start",
|
|
14
|
-
children: (_jsx(Text, { variant: "body1", className: "text-accent-primary", children: "The content of the Popover" })),
|
|
15
|
-
},
|
|
16
|
-
render: (props) => {
|
|
17
|
-
const [open, setOpen] = useState(props.open);
|
|
18
|
-
const [anchorEl, setAnchorEl] = useState();
|
|
19
|
-
return (_jsxs(_Fragment, { children: [_jsx(Button, { ref: setAnchorEl, onClick: () => {
|
|
20
|
-
setOpen((state) => !state);
|
|
21
|
-
}, children: "Show popover" }), _jsx(Popover, { ...props, open: open, anchorEl: anchorEl, onClickOutside: () => {
|
|
22
|
-
setOpen(false);
|
|
23
|
-
} })] }));
|
|
24
|
-
},
|
|
25
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Popover";
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { createPortal } from "react-dom";
|
|
3
|
-
import { useCoreUI } from "../../providers/CoreUIProvider";
|
|
4
|
-
export function Portal({ children, mounted = false, rootClassName = "portal-root", inheritViewport = true, pointerEvents = 'auto' }) {
|
|
5
|
-
const [rootRef, setRootRef] = useState(null);
|
|
6
|
-
const { portalContainer } = useCoreUI();
|
|
7
|
-
const shouldDisablePointerEvents = pointerEvents === 'none';
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (!mounted) {
|
|
10
|
-
setRootRef(null);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
const root = document.createElement("div");
|
|
14
|
-
root.className = rootClassName;
|
|
15
|
-
if (inheritViewport) {
|
|
16
|
-
if (!rootClassName.includes('popover')) {
|
|
17
|
-
const styles = {
|
|
18
|
-
position: "fixed",
|
|
19
|
-
top: "0",
|
|
20
|
-
left: "0",
|
|
21
|
-
width: "100vw",
|
|
22
|
-
height: "100vh",
|
|
23
|
-
zIndex: "9999",
|
|
24
|
-
pointerEvents: shouldDisablePointerEvents ? "none" : "auto"
|
|
25
|
-
};
|
|
26
|
-
Object.assign(root.style, styles);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
// For popovers, just set z-index and pointer events
|
|
30
|
-
root.style.zIndex = "9999";
|
|
31
|
-
root.style.pointerEvents = shouldDisablePointerEvents ? "none" : "auto";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const container = portalContainer || document.body;
|
|
35
|
-
container.appendChild(root);
|
|
36
|
-
setRootRef(root);
|
|
37
|
-
return () => {
|
|
38
|
-
if (container.contains(root)) {
|
|
39
|
-
container.removeChild(root);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}, [mounted, rootClassName, inheritViewport, shouldDisablePointerEvents, portalContainer]);
|
|
43
|
-
return rootRef ? createPortal(children, rootRef) : null;
|
|
44
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Portal";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Spacer } from './Spacer';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { twJoin } from "tailwind-merge";
|
|
3
|
-
import "./SubSection.css";
|
|
4
|
-
export const SubSection = ({ children, style, variant = "contained", className, }) => (_jsx("div", { className: twJoin("bbn-subsection", `bbn-subsection-${variant}`, className), style: style, children: children }));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { SubSection } from "./SubSection";
|
|
3
|
-
import { Text } from "../Text";
|
|
4
|
-
const meta = {
|
|
5
|
-
component: SubSection,
|
|
6
|
-
tags: ["autodocs"],
|
|
7
|
-
};
|
|
8
|
-
export default meta;
|
|
9
|
-
export const Default = {
|
|
10
|
-
args: {
|
|
11
|
-
children: _jsx(Text, { children: "Lorem ipsum dolor sit amet" }),
|
|
12
|
-
},
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SubSection } from "./SubSection";
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useMemo, useCallback, forwardRef, useImperativeHandle } from "react";
|
|
3
|
-
import { twJoin } from "tailwind-merge";
|
|
4
|
-
import { useTableScroll } from "@/hooks/useTableScroll";
|
|
5
|
-
import { useFrozenColumns } from "@/hooks/useFrozenColumns";
|
|
6
|
-
import { TableContext } from "../../context/Table.context";
|
|
7
|
-
import { Column } from "./components/Column";
|
|
8
|
-
import "./Table.css";
|
|
9
|
-
import { useControlledState } from "@/hooks/useControlledState";
|
|
10
|
-
import { useTableSort } from "@/hooks/useTableSort";
|
|
11
|
-
import { Row } from "./components/Row";
|
|
12
|
-
function TableBase({ data, columns, className, wrapperClassName, fluid = false, hasMore = false, loading = false, onLoadMore, onRowSelect, isRowSelectable, selectedRow: selectedRowProp, defaultSelectedRow, onSelectedRowChange, ...restProps }, ref) {
|
|
13
|
-
const tableRef = useRef(null);
|
|
14
|
-
useImperativeHandle(ref, () => tableRef.current, []);
|
|
15
|
-
const { sortStates, handleColumnSort, sortedData } = useTableSort(data, columns);
|
|
16
|
-
const { isScrolledTop } = useTableScroll(tableRef, { onLoadMore, hasMore, loading });
|
|
17
|
-
const { isLeftScrolled, isRightScrolled } = useFrozenColumns(tableRef);
|
|
18
|
-
const [selectedRow, setSelectedRow] = useControlledState({
|
|
19
|
-
value: selectedRowProp,
|
|
20
|
-
defaultValue: defaultSelectedRow ?? null,
|
|
21
|
-
onStateChange: onSelectedRowChange,
|
|
22
|
-
});
|
|
23
|
-
const handleRowSelect = useCallback((row) => {
|
|
24
|
-
if (!onRowSelect || (isRowSelectable && !isRowSelectable(row)))
|
|
25
|
-
return;
|
|
26
|
-
const newValue = selectedRow === row.id ? null : row.id;
|
|
27
|
-
setSelectedRow(newValue);
|
|
28
|
-
onRowSelect(newValue === null ? null : row);
|
|
29
|
-
}, [onRowSelect, isRowSelectable, selectedRow, setSelectedRow]);
|
|
30
|
-
const contextValue = useMemo(() => ({
|
|
31
|
-
data: sortedData,
|
|
32
|
-
columns,
|
|
33
|
-
sortStates,
|
|
34
|
-
onColumnSort: handleColumnSort,
|
|
35
|
-
onRowSelect: handleRowSelect,
|
|
36
|
-
}), [sortedData, columns, sortStates, handleColumnSort, handleRowSelect]);
|
|
37
|
-
const isHeadVisible = useMemo(() => {
|
|
38
|
-
return columns.some((column) => column.header && column.header !== '');
|
|
39
|
-
}, [columns]);
|
|
40
|
-
return (_jsx(TableContext.Provider, { value: contextValue, children: _jsx("div", { ref: tableRef, className: twJoin("bbn-table-wrapper", fluid && "bbn-table-wrapper-fluid", wrapperClassName), children: _jsxs("table", { className: twJoin("bbn-table", fluid && "bbn-table-fluid", className), ...restProps, children: [_jsx("thead", { className: twJoin("bbn-table-header", isScrolledTop && "scrolled-top", !isHeadVisible && "hidden"), children: _jsx("tr", { children: columns.map((column) => (_jsx(Column, { className: column.headerClassName, name: column.key, sorter: column.sorter, frozen: column.frozen, showFrozenShadow: (column.frozen === 'left' && isLeftScrolled) ||
|
|
41
|
-
(column.frozen === 'right' && isRightScrolled), children: column.header }, column.key))) }) }), _jsx("tbody", { className: "bbn-table-body", children: sortedData.map((row) => (_jsx(Row, { row: row, columns: columns, isSelected: selectedRow === row.id, isSelectable: isRowSelectable ? isRowSelectable(row) : true, onSelect: handleRowSelect, isLeftScrolled: isLeftScrolled, isRightScrolled: isRightScrolled }, row.id))) })] }) }) }));
|
|
42
|
-
}
|
|
43
|
-
export const Table = forwardRef(TableBase);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Table } from ".";
|
|
3
|
-
declare const meta: Meta<typeof Table>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const FrozenColumns: Story;
|
|
8
|
-
export declare const ControlledSelection: Story;
|
|
9
|
-
export declare const HeaderVisibility: Story;
|