@babylonlabs-io/core-ui 1.11.0 → 1.13.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/Accordion.js +25 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +6 -0
- package/dist/components/Accordion/Accordion.stories.js +16 -0
- package/dist/components/Accordion/components/AccordionDetails.d.ts +1 -1
- package/dist/components/Accordion/components/AccordionDetails.js +29 -0
- package/dist/components/Accordion/components/AccordionSummary.d.ts +1 -1
- package/dist/components/Accordion/components/AccordionSummary.js +10 -0
- package/dist/components/Accordion/hooks/useHeightObserver.d.ts +1 -1
- package/dist/components/Accordion/hooks/useHeightObserver.js +24 -0
- package/dist/components/Accordion/index.d.ts +4 -3
- package/dist/components/Accordion/index.js +4 -0
- package/dist/components/AmountItem/AmountItem.d.ts +1 -1
- package/dist/components/AmountItem/AmountItem.js +5 -0
- package/dist/components/AmountItem/AmountItem.stories.d.ts +6 -0
- package/dist/components/AmountItem/AmountItem.stories.js +29 -0
- package/dist/components/AmountItem/index.d.ts +1 -1
- package/dist/components/AmountItem/index.js +1 -0
- package/dist/components/Avatar/Avatar.d.ts +2 -1
- package/dist/components/Avatar/Avatar.js +6 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +7 -0
- package/dist/components/Avatar/Avatar.stories.js +18 -0
- package/dist/components/Avatar/AvatarGroup.d.ts +3 -2
- package/dist/components/Avatar/AvatarGroup.js +15 -0
- package/dist/components/Avatar/AvatarGroup.stories.d.ts +6 -0
- package/dist/components/Avatar/AvatarGroup.stories.js +21 -0
- package/dist/components/Avatar/index.d.ts +2 -2
- package/dist/components/Avatar/index.js +2 -0
- package/dist/components/Badge/Badge.d.ts +2 -1
- package/dist/components/Badge/Badge.js +10 -0
- package/dist/components/Badge/Badge.stories.d.ts +6 -0
- package/dist/components/Badge/Badge.stories.js +14 -0
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.js +1 -0
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Button/Button.js +8 -0
- package/dist/components/Button/Button.stories.d.ts +6 -0
- package/dist/components/Button/Button.stories.js +9 -0
- package/dist/components/Button/IconButton.d.ts +2 -1
- package/dist/components/Button/IconButton.js +6 -0
- package/dist/components/Button/IconButton.stories.d.ts +6 -0
- package/dist/components/Button/IconButton.stories.js +13 -0
- package/dist/components/Button/WalletDisconnectButton.d.ts +2 -2
- package/dist/components/Button/WalletDisconnectButton.js +8 -0
- package/dist/components/Button/index.d.ts +3 -3
- package/dist/components/Button/index.js +3 -0
- package/dist/components/Card/Card.d.ts +4 -3
- package/dist/components/Card/Card.js +6 -0
- package/dist/components/Card/Card.stories.d.ts +6 -0
- package/dist/components/Card/Card.stories.js +10 -0
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Card/index.js +1 -0
- package/dist/components/Chip/Chip.d.ts +2 -1
- package/dist/components/Chip/Chip.js +6 -0
- package/dist/components/Chip/Chip.stories.d.ts +6 -0
- package/dist/components/Chip/Chip.stories.js +9 -0
- package/dist/components/Chip/index.d.ts +1 -1
- package/dist/components/Chip/index.js +1 -0
- package/dist/components/Copy/Copy.d.ts +1 -1
- package/dist/components/Copy/Copy.js +29 -0
- package/dist/components/Copy/index.js +1 -0
- package/dist/components/CounterButton/CounterButton.js +8 -0
- package/dist/components/CounterButton/CounterButton.stories.d.ts +10 -0
- package/dist/components/CounterButton/CounterButton.stories.js +41 -0
- package/dist/components/CounterButton/index.d.ts +1 -1
- package/dist/components/CounterButton/index.js +1 -0
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/Dialog.js +9 -0
- package/dist/components/Dialog/Dialog.stories.d.ts +7 -0
- package/dist/components/Dialog/Dialog.stories.js +41 -0
- package/dist/components/Dialog/MobileDialog.d.ts +1 -1
- package/dist/components/Dialog/MobileDialog.js +10 -0
- package/dist/components/Dialog/MobileDialog.stories.d.ts +6 -0
- package/dist/components/Dialog/MobileDialog.stories.js +27 -0
- package/dist/components/Dialog/components/Backdrop.d.ts +2 -1
- package/dist/components/Dialog/components/Backdrop.js +4 -0
- package/dist/components/Dialog/components/DialogBody.d.ts +1 -1
- package/dist/components/Dialog/components/DialogBody.js +3 -0
- package/dist/components/Dialog/components/DialogFooter.d.ts +1 -1
- package/dist/components/Dialog/components/DialogFooter.js +3 -0
- package/dist/components/Dialog/components/DialogHeader.d.ts +1 -1
- package/dist/components/Dialog/components/DialogHeader.js +5 -0
- package/dist/components/Dialog/index.d.ts +6 -5
- package/dist/components/Dialog/index.js +6 -0
- package/dist/components/DisplayHash/DisplayHash.d.ts +1 -1
- package/dist/components/DisplayHash/DisplayHash.js +10 -0
- package/dist/components/DisplayHash/index.js +1 -0
- package/dist/{widgets/sections/FeesSection → components/FeeItem}/FeeItem.d.ts +1 -1
- package/dist/components/FeeItem/FeeItem.js +6 -0
- package/dist/components/FeeItem/FeeItem.stories.d.ts +7 -0
- package/dist/components/FeeItem/FeeItem.stories.js +19 -0
- package/dist/components/Form/Checkbox.d.ts +2 -2
- package/dist/components/Form/Checkbox.js +10 -0
- package/dist/components/Form/Checkbox.stories.d.ts +6 -0
- package/dist/components/Form/Checkbox.stories.js +13 -0
- package/dist/components/Form/FormControl.d.ts +2 -1
- package/dist/components/Form/FormControl.js +6 -0
- package/dist/components/Form/FormControl.stories.d.ts +8 -0
- package/dist/components/Form/FormControl.stories.js +30 -0
- package/dist/components/Form/Input.d.ts +3 -2
- package/dist/components/Form/Input.js +8 -0
- package/dist/components/Form/Input.stories.d.ts +10 -0
- package/dist/components/Form/Input.stories.js +43 -0
- package/dist/components/Form/Radio.d.ts +2 -2
- package/dist/components/Form/Radio.js +10 -0
- package/dist/components/Form/Radio.stories.d.ts +6 -0
- package/dist/components/Form/Radio.stories.js +13 -0
- package/dist/components/Form/Select.d.ts +3 -2
- package/dist/components/Form/Select.js +39 -0
- package/dist/components/Form/Select.stories.d.ts +9 -0
- package/dist/components/Form/Select.stories.js +47 -0
- package/dist/components/Form/components/Toggle.d.ts +3 -2
- package/dist/components/Form/components/Toggle.js +22 -0
- package/dist/components/Form/index.d.ts +5 -5
- package/dist/components/Form/index.js +5 -0
- package/dist/components/Heading/Heading.d.ts +3 -2
- package/dist/components/Heading/Heading.js +9 -0
- package/dist/components/Heading/Heading.stories.d.ts +6 -0
- package/dist/components/Heading/Heading.stories.js +10 -0
- package/dist/components/Heading/index.d.ts +1 -1
- package/dist/components/Heading/index.js +1 -0
- package/dist/components/Icons/ThemedIcon.js +25 -0
- package/dist/components/Icons/common/CloseIcon.d.ts +1 -1
- package/dist/components/Icons/common/CloseIcon.js +7 -0
- package/dist/components/Icons/common/CopyIcon.d.ts +1 -1
- package/dist/components/Icons/common/CopyIcon.js +7 -0
- package/dist/components/Icons/index.d.ts +6 -6
- package/dist/components/Icons/index.js +18 -0
- package/dist/components/Icons/wallet/BitcoinPublicKeyIcon.d.ts +1 -1
- package/dist/components/Icons/wallet/BitcoinPublicKeyIcon.js +5 -0
- package/dist/components/Icons/wallet/LinkWalletIcon.d.ts +1 -1
- package/dist/components/Icons/wallet/LinkWalletIcon.js +5 -0
- package/dist/components/Icons/wallet/UsingInscriptionIcon.d.ts +1 -1
- package/dist/components/Icons/wallet/UsingInscriptionIcon.js +5 -0
- package/dist/components/List/List.d.ts +3 -2
- package/dist/components/List/List.js +16 -0
- package/dist/components/List/List.stories.d.ts +11 -0
- package/dist/components/List/List.stories.js +69 -0
- package/dist/components/List/components/ListItem.js +6 -0
- package/dist/components/List/index.d.ts +2 -2
- package/dist/components/List/index.js +2 -0
- package/dist/components/ListLegacy/ListLegacy.d.ts +3 -2
- package/dist/components/ListLegacy/ListLegacy.js +16 -0
- package/dist/components/ListLegacy/ListLegacy.stories.d.ts +11 -0
- package/dist/components/ListLegacy/ListLegacy.stories.js +71 -0
- package/dist/components/ListLegacy/components/ListItemLegacy.js +6 -0
- package/dist/components/ListLegacy/index.d.ts +2 -2
- package/dist/components/ListLegacy/index.js +2 -0
- package/dist/components/Loader/Loader.d.ts +1 -0
- package/dist/components/Loader/Loader.js +6 -0
- package/dist/components/Loader/Loader.stories.d.ts +6 -0
- package/dist/components/Loader/Loader.stories.js +11 -0
- package/dist/components/Loader/index.d.ts +1 -1
- package/dist/components/Loader/index.js +1 -0
- package/dist/components/Menu/Menu.d.ts +2 -2
- package/dist/components/Menu/Menu.js +29 -0
- package/dist/components/Menu/Menu.stories.d.ts +6 -0
- package/dist/components/Menu/Menu.stories.js +38 -0
- package/dist/components/Menu/MenuContext.d.ts +1 -1
- package/dist/components/Menu/MenuContext.js +9 -0
- package/dist/components/Menu/MenuDrawer.d.ts +1 -1
- package/dist/components/Menu/MenuDrawer.js +22 -0
- package/dist/components/Menu/MenuItem.d.ts +1 -1
- package/dist/components/Menu/MenuItem.js +20 -0
- package/dist/components/Menu/SubMenu.d.ts +1 -1
- package/dist/components/Menu/SubMenu.js +12 -0
- package/dist/components/Menu/SubMenuItem.d.ts +1 -1
- package/dist/components/Menu/SubMenuItem.js +6 -0
- package/dist/components/Menu/index.d.ts +6 -6
- package/dist/components/Menu/index.js +6 -0
- package/dist/components/Popover/Popover.d.ts +3 -2
- package/dist/components/Popover/Popover.js +16 -0
- package/dist/components/Popover/Popover.stories.d.ts +6 -0
- package/dist/components/Popover/Popover.stories.js +25 -0
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/Popover/index.js +1 -0
- package/dist/components/Portal/Portal.d.ts +2 -2
- package/dist/components/Portal/Portal.js +45 -0
- package/dist/components/Portal/index.d.ts +1 -1
- package/dist/components/Portal/index.js +1 -0
- package/dist/components/Spacer/Spacer.d.ts +1 -1
- package/dist/components/Spacer/Spacer.js +9 -0
- package/dist/components/Spacer/index.js +1 -0
- package/dist/components/SubSection/SubSection.d.ts +1 -1
- package/dist/components/SubSection/SubSection.js +3 -0
- package/dist/components/SubSection/SubSection.stories.d.ts +6 -0
- package/dist/components/SubSection/SubSection.stories.js +13 -0
- package/dist/components/SubSection/index.d.ts +1 -1
- package/dist/components/SubSection/index.js +1 -0
- package/dist/components/Table/Table.d.ts +2 -1
- package/dist/components/Table/Table.js +37 -0
- package/dist/components/Table/Table.stories.d.ts +7 -0
- package/dist/components/Table/Table.stories.js +131 -0
- package/dist/components/Table/components/Cell.d.ts +1 -1
- package/dist/components/Table/components/Cell.js +6 -0
- package/dist/components/Table/components/Column.d.ts +1 -1
- package/dist/components/Table/components/Column.js +17 -0
- package/dist/components/Table/components/Row.d.ts +1 -1
- package/dist/components/Table/components/Row.js +6 -0
- package/dist/components/Table/index.d.ts +4 -4
- package/dist/components/Table/index.js +4 -0
- package/dist/components/Table/types/index.d.ts +1 -1
- package/dist/components/Table/types/index.js +1 -0
- package/dist/components/Text/Text.d.ts +3 -2
- package/dist/components/Text/Text.js +11 -0
- package/dist/components/Text/Text.stories.d.ts +6 -0
- package/dist/components/Text/Text.stories.js +10 -0
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Text/index.js +1 -0
- package/dist/components/Toggle/Toggle.d.ts +1 -0
- package/dist/components/Toggle/Toggle.js +12 -0
- package/dist/components/Toggle/Toggle.stories.d.ts +6 -0
- package/dist/components/Toggle/Toggle.stories.js +14 -0
- package/dist/components/Toggle/index.d.ts +1 -1
- package/dist/components/Toggle/index.js +1 -0
- package/dist/components/Warning/Warning.d.ts +6 -0
- package/dist/components/Warning/Warning.js +6 -0
- package/dist/components/Warning/Warning.stories.d.ts +9 -0
- package/dist/components/Warning/Warning.stories.js +26 -0
- package/dist/components/Warning/index.d.ts +1 -0
- package/dist/components/Warning/index.js +1 -0
- package/dist/components/index.js +3 -0
- package/dist/context/Dialog.context.d.ts +2 -2
- package/dist/context/Dialog.context.js +33 -0
- package/dist/context/Table.context.d.ts +2 -2
- package/dist/context/Table.context.js +8 -0
- package/dist/elements/FinalityProviderItem/FinalityProviderItem.js +30 -0
- package/dist/elements/FinalityProviderItem/FinalityProviderItem.stories.d.ts +12 -0
- package/dist/elements/FinalityProviderItem/FinalityProviderItem.stories.js +97 -0
- package/dist/elements/FinalityProviderItem/index.d.ts +1 -1
- package/dist/elements/FinalityProviderItem/index.js +1 -0
- package/dist/elements/FinalityProviderLogo/FinalityProviderLogo.js +24 -0
- package/dist/elements/FinalityProviderLogo/FinalityProviderLogo.stories.d.ts +13 -0
- package/dist/elements/FinalityProviderLogo/FinalityProviderLogo.stories.js +61 -0
- package/dist/elements/FinalityProviderLogo/index.d.ts +1 -1
- package/dist/elements/FinalityProviderLogo/index.js +1 -0
- package/dist/elements/Icons/ChevronRightIcon.d.ts +1 -1
- package/dist/elements/Icons/ChevronRightIcon.js +2 -0
- package/dist/elements/Icons/SettingsIcon.d.ts +1 -1
- package/dist/elements/Icons/SettingsIcon.js +2 -0
- package/dist/elements/Icons/index.js +2 -0
- package/dist/elements/ProvidersList/ProvidersList.js +9 -0
- package/dist/elements/ProvidersList/ProvidersList.stories.d.ts +10 -0
- package/dist/elements/ProvidersList/ProvidersList.stories.js +139 -0
- package/dist/elements/ProvidersList/index.d.ts +1 -1
- package/dist/elements/ProvidersList/index.js +1 -0
- package/dist/elements/Table/Table.d.ts +6 -0
- package/dist/elements/Table/Table.js +14 -0
- package/dist/elements/Table/Table.stories.d.ts +8 -0
- package/dist/elements/Table/Table.stories.js +50 -0
- package/dist/elements/Table/index.d.ts +1 -0
- package/dist/elements/Table/index.js +1 -0
- package/dist/hooks/index.js +9 -0
- package/dist/hooks/useClickOutside.js +17 -0
- package/dist/hooks/useControlledState.js +13 -0
- package/dist/hooks/useCopy.js +48 -0
- package/dist/hooks/useIsMobile.js +33 -0
- package/dist/hooks/useMemoizedArray.js +22 -0
- package/dist/hooks/useModalManager.js +28 -0
- package/dist/hooks/useResizeObserver.js +21 -0
- package/dist/hooks/useTableScroll.d.ts +1 -1
- package/dist/hooks/useTableScroll.js +22 -0
- package/dist/hooks/useTableSort.d.ts +1 -1
- package/dist/hooks/useTableSort.js +46 -0
- package/dist/images/status/close_icon.svg +4 -0
- package/dist/images/status/warning_dark2.svg +10 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +45 -43
- package/dist/index.es.js +1341 -1292
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +45 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +3 -0
- package/dist/utils/css.js +6 -0
- package/dist/utils/helpers.d.ts +7 -0
- package/dist/utils/helpers.js +71 -0
- package/dist/utils/trim.js +14 -0
- package/dist/widgets/form/CheckboxField/CheckboxField.d.ts +1 -1
- package/dist/widgets/form/CheckboxField/CheckboxField.js +7 -0
- package/dist/widgets/form/CheckboxField/CheckboxField.stories.d.ts +6 -0
- package/dist/widgets/form/CheckboxField/CheckboxField.stories.js +17 -0
- package/dist/widgets/form/CheckboxField/index.d.ts +1 -1
- package/dist/widgets/form/CheckboxField/index.js +1 -0
- package/dist/widgets/form/Form/Form.d.ts +3 -3
- package/dist/widgets/form/Form/Form.js +20 -0
- package/dist/widgets/form/Form/Form.stories.d.ts +6 -0
- package/dist/widgets/form/Form/Form.stories.js +27 -0
- package/dist/widgets/form/Form/index.d.ts +1 -1
- package/dist/widgets/form/Form/index.js +1 -0
- package/dist/widgets/form/HiddenField/HiddenField.d.ts +1 -1
- package/dist/widgets/form/HiddenField/HiddenField.js +13 -0
- package/dist/widgets/form/HiddenField/HiddenField.stories.d.ts +6 -0
- package/dist/widgets/form/HiddenField/HiddenField.stories.js +17 -0
- package/dist/widgets/form/HiddenField/index.d.ts +1 -1
- package/dist/widgets/form/HiddenField/index.js +1 -0
- package/dist/widgets/form/NumberField/NumberField.d.ts +2 -2
- package/dist/widgets/form/NumberField/NumberField.js +15 -0
- package/dist/widgets/form/NumberField/NumberField.stories.d.ts +6 -0
- package/dist/widgets/form/NumberField/NumberField.stories.js +31 -0
- package/dist/widgets/form/NumberField/index.d.ts +1 -1
- package/dist/widgets/form/NumberField/index.js +1 -0
- package/dist/widgets/form/RadioField/RadioField.d.ts +1 -1
- package/dist/widgets/form/RadioField/RadioField.js +7 -0
- package/dist/widgets/form/RadioField/RadioField.stories.d.ts +6 -0
- package/dist/widgets/form/RadioField/RadioField.stories.js +14 -0
- package/dist/widgets/form/RadioField/index.d.ts +1 -1
- package/dist/widgets/form/RadioField/index.js +1 -0
- package/dist/widgets/form/SelectField/SelectField.d.ts +3 -3
- package/dist/widgets/form/SelectField/SelectField.js +13 -0
- package/dist/widgets/form/SelectField/SelectField.stories.d.ts +6 -0
- package/dist/widgets/form/SelectField/SelectField.stories.js +33 -0
- package/dist/widgets/form/SelectField/index.d.ts +1 -1
- package/dist/widgets/form/SelectField/index.js +1 -0
- package/dist/widgets/form/TextField/TextField.d.ts +2 -2
- package/dist/widgets/form/TextField/TextField.js +9 -0
- package/dist/widgets/form/TextField/TextField.stories.d.ts +6 -0
- package/dist/widgets/form/TextField/TextField.stories.js +28 -0
- package/dist/widgets/form/TextField/index.d.ts +1 -1
- package/dist/widgets/form/TextField/index.js +1 -0
- package/dist/widgets/form/hooks.d.ts +3 -3
- package/dist/widgets/form/hooks.js +29 -0
- package/dist/widgets/form/types.js +1 -0
- package/dist/widgets/sections/AmountSubsection/AmountSubsection.js +29 -0
- package/dist/widgets/sections/AmountSubsection/AmountSubsection.stories.d.ts +6 -0
- package/dist/widgets/sections/AmountSubsection/AmountSubsection.stories.js +35 -0
- package/dist/widgets/sections/AmountSubsection/index.d.ts +1 -1
- package/dist/widgets/sections/AmountSubsection/index.js +1 -0
- package/dist/widgets/sections/FeesSection/BBNFeeAmount.js +7 -0
- package/dist/widgets/sections/FeesSection/BTCFeeAmount.js +19 -0
- package/dist/widgets/sections/FeesSection/BTCFeeRate.js +7 -0
- package/dist/widgets/sections/FeesSection/FeesSection.js +10 -0
- package/dist/widgets/sections/FeesSection/FeesSection.stories.d.ts +6 -0
- package/dist/widgets/sections/FeesSection/FeesSection.stories.js +14 -0
- package/dist/widgets/sections/FeesSection/Total.js +20 -0
- package/dist/widgets/sections/FeesSection/index.d.ts +6 -6
- package/dist/widgets/sections/FeesSection/index.js +6 -0
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.d.ts +1 -1
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.js +9 -0
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.stories.d.ts +13 -0
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.stories.js +191 -0
- package/dist/widgets/sections/FinalityProviderSubsection/index.d.ts +1 -1
- package/dist/widgets/sections/FinalityProviderSubsection/index.js +1 -0
- package/dist/widgets/sections/PreviewModal/PreviewModal.d.ts +1 -1
- package/dist/widgets/sections/PreviewModal/PreviewModal.js +37 -0
- package/dist/widgets/sections/PreviewModal/PreviewModal.stories.d.ts +6 -0
- package/dist/widgets/sections/PreviewModal/PreviewModal.stories.js +47 -0
- package/dist/widgets/sections/PreviewModal/index.d.ts +1 -1
- package/dist/widgets/sections/PreviewModal/index.js +1 -0
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.d.ts +25 -0
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.js +16 -0
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.stories.d.ts +7 -0
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.stories.js +60 -0
- package/dist/widgets/sections/RewardsSubsection/RewardsSubsection.js +13 -0
- package/dist/widgets/sections/RewardsSubsection/RewardsSubsection.stories.d.ts +7 -0
- package/dist/widgets/sections/RewardsSubsection/RewardsSubsection.stories.js +60 -0
- package/dist/widgets/sections/RewardsSubsection/index.d.ts +1 -1
- package/dist/widgets/sections/RewardsSubsection/index.js +1 -0
- package/dist/widgets/sections/SettingMenu/SettingMenu.d.ts +3 -3
- package/dist/widgets/sections/SettingMenu/SettingMenu.js +17 -0
- package/dist/widgets/sections/SettingMenu/SettingMenu.stories.d.ts +5 -0
- package/dist/widgets/sections/SettingMenu/SettingMenu.stories.js +35 -0
- package/dist/widgets/sections/SettingMenu/components/SettingMenuCustomContent.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuCustomContent.js +2 -0
- package/dist/widgets/sections/SettingMenu/components/SettingMenuDescription.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuDescription.js +4 -0
- package/dist/widgets/sections/SettingMenu/components/SettingMenuGroup.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuGroup.js +15 -0
- package/dist/widgets/sections/SettingMenu/components/SettingMenuItem.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuItem.js +13 -0
- package/dist/widgets/sections/SettingMenu/components/SettingMenuSubMenu.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuSubMenu.js +14 -0
- package/dist/widgets/sections/SettingMenu/components/SettingMenuTitle.d.ts +1 -1
- package/dist/widgets/sections/SettingMenu/components/SettingMenuTitle.js +4 -0
- package/dist/widgets/sections/SettingMenu/components/index.d.ts +12 -12
- package/dist/widgets/sections/SettingMenu/components/index.js +6 -0
- package/dist/widgets/sections/SettingMenu/index.d.ts +14 -14
- package/dist/widgets/sections/SettingMenu/index.js +7 -0
- package/dist/widgets/sections/TableElement/TableElement.d.ts +1 -1
- package/dist/widgets/sections/TableElement/TableElement.js +6 -0
- package/dist/widgets/sections/TableElement/TableElement.stories.d.ts +9 -0
- package/dist/widgets/sections/TableElement/TableElement.stories.js +54 -0
- package/dist/widgets/sections/TableElement/index.d.ts +1 -1
- package/dist/widgets/sections/TableElement/index.js +1 -0
- package/dist/widgets/sections/WalletMenu/WalletMenu.d.ts +1 -1
- package/dist/widgets/sections/WalletMenu/WalletMenu.js +22 -0
- package/dist/widgets/sections/WalletMenu/WalletMenu.stories.d.ts +6 -0
- package/dist/widgets/sections/WalletMenu/WalletMenu.stories.js +35 -0
- package/dist/widgets/sections/WalletMenu/components/WalletInfoCard.d.ts +1 -1
- package/dist/widgets/sections/WalletMenu/components/WalletInfoCard.js +9 -0
- package/dist/widgets/sections/WalletMenu/components/WalletInfoSection.d.ts +1 -1
- package/dist/widgets/sections/WalletMenu/components/WalletInfoSection.js +8 -0
- package/dist/widgets/sections/WalletMenu/components/WalletSettingItem.d.ts +1 -1
- package/dist/widgets/sections/WalletMenu/components/WalletSettingItem.js +7 -0
- package/dist/widgets/sections/WalletMenu/components/WalletToggle.d.ts +1 -1
- package/dist/widgets/sections/WalletMenu/components/WalletToggle.js +12 -0
- package/dist/widgets/sections/WalletMenu/components/index.js +4 -0
- package/dist/widgets/sections/WalletMenu/index.js +5 -0
- package/package.json +5 -9
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useCallback, useRef, useMemo, useImperativeHandle, } from "react";
|
|
3
|
+
import { twJoin } from "tailwind-merge";
|
|
4
|
+
import { RiArrowDownSLine } from "react-icons/ri";
|
|
5
|
+
import { Popover } from "@/components/Popover";
|
|
6
|
+
import { useControlledState } from "@/hooks/useControlledState";
|
|
7
|
+
import "./Select.css";
|
|
8
|
+
import { useResizeObserver } from "@/hooks/useResizeObserver";
|
|
9
|
+
const defaultOptionRenderer = (option) => option.label;
|
|
10
|
+
export const Select = forwardRef(({ disabled, className, value, defaultValue, placeholder = "Select option", open, defaultOpen, options = [], optionClassName, popoverClassName, state = "default", onOpen, onSelect, onClose, renderSelectedOption = defaultOptionRenderer, ...props }, ref) => {
|
|
11
|
+
const anchorEl = useRef(null);
|
|
12
|
+
useImperativeHandle(ref, () => anchorEl.current, []);
|
|
13
|
+
const { width } = useResizeObserver(anchorEl.current);
|
|
14
|
+
const [isOpen, setIsOpen] = useControlledState({
|
|
15
|
+
value: open,
|
|
16
|
+
defaultValue: defaultOpen,
|
|
17
|
+
onStateChange: (open) => void (open ? onOpen?.() : onClose?.()),
|
|
18
|
+
});
|
|
19
|
+
const [selectedValue, setSelectedValue] = useControlledState({
|
|
20
|
+
value,
|
|
21
|
+
defaultValue,
|
|
22
|
+
onStateChange: onSelect,
|
|
23
|
+
});
|
|
24
|
+
const selectedOption = useMemo(() => options.find((option) => option.value === selectedValue), [options, selectedValue]);
|
|
25
|
+
const handleSelect = useCallback((option) => {
|
|
26
|
+
setSelectedValue(option.value);
|
|
27
|
+
setIsOpen(false);
|
|
28
|
+
}, [setSelectedValue, setIsOpen]);
|
|
29
|
+
const handleClose = useCallback(() => {
|
|
30
|
+
setIsOpen(false);
|
|
31
|
+
}, [setIsOpen]);
|
|
32
|
+
const handleClick = useCallback(() => {
|
|
33
|
+
if (disabled)
|
|
34
|
+
return;
|
|
35
|
+
setIsOpen(!isOpen);
|
|
36
|
+
}, [isOpen, disabled, setIsOpen]);
|
|
37
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: anchorEl, className: twJoin("bbn-select", disabled && "bbn-select-disabled", `bbn-select-${state}`, className), onClick: handleClick, tabIndex: disabled ? -1 : 0, ...props, children: [_jsx("span", { children: selectedOption ? renderSelectedOption(selectedOption) : placeholder }), _jsx(RiArrowDownSLine, { className: twJoin("bbn-select-icon", isOpen && "bbn-select-icon-open"), size: 20 })] }), _jsx(Popover, { anchorEl: anchorEl.current, className: twJoin("bbn-select-menu custom-scrollbar", popoverClassName), open: isOpen && !disabled, onClickOutside: handleClose, offset: [0, 4], placement: "bottom-start", style: { width }, children: options.map((option) => (_jsx("div", { className: twJoin("bbn-select-option", selectedOption?.value === option.value && "bbn-select-option-selected", optionClassName), onClick: () => handleSelect(option), children: option.label }, option.value))) })] }));
|
|
38
|
+
});
|
|
39
|
+
Select.displayName = "Select";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Select } from "./Select";
|
|
3
|
+
declare const meta: Meta<typeof Select>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Controlled: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
9
|
+
export declare const CustomSelectedDisplay: Story;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Select } from "./Select";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
const meta = {
|
|
5
|
+
component: Select,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
const options = [
|
|
10
|
+
{ value: "active", label: "Active" },
|
|
11
|
+
{ value: "inactive", label: "Inactive" },
|
|
12
|
+
{ value: "pending", label: "Pending" },
|
|
13
|
+
];
|
|
14
|
+
export const Default = {
|
|
15
|
+
args: {
|
|
16
|
+
options,
|
|
17
|
+
placeholder: "Select status",
|
|
18
|
+
onSelect: console.log,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export const Controlled = {
|
|
22
|
+
render: (args) => {
|
|
23
|
+
const defaultValue = args.defaultValue ?? "pending";
|
|
24
|
+
const [value, setValue] = useState(defaultValue);
|
|
25
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx(Select, { ...args, value: value, onSelect: (val) => setValue(val) }), _jsxs("p", { children: ["Default value: ", defaultValue] }), _jsxs("p", { children: ["Selected value: ", value] })] }));
|
|
26
|
+
},
|
|
27
|
+
args: {
|
|
28
|
+
defaultValue: "active",
|
|
29
|
+
options,
|
|
30
|
+
placeholder: "Select status",
|
|
31
|
+
onSelect: console.log,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const Disabled = {
|
|
35
|
+
args: {
|
|
36
|
+
options,
|
|
37
|
+
placeholder: "Select status",
|
|
38
|
+
disabled: true,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
export const CustomSelectedDisplay = {
|
|
42
|
+
args: {
|
|
43
|
+
options,
|
|
44
|
+
placeholder: "Select status",
|
|
45
|
+
renderSelectedOption: (option) => `Showing ${option.value}`,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DetailedHTMLProps, FocusEventHandler, HTMLAttributes, JSX } from
|
|
1
|
+
import { type DetailedHTMLProps, type FocusEventHandler, type HTMLAttributes, type JSX } from "react";
|
|
2
|
+
import "./Toggle.css";
|
|
2
3
|
export interface ToggleProps {
|
|
3
4
|
id?: string;
|
|
4
5
|
name?: string;
|
|
@@ -19,4 +20,4 @@ export interface ToggleProps {
|
|
|
19
20
|
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
20
21
|
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
21
22
|
}
|
|
22
|
-
export declare const Toggle: import(
|
|
23
|
+
export declare const Toggle: import("react").ForwardRefExoticComponent<ToggleProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, } from "react";
|
|
3
|
+
import { twJoin } from "tailwind-merge";
|
|
4
|
+
import "./Toggle.css";
|
|
5
|
+
import { Text } from "@/components/Text";
|
|
6
|
+
import { useControlledState } from "@/hooks/useControlledState";
|
|
7
|
+
export const Toggle = forwardRef(function Toggle({ label, checked, defaultChecked = false, inputProps, orientation = "left", disabled = false, className, inputType, labelClassName, renderIcon, onChange, ...restProps }, ref) {
|
|
8
|
+
const [checkedState = false, setCheckedState] = useControlledState({
|
|
9
|
+
value: checked,
|
|
10
|
+
defaultValue: defaultChecked,
|
|
11
|
+
onStateChange: onChange,
|
|
12
|
+
});
|
|
13
|
+
function handleChange(e) {
|
|
14
|
+
setCheckedState(e.currentTarget.checked);
|
|
15
|
+
inputProps?.onChange?.(e);
|
|
16
|
+
}
|
|
17
|
+
const toggle = (_jsxs("span", { className: twJoin("bbn-switcher", disabled && "bbn-switcher-disabled", className), children: [renderIcon(checkedState), _jsx("input", { ref: ref, type: inputType, disabled: disabled, className: "bbn-switcher-input", ...restProps, ...inputProps, checked: checkedState, onChange: handleChange })] }));
|
|
18
|
+
if (label) {
|
|
19
|
+
return (_jsxs(Text, { as: "label", variant: "body1", className: twJoin("bbn-switcher-label", orientation === "left" ? "bbn-switcher-left" : "bbn-switcher-right", labelClassName), children: [toggle, label] }));
|
|
20
|
+
}
|
|
21
|
+
return toggle;
|
|
22
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from "./Checkbox";
|
|
2
|
+
export * from "./Radio";
|
|
3
|
+
export * from "./Select";
|
|
4
|
+
export * from "./Input";
|
|
5
|
+
export * from "./FormControl";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { HTMLProps } from
|
|
1
|
+
import { type HTMLProps } from "react";
|
|
2
|
+
import "./Heading.css";
|
|
2
3
|
type HeadingVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
3
4
|
export interface HeadingProps extends HTMLProps<HTMLElement> {
|
|
4
5
|
variant: HeadingVariant;
|
|
5
6
|
as?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare const Heading: import(
|
|
8
|
+
export declare const Heading: import("react").ForwardRefExoticComponent<Omit<HeadingProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
8
9
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createElement, forwardRef } from "react";
|
|
2
|
+
import { twJoin } from "tailwind-merge";
|
|
3
|
+
import "./Heading.css";
|
|
4
|
+
export const Heading = forwardRef(({ variant, as = variant, children, className, ...restProps }, ref) => createElement(as, {
|
|
5
|
+
...restProps,
|
|
6
|
+
ref,
|
|
7
|
+
className: twJoin(`bbn-${variant}`, className),
|
|
8
|
+
}, children));
|
|
9
|
+
Heading.displayName = "Heading";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Heading } from "./Heading";
|
|
3
|
+
const meta = {
|
|
4
|
+
component: Heading,
|
|
5
|
+
tags: ["autodocs"],
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
render: (args) => args.variant ? (_jsxs(Heading, { variant: args.variant, ...args, children: ["Heading--", args.variant] })) : (_jsxs("div", { className: "text-accent-primary", children: [_jsx(Heading, { ...args, variant: "h1", children: "Heading--H1" }), _jsx(Heading, { ...args, variant: "h2", children: "Heading--H2" }), _jsx(Heading, { ...args, variant: "h3", children: "Heading--H3" }), _jsx(Heading, { ...args, variant: "h4", children: "Heading--H4" }), _jsx(Heading, { ...args, variant: "h5", children: "Heading--H5" }), _jsx(Heading, { ...args, variant: "h6", children: "Heading--H6" })] })),
|
|
10
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./Heading";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Heading";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { twJoin } from "tailwind-merge";
|
|
3
|
+
export const ThemedIcon = ({ children, className = "", size = 40, variant = "default", background = false, rounded = false, }) => {
|
|
4
|
+
const variants = {
|
|
5
|
+
default: "text-accent-secondary",
|
|
6
|
+
primary: "text-primary-light",
|
|
7
|
+
secondary: "text-accent-secondary",
|
|
8
|
+
error: "text-error-main",
|
|
9
|
+
success: "text-success-main",
|
|
10
|
+
"accent-primary": "text-accent-primary",
|
|
11
|
+
"accent-secondary": "text-accent-secondary",
|
|
12
|
+
};
|
|
13
|
+
const backgroundStyles = {
|
|
14
|
+
default: "bg-accent-secondary/10",
|
|
15
|
+
primary: "bg-primary-light/10 dark:bg-[#47484A]",
|
|
16
|
+
secondary: "bg-accent-secondary/10",
|
|
17
|
+
error: "bg-error-main/10",
|
|
18
|
+
success: "bg-success-main/10",
|
|
19
|
+
"accent-primary": "bg-accent-primary/10",
|
|
20
|
+
"accent-secondary": "bg-accent-secondary/10",
|
|
21
|
+
};
|
|
22
|
+
return (_jsx("div", { className: twJoin("flex items-center justify-center", background && backgroundStyles[variant], rounded && "rounded-full", background
|
|
23
|
+
? "[&_svg]:w-4 [&_svg]:h-4"
|
|
24
|
+
: "[&_svg]:w-full [&_svg]:h-full", "[&_svg_path]:fill-current", background && "dark:[&_svg_path]:fill-white", variants[variant], className), style: { width: size, height: size }, children: children }));
|
|
25
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IconProps } from
|
|
1
|
+
import { IconProps } from "../index";
|
|
2
2
|
export declare const CloseIcon: ({ className, size, variant, color }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { iconColorVariants } from "../index";
|
|
3
|
+
import { twJoin } from "tailwind-merge";
|
|
4
|
+
export const CloseIcon = ({ className = "", size = 14, variant = "default", color }) => {
|
|
5
|
+
const colorClass = color || iconColorVariants[variant];
|
|
6
|
+
return (_jsx("svg", { style: { width: size, height: size }, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: twJoin("transition-opacity duration-200", colorClass, className), children: _jsx("path", { d: "M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z", fill: "currentColor" }) }));
|
|
7
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IconProps } from
|
|
1
|
+
import { IconProps } from "../index";
|
|
2
2
|
export declare const CopyIcon: ({ className, size, variant, color }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { iconColorVariants } from "../index";
|
|
3
|
+
import { twJoin } from "tailwind-merge";
|
|
4
|
+
export const CopyIcon = ({ className = "", size = 16, variant = "default", color }) => {
|
|
5
|
+
const colorClass = color || iconColorVariants[variant];
|
|
6
|
+
return (_jsx("svg", { style: { width: size, height: size * 1.143 }, viewBox: "0 0 14 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: twJoin("transition-opacity duration-200", colorClass, className), children: _jsx("path", { d: "M9.99984 0.666626H1.99984C1.2665 0.666626 0.666504 1.26663 0.666504 1.99996V11.3333H1.99984V1.99996H9.99984V0.666626ZM11.9998 3.33329H4.6665C3.93317 3.33329 3.33317 3.93329 3.33317 4.66663V14C3.33317 14.7333 3.93317 15.3333 4.6665 15.3333H11.9998C12.7332 15.3333 13.3332 14.7333 13.3332 14V4.66663C13.3332 3.93329 12.7332 3.33329 11.9998 3.33329ZM11.9998 14H4.6665V4.66663H11.9998V14Z", fill: "currentColor" }) }));
|
|
7
|
+
};
|
|
@@ -15,9 +15,9 @@ export declare const iconColorVariants: {
|
|
|
15
15
|
readonly "accent-primary": "text-accent-primary";
|
|
16
16
|
readonly "accent-secondary": "text-accent-secondary";
|
|
17
17
|
};
|
|
18
|
-
export { ThemedIcon } from
|
|
19
|
-
export { BitcoinPublicKeyIcon } from
|
|
20
|
-
export { LinkWalletIcon } from
|
|
21
|
-
export { UsingInscriptionIcon } from
|
|
22
|
-
export { CopyIcon } from
|
|
23
|
-
export { CloseIcon } from
|
|
18
|
+
export { ThemedIcon } from "./ThemedIcon";
|
|
19
|
+
export { BitcoinPublicKeyIcon } from "./wallet/BitcoinPublicKeyIcon";
|
|
20
|
+
export { LinkWalletIcon } from "./wallet/LinkWalletIcon";
|
|
21
|
+
export { UsingInscriptionIcon } from "./wallet/UsingInscriptionIcon";
|
|
22
|
+
export { CopyIcon } from "./common/CopyIcon";
|
|
23
|
+
export { CloseIcon } from "./common/CloseIcon";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Color variants mapping
|
|
2
|
+
export const iconColorVariants = {
|
|
3
|
+
default: "text-accent-primary",
|
|
4
|
+
primary: "text-primary-light",
|
|
5
|
+
secondary: "text-accent-secondary",
|
|
6
|
+
error: "text-error-main",
|
|
7
|
+
success: "text-success-main",
|
|
8
|
+
"accent-primary": "text-accent-primary",
|
|
9
|
+
"accent-secondary": "text-accent-secondary",
|
|
10
|
+
};
|
|
11
|
+
export { ThemedIcon } from "./ThemedIcon";
|
|
12
|
+
// Wallet icons
|
|
13
|
+
export { BitcoinPublicKeyIcon } from "./wallet/BitcoinPublicKeyIcon";
|
|
14
|
+
export { LinkWalletIcon } from "./wallet/LinkWalletIcon";
|
|
15
|
+
export { UsingInscriptionIcon } from "./wallet/UsingInscriptionIcon";
|
|
16
|
+
// Common icons
|
|
17
|
+
export { CopyIcon } from "./common/CopyIcon";
|
|
18
|
+
export { CloseIcon } from "./common/CloseIcon";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IconProps } from
|
|
1
|
+
import { IconProps } from "../index";
|
|
2
2
|
export declare const BitcoinPublicKeyIcon: ({ className, size, variant, }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ThemedIcon } from "../ThemedIcon";
|
|
3
|
+
export const BitcoinPublicKeyIcon = ({ className = "", size = 24, variant = "primary", }) => {
|
|
4
|
+
return (_jsx(ThemedIcon, { variant: variant, background: true, rounded: true, className: className, children: _jsx("svg", { style: { width: size, height: size * 0.545 }, viewBox: "0 0 22 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M20 4H11.65C10.83 1.67 8.61 0 6 0C2.69 0 0 2.69 0 6C0 9.31 2.69 12 6 12C8.61 12 10.83 10.33 11.65 8H12L14 10L16 8L18 10L22 5.96L20 4ZM6 9C4.35 9 3 7.65 3 6C3 4.35 4.35 3 6 3C7.65 3 9 4.35 9 6C9 7.65 7.65 9 6 9Z" }) }) }));
|
|
5
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IconProps } from
|
|
1
|
+
import { IconProps } from "../index";
|
|
2
2
|
export declare const LinkWalletIcon: ({ className, size, variant, }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ThemedIcon } from "../ThemedIcon";
|
|
3
|
+
export const LinkWalletIcon = ({ className = "", size = 24, variant = "primary", }) => {
|
|
4
|
+
return (_jsx(ThemedIcon, { variant: variant, background: true, rounded: true, className: className, children: _jsx("svg", { style: { width: size, height: size }, viewBox: "0 0 20 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M15 0H11V2H15C16.65 2 18 3.35 18 5C18 6.65 16.65 8 15 8H11V10H15C17.76 10 20 7.76 20 5C20 2.24 17.76 0 15 0ZM9 8H5C3.35 8 2 6.65 2 5C2 3.35 3.35 2 5 2H9V0H5C2.24 0 0 2.24 0 5C0 7.76 2.24 10 5 10H9V8ZM6 4H14V6H6V4Z" }) }) }));
|
|
5
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IconProps } from
|
|
1
|
+
import { IconProps } from "../index";
|
|
2
2
|
export declare const UsingInscriptionIcon: ({ className, size, variant, }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ThemedIcon } from "../ThemedIcon";
|
|
3
|
+
export const UsingInscriptionIcon = ({ className = "", size = 24, variant = "primary", }) => {
|
|
4
|
+
return (_jsx(ThemedIcon, { variant: variant, background: true, rounded: true, className: className, children: _jsxs("svg", { style: { width: size, height: size }, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 18C5.58 18 2 14.42 2 10C2 5.58 5.58 2 10 2C14.42 2 18 5.58 18 10C18 14.42 14.42 18 10 18Z" }), _jsx("path", { d: "M10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5C7.23858 5 5 7.23858 5 10C5 12.7614 7.23858 15 10 15Z" })] }) }));
|
|
5
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from
|
|
2
|
-
import
|
|
1
|
+
import { type PropsWithChildren, ReactElement } from "react";
|
|
2
|
+
import "./List.css";
|
|
3
|
+
import { type ListItemProps, ListItem } from "./components/ListItem";
|
|
3
4
|
export interface ListProps {
|
|
4
5
|
className?: string;
|
|
5
6
|
orientation: "adaptive" | "horizontal" | "vertical";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Children, cloneElement, isValidElement } from "react";
|
|
3
|
+
import "./List.css";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
const ROW_ORIENTATION = {
|
|
6
|
+
adaptive: "adaptive",
|
|
7
|
+
horizontal: "vertical",
|
|
8
|
+
vertical: "horizontal",
|
|
9
|
+
};
|
|
10
|
+
export function List({ className, orientation = "vertical", children }) {
|
|
11
|
+
return (_jsx("div", { className: twMerge("bbn-list", `bbn-list-${orientation}`, className), children: Children.map(children, (item) => isValidElement(item)
|
|
12
|
+
? cloneElement(item, {
|
|
13
|
+
orientation: ROW_ORIENTATION[orientation],
|
|
14
|
+
})
|
|
15
|
+
: item) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { List } from "./List";
|
|
3
|
+
declare const meta: Meta<typeof List>;
|
|
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;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { MdOutlineInfo, MdAccountBalanceWallet, MdTrendingUp } from "react-icons/md";
|
|
3
|
+
import { List } from "./List";
|
|
4
|
+
import { ListItem } from "./components/ListItem";
|
|
5
|
+
const meta = {
|
|
6
|
+
component: List,
|
|
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(ListItem, { title: "Bitcoin Balance", value: "100.123456 BTC", suffix: _jsx(MdAccountBalanceWallet, { size: 20 }) }),
|
|
18
|
+
_jsx(ListItem, { title: "USD Value", value: "$4,567,890.12", suffix: _jsx(MdTrendingUp, { size: 20 }) }),
|
|
19
|
+
_jsx(ListItem, { title: "Status", value: "Active", suffix: _jsx(MdOutlineInfo, { size: 20 }) }),
|
|
20
|
+
];
|
|
21
|
+
const longContentItems = [
|
|
22
|
+
_jsx(ListItem, { title: "Very Long Bitcoin Wallet Address", value: "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh" }),
|
|
23
|
+
_jsx(ListItem, { title: "Transaction Hash with Very Long Text", value: "a1b2c3d4e5f6789012345678901234567890abcdef" }),
|
|
24
|
+
_jsx(ListItem, { 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: [_jsx(ListItem, { title: "Single Entry", value: "Only one item in list", suffix: _jsx(MdOutlineInfo, { size: 20 }) })],
|
|
68
|
+
},
|
|
69
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
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,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./List";
|
|
2
|
+
export * from "./components/ListItem";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactElement } from
|
|
2
|
-
import
|
|
1
|
+
import { type PropsWithChildren, ReactElement } from "react";
|
|
2
|
+
import "./ListLegacy.css";
|
|
3
|
+
import { type ListItemLegacyProps, ListItemLegacy } from "./components/ListItemLegacy";
|
|
3
4
|
export interface ListLegacyProps {
|
|
4
5
|
className?: string;
|
|
5
6
|
orientation: "adaptive" | "horizontal" | "vertical";
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
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,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./ListLegacy";
|
|
2
|
+
export * from "./components/ListItemLegacy";
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
}
|