@ton/appkit-react 0.0.1-alpha.2 → 0.0.2
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/README.md +211 -1
- package/dist/esm/components/block/block.js +7 -0
- package/dist/esm/components/block/block.js.map +1 -0
- package/dist/esm/components/block/block.module.css +13 -0
- package/dist/esm/components/block/block.stories.js +27 -0
- package/dist/esm/components/block/block.stories.js.map +1 -0
- package/dist/esm/components/block/index.js +9 -0
- package/dist/esm/components/block/index.js.map +1 -0
- package/dist/esm/components/button/button.js +7 -0
- package/dist/esm/components/button/button.js.map +1 -0
- package/dist/esm/components/button/button.module.css +38 -0
- package/dist/esm/components/button/button.stories.js +30 -0
- package/dist/esm/components/button/button.stories.js.map +1 -0
- package/dist/esm/components/button/index.js +9 -0
- package/dist/esm/components/button/index.js.map +1 -0
- package/dist/esm/components/circle-icon/circle-icon.js +8 -0
- package/dist/esm/components/circle-icon/circle-icon.js.map +1 -0
- package/dist/esm/components/circle-icon/circle-icon.module.css +32 -0
- package/dist/esm/components/circle-icon/circle-icon.stories.js +56 -0
- package/dist/esm/components/circle-icon/circle-icon.stories.js.map +1 -0
- package/dist/esm/components/circle-icon/index.js +9 -0
- package/dist/esm/components/circle-icon/index.js.map +1 -0
- package/dist/esm/components/ton-icon/index.js +9 -0
- package/dist/esm/components/ton-icon/index.js.map +1 -0
- package/dist/esm/components/ton-icon/ton-icon.js +8 -0
- package/dist/esm/components/ton-icon/ton-icon.js.map +1 -0
- package/dist/esm/components/ton-icon/ton-icon.stories.js +56 -0
- package/dist/esm/components/ton-icon/ton-icon.stories.js.map +1 -0
- package/dist/esm/features/balances/components/balance-badge/balance-badge.js +33 -0
- package/dist/esm/features/balances/components/balance-badge/balance-badge.js.map +1 -0
- package/dist/esm/features/balances/components/balance-badge/balance-badge.module.css +21 -0
- package/dist/esm/features/balances/components/balance-badge/balance-badge.stories.js +23 -0
- package/dist/esm/features/balances/components/balance-badge/balance-badge.stories.js.map +1 -0
- package/dist/esm/features/balances/components/balance-badge/index.js +9 -0
- package/dist/esm/features/balances/components/balance-badge/index.js.map +1 -0
- package/dist/esm/features/balances/components/currency-item/currency-item.js +8 -0
- package/dist/esm/features/balances/components/currency-item/currency-item.js.map +1 -0
- package/dist/esm/features/balances/components/currency-item/currency-item.module.css +80 -0
- package/dist/esm/features/balances/components/currency-item/currency-item.stories.js +61 -0
- package/dist/esm/features/balances/components/currency-item/currency-item.stories.js.map +1 -0
- package/dist/esm/features/balances/components/currency-item/index.js +9 -0
- package/dist/esm/features/balances/components/currency-item/index.js.map +1 -0
- package/dist/esm/features/balances/components/send-jetton-button/index.js +9 -0
- package/dist/esm/features/balances/components/send-jetton-button/index.js.map +1 -0
- package/dist/esm/features/balances/components/send-jetton-button/send-jetton-button.js +43 -0
- package/dist/esm/features/balances/components/send-jetton-button/send-jetton-button.js.map +1 -0
- package/dist/esm/features/balances/components/send-jetton-button/send-jetton-button.stories.js +41 -0
- package/dist/esm/features/balances/components/send-jetton-button/send-jetton-button.stories.js.map +1 -0
- package/dist/esm/features/balances/components/send-ton-button/index.js +9 -0
- package/dist/esm/features/balances/components/send-ton-button/index.js.map +1 -0
- package/dist/esm/features/balances/components/send-ton-button/send-ton-button.js +26 -0
- package/dist/esm/features/balances/components/send-ton-button/send-ton-button.js.map +1 -0
- package/dist/esm/features/balances/components/send-ton-button/send-ton-button.stories.js +36 -0
- package/dist/esm/features/balances/components/send-ton-button/send-ton-button.stories.js.map +1 -0
- package/dist/esm/features/balances/hooks/use-balance-by-address.js +18 -0
- package/dist/esm/features/balances/hooks/use-balance-by-address.js.map +1 -0
- package/dist/esm/features/balances/hooks/use-balance.js +17 -0
- package/dist/esm/features/balances/hooks/use-balance.js.map +1 -0
- package/dist/esm/features/balances/index.js +14 -0
- package/dist/esm/features/balances/index.js.map +1 -0
- package/dist/esm/features/jettons/hooks/use-jetton-balance-by-address.js +18 -0
- package/dist/esm/features/jettons/hooks/use-jetton-balance-by-address.js.map +1 -0
- package/dist/esm/features/jettons/hooks/use-jetton-info.js +18 -0
- package/dist/esm/features/jettons/hooks/use-jetton-info.js.map +1 -0
- package/dist/esm/features/jettons/hooks/use-jetton-wallet-address.js +18 -0
- package/dist/esm/features/jettons/hooks/use-jetton-wallet-address.js.map +1 -0
- package/dist/esm/features/jettons/hooks/use-jettons-by-address.js +18 -0
- package/dist/esm/features/jettons/hooks/use-jettons-by-address.js.map +1 -0
- package/dist/esm/features/jettons/hooks/use-jettons.js +17 -0
- package/dist/esm/features/jettons/hooks/use-jettons.js.map +1 -0
- package/dist/esm/features/jettons/hooks/use-transfer-jetton.js +16 -0
- package/dist/esm/features/jettons/hooks/use-transfer-jetton.js.map +1 -0
- package/dist/esm/features/jettons/index.js +14 -0
- package/dist/esm/features/jettons/index.js.map +1 -0
- package/dist/esm/features/network/hooks/use-network.js +17 -0
- package/dist/esm/features/network/hooks/use-network.js.map +1 -0
- package/dist/esm/features/network/hooks/use-networks.js +24 -0
- package/dist/esm/features/network/hooks/use-networks.js.map +1 -0
- package/dist/esm/features/network/index.js +11 -0
- package/dist/esm/features/network/index.js.map +1 -0
- package/dist/esm/features/nft/components/nft-item/index.js +9 -0
- package/dist/esm/features/nft/components/nft-item/index.js.map +1 -0
- package/dist/esm/features/nft/components/nft-item/nft-item.js +15 -0
- package/dist/esm/features/nft/components/nft-item/nft-item.js.map +1 -0
- package/dist/esm/features/nft/components/nft-item/nft-item.module.css +74 -0
- package/dist/esm/features/nft/components/nft-item/nft-item.stories.js +52 -0
- package/dist/esm/features/nft/components/nft-item/nft-item.stories.js.map +1 -0
- package/dist/esm/features/nft/hooks/use-nft.js +18 -0
- package/dist/esm/features/nft/hooks/use-nft.js.map +1 -0
- package/dist/esm/features/nft/hooks/use-nfts-by-address.js +18 -0
- package/dist/esm/features/nft/hooks/use-nfts-by-address.js.map +1 -0
- package/dist/esm/features/nft/hooks/use-nfts.js +17 -0
- package/dist/esm/features/nft/hooks/use-nfts.js.map +1 -0
- package/dist/esm/features/nft/hooks/use-transfer-nft.js +16 -0
- package/dist/esm/features/nft/hooks/use-transfer-nft.js.map +1 -0
- package/dist/esm/features/nft/index.js +13 -0
- package/dist/esm/features/nft/index.js.map +1 -0
- package/dist/esm/features/signing/hooks/use-sign-binary.js +27 -0
- package/dist/esm/features/signing/hooks/use-sign-binary.js.map +1 -0
- package/dist/esm/features/signing/hooks/use-sign-cell.js +28 -0
- package/dist/esm/features/signing/hooks/use-sign-cell.js.map +1 -0
- package/dist/esm/features/signing/hooks/use-sign-text.js +27 -0
- package/dist/esm/features/signing/hooks/use-sign-text.js.map +1 -0
- package/dist/esm/features/signing/index.js +11 -0
- package/dist/esm/features/signing/index.js.map +1 -0
- package/dist/esm/features/swap/hooks/use-build-swap-transaction.js +16 -0
- package/dist/esm/features/swap/hooks/use-build-swap-transaction.js.map +1 -0
- package/dist/esm/features/swap/hooks/use-swap-quote.js +16 -0
- package/dist/esm/features/swap/hooks/use-swap-quote.js.map +1 -0
- package/dist/esm/features/swap/index.js +10 -0
- package/dist/esm/features/swap/index.js.map +1 -0
- package/dist/esm/features/transaction/components/transaction/index.js +9 -0
- package/dist/esm/features/transaction/components/transaction/index.js.map +1 -0
- package/dist/esm/features/transaction/components/transaction/transaction.js +41 -0
- package/dist/esm/features/transaction/components/transaction/transaction.js.map +1 -0
- package/dist/esm/features/transaction/components/transaction/transaction.stories.js +47 -0
- package/dist/esm/features/transaction/components/transaction/transaction.stories.js.map +1 -0
- package/dist/esm/features/transaction/components/transaction-provider/index.js +9 -0
- package/dist/esm/features/transaction/components/transaction-provider/index.js.map +1 -0
- package/dist/esm/features/transaction/components/transaction-provider/transaction-provider.js +64 -0
- package/dist/esm/features/transaction/components/transaction-provider/transaction-provider.js.map +1 -0
- package/dist/esm/features/transaction/hooks/use-send-transaction.js +16 -0
- package/dist/esm/features/transaction/hooks/use-send-transaction.js.map +1 -0
- package/dist/esm/features/transaction/hooks/use-transfer-ton.js +16 -0
- package/dist/esm/features/transaction/hooks/use-transfer-ton.js.map +1 -0
- package/dist/esm/features/transaction/index.js +11 -0
- package/dist/esm/features/transaction/index.js.map +1 -0
- package/dist/esm/features/wallets/components/connect-button/index.js +9 -0
- package/dist/esm/features/wallets/components/connect-button/index.js.map +1 -0
- package/dist/esm/features/wallets/hooks/use-address.js +17 -0
- package/dist/esm/features/wallets/hooks/use-address.js.map +1 -0
- package/dist/esm/features/wallets/hooks/use-connect.js +15 -0
- package/dist/esm/features/wallets/hooks/use-connect.js.map +1 -0
- package/dist/esm/features/wallets/hooks/use-connected-wallets.js +21 -0
- package/dist/esm/features/wallets/hooks/use-connected-wallets.js.map +1 -0
- package/dist/esm/features/wallets/hooks/use-connector-by-id.js +21 -0
- package/dist/esm/features/wallets/hooks/use-connector-by-id.js.map +1 -0
- package/dist/esm/features/wallets/hooks/use-connectors.js +21 -0
- package/dist/esm/features/wallets/hooks/use-connectors.js.map +1 -0
- package/dist/esm/features/wallets/hooks/use-disconnect.js +16 -0
- package/dist/esm/features/wallets/hooks/use-disconnect.js.map +1 -0
- package/dist/esm/features/wallets/hooks/use-selected-wallet.js +28 -0
- package/dist/esm/features/wallets/hooks/use-selected-wallet.js.map +1 -0
- package/dist/esm/features/wallets/index.js +16 -0
- package/dist/esm/features/wallets/index.js.map +1 -0
- package/dist/esm/hooks/use-app-kit-theme.js +17 -0
- package/dist/esm/hooks/use-app-kit-theme.js.map +1 -0
- package/dist/esm/hooks/use-app-kit.js +17 -0
- package/dist/esm/hooks/use-app-kit.js.map +1 -0
- package/dist/esm/hooks/use-i18n.js +17 -0
- package/dist/esm/hooks/use-i18n.js.map +1 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/libs/i18n.js +14 -0
- package/dist/esm/libs/i18n.js.map +1 -0
- package/dist/esm/libs/query.js +18 -0
- package/dist/esm/libs/query.js.map +1 -0
- package/dist/esm/locales/en.js +32 -0
- package/dist/esm/locales/en.js.map +1 -0
- package/dist/esm/providers/app-kit-provider.js +9 -0
- package/dist/esm/providers/app-kit-provider.js.map +1 -0
- package/dist/esm/providers/i18n-provider.js +51 -0
- package/dist/esm/providers/i18n-provider.js.map +1 -0
- package/dist/esm/styles/index.css +88 -0
- package/dist/esm/styles/typography.module.css +92 -0
- package/dist/esm/tonconnect/tonconnect-bridge.js +27 -0
- package/dist/esm/tonconnect/tonconnect-bridge.js.map +1 -0
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -0
- package/dist/types/components/block/block.d.ts +13 -0
- package/dist/types/components/block/block.d.ts.map +1 -0
- package/dist/types/components/block/block.stories.d.ts +15 -0
- package/dist/types/components/block/block.stories.d.ts.map +1 -0
- package/dist/types/components/block/index.d.ts +9 -0
- package/dist/types/components/block/index.d.ts.map +1 -0
- package/dist/types/components/button/button.d.ts +10 -0
- package/dist/types/components/button/button.d.ts.map +1 -0
- package/dist/types/components/button/button.stories.d.ts +16 -0
- package/dist/types/components/button/button.stories.d.ts.map +1 -0
- package/dist/types/components/button/index.d.ts +9 -0
- package/dist/types/components/button/index.d.ts.map +1 -0
- package/dist/types/components/circle-icon/circle-icon.d.ts +16 -0
- package/dist/types/components/circle-icon/circle-icon.d.ts.map +1 -0
- package/dist/types/components/circle-icon/circle-icon.stories.d.ts +18 -0
- package/dist/types/components/circle-icon/circle-icon.stories.d.ts.map +1 -0
- package/dist/types/components/circle-icon/index.d.ts +9 -0
- package/dist/types/components/circle-icon/index.d.ts.map +1 -0
- package/dist/types/components/ton-icon/index.d.ts +9 -0
- package/dist/types/components/ton-icon/index.d.ts.map +1 -0
- package/dist/types/components/ton-icon/ton-icon.d.ts +14 -0
- package/dist/types/components/ton-icon/ton-icon.d.ts.map +1 -0
- package/dist/types/components/ton-icon/ton-icon.stories.d.ts +20 -0
- package/dist/types/components/ton-icon/ton-icon.stories.d.ts.map +1 -0
- package/dist/types/features/balances/components/balance-badge/balance-badge.d.ts +21 -0
- package/dist/types/features/balances/components/balance-badge/balance-badge.d.ts.map +1 -0
- package/dist/types/features/balances/components/balance-badge/balance-badge.stories.d.ts +16 -0
- package/dist/types/features/balances/components/balance-badge/balance-badge.stories.d.ts.map +1 -0
- package/dist/types/features/balances/components/balance-badge/index.d.ts +9 -0
- package/dist/types/features/balances/components/balance-badge/index.d.ts.map +1 -0
- package/dist/types/features/balances/components/currency-item/currency-item.d.ts +17 -0
- package/dist/types/features/balances/components/currency-item/currency-item.d.ts.map +1 -0
- package/dist/types/features/balances/components/currency-item/currency-item.stories.d.ts +19 -0
- package/dist/types/features/balances/components/currency-item/currency-item.stories.d.ts.map +1 -0
- package/dist/types/features/balances/components/currency-item/index.d.ts +9 -0
- package/dist/types/features/balances/components/currency-item/index.d.ts.map +1 -0
- package/dist/types/features/balances/components/send-jetton-button/index.d.ts +9 -0
- package/dist/types/features/balances/components/send-jetton-button/index.d.ts.map +1 -0
- package/dist/types/features/balances/components/send-jetton-button/send-jetton-button.d.ts +21 -0
- package/dist/types/features/balances/components/send-jetton-button/send-jetton-button.d.ts.map +1 -0
- package/dist/types/features/balances/components/send-jetton-button/send-jetton-button.stories.d.ts +22 -0
- package/dist/types/features/balances/components/send-jetton-button/send-jetton-button.stories.d.ts.map +1 -0
- package/dist/types/features/balances/components/send-ton-button/index.d.ts +9 -0
- package/dist/types/features/balances/components/send-ton-button/index.d.ts.map +1 -0
- package/dist/types/features/balances/components/send-ton-button/send-ton-button.d.ts +16 -0
- package/dist/types/features/balances/components/send-ton-button/send-ton-button.d.ts.map +1 -0
- package/dist/types/features/balances/components/send-ton-button/send-ton-button.stories.d.ts +21 -0
- package/dist/types/features/balances/components/send-ton-button/send-ton-button.stories.d.ts.map +1 -0
- package/dist/types/features/balances/hooks/use-balance-by-address.d.ts +16 -0
- package/dist/types/features/balances/hooks/use-balance-by-address.d.ts.map +1 -0
- package/dist/types/features/balances/hooks/use-balance.d.ts +16 -0
- package/dist/types/features/balances/hooks/use-balance.d.ts.map +1 -0
- package/dist/types/features/balances/index.d.ts +14 -0
- package/dist/types/features/balances/index.d.ts.map +1 -0
- package/dist/types/features/jettons/hooks/use-jetton-balance-by-address.d.ts +16 -0
- package/dist/types/features/jettons/hooks/use-jetton-balance-by-address.d.ts.map +1 -0
- package/dist/types/features/jettons/hooks/use-jetton-info.d.ts +16 -0
- package/dist/types/features/jettons/hooks/use-jetton-info.d.ts.map +1 -0
- package/dist/types/features/jettons/hooks/use-jetton-wallet-address.d.ts +16 -0
- package/dist/types/features/jettons/hooks/use-jetton-wallet-address.d.ts.map +1 -0
- package/dist/types/features/jettons/hooks/use-jettons-by-address.d.ts +16 -0
- package/dist/types/features/jettons/hooks/use-jettons-by-address.d.ts.map +1 -0
- package/dist/types/features/jettons/hooks/use-jettons.d.ts +16 -0
- package/dist/types/features/jettons/hooks/use-jettons.d.ts.map +1 -0
- package/dist/types/features/jettons/hooks/use-transfer-jetton.d.ts +14 -0
- package/dist/types/features/jettons/hooks/use-transfer-jetton.d.ts.map +1 -0
- package/dist/types/features/jettons/index.d.ts +14 -0
- package/dist/types/features/jettons/index.d.ts.map +1 -0
- package/dist/types/features/network/hooks/use-network.d.ts +14 -0
- package/dist/types/features/network/hooks/use-network.d.ts.map +1 -0
- package/dist/types/features/network/hooks/use-networks.d.ts +14 -0
- package/dist/types/features/network/hooks/use-networks.d.ts.map +1 -0
- package/dist/types/features/network/index.d.ts +10 -0
- package/dist/types/features/network/index.d.ts.map +1 -0
- package/dist/types/features/nft/components/nft-item/index.d.ts +9 -0
- package/dist/types/features/nft/components/nft-item/index.d.ts.map +1 -0
- package/dist/types/features/nft/components/nft-item/nft-item.d.ts +14 -0
- package/dist/types/features/nft/components/nft-item/nft-item.d.ts.map +1 -0
- package/dist/types/features/nft/components/nft-item/nft-item.stories.d.ts +25 -0
- package/dist/types/features/nft/components/nft-item/nft-item.stories.d.ts.map +1 -0
- package/dist/types/features/nft/hooks/use-nft.d.ts +16 -0
- package/dist/types/features/nft/hooks/use-nft.d.ts.map +1 -0
- package/dist/types/features/nft/hooks/use-nfts-by-address.d.ts +16 -0
- package/dist/types/features/nft/hooks/use-nfts-by-address.d.ts.map +1 -0
- package/dist/types/features/nft/hooks/use-nfts.d.ts +16 -0
- package/dist/types/features/nft/hooks/use-nfts.d.ts.map +1 -0
- package/dist/types/features/nft/hooks/use-transfer-nft.d.ts +14 -0
- package/dist/types/features/nft/hooks/use-transfer-nft.d.ts.map +1 -0
- package/dist/types/features/nft/index.d.ts +13 -0
- package/dist/types/features/nft/index.d.ts.map +1 -0
- package/dist/types/features/signing/hooks/use-sign-binary.d.ts +25 -0
- package/dist/types/features/signing/hooks/use-sign-binary.d.ts.map +1 -0
- package/dist/types/features/signing/hooks/use-sign-cell.d.ts +26 -0
- package/dist/types/features/signing/hooks/use-sign-cell.d.ts.map +1 -0
- package/dist/types/features/signing/hooks/use-sign-text.d.ts +25 -0
- package/dist/types/features/signing/hooks/use-sign-text.d.ts.map +1 -0
- package/dist/types/features/signing/index.d.ts +11 -0
- package/dist/types/features/signing/index.d.ts.map +1 -0
- package/dist/types/features/swap/hooks/use-build-swap-transaction.d.ts +13 -0
- package/dist/types/features/swap/hooks/use-build-swap-transaction.d.ts.map +1 -0
- package/dist/types/features/swap/hooks/use-swap-quote.d.ts +13 -0
- package/dist/types/features/swap/hooks/use-swap-quote.d.ts.map +1 -0
- package/dist/types/features/swap/index.d.ts +10 -0
- package/dist/types/features/swap/index.d.ts.map +1 -0
- package/dist/types/features/transaction/components/transaction/index.d.ts +10 -0
- package/dist/types/features/transaction/components/transaction/index.d.ts.map +1 -0
- package/dist/types/features/transaction/components/transaction/transaction.d.ts +30 -0
- package/dist/types/features/transaction/components/transaction/transaction.d.ts.map +1 -0
- package/dist/types/features/transaction/components/transaction/transaction.stories.d.ts +23 -0
- package/dist/types/features/transaction/components/transaction/transaction.stories.d.ts.map +1 -0
- package/dist/types/features/transaction/components/transaction-provider/index.d.ts +10 -0
- package/dist/types/features/transaction/components/transaction-provider/index.d.ts.map +1 -0
- package/dist/types/features/transaction/components/transaction-provider/transaction-provider.d.ts +36 -0
- package/dist/types/features/transaction/components/transaction-provider/transaction-provider.d.ts.map +1 -0
- package/dist/types/features/transaction/hooks/use-send-transaction.d.ts +14 -0
- package/dist/types/features/transaction/hooks/use-send-transaction.d.ts.map +1 -0
- package/dist/types/features/transaction/hooks/use-transfer-ton.d.ts +14 -0
- package/dist/types/features/transaction/hooks/use-transfer-ton.d.ts.map +1 -0
- package/dist/types/features/transaction/index.d.ts +11 -0
- package/dist/types/features/transaction/index.d.ts.map +1 -0
- package/dist/types/features/wallets/components/connect-button/index.d.ts +9 -0
- package/dist/types/features/wallets/components/connect-button/index.d.ts.map +1 -0
- package/dist/types/features/wallets/hooks/use-address.d.ts +13 -0
- package/dist/types/features/wallets/hooks/use-address.d.ts.map +1 -0
- package/dist/types/features/wallets/hooks/use-connect.d.ts +14 -0
- package/dist/types/features/wallets/hooks/use-connect.d.ts.map +1 -0
- package/dist/types/features/wallets/hooks/use-connected-wallets.d.ts +11 -0
- package/dist/types/features/wallets/hooks/use-connected-wallets.d.ts.map +1 -0
- package/dist/types/features/wallets/hooks/use-connector-by-id.d.ts +10 -0
- package/dist/types/features/wallets/hooks/use-connector-by-id.d.ts.map +1 -0
- package/dist/types/features/wallets/hooks/use-connectors.d.ts +11 -0
- package/dist/types/features/wallets/hooks/use-connectors.d.ts.map +1 -0
- package/dist/types/features/wallets/hooks/use-disconnect.d.ts +14 -0
- package/dist/types/features/wallets/hooks/use-disconnect.d.ts.map +1 -0
- package/dist/types/features/wallets/hooks/use-selected-wallet.d.ts +14 -0
- package/dist/types/features/wallets/hooks/use-selected-wallet.d.ts.map +1 -0
- package/dist/types/features/wallets/index.d.ts +16 -0
- package/dist/types/features/wallets/index.d.ts.map +1 -0
- package/dist/types/hooks/use-app-kit-theme.d.ts +10 -0
- package/dist/types/hooks/use-app-kit-theme.d.ts.map +1 -0
- package/dist/types/hooks/use-app-kit.d.ts +9 -0
- package/dist/types/hooks/use-app-kit.d.ts.map +1 -0
- package/dist/types/hooks/use-i18n.d.ts +9 -0
- package/dist/types/hooks/use-i18n.d.ts.map +1 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/libs/i18n.d.ts +34 -0
- package/dist/types/libs/i18n.d.ts.map +1 -0
- package/dist/types/libs/query.d.ts +26 -0
- package/dist/types/libs/query.d.ts.map +1 -0
- package/dist/types/locales/en.d.ts +29 -0
- package/dist/types/locales/en.d.ts.map +1 -0
- package/dist/types/providers/app-kit-provider.d.ts +15 -0
- package/dist/types/providers/app-kit-provider.d.ts.map +1 -0
- package/dist/types/providers/i18n-provider.d.ts +22 -0
- package/dist/types/providers/i18n-provider.d.ts.map +1 -0
- package/dist/types/tonconnect/tonconnect-bridge.d.ts +19 -0
- package/dist/types/tonconnect/tonconnect-bridge.d.ts.map +1 -0
- package/package.json +70 -7
- package/src/components/block/block.tsx +20 -0
- package/src/components/block/index.ts +9 -0
- package/src/components/button/button.tsx +16 -0
- package/src/components/button/index.ts +9 -0
- package/src/components/circle-icon/circle-icon.tsx +34 -0
- package/src/components/circle-icon/index.ts +9 -0
- package/src/components/ton-icon/index.ts +9 -0
- package/src/components/ton-icon/ton-icon.tsx +46 -0
- package/src/features/balances/components/balance-badge/balance-badge.tsx +47 -0
- package/src/features/balances/components/balance-badge/index.ts +9 -0
- package/src/features/balances/components/currency-item/currency-item.tsx +59 -0
- package/src/features/balances/components/currency-item/index.ts +9 -0
- package/src/features/balances/components/send-jetton-button/index.ts +9 -0
- package/src/features/balances/components/send-jetton-button/send-jetton-button.tsx +76 -0
- package/src/features/balances/components/send-ton-button/index.ts +9 -0
- package/src/features/balances/components/send-ton-button/send-ton-button.tsx +44 -0
- package/src/features/balances/hooks/use-balance-by-address.ts +33 -0
- package/src/features/balances/hooks/use-balance.ts +28 -0
- package/src/features/balances/index.ts +15 -0
- package/src/features/jettons/hooks/use-jetton-balance-by-address.ts +37 -0
- package/src/features/jettons/hooks/use-jetton-info.ts +32 -0
- package/src/features/jettons/hooks/use-jetton-wallet-address.ts +37 -0
- package/src/features/jettons/hooks/use-jettons-by-address.ts +33 -0
- package/src/features/jettons/hooks/use-jettons.ts +28 -0
- package/src/features/jettons/hooks/use-transfer-jetton.ts +44 -0
- package/src/features/jettons/index.ts +14 -0
- package/src/features/network/hooks/use-network.ts +23 -0
- package/src/features/network/hooks/use-networks.ts +35 -0
- package/src/features/network/index.ts +11 -0
- package/src/features/nft/components/nft-item/index.ts +9 -0
- package/src/features/nft/components/nft-item/nft-item.tsx +57 -0
- package/src/features/nft/hooks/use-nft.ts +29 -0
- package/src/features/nft/hooks/use-nfts-by-address.ts +29 -0
- package/src/features/nft/hooks/use-nfts.ts +28 -0
- package/src/features/nft/hooks/use-transfer-nft.ts +44 -0
- package/src/features/nft/index.ts +14 -0
- package/src/features/signing/hooks/use-sign-binary.ts +43 -0
- package/src/features/signing/hooks/use-sign-cell.ts +44 -0
- package/src/features/signing/hooks/use-sign-text.ts +43 -0
- package/src/features/signing/index.ts +11 -0
- package/src/features/swap/hooks/use-build-swap-transaction.ts +38 -0
- package/src/features/swap/hooks/use-swap-quote.ts +31 -0
- package/src/features/swap/index.ts +10 -0
- package/src/features/transaction/components/transaction/index.ts +10 -0
- package/src/features/transaction/components/transaction/transaction.tsx +105 -0
- package/src/features/transaction/components/transaction-provider/index.ts +10 -0
- package/src/features/transaction/components/transaction-provider/transaction-provider.tsx +114 -0
- package/src/features/transaction/hooks/use-send-transaction.ts +44 -0
- package/src/features/transaction/hooks/use-transfer-ton.ts +44 -0
- package/src/features/transaction/index.ts +12 -0
- package/src/features/wallets/components/connect-button/index.ts +9 -0
- package/src/features/wallets/hooks/use-address.ts +22 -0
- package/src/features/wallets/hooks/use-connect.ts +37 -0
- package/src/features/wallets/hooks/use-connected-wallets.ts +32 -0
- package/src/features/wallets/hooks/use-connector-by-id.ts +30 -0
- package/src/features/wallets/hooks/use-connectors.ts +32 -0
- package/src/features/wallets/hooks/use-disconnect.ts +39 -0
- package/src/features/wallets/hooks/use-selected-wallet.ts +44 -0
- package/src/features/wallets/index.ts +18 -0
- package/src/global.d.ts +12 -0
- package/src/hooks/use-app-kit-theme.ts +22 -0
- package/src/hooks/use-app-kit.ts +21 -0
- package/src/hooks/use-i18n.ts +21 -0
- package/src/index.ts +29 -0
- package/src/libs/i18n.ts +20 -0
- package/src/libs/query.ts +69 -0
- package/src/locales/en.ts +35 -0
- package/src/providers/app-kit-provider.tsx +30 -0
- package/src/providers/i18n-provider.tsx +83 -0
- package/src/tonconnect/tonconnect-bridge.tsx +39 -0
package/README.md
CHANGED
|
@@ -1 +1,211 @@
|
|
|
1
|
-
|
|
1
|
+
# @ton/appkit-react
|
|
2
|
+
|
|
3
|
+
React components and hooks for AppKit.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
- [Initialization](#initialization)
|
|
8
|
+
- [Basic Usage](#basic-usage)
|
|
9
|
+
- [Swap](#swap)
|
|
10
|
+
- [Creating a Swap Provider](./docs/creating-swap-provider.md): Implement your own swap provider for any DEX or protocol.
|
|
11
|
+
- [Hooks](./docs/hooks.md): React hooks for wallet connection, state, and data fetching.
|
|
12
|
+
- [Components](./docs/components.md): UI components for AppKit.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @ton/appkit-react @tanstack/react-query @tonconnect/ui-react @ton/core @ton/crypto
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Dependencies
|
|
21
|
+
|
|
22
|
+
`@ton/appkit-react` requires the following peer dependencies:
|
|
23
|
+
|
|
24
|
+
- `react` (>= 18.0.0)
|
|
25
|
+
- `react-dom` (>= 18.0.0)
|
|
26
|
+
- `@tanstack/react-query` (>= 5.0.0)
|
|
27
|
+
- `@tonconnect/ui-react` (>= 2.4.1)
|
|
28
|
+
|
|
29
|
+
## Initialization
|
|
30
|
+
|
|
31
|
+
Initialize `QueryClient` and `AppKit`, then wrap your application in `QueryClientProvider` and `AppKitProvider`.
|
|
32
|
+
|
|
33
|
+
> [!NOTE]
|
|
34
|
+
> Don't forget to import styles from `@ton/appkit-react/styles.css`.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
38
|
+
import { AppKit, Network, TonConnectConnector } from '@ton/appkit';
|
|
39
|
+
import { AppKitProvider } from '@ton/appkit-react';
|
|
40
|
+
import type { FC } from 'react';
|
|
41
|
+
|
|
42
|
+
// Import styles
|
|
43
|
+
import '@ton/appkit-react/styles.css';
|
|
44
|
+
|
|
45
|
+
// Initialize QueryClient
|
|
46
|
+
const queryClient = new QueryClient({
|
|
47
|
+
defaultOptions: {
|
|
48
|
+
queries: {
|
|
49
|
+
refetchOnWindowFocus: false,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Initialize AppKit
|
|
55
|
+
const appKit = new AppKit({
|
|
56
|
+
networks: {
|
|
57
|
+
[Network.mainnet().chainId]: {
|
|
58
|
+
apiClient: {
|
|
59
|
+
url: 'https://toncenter.com',
|
|
60
|
+
key: 'your-key',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
// Optional: add testnet
|
|
64
|
+
// [Network.testnet().chainId]: {
|
|
65
|
+
// apiClient: {
|
|
66
|
+
// url: 'https://testnet.toncenter.com',
|
|
67
|
+
// key: 'your-key',
|
|
68
|
+
// },
|
|
69
|
+
// },
|
|
70
|
+
},
|
|
71
|
+
connectors: [
|
|
72
|
+
new TonConnectConnector({
|
|
73
|
+
tonConnectOptions: {
|
|
74
|
+
manifestUrl: 'https://tonconnect-sdk-demo-dapp.vercel.app/tonconnect-manifest.json',
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
],
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export const App: FC = () => {
|
|
81
|
+
return (
|
|
82
|
+
<QueryClientProvider client={queryClient}>
|
|
83
|
+
<AppKitProvider appKit={appKit}>{/* <AppContent /> */}</AppKitProvider>
|
|
84
|
+
</QueryClientProvider>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
```
|
|
88
|
+
[Read more about TanStack Query](https://tanstack.com/query/latest/docs/framework/react/overview)
|
|
89
|
+
|
|
90
|
+
### TonConnect Configuration
|
|
91
|
+
|
|
92
|
+
When using `TonConnectConnector`, you can pass `tonConnectOptions` which accepts standard [TonConnectUI options](https://github.com/ton-connect/sdk/tree/main/packages/ui-react#parameters), including `manifestUrl`, `uiOptions`, etc.
|
|
93
|
+
|
|
94
|
+
## Basic Usage
|
|
95
|
+
|
|
96
|
+
### Connect Wallet
|
|
97
|
+
|
|
98
|
+
Use `TonConnectButton` to allow users to connect their wallets. It handles the connection flow and UI.
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
import { TonConnectButton } from '@ton/appkit-react';
|
|
102
|
+
|
|
103
|
+
export const Header = () => {
|
|
104
|
+
return (
|
|
105
|
+
<header>
|
|
106
|
+
<TonConnectButton />
|
|
107
|
+
</header>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Get Wallet Address
|
|
113
|
+
|
|
114
|
+
Use `useAddress` to get the currently connected wallet address.
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
import { useAddress } from '@ton/appkit-react';
|
|
118
|
+
|
|
119
|
+
export const AddressBlock = () => {
|
|
120
|
+
const address = useAddress();
|
|
121
|
+
|
|
122
|
+
if (!address) {
|
|
123
|
+
return <div>Wallet not connected</div>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return <div>Address: {address}</div>;
|
|
127
|
+
};
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Get Balance
|
|
131
|
+
|
|
132
|
+
Use `useBalance` to fetch the TON balance of the connected wallet.
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
import { useBalance } from '@ton/appkit-react';
|
|
136
|
+
|
|
137
|
+
export const Balance = () => {
|
|
138
|
+
const { data: balance, isLoading } = useBalance();
|
|
139
|
+
|
|
140
|
+
if (isLoading) {
|
|
141
|
+
return <div>Loading...</div>;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return <div>Balance: {balance?.toString()} TON</div>;
|
|
145
|
+
};
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
> See [Hooks Documentation](./docs/hooks.md) for all available hooks and [Components Documentation](./docs/components.md) for UI components.
|
|
149
|
+
|
|
150
|
+
## Swap
|
|
151
|
+
|
|
152
|
+
AppKit uses a provider-based architecture for swaps. Any DEX or protocol can implement a swap provider by extending the `SwapProvider` class — AppKit handles routing, hooks, and transaction building through a unified interface.
|
|
153
|
+
|
|
154
|
+
`OmnistonSwapProvider` is an available provider. You can use it, replace it, or run multiple providers side by side. To implement your own, see [Creating a Swap Provider](./docs/creating-swap-provider.md).
|
|
155
|
+
|
|
156
|
+
### Installation
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
npm install @ston-fi/omniston-sdk
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Setup
|
|
163
|
+
|
|
164
|
+
Initialize `AppKit` with `OmnistonSwapProvider`:
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
// Initialize AppKit with swap provider
|
|
168
|
+
const appKit = new AppKit({
|
|
169
|
+
networks: {
|
|
170
|
+
[Network.mainnet().chainId]: {
|
|
171
|
+
apiClient: {
|
|
172
|
+
url: 'https://toncenter.com',
|
|
173
|
+
key: 'your-key',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
providers: [
|
|
178
|
+
new OmnistonSwapProvider({
|
|
179
|
+
// Optional configuration
|
|
180
|
+
apiUrl: 'https://api.ston.fi',
|
|
181
|
+
defaultSlippageBps: 100, // 1%
|
|
182
|
+
}),
|
|
183
|
+
],
|
|
184
|
+
});
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Hooks
|
|
188
|
+
|
|
189
|
+
Use `useSwapQuote` to get a quote and `useBuildSwapTransaction` to build the transaction.
|
|
190
|
+
|
|
191
|
+
See [Swap Hooks](./docs/hooks.md#swap) for usage examples.
|
|
192
|
+
|
|
193
|
+
## Migration from TonConnect UI
|
|
194
|
+
|
|
195
|
+
`AppKitProvider` automatically bridges TonConnect if a `TonConnectConnector` is configured, so `@tonconnect/ui-react` hooks (like `useTonAddress`, `useTonWallet`, etc.) work out of the box inside `AppKitProvider`.
|
|
196
|
+
|
|
197
|
+
You can use standard TonConnect hooks in your components:
|
|
198
|
+
|
|
199
|
+
```tsx
|
|
200
|
+
import { useTonAddress } from '@tonconnect/ui-react';
|
|
201
|
+
|
|
202
|
+
export const AppContent: FC = () => {
|
|
203
|
+
const address = useTonAddress();
|
|
204
|
+
|
|
205
|
+
return <p>Address: {address}</p>;
|
|
206
|
+
};
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## License
|
|
210
|
+
|
|
211
|
+
MIT
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import styles from './block.module.css';
|
|
4
|
+
export const Block = ({ className, direction = 'column', ...props }) => {
|
|
5
|
+
return _jsx("div", { className: clsx(styles.block, direction === 'row' && styles.row, className), ...props });
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.js","sourceRoot":"","sources":["../../../../src/components/block/block.tsx"],"names":[],"mappings":";AASA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAMxC,MAAM,CAAC,MAAM,KAAK,GAAmB,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACnF,OAAO,cAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,KAAK,KAAK,IAAI,MAAM,CAAC,GAAG,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC3G,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Block } from './block';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Private/Components/Block',
|
|
5
|
+
component: Block,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {
|
|
8
|
+
direction: {
|
|
9
|
+
control: 'radio',
|
|
10
|
+
options: ['row', 'column'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
export const Column = {
|
|
16
|
+
args: {
|
|
17
|
+
direction: 'column',
|
|
18
|
+
children: (_jsxs(_Fragment, { children: [_jsx("div", { style: { padding: '8px', background: '#0098EB', color: 'white' }, children: "Item 1" }), _jsx("div", { style: { padding: '8px', background: '#0098EB', color: 'white' }, children: "Item 2" }), _jsx("div", { style: { padding: '8px', background: '#0098EB', color: 'white' }, children: "Item 3" })] })),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export const Row = {
|
|
22
|
+
args: {
|
|
23
|
+
direction: 'row',
|
|
24
|
+
children: (_jsxs(_Fragment, { children: [_jsx("div", { style: { padding: '8px', background: '#0098EB', color: 'white' }, children: "Item 1" }), _jsx("div", { style: { padding: '8px', background: '#0098EB', color: 'white' }, children: "Item 2" }), _jsx("div", { style: { padding: '8px', background: '#0098EB', color: 'white' }, children: "Item 3" })] })),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=block.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.stories.js","sourceRoot":"","sources":["../../../../src/components/block/block.stories.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,IAAI,GAAuB;IAC7B,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,KAAK;IAChB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACN,SAAS,EAAE;YACP,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;SAC7B;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,MAAM,GAAU;IACzB,IAAI,EAAE;QACF,SAAS,EAAE,QAAQ;QACnB,QAAQ,EAAE,CACN,8BACI,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAc,EACnF,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAc,EACnF,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAc,IACpF,CACN;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAU;IACtB,IAAI,EAAE;QACF,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,CACN,8BACI,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAc,EACnF,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAc,EACnF,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,uBAAc,IACpF,CACN;KACJ;CACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/block/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import styles from './button.module.css';
|
|
4
|
+
export const Button = ({ className, ...props }) => {
|
|
5
|
+
return _jsx("button", { className: clsx(styles.button, className), ...props });
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../../src/components/button/button.tsx"],"names":[],"mappings":";AASA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,CAAC,MAAM,MAAM,GAAiC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC5E,OAAO,iBAAQ,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC5E,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.button {
|
|
2
|
+
composes: bodyMedium from "../../styles/typography.module.css";
|
|
3
|
+
appearance: none;
|
|
4
|
+
border: none;
|
|
5
|
+
outline: none;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
padding: 8px 16px;
|
|
9
|
+
border-radius: 20px;
|
|
10
|
+
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
gap: 8px;
|
|
15
|
+
|
|
16
|
+
background-color: var(--ta-color-primary);
|
|
17
|
+
color: var(--ta-color-primary-foreground);
|
|
18
|
+
transition: transform 0.125s ease-in-out, background-color 0.2s ease;
|
|
19
|
+
will-change: transform;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.button:hover {
|
|
23
|
+
transform: scale(1.02);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.button:active {
|
|
27
|
+
transform: scale(0.98);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.button:disabled {
|
|
31
|
+
opacity: 0.5;
|
|
32
|
+
cursor: not-allowed;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.button:disabled:hover,
|
|
36
|
+
.button:disabled:active {
|
|
37
|
+
transform: none;
|
|
38
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from './button';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Public/Components/Button',
|
|
5
|
+
component: Button,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {
|
|
8
|
+
disabled: {
|
|
9
|
+
control: 'boolean',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
export const Default = {
|
|
15
|
+
args: {
|
|
16
|
+
children: 'Click me',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export const Disabled = {
|
|
20
|
+
args: {
|
|
21
|
+
children: 'Disabled Button',
|
|
22
|
+
disabled: true,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export const WithIcon = {
|
|
26
|
+
args: {
|
|
27
|
+
children: (_jsxs(_Fragment, { children: [_jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M12 5V19M5 12H19", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }), "Add Item"] })),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=button.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.stories.js","sourceRoot":"","sources":["../../../../src/components/button/button.stories.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,IAAI,GAAwB;IAC9B,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACN,QAAQ,EAAE;YACN,OAAO,EAAE,SAAS;SACrB;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC1B,IAAI,EAAE;QACF,QAAQ,EAAE,UAAU;KACvB;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC3B,IAAI,EAAE;QACF,QAAQ,EAAE,iBAAiB;QAC3B,QAAQ,EAAE,IAAI;KACjB;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC3B,IAAI,EAAE;QACF,QAAQ,EAAE,CACN,8BACI,cAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B,YAC1F,eACI,CAAC,EAAC,kBAAkB,EACpB,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACxB,GACA,gBAEP,CACN;KACJ;CACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Avatar } from 'radix-ui';
|
|
4
|
+
import styles from './circle-icon.module.css';
|
|
5
|
+
export const CircleIcon = ({ className, size = 30, src, alt, fallback, ...props }) => {
|
|
6
|
+
return (_jsxs(Avatar.Root, { className: clsx(styles.avatarRoot, className), style: { width: size, height: size }, ...props, children: [_jsx(Avatar.Image, { className: styles.avatarImage, src: src, alt: alt }), (fallback || alt) && (_jsx(Avatar.Fallback, { className: styles.avatarFallback, delayMs: 600, children: fallback ? fallback : alt?.[0] }))] }));
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=circle-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle-icon.js","sourceRoot":"","sources":["../../../../src/components/circle-icon/circle-icon.tsx"],"names":[],"mappings":";AASA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAS9C,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACtG,OAAO,CACH,MAAC,MAAM,CAAC,IAAI,IAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAM,KAAK,aACvG,KAAC,MAAM,CAAC,KAAK,IAAC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAI,EAElE,CAAC,QAAQ,IAAI,GAAG,CAAC,IAAI,CAClB,KAAC,MAAM,CAAC,QAAQ,IAAC,SAAS,EAAE,MAAM,CAAC,cAAc,EAAE,OAAO,EAAE,GAAG,YAC1D,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GACjB,CACrB,IACS,CACjB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.avatarRoot {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
vertical-align: middle;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
user-select: none;
|
|
8
|
+
width: 45px;
|
|
9
|
+
height: 45px;
|
|
10
|
+
border-radius: 100%;
|
|
11
|
+
background-color: var(--ta-color-block);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.avatarImage {
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
object-fit: cover;
|
|
18
|
+
border-radius: inherit;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.avatarFallback {
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
background-color: white;
|
|
28
|
+
color: var(--ta-color-block-foreground);
|
|
29
|
+
font-size: 15px;
|
|
30
|
+
line-height: 1;
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { CircleIcon } from './circle-icon';
|
|
9
|
+
const meta = {
|
|
10
|
+
title: 'Private/Components/CircleIcon',
|
|
11
|
+
component: CircleIcon,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
argTypes: {
|
|
14
|
+
size: {
|
|
15
|
+
control: { type: 'range', min: 20, max: 100, step: 5 },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
export const WithImage = {
|
|
21
|
+
args: {
|
|
22
|
+
size: 48,
|
|
23
|
+
src: 'https://ton.org/download/ton_symbol.png',
|
|
24
|
+
alt: 'TON',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export const WithFallback = {
|
|
28
|
+
args: {
|
|
29
|
+
size: 48,
|
|
30
|
+
fallback: 'T',
|
|
31
|
+
alt: 'TON',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const WithInvalidImage = {
|
|
35
|
+
args: {
|
|
36
|
+
size: 48,
|
|
37
|
+
src: 'https://invalid-url.com/image.png',
|
|
38
|
+
alt: 'Fallback',
|
|
39
|
+
fallback: 'F',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
export const SmallSize = {
|
|
43
|
+
args: {
|
|
44
|
+
size: 24,
|
|
45
|
+
src: 'https://ton.org/download/ton_symbol.png',
|
|
46
|
+
alt: 'TON',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
export const LargeSize = {
|
|
50
|
+
args: {
|
|
51
|
+
size: 80,
|
|
52
|
+
src: 'https://ton.org/download/ton_symbol.png',
|
|
53
|
+
alt: 'TON',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=circle-icon.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle-icon.stories.js","sourceRoot":"","sources":["../../../../src/components/circle-icon/circle-icon.stories.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,IAAI,GAA4B;IAClC,KAAK,EAAE,+BAA+B;IACtC,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACN,IAAI,EAAE;YACF,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE;SACzD;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,SAAS,GAAU;IAC5B,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,yCAAyC;QAC9C,GAAG,EAAE,KAAK;KACb;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAU;IAC/B,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;QACR,QAAQ,EAAE,GAAG;QACb,GAAG,EAAE,KAAK;KACb;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAU;IACnC,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,mCAAmC;QACxC,GAAG,EAAE,UAAU;QACf,QAAQ,EAAE,GAAG;KAChB;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC5B,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,yCAAyC;QAC9C,GAAG,EAAE,KAAK;KACb;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAU;IAC5B,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,yCAAyC;QAC9C,GAAG,EAAE,KAAK;KACb;CACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/circle-icon/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ton-icon/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const TonIcon = ({ size = 16, ...props }) => {
|
|
3
|
+
return (_jsx("svg", { width: size, height: size, viewBox: "0 0 29 29", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: _jsx("path", { d: "M23.7861 0H4.58614C1.08614 0 -1.11386 3.8 0.586136 6.9L12.3861 27.4C13.1861 28.7 15.0861 28.7 15.8861 27.4L27.6861 6.9C29.4861 3.8 27.2861 0 23.7861 0ZM12.4861 21.2L9.88614 16.2L3.68614 5.1C3.28614 4.4 3.78614 3.5 4.68614 3.5H12.4861V21.2ZM24.6861 5.1L18.4861 16.2L15.8861 21.2V3.5H23.6861C24.5861 3.5 25.0861 4.4 24.6861 5.1Z", fill: "currentColor" }) }));
|
|
4
|
+
};
|
|
5
|
+
export const TonIconCircle = ({ size = 16, ...props }) => {
|
|
6
|
+
return (_jsxs("svg", { width: size, height: size, viewBox: "0 0 56 56", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsxs("g", { clipPath: "url(#clip0_2906_144)", children: [_jsx("path", { d: "M28 56C43.5 56 56 43.5 56 28C56 12.5 43.5 0 28 0C12.5 0 0 12.5 0 28C0 43.5 12.5 56 28 56Z", fill: "#0098EA" }), _jsx("path", { d: "M37.5996 15.6H18.3996C14.8996 15.6 12.6996 19.4 14.3996 22.5L26.1996 43C26.9996 44.3 28.8996 44.3 29.6996 43L41.4996 22.5C43.2996 19.4 41.0996 15.6 37.5996 15.6ZM26.2996 36.8L23.6996 31.8L17.4996 20.7C17.0996 20 17.5996 19.1 18.4996 19.1H26.2996V36.8ZM38.4996 20.7L32.2996 31.8L29.6996 36.8V19.1H37.4996C38.3996 19.1 38.8996 20 38.4996 20.7Z", fill: "white" })] }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_2906_144", children: _jsx("rect", { width: "56", height: "56", fill: "white" }) }) })] }));
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=ton-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ton-icon.js","sourceRoot":"","sources":["../../../../src/components/ton-icon/ton-icon.tsx"],"names":[],"mappings":";AAcA,MAAM,CAAC,MAAM,OAAO,GAAqB,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACjE,OAAO,CACH,cAAK,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B,KAAK,KAAK,YACxG,eACI,CAAC,EAAC,wUAAwU,EAC1U,IAAI,EAAC,cAAc,GACrB,GACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAqB,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACvE,OAAO,CACH,eAAK,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B,KAAK,KAAK,aACxG,aAAG,QAAQ,EAAC,sBAAsB,aAC9B,eACI,CAAC,EAAC,2FAA2F,EAC7F,IAAI,EAAC,SAAS,GAChB,EACF,eACI,CAAC,EAAC,uVAAuV,EACzV,IAAI,EAAC,OAAO,GACd,IACF,EACJ,yBACI,mBAAU,EAAE,EAAC,gBAAgB,YACzB,eAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,GAAG,GACrC,GACR,IACL,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TonIcon, TonIconCircle } from './ton-icon';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Private/Components/TonIcon',
|
|
5
|
+
component: TonIcon,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {
|
|
8
|
+
size: {
|
|
9
|
+
control: { type: 'range', min: 12, max: 64, step: 4 },
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story) => (_jsx("div", { style: { color: 'white' }, children: _jsx(Story, {}) })),
|
|
14
|
+
],
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
export const Default = {
|
|
18
|
+
args: {
|
|
19
|
+
size: 24,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const Small = {
|
|
23
|
+
args: {
|
|
24
|
+
size: 16,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
export const Large = {
|
|
28
|
+
args: {
|
|
29
|
+
size: 48,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export const CustomColor = {
|
|
33
|
+
args: {
|
|
34
|
+
size: 32,
|
|
35
|
+
style: { color: '#0098EB' },
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export const Circle = {
|
|
39
|
+
render: (args) => _jsx(TonIconCircle, { ...args }),
|
|
40
|
+
args: {
|
|
41
|
+
size: 48,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export const CircleSmall = {
|
|
45
|
+
render: (args) => _jsx(TonIconCircle, { ...args }),
|
|
46
|
+
args: {
|
|
47
|
+
size: 24,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
export const CircleLarge = {
|
|
51
|
+
render: (args) => _jsx(TonIconCircle, { ...args }),
|
|
52
|
+
args: {
|
|
53
|
+
size: 72,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=ton-icon.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ton-icon.stories.js","sourceRoot":"","sources":["../../../../src/components/ton-icon/ton-icon.stories.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,IAAI,GAAyB;IAC/B,KAAK,EAAE,4BAA4B;IACnC,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACN,IAAI,EAAE;YACF,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;SACxD;KACJ;IACD,UAAU,EAAE;QACR,CAAC,KAAK,EAAE,EAAE,CAAC,CACP,cAAK,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAC1B,KAAC,KAAK,KAAG,GACP,CACT;KACJ;CACJ,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC1B,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;KACX;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAU;IACxB,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;KACX;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAU;IACxB,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;KACX;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAU;IAC9B,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;KAC9B;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAmC;IAClD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,aAAa,OAAK,IAAI,GAAI;IAC7C,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;KACX;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAmC;IACvD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,aAAa,OAAK,IAAI,GAAI;IAC7C,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;KACX;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAmC;IACvD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,aAAa,OAAK,IAAI,GAAI;IAC7C,IAAI,EAAE;QACF,IAAI,EAAE,EAAE;KACX;CACJ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) TonTech.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
import { formatUnits } from '@ton/appkit';
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { Block } from '../../../../components/block';
|
|
12
|
+
import styles from './balance-badge.module.css';
|
|
13
|
+
import { CircleIcon } from '../../../../components/circle-icon';
|
|
14
|
+
const BalanceBadgeContainer = ({ className, ...props }) => {
|
|
15
|
+
return _jsx(Block, { direction: "row", className: clsx(styles.balance, className), ...props });
|
|
16
|
+
};
|
|
17
|
+
const BalanceBlock = ({ className, ...props }) => {
|
|
18
|
+
return _jsx("div", { className: clsx(styles.balanceContainer, className), ...props });
|
|
19
|
+
};
|
|
20
|
+
const Balance = ({ balance, decimals, ...props }) => {
|
|
21
|
+
return _jsx("span", { ...props, children: balance ? formatUnits(balance, decimals) : '0' });
|
|
22
|
+
};
|
|
23
|
+
const BalanceSymbol = ({ className, symbol, ...props }) => {
|
|
24
|
+
return (_jsx("span", { className: clsx(styles.ticker, className), ...props, children: symbol }));
|
|
25
|
+
};
|
|
26
|
+
export const BalanceBadge = {
|
|
27
|
+
Container: BalanceBadgeContainer,
|
|
28
|
+
Icon: CircleIcon,
|
|
29
|
+
BalanceBlock: BalanceBlock,
|
|
30
|
+
Symbol: BalanceSymbol,
|
|
31
|
+
Balance: Balance,
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=balance-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance-badge.js","sourceRoot":"","sources":["../../../../../../src/features/balances/components/balance-badge/balance-badge.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,MAAM,qBAAqB,GAA8B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACjF,OAAO,KAAC,KAAK,IAAC,SAAS,EAAC,KAAK,EAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC5F,CAAC,CAAC;AAEF,MAAM,YAAY,GAA8B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACxE,OAAO,cAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACnF,CAAC,CAAC;AAEF,MAAM,OAAO,GAAuE,CAAC,EACjF,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,EAAE;IACD,OAAO,kBAAU,KAAK,YAAG,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,GAAQ,CAAC;AACpF,CAAC,CAAC;AAEF,MAAM,aAAa,GAAoD,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACvG,OAAO,CACH,eAAM,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,KAAM,KAAK,YACrD,MAAM,GACJ,CACV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,SAAS,EAAE,qBAAqB;IAChC,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE,YAAY;IAC1B,MAAM,EAAE,aAAa;IACrB,OAAO,EAAE,OAAO;CACnB,CAAC"}
|