@ton/appkit-react 0.0.6-alpha.3 → 1.0.0-alpha.1
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 +47 -15
- package/dist/esm/components/shared/amount-presets/amount-presets.js +8 -0
- package/dist/esm/components/shared/amount-presets/amount-presets.js.map +1 -0
- package/dist/esm/components/shared/amount-presets/amount-presets.module.css +20 -0
- package/dist/esm/{features/balances/components/balance-badge → components/shared/amount-presets}/index.js +1 -1
- package/dist/esm/components/shared/amount-presets/index.js.map +1 -0
- package/dist/esm/components/shared/button-with-connect/button-with-connect.js +16 -0
- package/dist/esm/components/shared/button-with-connect/button-with-connect.js.map +1 -0
- package/dist/esm/components/shared/button-with-connect/index.js +9 -0
- package/dist/esm/components/shared/button-with-connect/index.js.map +1 -0
- package/dist/esm/components/{ton-icon → shared/low-balance-modal}/index.js +1 -1
- package/dist/esm/components/shared/low-balance-modal/index.js.map +1 -0
- package/dist/esm/components/shared/low-balance-modal/low-balance-modal.js +11 -0
- package/dist/esm/components/shared/low-balance-modal/low-balance-modal.js.map +1 -0
- package/dist/esm/components/shared/low-balance-modal/low-balance-modal.module.css +21 -0
- package/dist/esm/components/shared/option-switcher/index.js +9 -0
- package/dist/esm/components/shared/option-switcher/index.js.map +1 -0
- package/dist/esm/components/shared/option-switcher/option-switcher.js +14 -0
- package/dist/esm/components/shared/option-switcher/option-switcher.js.map +1 -0
- package/dist/esm/components/shared/option-switcher/option-switcher.module.css +18 -0
- package/dist/esm/components/shared/settings-button/index.js +9 -0
- package/dist/esm/components/shared/settings-button/index.js.map +1 -0
- package/dist/esm/components/shared/settings-button/settings-button.js +9 -0
- package/dist/esm/components/shared/settings-button/settings-button.js.map +1 -0
- package/dist/esm/components/shared/settings-button/settings-button.module.css +11 -0
- package/dist/esm/components/shared/token-select-modal/index.js +9 -0
- package/dist/esm/components/shared/token-select-modal/index.js.map +1 -0
- package/dist/esm/components/shared/token-select-modal/token-select-modal.js +36 -0
- package/dist/esm/components/shared/token-select-modal/token-select-modal.js.map +1 -0
- package/dist/esm/components/shared/token-select-modal/token-select-modal.module.css +27 -0
- package/dist/esm/components/ui/amount-reversed/amount-reversed.js +13 -0
- package/dist/esm/components/ui/amount-reversed/amount-reversed.js.map +1 -0
- package/dist/esm/components/ui/amount-reversed/amount-reversed.module.css +34 -0
- package/dist/esm/components/ui/amount-reversed/index.js +9 -0
- package/dist/esm/components/ui/amount-reversed/index.js.map +1 -0
- package/dist/esm/components/ui/block/block.js.map +1 -0
- package/dist/esm/components/{block → ui/block}/block.module.css +1 -1
- package/dist/esm/components/ui/block/index.js.map +1 -0
- package/dist/esm/components/ui/button/button.js +31 -0
- package/dist/esm/components/ui/button/button.js.map +1 -0
- package/dist/esm/components/ui/button/button.module.css +137 -0
- package/dist/esm/components/ui/button/index.js.map +1 -0
- package/dist/esm/components/ui/centered-amount-input/centered-amount-input.js +51 -0
- package/dist/esm/components/ui/centered-amount-input/centered-amount-input.js.map +1 -0
- package/dist/esm/components/ui/centered-amount-input/centered-amount-input.module.css +69 -0
- package/dist/esm/components/ui/centered-amount-input/index.js +9 -0
- package/dist/esm/components/ui/centered-amount-input/index.js.map +1 -0
- package/dist/esm/components/ui/collapsible/collapsible.js +34 -0
- package/dist/esm/components/ui/collapsible/collapsible.js.map +1 -0
- package/dist/esm/components/ui/collapsible/collapsible.module.css +4 -0
- package/dist/esm/components/ui/collapsible/index.js +9 -0
- package/dist/esm/components/ui/collapsible/index.js.map +1 -0
- package/dist/esm/components/ui/dialog/dialog.js +67 -0
- package/dist/esm/components/ui/dialog/dialog.js.map +1 -0
- package/dist/esm/components/ui/dialog/index.js +9 -0
- package/dist/esm/components/ui/dialog/index.js.map +1 -0
- package/dist/esm/components/ui/dialog/use-dialog-context.js +16 -0
- package/dist/esm/components/ui/dialog/use-dialog-context.js.map +1 -0
- package/dist/esm/components/ui/icons/chevron-down-icon.js +4 -0
- package/dist/esm/components/ui/icons/chevron-down-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/chevrons-icon.js +4 -0
- package/dist/esm/components/ui/icons/chevrons-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/close-icon.js +4 -0
- package/dist/esm/components/ui/icons/close-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/failed-icon.js +4 -0
- package/dist/esm/components/ui/icons/failed-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/flip-icon.js +4 -0
- package/dist/esm/components/ui/icons/flip-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/image-icon.js +4 -0
- package/dist/esm/components/ui/icons/image-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/index.js +21 -0
- package/dist/esm/components/ui/icons/index.js.map +1 -0
- package/dist/esm/components/ui/icons/search-icon.js +4 -0
- package/dist/esm/components/ui/icons/search-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/sliders-icon.js +4 -0
- package/dist/esm/components/ui/icons/sliders-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/spinner-icon.js +4 -0
- package/dist/esm/components/ui/icons/spinner-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/success-icon.js +4 -0
- package/dist/esm/components/ui/icons/success-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/ton-icon.js +5 -0
- package/dist/esm/components/ui/icons/ton-icon.js.map +1 -0
- package/dist/esm/components/ui/icons/types.js +10 -0
- package/dist/esm/components/ui/icons/types.js.map +1 -0
- package/dist/esm/components/ui/icons/verified-icon.js +4 -0
- package/dist/esm/components/ui/icons/verified-icon.js.map +1 -0
- package/dist/esm/components/ui/info-block/index.js +9 -0
- package/dist/esm/components/ui/info-block/index.js.map +1 -0
- package/dist/esm/components/ui/info-block/info-block.js +31 -0
- package/dist/esm/components/ui/info-block/info-block.js.map +1 -0
- package/dist/esm/components/ui/info-block/info-block.module.css +30 -0
- package/dist/esm/components/ui/input/index.js +9 -0
- package/dist/esm/components/ui/input/index.js.map +1 -0
- package/dist/esm/components/ui/input/input.js +62 -0
- package/dist/esm/components/ui/input/input.js.map +1 -0
- package/dist/esm/components/ui/input/input.module.css +147 -0
- package/dist/esm/components/ui/input/use-input-resize.js +56 -0
- package/dist/esm/components/ui/input/use-input-resize.js.map +1 -0
- package/dist/esm/components/ui/logo/index.js +9 -0
- package/dist/esm/components/ui/logo/index.js.map +1 -0
- package/dist/esm/components/ui/logo/logo.js +54 -0
- package/dist/esm/components/ui/logo/logo.js.map +1 -0
- package/dist/esm/components/{circle-icon/circle-icon.module.css → ui/logo/logo.module.css} +6 -6
- package/dist/esm/components/ui/logo/use-image-loading-status.js +44 -0
- package/dist/esm/components/ui/logo/use-image-loading-status.js.map +1 -0
- package/dist/esm/components/ui/modal/index.js +9 -0
- package/dist/esm/components/ui/modal/index.js.map +1 -0
- package/dist/esm/components/ui/modal/modal.js +9 -0
- package/dist/esm/components/ui/modal/modal.js.map +1 -0
- package/dist/esm/components/ui/modal/modal.module.css +71 -0
- package/dist/esm/components/ui/select/index.js +9 -0
- package/dist/esm/components/ui/select/index.js.map +1 -0
- package/dist/esm/components/ui/select/select.js +147 -0
- package/dist/esm/components/ui/select/select.js.map +1 -0
- package/dist/esm/components/ui/select/select.module.css +37 -0
- package/dist/esm/components/ui/select/use-select-context.js +16 -0
- package/dist/esm/components/ui/select/use-select-context.js.map +1 -0
- package/dist/esm/components/ui/skeleton/index.js +9 -0
- package/dist/esm/components/ui/skeleton/index.js.map +1 -0
- package/dist/esm/components/ui/skeleton/skeleton.js +16 -0
- package/dist/esm/components/ui/skeleton/skeleton.js.map +1 -0
- package/dist/esm/components/ui/skeleton/skeleton.module.css +25 -0
- package/dist/esm/components/ui/tabs/index.js +9 -0
- package/dist/esm/components/ui/tabs/index.js.map +1 -0
- package/dist/esm/components/ui/tabs/tabs.js +43 -0
- package/dist/esm/components/ui/tabs/tabs.js.map +1 -0
- package/dist/esm/components/ui/tabs/tabs.module.css +32 -0
- package/dist/esm/features/balances/components/currency-item/currency-item.js +3 -2
- package/dist/esm/features/balances/components/currency-item/currency-item.js.map +1 -1
- package/dist/esm/features/balances/components/currency-item/currency-item.module.css +5 -11
- package/dist/esm/features/balances/components/send-jetton-button/send-jetton-button.js +4 -5
- package/dist/esm/features/balances/components/send-jetton-button/send-jetton-button.js.map +1 -1
- package/dist/esm/features/balances/components/send-ton-button/send-ton-button.js +1 -2
- package/dist/esm/features/balances/components/send-ton-button/send-ton-button.js.map +1 -1
- package/dist/esm/features/balances/hooks/use-balance-by-address.js +4 -2
- package/dist/esm/features/balances/hooks/use-balance-by-address.js.map +1 -1
- package/dist/esm/features/balances/hooks/use-watch-balance-by-address.js +1 -1
- package/dist/esm/features/balances/hooks/use-watch-balance-by-address.js.map +1 -1
- package/dist/esm/features/balances/index.js +0 -1
- package/dist/esm/features/balances/index.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-jetton-balance-by-address.js +4 -2
- package/dist/esm/features/jettons/hooks/use-jetton-balance-by-address.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-jetton-info.js +4 -2
- package/dist/esm/features/jettons/hooks/use-jetton-info.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-jetton-wallet-address.js +4 -2
- package/dist/esm/features/jettons/hooks/use-jetton-wallet-address.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-jettons-by-address.js +4 -2
- package/dist/esm/features/jettons/hooks/use-jettons-by-address.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-transfer-jetton.js +1 -1
- package/dist/esm/features/jettons/hooks/use-transfer-jetton.js.map +1 -1
- package/dist/esm/features/jettons/hooks/use-watch-jettons-by-address.js +1 -1
- package/dist/esm/features/jettons/hooks/use-watch-jettons-by-address.js.map +1 -1
- package/dist/esm/features/network/hooks/use-block-number.js +4 -2
- package/dist/esm/features/network/hooks/use-block-number.js.map +1 -1
- package/dist/esm/features/network/hooks/use-default-network.js +1 -1
- package/dist/esm/features/network/hooks/use-default-network.js.map +1 -1
- package/dist/esm/features/network/hooks/use-networks.js +1 -1
- package/dist/esm/features/network/hooks/use-networks.js.map +1 -1
- package/dist/esm/features/nft/components/nft-item/nft-item.js +3 -3
- package/dist/esm/features/nft/components/nft-item/nft-item.js.map +1 -1
- package/dist/esm/features/nft/components/nft-item/nft-item.module.css +4 -6
- package/dist/esm/features/nft/hooks/use-nft.js +4 -2
- package/dist/esm/features/nft/hooks/use-nft.js.map +1 -1
- package/dist/esm/features/nft/hooks/use-nfts-by-address.js +4 -2
- package/dist/esm/features/nft/hooks/use-nfts-by-address.js.map +1 -1
- package/dist/esm/features/nft/hooks/use-transfer-nft.js +1 -1
- package/dist/esm/features/nft/hooks/use-transfer-nft.js.map +1 -1
- package/dist/esm/features/settings/hooks/use-app-kit-theme.js.map +1 -0
- package/dist/esm/{hooks → features/settings/hooks}/use-app-kit.js +1 -1
- package/dist/esm/features/settings/hooks/use-app-kit.js.map +1 -0
- package/dist/esm/{hooks → features/settings/hooks}/use-i18n.js +1 -1
- package/dist/esm/features/settings/hooks/use-i18n.js.map +1 -0
- package/dist/esm/features/settings/index.js +11 -0
- package/dist/esm/features/settings/index.js.map +1 -0
- package/dist/esm/features/signing/hooks/use-sign-binary.js +1 -1
- package/dist/esm/features/signing/hooks/use-sign-binary.js.map +1 -1
- package/dist/esm/features/signing/hooks/use-sign-cell.js +1 -1
- package/dist/esm/features/signing/hooks/use-sign-cell.js.map +1 -1
- package/dist/esm/features/signing/hooks/use-sign-text.js +1 -1
- package/dist/esm/features/signing/hooks/use-sign-text.js.map +1 -1
- package/dist/esm/features/staking/components/select-unstake-mode/index.js +9 -0
- package/dist/esm/features/staking/components/select-unstake-mode/index.js.map +1 -0
- package/dist/esm/features/staking/components/select-unstake-mode/select-unstake-mode.js +56 -0
- package/dist/esm/features/staking/components/select-unstake-mode/select-unstake-mode.js.map +1 -0
- package/dist/esm/features/staking/components/select-unstake-mode/select-unstake-mode.module.css +111 -0
- package/dist/esm/features/staking/components/staking-balance-block/index.js +9 -0
- package/dist/esm/features/staking/components/staking-balance-block/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-balance-block/staking-balance-block.js +25 -0
- package/dist/esm/features/staking/components/staking-balance-block/staking-balance-block.js.map +1 -0
- package/dist/esm/features/staking/components/staking-balance-block/staking-balance-block.module.css +40 -0
- package/dist/esm/features/staking/components/staking-info/index.js +9 -0
- package/dist/esm/features/staking/components/staking-info/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-info/staking-info.js +13 -0
- package/dist/esm/features/staking/components/staking-info/staking-info.js.map +1 -0
- package/dist/esm/features/staking/components/staking-info/utils.js +13 -0
- package/dist/esm/features/staking/components/staking-info/utils.js.map +1 -0
- package/dist/esm/features/staking/components/staking-settings-modal/index.js +9 -0
- package/dist/esm/features/staking/components/staking-settings-modal/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-settings-modal/staking-settings-modal.js +38 -0
- package/dist/esm/features/staking/components/staking-settings-modal/staking-settings-modal.js.map +1 -0
- package/dist/esm/features/staking/components/staking-settings-modal/staking-settings-modal.module.css +24 -0
- package/dist/esm/features/staking/components/staking-widget/index.js +9 -0
- package/dist/esm/features/staking/components/staking-widget/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget/staking-widget.js +21 -0
- package/dist/esm/features/staking/components/staking-widget/staking-widget.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-provider/index.js +9 -0
- package/dist/esm/features/staking/components/staking-widget-provider/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-provider/staking-widget-provider.js +274 -0
- package/dist/esm/features/staking/components/staking-widget-provider/staking-widget-provider.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-provider/use-staking-validation.js +48 -0
- package/dist/esm/features/staking/components/staking-widget-provider/use-staking-validation.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-ui/index.js +9 -0
- package/dist/esm/features/staking/components/staking-widget-ui/index.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-ui/staking-widget-ui.js +36 -0
- package/dist/esm/features/staking/components/staking-widget-ui/staking-widget-ui.js.map +1 -0
- package/dist/esm/features/staking/components/staking-widget-ui/staking-widget-ui.module.css +35 -0
- package/dist/esm/features/staking/hooks/use-build-stake-transaction.js +1 -1
- package/dist/esm/features/staking/hooks/use-build-stake-transaction.js.map +1 -1
- package/dist/esm/features/staking/hooks/use-staked-balance.js +4 -2
- package/dist/esm/features/staking/hooks/use-staked-balance.js.map +1 -1
- package/dist/esm/features/staking/hooks/use-staking-provider-info.js +10 -2
- package/dist/esm/features/staking/hooks/use-staking-provider-info.js.map +1 -1
- package/dist/esm/features/staking/hooks/use-staking-provider-metadata.js +28 -0
- package/dist/esm/features/staking/hooks/use-staking-provider-metadata.js.map +1 -0
- package/dist/esm/features/staking/hooks/use-staking-provider.js +30 -0
- package/dist/esm/features/staking/hooks/use-staking-provider.js.map +1 -0
- package/dist/esm/features/staking/hooks/use-staking-providers.js +12 -6
- package/dist/esm/features/staking/hooks/use-staking-providers.js.map +1 -1
- package/dist/esm/features/staking/hooks/use-staking-quote.js +4 -2
- package/dist/esm/features/staking/hooks/use-staking-quote.js.map +1 -1
- package/dist/esm/features/staking/index.js +10 -1
- package/dist/esm/features/staking/index.js.map +1 -1
- package/dist/esm/features/staking/utils/map-staking-error.js +25 -0
- package/dist/esm/features/staking/utils/map-staking-error.js.map +1 -0
- package/dist/esm/features/swap/components/swap-field/index.js +9 -0
- package/dist/esm/features/swap/components/swap-field/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-field/swap-field.js +17 -0
- package/dist/esm/features/swap/components/swap-field/swap-field.js.map +1 -0
- package/dist/esm/features/swap/components/swap-field/swap-field.module.css +65 -0
- package/dist/esm/features/swap/components/swap-flip-button/index.js +9 -0
- package/dist/esm/features/swap/components/swap-flip-button/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-flip-button/swap-flip-button.js +9 -0
- package/dist/esm/features/swap/components/swap-flip-button/swap-flip-button.js.map +1 -0
- package/dist/esm/features/swap/components/swap-flip-button/swap-flip-button.module.css +32 -0
- package/dist/esm/features/swap/components/swap-info/index.js +9 -0
- package/dist/esm/features/swap/components/swap-info/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-info/swap-info.js +12 -0
- package/dist/esm/features/swap/components/swap-info/swap-info.js.map +1 -0
- package/dist/esm/features/swap/components/swap-settings-modal/index.js +9 -0
- package/dist/esm/features/swap/components/swap-settings-modal/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-settings-modal/swap-settings-modal.js +41 -0
- package/dist/esm/features/swap/components/swap-settings-modal/swap-settings-modal.js.map +1 -0
- package/dist/esm/features/swap/components/swap-settings-modal/swap-settings-modal.module.css +24 -0
- package/dist/esm/features/swap/components/swap-token-select-modal/index.js +9 -0
- package/dist/esm/features/swap/components/swap-token-select-modal/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-token-select-modal/swap-token-select-modal.js +8 -0
- package/dist/esm/features/swap/components/swap-token-select-modal/swap-token-select-modal.js.map +1 -0
- package/dist/esm/features/swap/components/swap-token-select-modal/swap-token-select-modal.module.css +67 -0
- package/dist/esm/{components/circle-icon → features/swap/components/swap-widget}/index.js +1 -1
- package/dist/esm/features/swap/components/swap-widget/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget/swap-widget.js +21 -0
- package/dist/esm/features/swap/components/swap-widget/swap-widget.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-provider/index.js +9 -0
- package/dist/esm/features/swap/components/swap-widget-provider/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-provider/swap-widget-provider.js +237 -0
- package/dist/esm/features/swap/components/swap-widget-provider/swap-widget-provider.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-balances.js +38 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-balances.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-token-state.js +62 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-token-state.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-validation.js +28 -0
- package/dist/esm/features/swap/components/swap-widget-provider/use-swap-validation.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-ui/index.js +9 -0
- package/dist/esm/features/swap/components/swap-widget-ui/index.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-ui/swap-widget-ui.js +49 -0
- package/dist/esm/features/swap/components/swap-widget-ui/swap-widget-ui.js.map +1 -0
- package/dist/esm/features/swap/components/swap-widget-ui/swap-widget-ui.module.css +51 -0
- package/dist/esm/features/swap/components/token-selector/index.js +9 -0
- package/dist/esm/features/swap/components/token-selector/index.js.map +1 -0
- package/dist/esm/features/swap/components/token-selector/token-selector.js +13 -0
- package/dist/esm/features/swap/components/token-selector/token-selector.js.map +1 -0
- package/dist/esm/features/swap/components/token-selector/token-selector.module.css +12 -0
- package/dist/esm/features/swap/hooks/use-build-swap-transaction.js +4 -1
- package/dist/esm/features/swap/hooks/use-build-swap-transaction.js.map +1 -1
- package/dist/esm/features/swap/hooks/use-swap-provider.js +34 -0
- package/dist/esm/features/swap/hooks/use-swap-provider.js.map +1 -0
- package/dist/esm/features/swap/hooks/use-swap-providers.js +24 -0
- package/dist/esm/features/swap/hooks/use-swap-providers.js.map +1 -0
- package/dist/esm/features/swap/hooks/use-swap-quote.js +7 -2
- package/dist/esm/features/swap/hooks/use-swap-quote.js.map +1 -1
- package/dist/esm/features/swap/index.js +8 -0
- package/dist/esm/features/swap/index.js.map +1 -1
- package/dist/esm/features/swap/utils/get-display-amount.js +19 -0
- package/dist/esm/features/swap/utils/get-display-amount.js.map +1 -0
- package/dist/esm/features/swap/utils/map-swap-error.js +29 -0
- package/dist/esm/features/swap/utils/map-swap-error.js.map +1 -0
- package/dist/esm/features/swap/utils/map-swap-widget-tokens.js +26 -0
- package/dist/esm/features/swap/utils/map-swap-widget-tokens.js.map +1 -0
- package/dist/esm/features/transaction/components/transaction/send.js +2 -2
- package/dist/esm/features/transaction/components/transaction/send.js.map +1 -1
- package/dist/esm/features/transaction/components/transaction-progress/transaction-progress-icons.js +7 -8
- package/dist/esm/features/transaction/components/transaction-progress/transaction-progress-icons.js.map +1 -1
- package/dist/esm/features/transaction/components/transaction-progress/transaction-progress.js +1 -1
- package/dist/esm/features/transaction/components/transaction-progress/transaction-progress.js.map +1 -1
- package/dist/esm/features/transaction/components/transaction-progress/transaction-progress.module.css +3 -3
- package/dist/esm/features/transaction/hooks/use-send-transaction.js +1 -1
- package/dist/esm/features/transaction/hooks/use-send-transaction.js.map +1 -1
- package/dist/esm/features/transaction/hooks/use-transaction-status.js +4 -2
- package/dist/esm/features/transaction/hooks/use-transaction-status.js.map +1 -1
- package/dist/esm/features/transaction/hooks/use-transfer-ton.js +1 -1
- package/dist/esm/features/transaction/hooks/use-transfer-ton.js.map +1 -1
- package/dist/esm/features/transaction/hooks/use-watch-transactions-by-address.js +1 -1
- package/dist/esm/features/transaction/hooks/use-watch-transactions-by-address.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-connect.js +1 -1
- package/dist/esm/features/wallets/hooks/use-connect.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-connected-wallets.js +1 -1
- package/dist/esm/features/wallets/hooks/use-connected-wallets.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-connector-by-id.js +1 -1
- package/dist/esm/features/wallets/hooks/use-connector-by-id.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-connectors.js +1 -1
- package/dist/esm/features/wallets/hooks/use-connectors.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-disconnect.js +1 -1
- package/dist/esm/features/wallets/hooks/use-disconnect.js.map +1 -1
- package/dist/esm/features/wallets/hooks/use-selected-wallet.js +1 -1
- package/dist/esm/features/wallets/hooks/use-selected-wallet.js.map +1 -1
- package/dist/esm/hooks/use-debounce-callback.js +41 -0
- package/dist/esm/hooks/use-debounce-callback.js.map +1 -0
- package/dist/esm/hooks/use-debounce-value.js +23 -0
- package/dist/esm/hooks/use-debounce-value.js.map +1 -0
- package/dist/esm/hooks/use-unmount.js +14 -0
- package/dist/esm/hooks/use-unmount.js.map +1 -0
- package/dist/esm/index.js +19 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/locales/en.js +75 -0
- package/dist/esm/locales/en.js.map +1 -1
- package/dist/esm/styles/index.css +106 -60
- package/dist/esm/styles/typography.module.css +104 -54
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/{src/components/ton-icon/index.ts → dist/esm/types/appkit-ui-token.js} +2 -2
- package/dist/esm/types/appkit-ui-token.js.map +1 -0
- package/dist/esm/utils/map-defi-error.js +34 -0
- package/dist/esm/utils/map-defi-error.js.map +1 -0
- package/dist/esm/utils/validate-amount.js +30 -0
- package/dist/esm/utils/validate-amount.js.map +1 -0
- package/dist/types/components/shared/amount-presets/amount-presets.d.ts +20 -0
- package/dist/types/components/shared/amount-presets/amount-presets.d.ts.map +1 -0
- package/dist/types/components/shared/amount-presets/index.d.ts +10 -0
- package/dist/types/components/shared/amount-presets/index.d.ts.map +1 -0
- package/dist/types/components/shared/button-with-connect/button-with-connect.d.ts +11 -0
- package/dist/types/components/shared/button-with-connect/button-with-connect.d.ts.map +1 -0
- package/dist/types/components/{ton-icon → shared/button-with-connect}/index.d.ts +1 -1
- package/dist/types/components/shared/button-with-connect/index.d.ts.map +1 -0
- package/dist/types/components/shared/low-balance-modal/index.d.ts +10 -0
- package/dist/types/components/shared/low-balance-modal/index.d.ts.map +1 -0
- package/dist/types/components/shared/low-balance-modal/low-balance-modal.d.ts +23 -0
- package/dist/types/components/shared/low-balance-modal/low-balance-modal.d.ts.map +1 -0
- package/dist/types/components/shared/option-switcher/index.d.ts +9 -0
- package/dist/types/components/shared/option-switcher/index.d.ts.map +1 -0
- package/dist/types/components/shared/option-switcher/option-switcher.d.ts +28 -0
- package/dist/types/components/shared/option-switcher/option-switcher.d.ts.map +1 -0
- package/dist/types/components/shared/settings-button/index.d.ts +9 -0
- package/dist/types/components/shared/settings-button/index.d.ts.map +1 -0
- package/dist/types/components/shared/settings-button/settings-button.d.ts +14 -0
- package/dist/types/components/shared/settings-button/settings-button.d.ts.map +1 -0
- package/dist/types/components/shared/token-select-modal/index.d.ts +10 -0
- package/dist/types/components/shared/token-select-modal/index.d.ts.map +1 -0
- package/dist/types/components/shared/token-select-modal/token-select-modal.d.ts +19 -0
- package/dist/types/components/shared/token-select-modal/token-select-modal.d.ts.map +1 -0
- package/dist/types/components/ui/amount-reversed/amount-reversed.d.ts +19 -0
- package/dist/types/components/ui/amount-reversed/amount-reversed.d.ts.map +1 -0
- package/dist/types/components/ui/amount-reversed/index.d.ts +10 -0
- package/dist/types/components/ui/amount-reversed/index.d.ts.map +1 -0
- package/dist/types/components/ui/block/block.d.ts.map +1 -0
- package/dist/types/components/ui/block/index.d.ts.map +1 -0
- package/dist/types/components/ui/button/button.d.ts +31 -0
- package/dist/types/components/ui/button/button.d.ts.map +1 -0
- package/dist/types/components/ui/button/index.d.ts +10 -0
- package/dist/types/components/ui/button/index.d.ts.map +1 -0
- package/dist/types/components/ui/centered-amount-input/centered-amount-input.d.ts +17 -0
- package/dist/types/components/ui/centered-amount-input/centered-amount-input.d.ts.map +1 -0
- package/dist/types/components/ui/centered-amount-input/index.d.ts +10 -0
- package/dist/types/components/ui/centered-amount-input/index.d.ts.map +1 -0
- package/dist/types/components/{button/button.d.ts → ui/collapsible/collapsible.d.ts} +5 -2
- package/dist/types/components/ui/collapsible/collapsible.d.ts.map +1 -0
- package/dist/types/components/ui/collapsible/index.d.ts +10 -0
- package/dist/types/components/ui/collapsible/index.d.ts.map +1 -0
- package/dist/types/components/ui/dialog/dialog.d.ts +27 -0
- package/dist/types/components/ui/dialog/dialog.d.ts.map +1 -0
- package/dist/types/components/ui/dialog/index.d.ts +9 -0
- package/dist/types/components/ui/dialog/index.d.ts.map +1 -0
- package/dist/types/components/ui/dialog/use-dialog-context.d.ts +15 -0
- package/dist/types/components/ui/dialog/use-dialog-context.d.ts.map +1 -0
- package/dist/types/components/ui/icons/chevron-down-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/chevron-down-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/chevrons-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/chevrons-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/close-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/close-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/failed-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/failed-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/flip-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/flip-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/image-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/image-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/index.d.ts +21 -0
- package/dist/types/components/ui/icons/index.d.ts.map +1 -0
- package/dist/types/components/ui/icons/search-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/search-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/sliders-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/sliders-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/spinner-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/spinner-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/success-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/success-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/ton-icon.d.ts +12 -0
- package/dist/types/components/ui/icons/ton-icon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/types.d.ts +20 -0
- package/dist/types/components/ui/icons/types.d.ts.map +1 -0
- package/dist/types/components/ui/icons/verified-icon.d.ts +11 -0
- package/dist/types/components/ui/icons/verified-icon.d.ts.map +1 -0
- package/dist/types/components/ui/info-block/index.d.ts +9 -0
- package/dist/types/components/ui/info-block/index.d.ts.map +1 -0
- package/dist/types/components/ui/info-block/info-block.d.ts +18 -0
- package/dist/types/components/ui/info-block/info-block.d.ts.map +1 -0
- package/dist/types/components/ui/input/index.d.ts +9 -0
- package/dist/types/components/ui/input/index.d.ts.map +1 -0
- package/dist/types/components/ui/input/input.d.ts +40 -0
- package/dist/types/components/ui/input/input.d.ts.map +1 -0
- package/dist/types/components/ui/input/use-input-resize.d.ts +31 -0
- package/dist/types/components/ui/input/use-input-resize.d.ts.map +1 -0
- package/dist/types/components/ui/logo/index.d.ts +9 -0
- package/dist/types/components/ui/logo/index.d.ts.map +1 -0
- package/dist/types/components/ui/logo/logo.d.ts +16 -0
- package/dist/types/components/ui/logo/logo.d.ts.map +1 -0
- package/dist/types/components/ui/logo/use-image-loading-status.d.ts +10 -0
- package/dist/types/components/ui/logo/use-image-loading-status.d.ts.map +1 -0
- package/dist/types/components/ui/modal/index.d.ts +9 -0
- package/dist/types/components/ui/modal/index.d.ts.map +1 -0
- package/dist/types/components/ui/modal/modal.d.ts +32 -0
- package/dist/types/components/ui/modal/modal.d.ts.map +1 -0
- package/dist/types/components/ui/select/index.d.ts +9 -0
- package/dist/types/components/ui/select/index.d.ts.map +1 -0
- package/dist/types/components/ui/select/select.d.ts +44 -0
- package/dist/types/components/ui/select/select.d.ts.map +1 -0
- package/dist/types/components/ui/select/use-select-context.d.ts +20 -0
- package/dist/types/components/ui/select/use-select-context.d.ts.map +1 -0
- package/dist/types/components/ui/skeleton/index.d.ts +10 -0
- package/dist/types/components/ui/skeleton/index.d.ts.map +1 -0
- package/dist/types/components/ui/skeleton/skeleton.d.ts +14 -0
- package/dist/types/components/ui/skeleton/skeleton.d.ts.map +1 -0
- package/dist/types/components/ui/tabs/index.d.ts +10 -0
- package/dist/types/components/ui/tabs/index.d.ts.map +1 -0
- package/dist/types/components/ui/tabs/tabs.d.ts +30 -0
- package/dist/types/components/ui/tabs/tabs.d.ts.map +1 -0
- package/dist/types/features/balances/components/currency-item/currency-item.d.ts.map +1 -1
- package/dist/types/features/balances/components/send-jetton-button/send-jetton-button.d.ts.map +1 -1
- package/dist/types/features/balances/components/send-ton-button/send-ton-button.d.ts.map +1 -1
- package/dist/types/features/balances/hooks/use-balance-by-address.d.ts.map +1 -1
- package/dist/types/features/balances/index.d.ts +0 -1
- package/dist/types/features/balances/index.d.ts.map +1 -1
- package/dist/types/features/jettons/hooks/use-jetton-balance-by-address.d.ts.map +1 -1
- package/dist/types/features/jettons/hooks/use-jetton-info.d.ts.map +1 -1
- package/dist/types/features/jettons/hooks/use-jetton-wallet-address.d.ts.map +1 -1
- package/dist/types/features/jettons/hooks/use-jettons-by-address.d.ts.map +1 -1
- package/dist/types/features/network/hooks/use-block-number.d.ts.map +1 -1
- package/dist/types/features/nft/components/nft-item/nft-item.d.ts.map +1 -1
- package/dist/types/features/nft/hooks/use-nft.d.ts.map +1 -1
- package/dist/types/features/nft/hooks/use-nfts-by-address.d.ts.map +1 -1
- package/dist/types/features/settings/hooks/use-app-kit-theme.d.ts.map +1 -0
- package/dist/types/features/settings/hooks/use-app-kit.d.ts.map +1 -0
- package/dist/types/{hooks → features/settings/hooks}/use-i18n.d.ts +1 -1
- package/dist/types/features/settings/hooks/use-i18n.d.ts.map +1 -0
- package/dist/types/features/settings/index.d.ts +11 -0
- package/dist/types/features/settings/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/select-unstake-mode/index.d.ts +10 -0
- package/dist/types/features/staking/components/select-unstake-mode/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/select-unstake-mode/select-unstake-mode.d.ts +17 -0
- package/dist/types/features/staking/components/select-unstake-mode/select-unstake-mode.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-balance-block/index.d.ts +9 -0
- package/dist/types/features/staking/components/staking-balance-block/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-balance-block/staking-balance-block.d.ts +21 -0
- package/dist/types/features/staking/components/staking-balance-block/staking-balance-block.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-info/index.d.ts +10 -0
- package/dist/types/features/staking/components/staking-info/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-info/staking-info.d.ts +21 -0
- package/dist/types/features/staking/components/staking-info/staking-info.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-info/utils.d.ts +9 -0
- package/dist/types/features/staking/components/staking-info/utils.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-settings-modal/index.d.ts +9 -0
- package/dist/types/features/staking/components/staking-settings-modal/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-settings-modal/staking-settings-modal.d.ts +19 -0
- package/dist/types/features/staking/components/staking-settings-modal/staking-settings-modal.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget/index.d.ts +9 -0
- package/dist/types/features/staking/components/staking-widget/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget/staking-widget.d.ts +30 -0
- package/dist/types/features/staking/components/staking-widget/staking-widget.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget-provider/index.d.ts +9 -0
- package/dist/types/features/staking/components/staking-widget-provider/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget-provider/staking-widget-provider.d.ts +98 -0
- package/dist/types/features/staking/components/staking-widget-provider/staking-widget-provider.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget-provider/use-staking-validation.d.ts +26 -0
- package/dist/types/features/staking/components/staking-widget-provider/use-staking-validation.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget-ui/index.d.ts +9 -0
- package/dist/types/features/staking/components/staking-widget-ui/index.d.ts.map +1 -0
- package/dist/types/features/staking/components/staking-widget-ui/staking-widget-ui.d.ts +12 -0
- package/dist/types/features/staking/components/staking-widget-ui/staking-widget-ui.d.ts.map +1 -0
- package/dist/types/features/staking/hooks/use-staked-balance.d.ts.map +1 -1
- package/dist/types/features/staking/hooks/use-staking-provider-info.d.ts.map +1 -1
- package/dist/types/features/staking/hooks/use-staking-provider-metadata.d.ts +15 -0
- package/dist/types/features/staking/hooks/use-staking-provider-metadata.d.ts.map +1 -0
- package/dist/types/features/staking/hooks/use-staking-provider.d.ts +14 -0
- package/dist/types/features/staking/hooks/use-staking-provider.d.ts.map +1 -0
- package/dist/types/features/staking/hooks/use-staking-providers.d.ts +4 -6
- package/dist/types/features/staking/hooks/use-staking-providers.d.ts.map +1 -1
- package/dist/types/features/staking/hooks/use-staking-quote.d.ts.map +1 -1
- package/dist/types/features/staking/index.d.ts +10 -1
- package/dist/types/features/staking/index.d.ts.map +1 -1
- package/dist/types/features/staking/utils/map-staking-error.d.ts +13 -0
- package/dist/types/features/staking/utils/map-staking-error.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-field/index.d.ts +9 -0
- package/dist/types/features/swap/components/swap-field/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-field/swap-field.d.ts +25 -0
- package/dist/types/features/swap/components/swap-field/swap-field.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-flip-button/index.d.ts +9 -0
- package/dist/types/features/swap/components/swap-flip-button/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-flip-button/swap-flip-button.d.ts +14 -0
- package/dist/types/features/swap/components/swap-flip-button/swap-flip-button.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-info/index.d.ts +9 -0
- package/dist/types/features/swap/components/swap-info/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-info/swap-info.d.ts +20 -0
- package/dist/types/features/swap/components/swap-info/swap-info.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-settings-modal/index.d.ts +10 -0
- package/dist/types/features/swap/components/swap-settings-modal/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-settings-modal/swap-settings-modal.d.ts +20 -0
- package/dist/types/features/swap/components/swap-settings-modal/swap-settings-modal.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-token-select-modal/index.d.ts +10 -0
- package/dist/types/features/swap/components/swap-token-select-modal/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-token-select-modal/swap-token-select-modal.d.ts +12 -0
- package/dist/types/features/swap/components/swap-token-select-modal/swap-token-select-modal.d.ts.map +1 -0
- package/dist/types/{components/circle-icon → features/swap/components/swap-widget}/index.d.ts +1 -1
- package/dist/types/features/swap/components/swap-widget/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget/swap-widget.d.ts +31 -0
- package/dist/types/features/swap/components/swap-widget/swap-widget.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-provider/index.d.ts +9 -0
- package/dist/types/features/swap/components/swap-widget-provider/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-provider/swap-widget-provider.d.ts +106 -0
- package/dist/types/features/swap/components/swap-widget-provider/swap-widget-provider.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-balances.d.ts +23 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-balances.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-token-state.d.ts +24 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-token-state.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-validation.d.ts +23 -0
- package/dist/types/features/swap/components/swap-widget-provider/use-swap-validation.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-ui/index.d.ts +9 -0
- package/dist/types/features/swap/components/swap-widget-ui/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/swap-widget-ui/swap-widget-ui.d.ts +12 -0
- package/dist/types/features/swap/components/swap-widget-ui/swap-widget-ui.d.ts.map +1 -0
- package/dist/types/features/swap/components/token-selector/index.d.ts +9 -0
- package/dist/types/features/swap/components/token-selector/index.d.ts.map +1 -0
- package/dist/types/features/swap/components/token-selector/token-selector.d.ts +15 -0
- package/dist/types/features/swap/components/token-selector/token-selector.d.ts.map +1 -0
- package/dist/types/features/swap/hooks/use-build-swap-transaction.d.ts +3 -0
- package/dist/types/features/swap/hooks/use-build-swap-transaction.d.ts.map +1 -1
- package/dist/types/features/swap/hooks/use-swap-provider.d.ts +15 -0
- package/dist/types/features/swap/hooks/use-swap-provider.d.ts.map +1 -0
- package/dist/types/features/swap/hooks/use-swap-providers.d.ts +14 -0
- package/dist/types/features/swap/hooks/use-swap-providers.d.ts.map +1 -0
- package/dist/types/features/swap/hooks/use-swap-quote.d.ts +3 -0
- package/dist/types/features/swap/hooks/use-swap-quote.d.ts.map +1 -1
- package/dist/types/features/swap/index.d.ts +8 -0
- package/dist/types/features/swap/index.d.ts.map +1 -1
- package/dist/types/features/swap/utils/get-display-amount.d.ts +13 -0
- package/dist/types/features/swap/utils/get-display-amount.d.ts.map +1 -0
- package/dist/types/features/swap/utils/map-swap-error.d.ts +13 -0
- package/dist/types/features/swap/utils/map-swap-error.d.ts.map +1 -0
- package/dist/types/features/swap/utils/map-swap-widget-tokens.d.ts +10 -0
- package/dist/types/features/swap/utils/map-swap-widget-tokens.d.ts.map +1 -0
- package/dist/types/features/transaction/components/transaction/send.d.ts +3 -2
- package/dist/types/features/transaction/components/transaction/send.d.ts.map +1 -1
- package/dist/types/features/transaction/components/transaction-progress/transaction-progress-icons.d.ts.map +1 -1
- package/dist/types/features/transaction/hooks/use-transaction-status.d.ts.map +1 -1
- package/dist/types/hooks/use-debounce-callback.d.ts +17 -0
- package/dist/types/hooks/use-debounce-callback.d.ts.map +1 -0
- package/dist/types/hooks/use-debounce-value.d.ts +15 -0
- package/dist/types/hooks/use-debounce-value.d.ts.map +1 -0
- package/dist/types/hooks/use-unmount.d.ts +9 -0
- package/dist/types/hooks/use-unmount.d.ts.map +1 -0
- package/dist/types/index.d.ts +19 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/libs/i18n.d.ts +70 -0
- package/dist/types/libs/i18n.d.ts.map +1 -1
- package/dist/types/locales/en.d.ts +70 -0
- package/dist/types/locales/en.d.ts.map +1 -1
- package/dist/types/types/appkit-ui-token.d.ts +25 -0
- package/dist/types/types/appkit-ui-token.d.ts.map +1 -0
- package/dist/types/utils/map-defi-error.d.ts +14 -0
- package/dist/types/utils/map-defi-error.d.ts.map +1 -0
- package/dist/types/utils/validate-amount.d.ts +18 -0
- package/dist/types/utils/validate-amount.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/components/shared/amount-presets/amount-presets.tsx +50 -0
- package/src/components/shared/amount-presets/index.ts +10 -0
- package/src/components/shared/button-with-connect/button-with-connect.tsx +37 -0
- package/src/components/shared/button-with-connect/index.ts +9 -0
- package/src/components/shared/low-balance-modal/index.ts +10 -0
- package/src/components/shared/low-balance-modal/low-balance-modal.tsx +58 -0
- package/src/components/{button → shared/option-switcher}/index.ts +1 -1
- package/src/components/shared/option-switcher/option-switcher.tsx +55 -0
- package/src/{features/balances/components/balance-badge → components/shared/settings-button}/index.ts +1 -1
- package/src/components/shared/settings-button/settings-button.tsx +33 -0
- package/src/components/shared/token-select-modal/index.ts +10 -0
- package/src/components/shared/token-select-modal/token-select-modal.tsx +103 -0
- package/src/components/ui/amount-reversed/amount-reversed.tsx +65 -0
- package/src/components/ui/amount-reversed/index.ts +10 -0
- package/src/components/ui/button/button.tsx +100 -0
- package/{dist/types/components/button/index.d.ts → src/components/ui/button/index.ts} +2 -1
- package/src/components/ui/centered-amount-input/centered-amount-input.tsx +118 -0
- package/src/components/ui/centered-amount-input/index.ts +10 -0
- package/src/components/ui/collapsible/collapsible.tsx +54 -0
- package/src/components/ui/collapsible/index.ts +10 -0
- package/src/components/ui/dialog/dialog.tsx +105 -0
- package/src/components/{circle-icon → ui/dialog}/index.ts +1 -1
- package/src/components/ui/dialog/use-dialog-context.ts +23 -0
- package/src/components/ui/icons/chevron-down-icon.tsx +26 -0
- package/src/components/ui/icons/chevrons-icon.tsx +39 -0
- package/src/components/ui/icons/close-icon.tsx +32 -0
- package/src/components/ui/icons/failed-icon.tsx +32 -0
- package/src/components/ui/icons/flip-icon.tsx +39 -0
- package/src/components/ui/icons/image-icon.tsx +32 -0
- package/src/components/ui/icons/index.ts +21 -0
- package/src/components/ui/icons/search-icon.tsx +29 -0
- package/src/components/ui/icons/sliders-icon.tsx +31 -0
- package/src/components/ui/icons/spinner-icon.tsx +30 -0
- package/src/components/ui/icons/success-icon.tsx +31 -0
- package/src/components/ui/icons/ton-icon.tsx +50 -0
- package/src/components/ui/icons/types.ts +22 -0
- package/src/components/ui/icons/verified-icon.tsx +30 -0
- package/src/components/ui/info-block/index.ts +9 -0
- package/src/components/ui/info-block/info-block.tsx +47 -0
- package/src/components/ui/input/index.ts +9 -0
- package/src/components/ui/input/input.tsx +194 -0
- package/src/components/ui/input/use-input-resize.ts +96 -0
- package/src/components/ui/logo/index.ts +9 -0
- package/src/components/ui/logo/logo.tsx +106 -0
- package/src/components/ui/logo/use-image-loading-status.ts +50 -0
- package/src/components/ui/modal/index.ts +9 -0
- package/src/components/ui/modal/modal.tsx +57 -0
- package/src/components/ui/select/index.ts +9 -0
- package/src/components/ui/select/select.tsx +274 -0
- package/src/components/ui/select/use-select-context.ts +28 -0
- package/src/components/ui/skeleton/index.ts +10 -0
- package/src/components/ui/skeleton/skeleton.tsx +33 -0
- package/src/components/ui/tabs/index.ts +10 -0
- package/src/components/ui/tabs/tabs.tsx +116 -0
- package/src/features/balances/components/currency-item/currency-item.tsx +12 -15
- package/src/features/balances/components/send-jetton-button/send-jetton-button.tsx +4 -5
- package/src/features/balances/components/send-ton-button/send-ton-button.tsx +1 -2
- package/src/features/balances/hooks/use-balance-by-address.ts +6 -2
- package/src/features/balances/hooks/use-watch-balance-by-address.ts +1 -1
- package/src/features/balances/index.ts +0 -1
- package/src/features/jettons/hooks/use-jetton-balance-by-address.ts +6 -2
- package/src/features/jettons/hooks/use-jetton-info.ts +4 -2
- package/src/features/jettons/hooks/use-jetton-wallet-address.ts +6 -2
- package/src/features/jettons/hooks/use-jettons-by-address.ts +6 -2
- package/src/features/jettons/hooks/use-transfer-jetton.ts +1 -1
- package/src/features/jettons/hooks/use-watch-jettons-by-address.ts +1 -1
- package/src/features/network/hooks/use-block-number.ts +6 -2
- package/src/features/network/hooks/use-default-network.ts +1 -1
- package/src/features/network/hooks/use-networks.ts +1 -1
- package/src/features/nft/components/nft-item/nft-item.tsx +3 -13
- package/src/features/nft/hooks/use-nft.ts +4 -2
- package/src/features/nft/hooks/use-nfts-by-address.ts +4 -2
- package/src/features/nft/hooks/use-transfer-nft.ts +1 -1
- package/src/{hooks → features/settings/hooks}/use-app-kit.ts +1 -1
- package/src/{hooks → features/settings/hooks}/use-i18n.ts +1 -1
- package/src/features/settings/index.ts +11 -0
- package/src/features/signing/hooks/use-sign-binary.ts +1 -1
- package/src/features/signing/hooks/use-sign-cell.ts +1 -1
- package/src/features/signing/hooks/use-sign-text.ts +1 -1
- package/src/features/staking/components/select-unstake-mode/index.ts +10 -0
- package/src/features/staking/components/select-unstake-mode/select-unstake-mode.tsx +136 -0
- package/src/features/staking/components/staking-balance-block/index.ts +9 -0
- package/src/features/staking/components/staking-balance-block/staking-balance-block.tsx +90 -0
- package/src/features/staking/components/staking-info/index.ts +10 -0
- package/src/features/staking/components/staking-info/staking-info.tsx +95 -0
- package/src/features/staking/components/staking-info/utils.ts +15 -0
- package/src/features/staking/components/staking-settings-modal/index.ts +9 -0
- package/src/features/staking/components/staking-settings-modal/staking-settings-modal.tsx +76 -0
- package/src/features/staking/components/staking-widget/index.ts +9 -0
- package/src/features/staking/components/staking-widget/staking-widget.tsx +54 -0
- package/src/features/staking/components/staking-widget-provider/index.ts +9 -0
- package/src/features/staking/components/staking-widget-provider/staking-widget-provider.tsx +421 -0
- package/src/features/staking/components/staking-widget-provider/use-staking-validation.ts +79 -0
- package/src/features/staking/components/staking-widget-ui/index.ts +9 -0
- package/src/features/staking/components/staking-widget-ui/staking-widget-ui.tsx +200 -0
- package/src/features/staking/hooks/use-build-stake-transaction.ts +1 -1
- package/src/features/staking/hooks/use-staked-balance.ts +7 -2
- package/src/features/staking/hooks/use-staking-provider-info.ts +13 -2
- package/src/features/staking/hooks/use-staking-provider-metadata.ts +34 -0
- package/src/features/staking/hooks/use-staking-provider.ts +42 -0
- package/src/features/staking/hooks/use-staking-providers.ts +20 -20
- package/src/features/staking/hooks/use-staking-quote.ts +7 -2
- package/src/features/staking/index.ts +15 -5
- package/src/features/staking/utils/map-staking-error.ts +28 -0
- package/src/features/swap/components/swap-field/index.ts +9 -0
- package/src/features/swap/components/swap-field/swap-field.tsx +114 -0
- package/src/features/swap/components/swap-flip-button/index.ts +9 -0
- package/src/features/swap/components/swap-flip-button/swap-flip-button.tsx +29 -0
- package/src/features/swap/components/swap-info/index.ts +9 -0
- package/src/features/swap/components/swap-info/swap-info.tsx +48 -0
- package/src/features/swap/components/swap-settings-modal/index.ts +10 -0
- package/src/features/swap/components/swap-settings-modal/swap-settings-modal.tsx +92 -0
- package/src/features/swap/components/swap-token-select-modal/index.ts +10 -0
- package/src/features/swap/components/swap-token-select-modal/swap-token-select-modal.tsx +21 -0
- package/src/features/swap/components/swap-widget/index.ts +9 -0
- package/src/features/swap/components/swap-widget/swap-widget.tsx +70 -0
- package/src/features/swap/components/swap-widget-provider/index.ts +9 -0
- package/src/features/swap/components/swap-widget-provider/swap-widget-provider.tsx +379 -0
- package/src/features/swap/components/swap-widget-provider/use-swap-balances.ts +53 -0
- package/src/features/swap/components/swap-widget-provider/use-swap-token-state.ts +96 -0
- package/src/features/swap/components/swap-widget-provider/use-swap-validation.ts +51 -0
- package/src/features/swap/components/swap-widget-ui/index.ts +9 -0
- package/src/features/swap/components/swap-widget-ui/swap-widget-ui.tsx +168 -0
- package/src/features/swap/components/token-selector/index.ts +9 -0
- package/src/features/swap/components/token-selector/token-selector.tsx +35 -0
- package/src/features/swap/hooks/use-build-swap-transaction.ts +4 -1
- package/src/features/swap/hooks/use-swap-provider.ts +49 -0
- package/src/features/swap/hooks/use-swap-providers.ts +35 -0
- package/src/features/swap/hooks/use-swap-quote.ts +7 -2
- package/src/features/swap/index.ts +9 -0
- package/src/features/swap/utils/get-display-amount.ts +21 -0
- package/src/features/swap/utils/map-swap-error.ts +32 -0
- package/src/features/swap/utils/map-swap-widget-tokens.ts +34 -0
- package/src/features/transaction/components/transaction/send.tsx +6 -5
- package/src/features/transaction/components/transaction-progress/transaction-progress-icons.tsx +13 -57
- package/src/features/transaction/components/transaction-progress/transaction-progress.tsx +1 -1
- package/src/features/transaction/hooks/use-send-transaction.ts +1 -1
- package/src/features/transaction/hooks/use-transaction-status.ts +6 -2
- package/src/features/transaction/hooks/use-transfer-ton.ts +1 -1
- package/src/features/transaction/hooks/use-watch-transactions-by-address.ts +1 -1
- package/src/features/wallets/hooks/use-connect.ts +1 -1
- package/src/features/wallets/hooks/use-connected-wallets.ts +1 -1
- package/src/features/wallets/hooks/use-connector-by-id.ts +1 -1
- package/src/features/wallets/hooks/use-connectors.ts +1 -1
- package/src/features/wallets/hooks/use-disconnect.ts +1 -1
- package/src/features/wallets/hooks/use-selected-wallet.ts +1 -1
- package/src/hooks/use-debounce-callback.ts +69 -0
- package/src/hooks/use-debounce-value.ts +38 -0
- package/src/hooks/use-unmount.ts +16 -0
- package/src/index.ts +20 -7
- package/src/locales/en.ts +82 -0
- package/src/storybook/fixtures/tokens.ts +88 -0
- package/src/types/appkit-ui-token.ts +26 -0
- package/src/utils/map-defi-error.ts +35 -0
- package/src/utils/validate-amount.ts +28 -0
- package/dist/esm/components/block/block.js.map +0 -1
- package/dist/esm/components/block/index.js.map +0 -1
- package/dist/esm/components/button/button.js +0 -7
- package/dist/esm/components/button/button.js.map +0 -1
- package/dist/esm/components/button/button.module.css +0 -38
- package/dist/esm/components/button/index.js.map +0 -1
- package/dist/esm/components/circle-icon/circle-icon.js +0 -8
- package/dist/esm/components/circle-icon/circle-icon.js.map +0 -1
- package/dist/esm/components/circle-icon/index.js.map +0 -1
- package/dist/esm/components/ton-icon/index.js.map +0 -1
- package/dist/esm/components/ton-icon/ton-icon.js +0 -8
- package/dist/esm/components/ton-icon/ton-icon.js.map +0 -1
- package/dist/esm/features/balances/components/balance-badge/balance-badge.js +0 -33
- package/dist/esm/features/balances/components/balance-badge/balance-badge.js.map +0 -1
- package/dist/esm/features/balances/components/balance-badge/balance-badge.module.css +0 -21
- package/dist/esm/features/balances/components/balance-badge/index.js.map +0 -1
- package/dist/esm/hooks/use-app-kit-theme.js.map +0 -1
- package/dist/esm/hooks/use-app-kit.js.map +0 -1
- package/dist/esm/hooks/use-i18n.js.map +0 -1
- package/dist/types/components/block/block.d.ts.map +0 -1
- package/dist/types/components/block/index.d.ts.map +0 -1
- package/dist/types/components/button/button.d.ts.map +0 -1
- package/dist/types/components/button/index.d.ts.map +0 -1
- package/dist/types/components/circle-icon/circle-icon.d.ts +0 -16
- package/dist/types/components/circle-icon/circle-icon.d.ts.map +0 -1
- package/dist/types/components/circle-icon/index.d.ts.map +0 -1
- package/dist/types/components/ton-icon/index.d.ts.map +0 -1
- package/dist/types/components/ton-icon/ton-icon.d.ts +0 -14
- package/dist/types/components/ton-icon/ton-icon.d.ts.map +0 -1
- package/dist/types/features/balances/components/balance-badge/balance-badge.d.ts +0 -21
- package/dist/types/features/balances/components/balance-badge/balance-badge.d.ts.map +0 -1
- package/dist/types/features/balances/components/balance-badge/index.d.ts +0 -9
- package/dist/types/features/balances/components/balance-badge/index.d.ts.map +0 -1
- package/dist/types/hooks/use-app-kit-theme.d.ts.map +0 -1
- package/dist/types/hooks/use-app-kit.d.ts.map +0 -1
- package/dist/types/hooks/use-i18n.d.ts.map +0 -1
- package/src/components/button/button.tsx +0 -16
- package/src/components/circle-icon/circle-icon.tsx +0 -34
- package/src/components/ton-icon/ton-icon.tsx +0 -46
- package/src/features/balances/components/balance-badge/balance-badge.tsx +0 -47
- /package/dist/esm/components/{block → ui/block}/block.js +0 -0
- /package/dist/esm/components/{block → ui/block}/index.js +0 -0
- /package/dist/esm/components/{button → ui/button}/index.js +0 -0
- /package/dist/esm/{hooks → features/settings/hooks}/use-app-kit-theme.js +0 -0
- /package/dist/types/components/{block → ui/block}/block.d.ts +0 -0
- /package/dist/types/components/{block → ui/block}/index.d.ts +0 -0
- /package/dist/types/{hooks → features/settings/hooks}/use-app-kit-theme.d.ts +0 -0
- /package/dist/types/{hooks → features/settings/hooks}/use-app-kit.d.ts +0 -0
- /package/src/components/{block → ui/block}/block.tsx +0 -0
- /package/src/components/{block → ui/block}/index.ts +0 -0
- /package/src/{hooks → features/settings/hooks}/use-app-kit-theme.ts +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DEFAULT_ICON_SIZE } from './types';
|
|
3
|
+
export const VerifiedIcon = ({ size = DEFAULT_ICON_SIZE, ...props }) => (_jsx("svg", { width: size, height: size, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", ...props, children: _jsx("path", { fillRule: "evenodd", d: "M6.267 3.455a3.066 3.066 0 001.745-.723 3.066 3.066 0 013.976 0 3.066 3.066 0 001.745.723 3.066 3.066 0 012.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 010 3.976 3.066 3.066 0 00-.723 1.745 3.066 3.066 0 01-2.812 2.812 3.066 3.066 0 00-1.745.723 3.066 3.066 0 01-3.976 0 3.066 3.066 0 00-1.745-.723 3.066 3.066 0 01-2.812-2.812 3.066 3.066 0 00-.723-1.745 3.066 3.066 0 010-3.976 3.066 3.066 0 00.723-1.745 3.066 3.066 0 012.812-2.812zm7.44 5.252a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }));
|
|
4
|
+
//# sourceMappingURL=verified-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verified-icon.js","sourceRoot":"","sources":["../../../../../src/components/ui/icons/verified-icon.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C,MAAM,CAAC,MAAM,YAAY,GAAkB,CAAC,EAAE,IAAI,GAAG,iBAAiB,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,CACnF,cACI,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,cAAc,EACnB,KAAK,EAAC,4BAA4B,iBACtB,MAAM,KACd,KAAK,YAET,eACI,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,iiBAAiiB,EACniB,QAAQ,EAAC,SAAS,GACpB,GACA,CACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/ui/info-block/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import styles from './info-block.module.css';
|
|
4
|
+
import { Skeleton } from '../skeleton';
|
|
5
|
+
const Container = ({ className, ...props }) => {
|
|
6
|
+
return _jsx("div", { className: clsx(styles.container, className), ...props });
|
|
7
|
+
};
|
|
8
|
+
const Row = ({ className, ...props }) => {
|
|
9
|
+
return _jsx("div", { className: clsx(styles.row, className), ...props });
|
|
10
|
+
};
|
|
11
|
+
const Label = ({ className, ...props }) => {
|
|
12
|
+
return _jsx("span", { className: clsx(styles.label, className), ...props });
|
|
13
|
+
};
|
|
14
|
+
const Value = ({ className, ...props }) => {
|
|
15
|
+
return _jsx("span", { className: clsx(styles.value, className), ...props });
|
|
16
|
+
};
|
|
17
|
+
const LabelSkeleton = ({ width = 64, height = '1lh', ...props }) => {
|
|
18
|
+
return _jsx(Skeleton, { width: width, height: height, ...props });
|
|
19
|
+
};
|
|
20
|
+
const ValueSkeleton = ({ width = 80, height = '1lh', ...props }) => {
|
|
21
|
+
return _jsx(Skeleton, { width: width, height: height, ...props });
|
|
22
|
+
};
|
|
23
|
+
export const InfoBlock = {
|
|
24
|
+
Container,
|
|
25
|
+
Row,
|
|
26
|
+
Label,
|
|
27
|
+
Value,
|
|
28
|
+
LabelSkeleton,
|
|
29
|
+
ValueSkeleton,
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=info-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-block.js","sourceRoot":"","sources":["../../../../../src/components/ui/info-block/info-block.tsx"],"names":[],"mappings":";AASA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,SAAS,GAA8B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACrE,OAAO,cAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC5E,CAAC,CAAC;AAEF,MAAM,GAAG,GAA8B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC/D,OAAO,cAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACtE,CAAC,CAAC;AAEF,MAAM,KAAK,GAA+B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAClE,OAAO,eAAM,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACzE,CAAC,CAAC;AAEF,MAAM,KAAK,GAA+B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAClE,OAAO,eAAM,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACzE,CAAC,CAAC;AAEF,MAAM,aAAa,GAAsB,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAClF,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,KAAM,KAAK,GAAI,CAAC;AACjE,CAAC,CAAC;AAEF,MAAM,aAAa,GAAsB,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAClF,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,KAAM,KAAK,GAAI,CAAC;AACjE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,SAAS;IACT,GAAG;IACH,KAAK;IACL,KAAK;IACL,aAAa;IACb,aAAa;CAChB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 16px;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
padding: 16px 0;
|
|
8
|
+
border-radius: var(--ta-border-radius-l);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.row {
|
|
12
|
+
composes: bodyMedium from "../../../styles/typography.module.css";
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
align-items: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.label {
|
|
19
|
+
composes: bodyMedium from "../../../styles/typography.module.css";
|
|
20
|
+
color: var(--ta-color-text-secondary);
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 4px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.value {
|
|
27
|
+
composes: bodyMedium from "../../../styles/typography.module.css";
|
|
28
|
+
color: var(--ta-color-text);
|
|
29
|
+
text-align: right;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/ui/input/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } 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 { createContext, useContext, useMemo } from 'react';
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { Skeleton } from '../skeleton';
|
|
12
|
+
import { useInputResize } from './use-input-resize';
|
|
13
|
+
import styles from './input.module.css';
|
|
14
|
+
const InputContext = createContext(undefined);
|
|
15
|
+
const useInputContext = () => {
|
|
16
|
+
const context = useContext(InputContext);
|
|
17
|
+
if (!context) {
|
|
18
|
+
throw new Error('Input components must be used within an Input.Container');
|
|
19
|
+
}
|
|
20
|
+
return context;
|
|
21
|
+
};
|
|
22
|
+
const Container = ({ size = 'm', variant = 'default', disabled, error, loading, resizable, className, children, ...props }) => {
|
|
23
|
+
const contextValue = useMemo(() => ({ size, variant, disabled, error, loading, resizable }), [size, variant, disabled, error, loading, resizable]);
|
|
24
|
+
return (_jsx(InputContext.Provider, { value: contextValue, children: _jsx("div", { className: clsx(styles.container, styles[`variant-${variant}`], disabled && styles.disabled, error && styles.error, loading && styles.loading, className), ...props, children: children }) }));
|
|
25
|
+
};
|
|
26
|
+
const Header = ({ className, children, ...props }) => (_jsx("div", { className: clsx(styles.header, className), ...props, children: children }));
|
|
27
|
+
const Title = ({ className, children, ...props }) => (_jsx("span", { className: clsx(styles.title, className), ...props, children: children }));
|
|
28
|
+
const Field = ({ className, children, ...props }) => (_jsx("div", { className: clsx(styles.field, className), ...props, children: children }));
|
|
29
|
+
const Slot = ({ side, className, children, ...props }) => (_jsx("div", { className: clsx(styles.slot, side === 'right' && styles.right, className), ...props, children: children }));
|
|
30
|
+
const InputControl = ({ className, disabled: propsDisabled, onChange, ...props }) => {
|
|
31
|
+
const { size: contextSize, disabled: contextDisabled, loading, resizable } = useInputContext();
|
|
32
|
+
const disabled = propsDisabled || contextDisabled;
|
|
33
|
+
const { inputRef, measureMaxRef, measureMinRef, resizeStyle, adjustSize } = useInputResize({
|
|
34
|
+
resizable,
|
|
35
|
+
contextSize,
|
|
36
|
+
value: props.value,
|
|
37
|
+
});
|
|
38
|
+
const handleChange = (e) => {
|
|
39
|
+
onChange?.(e);
|
|
40
|
+
adjustSize();
|
|
41
|
+
};
|
|
42
|
+
const text = String(props.value ?? props.defaultValue ?? '');
|
|
43
|
+
if (loading) {
|
|
44
|
+
const skeletonClass = styles[`inputSkeleton_${contextSize}`];
|
|
45
|
+
return (_jsx("div", { className: clsx(styles.input, styles.inputSkeleton, skeletonClass, className), children: _jsx(Skeleton, { width: 75, height: "70%" }) }));
|
|
46
|
+
}
|
|
47
|
+
return (_jsxs(_Fragment, { children: [resizable && (_jsxs(_Fragment, { children: [_jsx("span", { ref: measureMaxRef, className: clsx(styles.inputMeasure, styles[`input_${contextSize}`]), "aria-hidden": true, children: text }), _jsx("span", { ref: measureMinRef, className: clsx(styles.inputMeasure, styles.input_s), "aria-hidden": true })] })), _jsx("input", { className: clsx(styles.input, styles[`input_${contextSize}`], className), style: resizeStyle, disabled: disabled, ...props, ref: inputRef, onChange: handleChange })] }));
|
|
48
|
+
};
|
|
49
|
+
const Caption = ({ className, children, ...props }) => {
|
|
50
|
+
const { error } = useInputContext();
|
|
51
|
+
return (_jsx("span", { className: clsx(styles.caption, error && styles.errorText, className), ...props, children: children }));
|
|
52
|
+
};
|
|
53
|
+
export const Input = Object.assign(Container, {
|
|
54
|
+
Container,
|
|
55
|
+
Header,
|
|
56
|
+
Title,
|
|
57
|
+
Field,
|
|
58
|
+
Slot,
|
|
59
|
+
Input: InputControl,
|
|
60
|
+
Caption,
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
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AAC,KAAK,EAAE,MAAM,CAAC,SAAS,WAAW,EAAE,CAAC,EAAE,SAAS,CAAC,EACxE,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,QAAQ,KACd,KAAK,EACT,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,YAAY,GACxB,IACH,CACN,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,OAAO,GAA+B,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC9E,MAAM,EAAE,KAAK,EAAE,GAAG,eAAe,EAAE,CAAC;IACpC,OAAO,CACH,eAAM,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,IAAI,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,KAAM,KAAK,YACjF,QAAQ,GACN,CACV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;IAC1C,SAAS;IACT,MAAM;IACN,KAAK;IACL,KAAK;IACL,IAAI;IACJ,KAAK,EAAE,YAAY;IACnB,OAAO;CACV,CAAC,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 4px;
|
|
5
|
+
width: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.header {
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
align-items: center;
|
|
12
|
+
padding: 0 4px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.title {
|
|
16
|
+
composes: bodyMedium from "../../../styles/typography.module.css";
|
|
17
|
+
color: var(--ta-color-text-secondary);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.field {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 8px;
|
|
24
|
+
background: var(--ta-color-background-secondary);
|
|
25
|
+
border: var(--ta-border-width-m) solid transparent;
|
|
26
|
+
border-radius: var(--ta-border-radius-l);
|
|
27
|
+
transition: border-color 0.2s;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.field:focus-within {
|
|
33
|
+
border-color: var(--ta-color-primary);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Sizes */
|
|
37
|
+
.field {
|
|
38
|
+
padding: 14px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Variants */
|
|
42
|
+
.variant-unstyled .field {
|
|
43
|
+
background: none;
|
|
44
|
+
border: none;
|
|
45
|
+
padding: 0;
|
|
46
|
+
min-height: unset;
|
|
47
|
+
border-radius: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.variant-unstyled .field:focus-within {
|
|
51
|
+
background: none;
|
|
52
|
+
border: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* States */
|
|
56
|
+
.disabled {
|
|
57
|
+
opacity: 0.5;
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.error .field {
|
|
62
|
+
border-color: var(--ta-color-error);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.input_s {
|
|
66
|
+
composes: inputS from "../../../styles/typography.module.css";
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.input_m {
|
|
70
|
+
composes: inputM from "../../../styles/typography.module.css";
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.input_l {
|
|
74
|
+
composes: inputL from "../../../styles/typography.module.css";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.inputSkeleton_s {
|
|
78
|
+
height: var(--ta-input-s-line-height);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.input_resize_m {
|
|
82
|
+
font-size: var(--ta-input-m-size);
|
|
83
|
+
font-weight: var(--ta-input-m-weight);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.input_resize_s {
|
|
87
|
+
font-size: var(--ta-input-s-size);
|
|
88
|
+
font-weight: var(--ta-input-s-weight);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.inputSkeleton_m {
|
|
92
|
+
height: var(--ta-input-m-line-height);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.inputSkeleton_l {
|
|
96
|
+
height: var(--ta-input-l-line-height);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Hidden spans used to measure text width at each size (same idea as Uniswap AmountInput) */
|
|
100
|
+
.inputMeasure {
|
|
101
|
+
position: absolute;
|
|
102
|
+
visibility: hidden;
|
|
103
|
+
white-space: pre;
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
font-family: var(--ta-font-family);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.input {
|
|
109
|
+
flex: 1;
|
|
110
|
+
min-width: 0;
|
|
111
|
+
background: none;
|
|
112
|
+
border: none;
|
|
113
|
+
outline: none;
|
|
114
|
+
color: var(--ta-color-text);
|
|
115
|
+
font-family: var(--ta-font-family);
|
|
116
|
+
width: 100%;
|
|
117
|
+
padding: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.input::placeholder {
|
|
121
|
+
color: var(--ta-color-text-secondary);
|
|
122
|
+
opacity: 0.6;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.inputSkeleton {
|
|
126
|
+
width: 100%;
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
pointer-events: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.slot {
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
justify-content: center;
|
|
136
|
+
flex-shrink: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.caption {
|
|
140
|
+
composes: footnoteRegular from "../../../styles/typography.module.css";
|
|
141
|
+
padding: 0 4px;
|
|
142
|
+
color: var(--ta-color-text-secondary);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.errorText {
|
|
146
|
+
color: var(--ta-color-error);
|
|
147
|
+
}
|
|
@@ -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 { useRef, useState, useLayoutEffect } from 'react';
|
|
9
|
+
export const readResizeMetrics = (maxSpan, minSpan, input) => {
|
|
10
|
+
const maxStyle = getComputedStyle(maxSpan);
|
|
11
|
+
const maxFontSize = parseFloat(maxStyle.fontSize);
|
|
12
|
+
const lineHeightRatio = parseFloat(maxStyle.lineHeight) / maxFontSize;
|
|
13
|
+
return {
|
|
14
|
+
maxFontSize,
|
|
15
|
+
minFontSize: parseFloat(getComputedStyle(minSpan).fontSize),
|
|
16
|
+
lineHeightRatio,
|
|
17
|
+
parentFontSize: parseFloat(getComputedStyle(input.parentElement).fontSize),
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export const useInputResize = ({ resizable, contextSize, value }) => {
|
|
21
|
+
const inputRef = useRef(null);
|
|
22
|
+
const measureMaxRef = useRef(null);
|
|
23
|
+
const measureMinRef = useRef(null);
|
|
24
|
+
const [fontSizeEm, setFontSizeEm] = useState(undefined);
|
|
25
|
+
const lineHeightRatioRef = useRef(1.25);
|
|
26
|
+
const adjustSize = () => {
|
|
27
|
+
if (!resizable || !inputRef.current || !measureMaxRef.current || !measureMinRef.current)
|
|
28
|
+
return;
|
|
29
|
+
const availableWidth = inputRef.current.clientWidth;
|
|
30
|
+
if (availableWidth === 0)
|
|
31
|
+
return;
|
|
32
|
+
const textWidth = measureMaxRef.current.offsetWidth;
|
|
33
|
+
const { maxFontSize, minFontSize, lineHeightRatio, parentFontSize } = readResizeMetrics(measureMaxRef.current, measureMinRef.current, inputRef.current);
|
|
34
|
+
const ratio = textWidth > 0 ? availableWidth / textWidth : 1;
|
|
35
|
+
const scaledPx = Math.min(maxFontSize, Math.max(minFontSize, maxFontSize * ratio));
|
|
36
|
+
setFontSizeEm(scaledPx / parentFontSize);
|
|
37
|
+
lineHeightRatioRef.current = lineHeightRatio;
|
|
38
|
+
};
|
|
39
|
+
// Re-measure when controlled value or context size changes
|
|
40
|
+
useLayoutEffect(adjustSize, [resizable, contextSize, value]);
|
|
41
|
+
// Re-measure on container resize (observe parent, not the input itself,
|
|
42
|
+
// to avoid feedback loop when font-size change triggers ResizeObserver)
|
|
43
|
+
useLayoutEffect(() => {
|
|
44
|
+
const parent = inputRef.current?.parentElement;
|
|
45
|
+
if (!resizable || !parent)
|
|
46
|
+
return;
|
|
47
|
+
const observer = new ResizeObserver(adjustSize);
|
|
48
|
+
observer.observe(parent);
|
|
49
|
+
return () => observer.disconnect();
|
|
50
|
+
}, [resizable, contextSize]);
|
|
51
|
+
const resizeStyle = resizable && fontSizeEm !== undefined
|
|
52
|
+
? { fontSize: `${fontSizeEm}em`, lineHeight: lineHeightRatioRef.current }
|
|
53
|
+
: undefined;
|
|
54
|
+
return { inputRef, measureMaxRef, measureMinRef, resizeStyle, adjustSize };
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=use-input-resize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-input-resize.js","sourceRoot":"","sources":["../../../../../src/components/ui/input/use-input-resize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAY1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC7B,OAAwB,EACxB,OAAwB,EACxB,KAAuB,EACV,EAAE;IACf,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,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../../src/components/ui/logo/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } 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 { createContext, forwardRef, useContext, useEffect, useLayoutEffect, useState } from 'react';
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
import { useImageLoadingStatus } from './use-image-loading-status';
|
|
12
|
+
import styles from './logo.module.css';
|
|
13
|
+
const LogoContext = createContext(null);
|
|
14
|
+
const useLogoContext = () => {
|
|
15
|
+
const ctx = useContext(LogoContext);
|
|
16
|
+
if (!ctx)
|
|
17
|
+
throw new Error('Logo compound components must be used within Logo.Root');
|
|
18
|
+
return ctx;
|
|
19
|
+
};
|
|
20
|
+
const LogoRoot = forwardRef(({ className, ...props }, ref) => {
|
|
21
|
+
const [imageLoadingStatus, setImageLoadingStatus] = useState('idle');
|
|
22
|
+
return (_jsx(LogoContext.Provider, { value: { imageLoadingStatus, onImageLoadingStatusChange: setImageLoadingStatus }, children: _jsx("span", { className: clsx(styles.logoRoot, className), ...props, ref: ref }) }));
|
|
23
|
+
});
|
|
24
|
+
LogoRoot.displayName = 'LogoRoot';
|
|
25
|
+
const LogoImage = forwardRef(({ src, onLoadingStatusChange, className, ...props }, ref) => {
|
|
26
|
+
const context = useLogoContext();
|
|
27
|
+
const loadingStatus = useImageLoadingStatus(src);
|
|
28
|
+
useLayoutEffect(() => {
|
|
29
|
+
if (loadingStatus !== 'idle') {
|
|
30
|
+
onLoadingStatusChange?.(loadingStatus);
|
|
31
|
+
context.onImageLoadingStatusChange(loadingStatus);
|
|
32
|
+
}
|
|
33
|
+
}, [loadingStatus]);
|
|
34
|
+
return loadingStatus === 'loaded' ? (_jsx("img", { className: clsx(styles.logoImage, className), ...props, ref: ref, src: src })) : null;
|
|
35
|
+
});
|
|
36
|
+
LogoImage.displayName = 'LogoImage';
|
|
37
|
+
const LogoFallback = forwardRef(({ delayMs, className, ...props }, ref) => {
|
|
38
|
+
const context = useLogoContext();
|
|
39
|
+
const [canRender, setCanRender] = useState(delayMs === undefined);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (delayMs !== undefined) {
|
|
42
|
+
const id = window.setTimeout(() => setCanRender(true), delayMs);
|
|
43
|
+
return () => window.clearTimeout(id);
|
|
44
|
+
}
|
|
45
|
+
return undefined;
|
|
46
|
+
}, [delayMs]);
|
|
47
|
+
return canRender && context.imageLoadingStatus !== 'loaded' ? (_jsx("span", { className: clsx(styles.logoFallback, className), ...props, ref: ref })) : null;
|
|
48
|
+
});
|
|
49
|
+
LogoFallback.displayName = 'LogoFallback';
|
|
50
|
+
export const Logo = forwardRef(({ size = 30, src, alt, fallback, ...props }, ref) => {
|
|
51
|
+
return (_jsxs(LogoRoot, { ref: ref, style: { width: size, height: size }, ...props, children: [_jsx(LogoImage, { src: src, alt: alt }), (fallback || alt) && _jsx(LogoFallback, { delayMs: 600, children: fallback ? fallback : alt?.[0] })] }));
|
|
52
|
+
});
|
|
53
|
+
Logo.displayName = 'Logo';
|
|
54
|
+
//# sourceMappingURL=logo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logo.js","sourceRoot":"","sources":["../../../../../src/components/ui/logo/logo.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpG,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,MAAM,MAAM,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CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjH,OAAO,CACH,MAAC,QAAQ,IAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAM,KAAK,aAC/D,KAAC,SAAS,IAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAI,EAEhC,CAAC,QAAQ,IAAI,GAAG,CAAC,IAAI,KAAC,YAAY,IAAC,OAAO,EAAE,GAAG,YAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAgB,IAC1F,CACd,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.logoRoot {
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -8,24 +8,24 @@
|
|
|
8
8
|
width: 45px;
|
|
9
9
|
height: 45px;
|
|
10
10
|
border-radius: 100%;
|
|
11
|
-
background-color: var(--ta-color-
|
|
11
|
+
background-color: var(--ta-color-background);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.
|
|
14
|
+
.logoImage {
|
|
15
15
|
width: 100%;
|
|
16
16
|
height: 100%;
|
|
17
17
|
object-fit: cover;
|
|
18
18
|
border-radius: inherit;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.
|
|
21
|
+
.logoFallback {
|
|
22
22
|
width: 100%;
|
|
23
23
|
height: 100%;
|
|
24
24
|
display: flex;
|
|
25
25
|
align-items: center;
|
|
26
26
|
justify-content: center;
|
|
27
|
-
background-color:
|
|
28
|
-
color: var(--ta-color-
|
|
27
|
+
background-color: var(--ta-color-background-tertiary);
|
|
28
|
+
color: var(--ta-color-text);
|
|
29
29
|
font-size: 15px;
|
|
30
30
|
line-height: 1;
|
|
31
31
|
font-weight: 500;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { useLayoutEffect, useRef, useState } from 'react';
|
|
9
|
+
const resolveLoadingStatus = (image, src) => {
|
|
10
|
+
if (!image || !src)
|
|
11
|
+
return 'idle';
|
|
12
|
+
if (image.src !== src)
|
|
13
|
+
image.src = src;
|
|
14
|
+
return image.complete && image.naturalWidth > 0 ? 'loaded' : 'loading';
|
|
15
|
+
};
|
|
16
|
+
export const useImageLoadingStatus = (src) => {
|
|
17
|
+
const imageRef = useRef(null);
|
|
18
|
+
const getImage = () => {
|
|
19
|
+
if (typeof window === 'undefined')
|
|
20
|
+
return null;
|
|
21
|
+
if (!imageRef.current)
|
|
22
|
+
imageRef.current = new window.Image();
|
|
23
|
+
return imageRef.current;
|
|
24
|
+
};
|
|
25
|
+
const [loadingStatus, setLoadingStatus] = useState(() => resolveLoadingStatus(getImage(), src));
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
setLoadingStatus(resolveLoadingStatus(getImage(), src));
|
|
28
|
+
}, [src]);
|
|
29
|
+
useLayoutEffect(() => {
|
|
30
|
+
const image = getImage();
|
|
31
|
+
if (!image)
|
|
32
|
+
return;
|
|
33
|
+
const handleLoad = () => setLoadingStatus('loaded');
|
|
34
|
+
const handleError = () => setLoadingStatus('error');
|
|
35
|
+
image.addEventListener('load', handleLoad);
|
|
36
|
+
image.addEventListener('error', handleError);
|
|
37
|
+
return () => {
|
|
38
|
+
image.removeEventListener('load', handleLoad);
|
|
39
|
+
image.removeEventListener('error', handleError);
|
|
40
|
+
};
|
|
41
|
+
}, [src]);
|
|
42
|
+
return loadingStatus;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=use-image-loading-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-image-loading-status.js","sourceRoot":"","sources":["../../../../../src/components/ui/logo/use-image-loading-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI1D,MAAM,oBAAoB,GAAG,CAAC,KAA8B,EAAE,GAAY,EAAsB,EAAE;IAC9F,IAAI,CAAC,KAAK,IAAI,CAAC,GAAG;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG;QAAE,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;IACvC,OAAO,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAuB,EAAsB,EAAE;IACjF,MAAM,QAAQ,GAAG,MAAM,CAA0B,IAAI,CAAC,CAAC;IAEvD,MAAM,QAAQ,GAAG,GAA4B,EAAE;QAC3C,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO,IAAI,CAAC;QAC/C,IAAI,CAAC,QAAQ,CAAC,OAAO;YAAE,QAAQ,CAAC,OAAO,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QAC7D,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC5B,CAAC,CAAC;IAEF,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAqB,GAAG,EAAE,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IAEpH,eAAe,CAAC,GAAG,EAAE;QACjB,gBAAgB,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IAC5D,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,eAAe,CAAC,GAAG,EAAE;QACjB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;QACzB,IAAI,CAAC,KAAK;YAAE,OAAO;QAEnB,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACpD,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACpD,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAC3C,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAE7C,OAAO,GAAG,EAAE;YACR,KAAK,CAAC,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YAC9C,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QACpD,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,OAAO,aAAa,CAAC;AACzB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/ui/modal/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Dialog } from '../dialog';
|
|
4
|
+
import { CloseIcon } from '../icons';
|
|
5
|
+
import styles from './modal.module.css';
|
|
6
|
+
export const Modal = ({ open, onOpenChange, title, children, className }) => {
|
|
7
|
+
return (_jsx(Dialog.Root, { open: open, onOpenChange: onOpenChange, children: _jsx(Dialog.Portal, { children: _jsx(Dialog.Overlay, { className: styles.overlay, onClick: () => onOpenChange?.(false), children: _jsxs(Dialog.Content, { className: clsx(styles.content, className), onClick: (e) => e.stopPropagation(), children: [_jsxs("div", { className: styles.header, children: [title && _jsx(Dialog.Title, { className: styles.title, children: title }), _jsx(Dialog.Close, { className: styles.close, "aria-label": "Close", children: _jsx(CloseIcon, { size: 12 }) })] }), _jsx("div", { className: styles.body, children: children })] }) }) }) }));
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../../../src/components/ui/modal/modal.tsx"],"names":[],"mappings":";AASA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAyBxC,MAAM,CAAC,MAAM,KAAK,GAAmB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;IACxF,OAAO,CACH,KAAC,MAAM,CAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,YAC/C,KAAC,MAAM,CAAC,MAAM,cACV,KAAC,MAAM,CAAC,OAAO,IAAC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,YAC3E,MAAC,MAAM,CAAC,OAAO,IAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,aAC3F,eAAK,SAAS,EAAE,MAAM,CAAC,MAAM,aACxB,KAAK,IAAI,KAAC,MAAM,CAAC,KAAK,IAAC,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAgB,EACvE,KAAC,MAAM,CAAC,KAAK,IAAC,SAAS,EAAE,MAAM,CAAC,KAAK,gBAAa,OAAO,YACrD,KAAC,SAAS,IAAC,IAAI,EAAE,EAAE,GAAI,GACZ,IACb,EACN,cAAK,SAAS,EAAE,MAAM,CAAC,IAAI,YAAG,QAAQ,GAAO,IAChC,GACJ,GACL,GACN,CACjB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
|
|
9
|
+
.overlay {
|
|
10
|
+
position: fixed;
|
|
11
|
+
inset: 0;
|
|
12
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
13
|
+
backdrop-filter: blur(4px);
|
|
14
|
+
z-index: 900;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
padding: 16px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.content {
|
|
22
|
+
background-color: var(--ta-color-background);
|
|
23
|
+
border-radius: var(--ta-border-radius-xl);
|
|
24
|
+
width: 100%;
|
|
25
|
+
max-width: 480px;
|
|
26
|
+
max-height: calc(100vh - 32px);
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
outline: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.header {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
padding: 20px 20px 16px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.title {
|
|
42
|
+
composes: title from "../../../styles/typography.module.css";
|
|
43
|
+
margin: 0;
|
|
44
|
+
color: var(--ta-color-text);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.close {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
width: 32px;
|
|
52
|
+
height: 32px;
|
|
53
|
+
border-radius: var(--ta-border-radius-full);
|
|
54
|
+
border: none;
|
|
55
|
+
background-color: var(--ta-color-background-secondary);
|
|
56
|
+
color: var(--ta-color-text-secondary);
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
transition: opacity 0.2s ease;
|
|
59
|
+
padding: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.close:hover {
|
|
63
|
+
opacity: 0.8;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.body {
|
|
67
|
+
composes: bodyRegular from "../../../styles/typography.module.css";
|
|
68
|
+
padding: 0 20px 24px;
|
|
69
|
+
overflow-y: auto;
|
|
70
|
+
color: var(--ta-color-text);
|
|
71
|
+
}
|