@stridge/kit 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/KitProvider.d.ts +91 -0
- package/dist/KitProvider.js +1 -0
- package/dist/_internal/deposit/driver/index.d.ts +5 -0
- package/dist/_internal/deposit/driver/index.js +1 -0
- package/dist/_internal/deposit/widgets/index.d.ts +11 -0
- package/dist/_internal/deposit/widgets/index.js +1 -0
- package/dist/_internal/drivers/stridge/index.d.ts +6 -0
- package/dist/_internal/drivers/stridge/index.js +1 -0
- package/dist/_internal/drivers/stridge-mock/index.d.ts +5 -0
- package/dist/_internal/drivers/stridge-mock/index.js +1 -0
- package/dist/_internal/index.d.ts +2 -0
- package/dist/_internal/index.js +1 -0
- package/dist/_internal/withdraw/driver/index.d.ts +6 -0
- package/dist/_internal/withdraw/driver/index.js +1 -0
- package/dist/_internal/withdraw/widgets/index.d.ts +5 -0
- package/dist/_internal/withdraw/widgets/index.js +1 -0
- package/dist/banners/index.d.ts +1 -0
- package/dist/banners/index.js +1 -0
- package/dist/banners/useBannerAck.d.ts +61 -0
- package/dist/banners/useBannerAck.js +1 -0
- package/dist/deposit/compound/index.d.ts +28 -0
- package/dist/deposit/compound/index.js +1 -0
- package/dist/deposit/dialog/index.d.ts +2 -0
- package/dist/deposit/dialog/index.js +1 -0
- package/dist/drivers/stridge/createStridgeDepositDriver.d.ts +29 -0
- package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -0
- package/dist/drivers/stridge/createStridgeWithdrawDriver.d.ts +113 -0
- package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -0
- package/dist/drivers/stridge/internal/encoding.js +1 -0
- package/dist/drivers/stridge/internal/env.js +1 -0
- package/dist/drivers/stridge/internal/metadata.js +1 -0
- package/dist/drivers/stridge/internal/pollOnce.js +1 -0
- package/dist/drivers/stridge/internal/signAndConfirm.js +1 -0
- package/dist/drivers/stridge/poll.js +1 -0
- package/dist/drivers/stridge/rpc.d.ts +77 -0
- package/dist/drivers/stridge/rpc.js +1 -0
- package/dist/drivers/stridge/types.d.ts +145 -0
- package/dist/drivers/stridge/types.js +1 -0
- package/dist/drivers/stridge/wagmiSigner.js +1 -0
- package/dist/drivers/stridge-mock/createStridgeMockDriver.d.ts +120 -0
- package/dist/drivers/stridge-mock/createStridgeMockDriver.js +1 -0
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +118 -0
- package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -0
- package/dist/drivers/stridge-mock/fixtures.d.ts +127 -0
- package/dist/drivers/stridge-mock/fixtures.js +1 -0
- package/dist/drivers/stridge-mock/store.js +1 -0
- package/dist/drivers/stridge-mock/triggers.d.ts +41 -0
- package/dist/flows/deposit/dialog/DepositBootstrapErrorState.js +1 -0
- package/dist/flows/deposit/dialog/DepositBootstrapErrorState.styles.js +1 -0
- package/dist/flows/deposit/dialog/DepositDialog.d.ts +112 -0
- package/dist/flows/deposit/dialog/DepositDialog.js +1 -0
- package/dist/flows/deposit/driver/context.d.ts +37 -0
- package/dist/flows/deposit/driver/context.js +1 -0
- package/dist/flows/deposit/driver/payloads.d.ts +342 -0
- package/dist/flows/deposit/driver/transformers/balanceToBalancesPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/quoteToPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/settlementToPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/startToAddressesPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/startToBrandPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/startToTargetPayload.js +1 -0
- package/dist/flows/deposit/driver/transformers/walletAddressToWalletPayload.js +1 -0
- package/dist/flows/deposit/driver/types.d.ts +177 -0
- package/dist/flows/deposit/orchestrator/controller.d.ts +11 -0
- package/dist/flows/deposit/orchestrator/controller.js +1 -0
- package/dist/flows/deposit/orchestrator/reducer.js +1 -0
- package/dist/flows/deposit/orchestrator/resolveAssetById.js +1 -0
- package/dist/flows/deposit/orchestrator/steps.d.ts +23 -0
- package/dist/flows/deposit/orchestrator/steps.js +1 -0
- package/dist/flows/deposit/orchestrator/types.d.ts +266 -0
- package/dist/flows/deposit/orchestrator/useDeposit.d.ts +35 -0
- package/dist/flows/deposit/orchestrator/useDeposit.js +1 -0
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.d.ts +35 -0
- package/dist/flows/deposit/widgets/amount-entry/AmountEntry.js +1 -0
- package/dist/flows/deposit/widgets/amount-entry/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/amount-entry/index.js +1 -0
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.d.ts +25 -0
- package/dist/flows/deposit/widgets/asset-picker/AssetPicker.js +1 -0
- package/dist/flows/deposit/widgets/asset-picker/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/asset-picker/index.js +1 -0
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.d.ts +31 -0
- package/dist/flows/deposit/widgets/confirm-deposit/ConfirmDeposit.js +1 -0
- package/dist/flows/deposit/widgets/confirm-deposit/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/confirm-deposit/index.js +1 -0
- package/dist/flows/deposit/widgets/deposit/Deposit.d.ts +30 -0
- package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.d.ts +51 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.d.ts +11 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.slots.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/Deposit.styles.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.d.ts +15 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Header.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Method.d.ts +32 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Method.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Methods.d.ts +23 -0
- package/dist/flows/deposit/widgets/deposit/compound/components/Methods.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/context.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/index.d.ts +3 -0
- package/dist/flows/deposit/widgets/deposit/compound/index.js +1 -0
- package/dist/flows/deposit/widgets/deposit/compound/types.d.ts +129 -0
- package/dist/flows/deposit/widgets/deposit/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/deposit/index.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.d.ts +20 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.d.ts +102 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.slots.d.ts +20 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.slots.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.styles.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Body.d.ts +17 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Body.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Close.d.ts +13 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Close.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Detail.d.ts +14 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Detail.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Details.d.ts +20 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Details.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Footer.d.ts +17 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Footer.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Hero.d.ts +17 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Hero.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/PrimaryAction.d.ts +26 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/PrimaryAction.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Rows.d.ts +35 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Rows.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Toggle.d.ts +18 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/components/Toggle.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/context.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/index.d.ts +3 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/index.js +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/compound/types.d.ts +188 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/deposit-status-banner/index.js +1 -0
- package/dist/flows/deposit/widgets/error-state/ErrorState.d.ts +30 -0
- package/dist/flows/deposit/widgets/error-state/ErrorState.js +1 -0
- package/dist/flows/deposit/widgets/error-state/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/error-state/index.js +1 -0
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.d.ts +31 -0
- package/dist/flows/deposit/widgets/processing-state/ProcessingState.js +1 -0
- package/dist/flows/deposit/widgets/processing-state/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/processing-state/index.js +1 -0
- package/dist/flows/deposit/widgets/success-state/SuccessState.d.ts +30 -0
- package/dist/flows/deposit/widgets/success-state/SuccessState.js +1 -0
- package/dist/flows/deposit/widgets/success-state/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/success-state/index.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.d.ts +41 -0
- package/dist/flows/deposit/widgets/transfer-crypto/TransferCrypto.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.d.ts +56 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.slots.d.ts +15 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.slots.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/TransferCrypto.styles.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.d.ts +10 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.d.ts +17 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.d.ts +15 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Header.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/InfoTooltip.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.d.ts +21 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Selectors.d.ts +11 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Selectors.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Summary.d.ts +11 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Summary.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/context.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/index.d.ts +3 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/index.js +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/compound/types.d.ts +187 -0
- package/dist/flows/deposit/widgets/transfer-crypto/index.d.ts +1 -0
- package/dist/flows/deposit/widgets/transfer-crypto/index.js +1 -0
- package/dist/flows/shared/transformers/classifySettlementStatus.js +1 -0
- package/dist/flows/shared/transformers/computeQuoteAttrs.js +1 -0
- package/dist/flows/shared/transformers/parseIsoMs.js +1 -0
- package/dist/flows/shared/transformers/parseSmallestUnit.js +1 -0
- package/dist/flows/shared/transformers/pickRelevantSettlement.js +1 -0
- package/dist/flows/withdraw/dialog/WithdrawDialog.d.ts +103 -0
- package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -0
- package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.d.ts +36 -0
- package/dist/flows/withdraw/dialog/WithdrawDialogEventsContext.js +1 -0
- package/dist/flows/withdraw/driver/context.d.ts +24 -0
- package/dist/flows/withdraw/driver/context.js +1 -0
- package/dist/flows/withdraw/driver/dto.d.ts +41 -0
- package/dist/flows/withdraw/driver/payloads.d.ts +206 -0
- package/dist/flows/withdraw/driver/transformers/balanceToWithdrawableBalancesPayload.js +1 -0
- package/dist/flows/withdraw/driver/transformers/quoteToWithdrawalPayload.js +1 -0
- package/dist/flows/withdraw/driver/transformers/settlementToWithdrawalPayload.js +1 -0
- package/dist/flows/withdraw/driver/transformers/supportedAssetsToReceiveOptionsPayload.js +1 -0
- package/dist/flows/withdraw/driver/types.d.ts +133 -0
- package/dist/flows/withdraw/orchestrator/controller.d.ts +11 -0
- package/dist/flows/withdraw/orchestrator/controller.js +1 -0
- package/dist/flows/withdraw/orchestrator/index.d.ts +4 -0
- package/dist/flows/withdraw/orchestrator/index.js +1 -0
- package/dist/flows/withdraw/orchestrator/reducer.js +1 -0
- package/dist/flows/withdraw/orchestrator/types.d.ts +156 -0
- package/dist/flows/withdraw/orchestrator/useWithdraw.d.ts +23 -0
- package/dist/flows/withdraw/orchestrator/useWithdraw.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.d.ts +22 -0
- package/dist/flows/withdraw/widgets/withdraw-error/WithdrawError.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-error/index.d.ts +1 -0
- package/dist/flows/withdraw/widgets/withdraw-error/index.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.d.ts +29 -0
- package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.d.ts +55 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.slots.d.ts +31 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.slots.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.styles.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/AmountField.d.ts +12 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/AmountField.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.d.ts +20 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Body.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/BreakdownCard.d.ts +17 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/BreakdownCard.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Footer.d.ts +18 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Footer.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.d.ts +21 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/Header.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/InfoTooltip.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/ReceiveSelectors.d.ts +13 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/ReceiveSelectors.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.d.ts +19 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/context.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/index.d.ts +3 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/index.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/compound/types.d.ts +149 -0
- package/dist/flows/withdraw/widgets/withdraw-form/index.d.ts +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/index.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-form/validation.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.d.ts +19 -0
- package/dist/flows/withdraw/widgets/withdraw-in-progress/WithdrawInProgress.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-in-progress/index.d.ts +1 -0
- package/dist/flows/withdraw/widgets/withdraw-in-progress/index.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.d.ts +20 -0
- package/dist/flows/withdraw/widgets/withdraw-success/WithdrawSuccess.js +1 -0
- package/dist/flows/withdraw/widgets/withdraw-success/index.d.ts +1 -0
- package/dist/flows/withdraw/widgets/withdraw-success/index.js +1 -0
- package/dist/format/index.d.ts +10 -0
- package/dist/format/index.js +1 -0
- package/dist/i18n/index.d.ts +9 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/locales/ar.d.ts +6 -0
- package/dist/i18n/locales/ar.js +1 -0
- package/dist/i18n/locales/es.d.ts +6 -0
- package/dist/i18n/locales/es.js +1 -0
- package/dist/icons/index.d.ts +27 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +1 -0
- package/dist/kit/package.js +1 -0
- package/dist/scope/KitPortalScope.d.ts +31 -0
- package/dist/scope/KitPortalScope.js +1 -0
- package/dist/scope/KitScope.d.ts +63 -0
- package/dist/scope/KitScope.js +1 -0
- package/dist/scope/KitScope.slots.js +1 -0
- package/dist/scope/context.d.ts +67 -0
- package/dist/scope/context.js +1 -0
- package/dist/scope/index.d.ts +3 -0
- package/dist/scope/index.js +1 -0
- package/dist/shared/chains/index.d.ts +40 -0
- package/dist/shared/chains/index.js +1 -0
- package/dist/shared/constants/brand-links.js +1 -0
- package/dist/shared/dialog/DialogShell.d.ts +63 -0
- package/dist/shared/dialog/DialogShell.js +1 -0
- package/dist/shared/dialog/Frame.js +1 -0
- package/dist/shared/dialog/GatewayKitRoot.js +1 -0
- package/dist/shared/dialog/StepTransition.js +1 -0
- package/dist/shared/dialog/useDirectionalChevronTransform.js +1 -0
- package/dist/shared/driver/types.d.ts +69 -0
- package/dist/shared/error-handling/components/GatewayKitBoundary.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/GatewayKitErrorCard.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/GatewayKitErrorCard.slots.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/GatewayKitErrorCard.styles.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Action.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Actions.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/CodeSample.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Description.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/DetailRow.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Guidance.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Section.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/TechnicalDetails.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/TechnicalDetailsToggle.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/components/Title.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/context.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitErrorCard/index.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitRecoveryError.js +1 -0
- package/dist/shared/error-handling/components/GatewayKitSetupError.js +1 -0
- package/dist/shared/error-handling/constants/guides.js +1 -0
- package/dist/shared/error-handling/constants/snippets.js +6 -0
- package/dist/shared/error-handling/index.js +1 -0
- package/dist/shared/error-handling/lib/isWagmiProviderMissingError.js +1 -0
- package/dist/shared/format/formatDurationCoarse.d.ts +29 -0
- package/dist/shared/format/formatDurationCoarse.js +1 -0
- package/dist/shared/format/formatDurationCompact.d.ts +28 -0
- package/dist/shared/format/formatDurationCompact.js +1 -0
- package/dist/shared/format/formatNetworkName.d.ts +27 -0
- package/dist/shared/format/formatNetworkName.js +1 -0
- package/dist/shared/format/formatPercent.d.ts +23 -0
- package/dist/shared/format/formatPercent.js +1 -0
- package/dist/shared/format/formatTimestamp.d.ts +22 -0
- package/dist/shared/format/formatTimestamp.js +1 -0
- package/dist/shared/format/formatTokenAmount.d.ts +46 -0
- package/dist/shared/format/formatTokenAmount.js +1 -0
- package/dist/shared/format/formatUsd.d.ts +41 -0
- package/dist/shared/format/formatUsd.js +1 -0
- package/dist/shared/format/shortenAddress.d.ts +27 -0
- package/dist/shared/format/shortenAddress.js +1 -0
- package/dist/shared/format/types.d.ts +33 -0
- package/dist/shared/i18n/KitI18nProvider.d.ts +23 -0
- package/dist/shared/i18n/KitI18nProvider.js +1 -0
- package/dist/shared/i18n/Trans.d.ts +39 -0
- package/dist/shared/i18n/Trans.js +1 -0
- package/dist/shared/i18n/createKitI18n.d.ts +41 -0
- package/dist/shared/i18n/createKitI18n.js +1 -0
- package/dist/shared/i18n/defaultI18n.js +1 -0
- package/dist/shared/i18n/getLocaleDirection.d.ts +24 -0
- package/dist/shared/i18n/getLocaleDirection.js +1 -0
- package/dist/shared/i18n/locales.d.ts +31 -0
- package/dist/shared/i18n/locales.js +1 -0
- package/dist/shared/i18n/useKitI18n.d.ts +14 -0
- package/dist/shared/i18n/useKitI18n.js +1 -0
- package/dist/shared/i18n/useLingui.d.ts +35 -0
- package/dist/shared/i18n/useLingui.js +1 -0
- package/dist/shared/i18n/useT.d.ts +25 -0
- package/dist/shared/i18n/useT.js +1 -0
- package/dist/shared/icons/AlertIcon.d.ts +12 -0
- package/dist/shared/icons/AlertIcon.js +1 -0
- package/dist/shared/icons/ArrowDownIcon.d.ts +7 -0
- package/dist/shared/icons/ArrowDownIcon.js +1 -0
- package/dist/shared/icons/ArrowRightIcon.d.ts +7 -0
- package/dist/shared/icons/ArrowRightIcon.js +1 -0
- package/dist/shared/icons/ArrowRightLeftIcon.d.ts +7 -0
- package/dist/shared/icons/ArrowRightLeftIcon.js +1 -0
- package/dist/shared/icons/CheckIcon.d.ts +7 -0
- package/dist/shared/icons/CheckIcon.js +1 -0
- package/dist/shared/icons/ChevronDownIcon.d.ts +7 -0
- package/dist/shared/icons/ChevronDownIcon.js +1 -0
- package/dist/shared/icons/ChevronLeftIcon.d.ts +7 -0
- package/dist/shared/icons/ChevronLeftIcon.js +1 -0
- package/dist/shared/icons/ChevronRightIcon.d.ts +7 -0
- package/dist/shared/icons/ChevronRightIcon.js +1 -0
- package/dist/shared/icons/ChevronUpIcon.d.ts +7 -0
- package/dist/shared/icons/ChevronUpIcon.js +1 -0
- package/dist/shared/icons/CircleArrowUpIcon.d.ts +7 -0
- package/dist/shared/icons/CircleArrowUpIcon.js +1 -0
- package/dist/shared/icons/CircleHelpIcon.d.ts +7 -0
- package/dist/shared/icons/CircleHelpIcon.js +1 -0
- package/dist/shared/icons/ClockIcon.d.ts +7 -0
- package/dist/shared/icons/ClockIcon.js +1 -0
- package/dist/shared/icons/CopyIcon.d.ts +7 -0
- package/dist/shared/icons/CopyIcon.js +1 -0
- package/dist/shared/icons/ExternalLinkIcon.d.ts +7 -0
- package/dist/shared/icons/ExternalLinkIcon.js +1 -0
- package/dist/shared/icons/InfoIcon.d.ts +7 -0
- package/dist/shared/icons/InfoIcon.js +1 -0
- package/dist/shared/icons/LoaderIcon.d.ts +7 -0
- package/dist/shared/icons/LoaderIcon.js +1 -0
- package/dist/shared/icons/MailIcon.d.ts +7 -0
- package/dist/shared/icons/MailIcon.js +1 -0
- package/dist/shared/icons/PackageIcon.d.ts +7 -0
- package/dist/shared/icons/PackageIcon.js +1 -0
- package/dist/shared/icons/QrCodeIcon.d.ts +7 -0
- package/dist/shared/icons/QrCodeIcon.js +1 -0
- package/dist/shared/icons/WalletIcon.d.ts +7 -0
- package/dist/shared/icons/WalletIcon.js +1 -0
- package/dist/shared/icons/XIcon.d.ts +7 -0
- package/dist/shared/icons/XIcon.js +1 -0
- package/dist/shared/icons/exchanges/BinanceIcon.d.ts +7 -0
- package/dist/shared/icons/exchanges/BinanceIcon.js +1 -0
- package/dist/shared/icons/exchanges/CoinbaseIcon.d.ts +7 -0
- package/dist/shared/icons/exchanges/CoinbaseIcon.js +1 -0
- package/dist/shared/icons/exchanges/KrakenIcon.d.ts +7 -0
- package/dist/shared/icons/exchanges/KrakenIcon.js +1 -0
- package/dist/shared/icons/exchanges/OkxIcon.d.ts +7 -0
- package/dist/shared/icons/exchanges/OkxIcon.js +1 -0
- package/dist/shared/icons/exchanges/RobinhoodIcon.d.ts +7 -0
- package/dist/shared/icons/exchanges/RobinhoodIcon.js +1 -0
- package/dist/shared/icons/exchanges/index.d.ts +5 -0
- package/dist/shared/icons/exchanges/index.js +1 -0
- package/dist/shared/orchestrator/failureReason.js +1 -0
- package/dist/shared/orchestrator/index.js +1 -0
- package/dist/shared/orchestrator/toFailure.js +1 -0
- package/dist/shared/orchestrator/types.d.ts +20 -0
- package/dist/shared/orchestrator/useDialogLifecycle.js +1 -0
- package/dist/shared/orchestrator/useDriverSettlementListener.js +1 -0
- package/dist/shared/orchestrator/useEffectiveState.js +1 -0
- package/dist/shared/orchestrator/useSettlementWatcher.js +1 -0
- package/dist/shared/orchestrator/userRejection.js +1 -0
- package/dist/shared/primitives/TxHashValue/TxHashValue.d.ts +20 -0
- package/dist/shared/primitives/TxHashValue/TxHashValue.js +1 -0
- package/dist/shared/primitives/TxHashValue/TxHashValue.slots.js +1 -0
- package/dist/shared/primitives/TxHashValue/TxHashValue.styles.js +1 -0
- package/dist/shared/primitives/TxHashValue/index.d.ts +2 -0
- package/dist/shared/primitives/TxHashValue/index.js +1 -0
- package/dist/shared/primitives/TxHashValue/types.d.ts +25 -0
- package/dist/shared/primitives/WalletValue/WalletValue.d.ts +40 -0
- package/dist/shared/primitives/WalletValue/WalletValue.js +1 -0
- package/dist/shared/primitives/WalletValue/index.d.ts +1 -0
- package/dist/shared/primitives/WalletValue/index.js +1 -0
- package/dist/shared/quote/index.js +1 -0
- package/dist/shared/quote/useQuoteCountdown.js +1 -0
- package/dist/shared/styles/tokens.stylex.js +1 -0
- package/dist/shared/ui/Alert/Alert.d.ts +105 -0
- package/dist/shared/ui/Alert/Alert.js +1 -0
- package/dist/shared/ui/Alert/Alert.slots.d.ts +10 -0
- package/dist/shared/ui/Alert/Alert.slots.js +1 -0
- package/dist/shared/ui/Alert/Alert.styles.js +1 -0
- package/dist/shared/ui/Alert/index.d.ts +2 -0
- package/dist/shared/ui/Alert/index.js +1 -0
- package/dist/shared/ui/AmountInput/AmountInput.d.ts +132 -0
- package/dist/shared/ui/AmountInput/AmountInput.js +1 -0
- package/dist/shared/ui/AmountInput/AmountInput.slots.d.ts +11 -0
- package/dist/shared/ui/AmountInput/AmountInput.slots.js +1 -0
- package/dist/shared/ui/AmountInput/AmountInput.styles.js +1 -0
- package/dist/shared/ui/AmountInput/attachInputNormalization.js +1 -0
- package/dist/shared/ui/AmountInput/context.js +1 -0
- package/dist/shared/ui/AmountInput/index.d.ts +3 -0
- package/dist/shared/ui/AmountInput/index.js +1 -0
- package/dist/shared/ui/AmountInput/useAutoShrinkFontSize.js +14 -0
- package/dist/shared/ui/AmountInput/utils.d.ts +12 -0
- package/dist/shared/ui/AmountInput/utils.js +1 -0
- package/dist/shared/ui/Badge/Badge.d.ts +89 -0
- package/dist/shared/ui/Badge/Badge.js +1 -0
- package/dist/shared/ui/Badge/Badge.slots.d.ts +7 -0
- package/dist/shared/ui/Badge/Badge.slots.js +1 -0
- package/dist/shared/ui/Badge/Badge.styles.js +1 -0
- package/dist/shared/ui/Badge/index.d.ts +2 -0
- package/dist/shared/ui/Badge/index.js +1 -0
- package/dist/shared/ui/Button/Button.d.ts +82 -0
- package/dist/shared/ui/Button/Button.js +1 -0
- package/dist/shared/ui/Button/Button.slots.d.ts +7 -0
- package/dist/shared/ui/Button/Button.slots.js +1 -0
- package/dist/shared/ui/Button/Button.styles.js +1 -0
- package/dist/shared/ui/Button/index.d.ts +2 -0
- package/dist/shared/ui/Button/index.js +1 -0
- package/dist/shared/ui/Card/Card.d.ts +93 -0
- package/dist/shared/ui/Card/Card.js +1 -0
- package/dist/shared/ui/Card/Card.slots.d.ts +10 -0
- package/dist/shared/ui/Card/Card.slots.js +1 -0
- package/dist/shared/ui/Card/Card.styles.js +1 -0
- package/dist/shared/ui/Card/index.d.ts +2 -0
- package/dist/shared/ui/Card/index.js +1 -0
- package/dist/shared/ui/Collapsible/Collapsible.d.ts +57 -0
- package/dist/shared/ui/Collapsible/Collapsible.js +1 -0
- package/dist/shared/ui/Collapsible/Collapsible.slots.d.ts +10 -0
- package/dist/shared/ui/Collapsible/Collapsible.slots.js +1 -0
- package/dist/shared/ui/Collapsible/Collapsible.styles.js +1 -0
- package/dist/shared/ui/Collapsible/index.d.ts +2 -0
- package/dist/shared/ui/Collapsible/index.js +1 -0
- package/dist/shared/ui/Details/Details.d.ts +76 -0
- package/dist/shared/ui/Details/Details.js +1 -0
- package/dist/shared/ui/Details/Details.slots.d.ts +9 -0
- package/dist/shared/ui/Details/Details.slots.js +1 -0
- package/dist/shared/ui/Details/Details.styles.js +1 -0
- package/dist/shared/ui/Details/index.d.ts +2 -0
- package/dist/shared/ui/Details/index.js +1 -0
- package/dist/shared/ui/Dialog/Dialog.d.ts +147 -0
- package/dist/shared/ui/Dialog/Dialog.js +1 -0
- package/dist/shared/ui/Dialog/Dialog.slots.d.ts +17 -0
- package/dist/shared/ui/Dialog/Dialog.slots.js +1 -0
- package/dist/shared/ui/Dialog/Dialog.styles.js +1 -0
- package/dist/shared/ui/Dialog/index.d.ts +2 -0
- package/dist/shared/ui/Dialog/index.js +1 -0
- package/dist/shared/ui/ExternalLink/ExternalLink.d.ts +41 -0
- package/dist/shared/ui/ExternalLink/ExternalLink.js +1 -0
- package/dist/shared/ui/ExternalLink/ExternalLink.slots.d.ts +7 -0
- package/dist/shared/ui/ExternalLink/ExternalLink.slots.js +1 -0
- package/dist/shared/ui/ExternalLink/ExternalLink.styles.js +1 -0
- package/dist/shared/ui/ExternalLink/index.d.ts +2 -0
- package/dist/shared/ui/ExternalLink/index.js +1 -0
- package/dist/shared/ui/ExternalLink/toSafeHref.js +1 -0
- package/dist/shared/ui/Field/Field.d.ts +185 -0
- package/dist/shared/ui/Field/Field.js +1 -0
- package/dist/shared/ui/Field/Field.slots.d.ts +21 -0
- package/dist/shared/ui/Field/Field.slots.js +1 -0
- package/dist/shared/ui/Field/Field.styles.js +1 -0
- package/dist/shared/ui/Field/index.d.ts +2 -0
- package/dist/shared/ui/Field/index.js +1 -0
- package/dist/shared/ui/IconButton/IconButton.d.ts +48 -0
- package/dist/shared/ui/IconButton/IconButton.js +1 -0
- package/dist/shared/ui/IconButton/IconButton.slots.d.ts +7 -0
- package/dist/shared/ui/IconButton/IconButton.slots.js +1 -0
- package/dist/shared/ui/IconButton/IconButton.styles.js +1 -0
- package/dist/shared/ui/IconButton/index.d.ts +2 -0
- package/dist/shared/ui/IconButton/index.js +1 -0
- package/dist/shared/ui/Image/Image.d.ts +43 -0
- package/dist/shared/ui/Image/Image.js +1 -0
- package/dist/shared/ui/Image/Image.slots.d.ts +14 -0
- package/dist/shared/ui/Image/Image.slots.js +1 -0
- package/dist/shared/ui/Image/Image.styles.js +1 -0
- package/dist/shared/ui/Image/index.d.ts +3 -0
- package/dist/shared/ui/Image/index.js +1 -0
- package/dist/shared/ui/Image/types.d.ts +131 -0
- package/dist/shared/ui/InputGroup/InputGroup.d.ts +129 -0
- package/dist/shared/ui/InputGroup/InputGroup.js +1 -0
- package/dist/shared/ui/InputGroup/InputGroup.slots.d.ts +16 -0
- package/dist/shared/ui/InputGroup/InputGroup.slots.js +1 -0
- package/dist/shared/ui/InputGroup/InputGroup.styles.js +1 -0
- package/dist/shared/ui/InputGroup/index.d.ts +2 -0
- package/dist/shared/ui/InputGroup/index.js +1 -0
- package/dist/shared/ui/LtrAtom/LtrAtom.d.ts +31 -0
- package/dist/shared/ui/LtrAtom/LtrAtom.js +1 -0
- package/dist/shared/ui/LtrAtom/index.d.ts +1 -0
- package/dist/shared/ui/LtrAtom/index.js +1 -0
- package/dist/shared/ui/ScrollArea/ScrollArea.d.ts +86 -0
- package/dist/shared/ui/ScrollArea/ScrollArea.js +1 -0
- package/dist/shared/ui/ScrollArea/ScrollArea.slots.d.ts +12 -0
- package/dist/shared/ui/ScrollArea/ScrollArea.slots.js +1 -0
- package/dist/shared/ui/ScrollArea/ScrollArea.styles.js +1 -0
- package/dist/shared/ui/ScrollArea/index.d.ts +2 -0
- package/dist/shared/ui/ScrollArea/index.js +1 -0
- package/dist/shared/ui/Select/Select.context.d.ts +10 -0
- package/dist/shared/ui/Select/Select.context.js +1 -0
- package/dist/shared/ui/Select/Select.d.ts +243 -0
- package/dist/shared/ui/Select/Select.js +1 -0
- package/dist/shared/ui/Select/Select.slots.d.ts +20 -0
- package/dist/shared/ui/Select/Select.slots.js +1 -0
- package/dist/shared/ui/Select/Select.styles.js +1 -0
- package/dist/shared/ui/Select/index.d.ts +3 -0
- package/dist/shared/ui/Select/index.js +1 -0
- package/dist/shared/ui/SelectableTile/SelectableTile.d.ts +83 -0
- package/dist/shared/ui/SelectableTile/SelectableTile.js +1 -0
- package/dist/shared/ui/SelectableTile/SelectableTile.slots.d.ts +7 -0
- package/dist/shared/ui/SelectableTile/SelectableTile.slots.js +1 -0
- package/dist/shared/ui/SelectableTile/SelectableTile.styles.js +1 -0
- package/dist/shared/ui/SelectableTile/SelectableTileGroup.d.ts +82 -0
- package/dist/shared/ui/SelectableTile/SelectableTileGroup.js +1 -0
- package/dist/shared/ui/SelectableTile/index.d.ts +3 -0
- package/dist/shared/ui/SelectableTile/index.js +1 -0
- package/dist/shared/ui/Skeleton/Skeleton.d.ts +41 -0
- package/dist/shared/ui/Skeleton/Skeleton.js +1 -0
- package/dist/shared/ui/Skeleton/Skeleton.slots.d.ts +7 -0
- package/dist/shared/ui/Skeleton/Skeleton.slots.js +1 -0
- package/dist/shared/ui/Skeleton/Skeleton.styles.js +1 -0
- package/dist/shared/ui/Skeleton/index.d.ts +2 -0
- package/dist/shared/ui/Skeleton/index.js +1 -0
- package/dist/shared/ui/Text/Text.d.ts +87 -0
- package/dist/shared/ui/Text/Text.js +1 -0
- package/dist/shared/ui/Text/Text.slots.d.ts +7 -0
- package/dist/shared/ui/Text/Text.slots.js +1 -0
- package/dist/shared/ui/Text/Text.styles.js +1 -0
- package/dist/shared/ui/Text/index.d.ts +2 -0
- package/dist/shared/ui/Text/index.js +1 -0
- package/dist/shared/ui/TokenLogo/TokenLogo.d.ts +41 -0
- package/dist/shared/ui/TokenLogo/TokenLogo.js +1 -0
- package/dist/shared/ui/TokenLogo/index.d.ts +2 -0
- package/dist/shared/ui/TokenLogo/index.js +1 -0
- package/dist/shared/ui/TokenLogo/types.d.ts +64 -0
- package/dist/shared/ui/Tooltip/Tooltip.d.ts +171 -0
- package/dist/shared/ui/Tooltip/Tooltip.js +1 -0
- package/dist/shared/ui/Tooltip/Tooltip.slots.d.ts +11 -0
- package/dist/shared/ui/Tooltip/Tooltip.slots.js +1 -0
- package/dist/shared/ui/Tooltip/Tooltip.styles.js +1 -0
- package/dist/shared/ui/Tooltip/index.d.ts +2 -0
- package/dist/shared/ui/Tooltip/index.js +1 -0
- package/dist/shared/ui/WalletRow/WalletRow.d.ts +55 -0
- package/dist/shared/ui/WalletRow/WalletRow.js +1 -0
- package/dist/shared/ui/WalletRow/WalletRow.slots.d.ts +7 -0
- package/dist/shared/ui/WalletRow/WalletRow.slots.js +1 -0
- package/dist/shared/ui/WalletRow/WalletRow.styles.js +1 -0
- package/dist/shared/ui/WalletRow/index.d.ts +2 -0
- package/dist/shared/ui/WalletRow/index.js +1 -0
- package/dist/shared/utils/explorers.js +1 -0
- package/dist/shared/utils/joinClassNames.js +1 -0
- package/dist/shared/utils/logos/api.d.ts +54 -0
- package/dist/shared/utils/logos/api.js +1 -0
- package/dist/shared/utils/logos/chains.d.ts +32 -0
- package/dist/shared/utils/logos/chains.js +1 -0
- package/dist/shared/utils/logos/conventionUrls.js +1 -0
- package/dist/shared/utils/logos/index.js +1 -0
- package/dist/shared/utils/logos/resolveLogoSrc.js +1 -0
- package/dist/shared/utils/logos/types.d.ts +62 -0
- package/dist/shared/utils/mergeClassName.js +1 -0
- package/dist/shared/utils/mergeStyle.js +1 -0
- package/dist/shared/wallet/resolveSupportedChainIds.js +1 -0
- package/dist/shared/wallet/resolveSupportedChains.js +1 -0
- package/dist/shared/wallet/types.d.ts +103 -0
- package/dist/shared/wallet/useWalletState.d.ts +21 -0
- package/dist/shared/wallet/useWalletState.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.d.ts +59 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.d.ts +15 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.slots.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/AmountEntry.styles.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Flow.d.ts +14 -0
- package/dist/shared/widgets/amount-entry/compound/components/Flow.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Footer.d.ts +22 -0
- package/dist/shared/widgets/amount-entry/compound/components/Footer.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Header.d.ts +15 -0
- package/dist/shared/widgets/amount-entry/compound/components/Header.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/Hero.d.ts +22 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/Hero.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/StaticBand.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/SwapBackdrop.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/index.d.ts +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/index.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/transitions.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/useSwapState.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Hero/utils.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/components/Pills.d.ts +22 -0
- package/dist/shared/widgets/amount-entry/compound/components/Pills.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/context.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/index.d.ts +3 -0
- package/dist/shared/widgets/amount-entry/compound/index.js +1 -0
- package/dist/shared/widgets/amount-entry/compound/types.d.ts +224 -0
- package/dist/shared/widgets/asset-descriptor.d.ts +27 -0
- package/dist/shared/widgets/asset-descriptor.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.d.ts +51 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.d.ts +11 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.slots.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/AssetPicker.styles.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/components/Asset.d.ts +30 -0
- package/dist/shared/widgets/asset-picker/compound/components/Asset.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/components/Footer.d.ts +16 -0
- package/dist/shared/widgets/asset-picker/compound/components/Footer.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/components/Header.d.ts +19 -0
- package/dist/shared/widgets/asset-picker/compound/components/Header.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/components/List.d.ts +22 -0
- package/dist/shared/widgets/asset-picker/compound/components/List.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/context.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/index.d.ts +3 -0
- package/dist/shared/widgets/asset-picker/compound/index.js +1 -0
- package/dist/shared/widgets/asset-picker/compound/types.d.ts +212 -0
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.d.ts +64 -0
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.slots.d.ts +16 -0
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.slots.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/ConfirmTransfer.styles.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Amounts.d.ts +15 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Amounts.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Breakdown.d.ts +17 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Breakdown.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.d.ts +15 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Footer.d.ts +26 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Footer.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Header.d.ts +13 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Header.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Hero.d.ts +16 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Hero.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Meta.d.ts +16 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/Meta.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/QuoteTimer.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/components/splitAmount.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/context.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/index.d.ts +3 -0
- package/dist/shared/widgets/confirm-transfer/compound/index.js +1 -0
- package/dist/shared/widgets/confirm-transfer/compound/types.d.ts +338 -0
- package/dist/shared/widgets/error-state/compound/ErrorState.d.ts +96 -0
- package/dist/shared/widgets/error-state/compound/ErrorState.js +1 -0
- package/dist/shared/widgets/error-state/compound/ErrorState.slots.d.ts +18 -0
- package/dist/shared/widgets/error-state/compound/ErrorState.slots.js +1 -0
- package/dist/shared/widgets/error-state/compound/ErrorState.styles.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Actions.d.ts +17 -0
- package/dist/shared/widgets/error-state/compound/components/Actions.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/AssetValue.d.ts +20 -0
- package/dist/shared/widgets/error-state/compound/components/AssetValue.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Detail.d.ts +14 -0
- package/dist/shared/widgets/error-state/compound/components/Detail.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Details.d.ts +12 -0
- package/dist/shared/widgets/error-state/compound/components/Details.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/DisclosureChevron.d.ts +11 -0
- package/dist/shared/widgets/error-state/compound/components/DisclosureChevron.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Header.d.ts +13 -0
- package/dist/shared/widgets/error-state/compound/components/Header.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/HelpInfo.d.ts +10 -0
- package/dist/shared/widgets/error-state/compound/components/HelpInfo.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Hero.d.ts +9 -0
- package/dist/shared/widgets/error-state/compound/components/Hero.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.d.ts +18 -0
- package/dist/shared/widgets/error-state/compound/components/MoreDetails.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/Rows.d.ts +57 -0
- package/dist/shared/widgets/error-state/compound/components/Rows.js +1 -0
- package/dist/shared/widgets/error-state/compound/components/StatusValue.d.ts +14 -0
- package/dist/shared/widgets/error-state/compound/components/StatusValue.js +1 -0
- package/dist/shared/widgets/error-state/compound/context.js +1 -0
- package/dist/shared/widgets/error-state/compound/index.d.ts +3 -0
- package/dist/shared/widgets/error-state/compound/index.js +1 -0
- package/dist/shared/widgets/error-state/compound/types.d.ts +291 -0
- package/dist/shared/widgets/processing-state/compound/ProcessingState.d.ts +77 -0
- package/dist/shared/widgets/processing-state/compound/ProcessingState.js +1 -0
- package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.d.ts +15 -0
- package/dist/shared/widgets/processing-state/compound/ProcessingState.slots.js +1 -0
- package/dist/shared/widgets/processing-state/compound/ProcessingState.styles.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Actions.d.ts +17 -0
- package/dist/shared/widgets/processing-state/compound/components/Actions.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Detail.d.ts +14 -0
- package/dist/shared/widgets/processing-state/compound/components/Detail.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Details.d.ts +12 -0
- package/dist/shared/widgets/processing-state/compound/components/Details.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Header.d.ts +15 -0
- package/dist/shared/widgets/processing-state/compound/components/Header.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Hero.d.ts +16 -0
- package/dist/shared/widgets/processing-state/compound/components/Hero.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/Rows.d.ts +36 -0
- package/dist/shared/widgets/processing-state/compound/components/Rows.js +1 -0
- package/dist/shared/widgets/processing-state/compound/components/StatusPill.d.ts +13 -0
- package/dist/shared/widgets/processing-state/compound/components/StatusPill.js +1 -0
- package/dist/shared/widgets/processing-state/compound/context.js +1 -0
- package/dist/shared/widgets/processing-state/compound/index.d.ts +3 -0
- package/dist/shared/widgets/processing-state/compound/index.js +1 -0
- package/dist/shared/widgets/processing-state/compound/types.d.ts +216 -0
- package/dist/shared/widgets/success-state/compound/SuccessState.d.ts +105 -0
- package/dist/shared/widgets/success-state/compound/SuccessState.js +1 -0
- package/dist/shared/widgets/success-state/compound/SuccessState.slots.d.ts +21 -0
- package/dist/shared/widgets/success-state/compound/SuccessState.slots.js +1 -0
- package/dist/shared/widgets/success-state/compound/SuccessState.styles.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Actions.d.ts +18 -0
- package/dist/shared/widgets/success-state/compound/components/Actions.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/AssetValue.d.ts +18 -0
- package/dist/shared/widgets/success-state/compound/components/AssetValue.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Detail.d.ts +18 -0
- package/dist/shared/widgets/success-state/compound/components/Detail.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Details.d.ts +16 -0
- package/dist/shared/widgets/success-state/compound/components/Details.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Header.d.ts +13 -0
- package/dist/shared/widgets/success-state/compound/components/Header.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Headline.d.ts +16 -0
- package/dist/shared/widgets/success-state/compound/components/Headline.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Hero.d.ts +10 -0
- package/dist/shared/widgets/success-state/compound/components/Hero.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.d.ts +19 -0
- package/dist/shared/widgets/success-state/compound/components/MoreDetails.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/RouteValue.d.ts +15 -0
- package/dist/shared/widgets/success-state/compound/components/RouteValue.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/Rows.d.ts +69 -0
- package/dist/shared/widgets/success-state/compound/components/Rows.js +1 -0
- package/dist/shared/widgets/success-state/compound/components/StatusPill.d.ts +13 -0
- package/dist/shared/widgets/success-state/compound/components/StatusPill.js +1 -0
- package/dist/shared/widgets/success-state/compound/context.js +1 -0
- package/dist/shared/widgets/success-state/compound/index.d.ts +3 -0
- package/dist/shared/widgets/success-state/compound/index.js +1 -0
- package/dist/shared/widgets/success-state/compound/types.d.ts +307 -0
- package/dist/storage/adapters.d.ts +29 -0
- package/dist/storage/adapters.js +1 -0
- package/dist/storage/context.d.ts +62 -0
- package/dist/storage/context.js +1 -0
- package/dist/storage/createKitStorage.d.ts +45 -0
- package/dist/storage/createKitStorage.js +1 -0
- package/dist/storage/index.d.ts +4 -0
- package/dist/storage/index.js +1 -0
- package/dist/storage/types.d.ts +26 -0
- package/dist/stridge/StridgeContext.d.ts +29 -0
- package/dist/stridge/StridgeContext.js +1 -0
- package/dist/stridge/StridgeProvider.d.ts +158 -0
- package/dist/stridge/StridgeProvider.js +1 -0
- package/dist/stridge/stubs.js +1 -0
- package/dist/styles/index.css +3494 -0
- package/dist/types.d.ts +15 -0
- package/dist/types.js +1 -0
- package/dist/ui/index.d.ts +48 -0
- package/dist/ui/index.js +1 -0
- package/dist/utils/src/use-copy-to-clipboard.js +1 -0
- package/dist/wallet/index.d.ts +3 -0
- package/dist/wallet/index.js +1 -0
- package/dist/withdraw/compound/index.d.ts +22 -0
- package/dist/withdraw/compound/index.js +1 -0
- package/dist/withdraw/dialog/index.d.ts +2 -0
- package/dist/withdraw/dialog/index.js +1 -0
- package/package.json +156 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";function n(n){return t(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":!0,...n,children:[e(`path`,{d:`M16 0H4a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V4a4 4 0 0 0-4-4`,fill:`#5741D9`}),e(`path`,{d:`M4 11.78v-.67a6.4 6.4 0 0 1 .83-3.26 6 6 0 0 1 2.64-2.3A6 6 0 0 1 9.89 5q1.84-.02 3.4.96a5.6 5.6 0 0 1 2.64 4.18q.1.9.07 1.82l-.01.98q0 .22-.05.43c-.15.54-.8.8-1.27.49a.8.8 0 0 1-.35-.57l-.04-.48v-1.98q0-.4-.26-.68a.83.83 0 0 0-1.17-.04 1 1 0 0 0-.32.65v.28l-.01 2.19c0 .41-.33.73-.76.76a1 1 0 0 1-.56-.17.8.8 0 0 1-.3-.48l-.03-.33v-2.2a1 1 0 0 0-.26-.65.84.84 0 0 0-1.25.02 1 1 0 0 0-.24.64V13q0 .28-.1.54a1 1 0 0 1-.32.34.8.8 0 0 1-1.17-.4 1 1 0 0 1-.07-.38V11q.01-.24-.05-.47a.9.9 0 0 0-.72-.62c-.37-.06-.65.11-.85.4q-.14.22-.14.46v2q.02.3-.04.59a.84.84 0 0 1-.87.63.9.9 0 0 1-.74-.63A1 1 0 0 1 4 13z`,fill:`#fff`})]})}export{n as KrakenIcon};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SVGProps } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/icons/exchanges/OkxIcon.d.ts
|
|
5
|
+
declare function OkxIcon(props: SVGProps<SVGSVGElement>): _$react_jsx_runtime0.JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { OkxIcon };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";function n(n){return t(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":!0,...n,children:[e(`path`,{d:`M16 0H4a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V4a4 4 0 0 0-4-4`,fill:`#58C8E6`}),e(`path`,{d:`M15.025 7.686H8.661a3.21 3.21 0 0 1 3.182-2.746 3.21 3.21 0 0 1 3.182 2.746m-3.653.94v2.746H8.626V8.626zm-.035 3.686a3.21 3.21 0 0 1-3.182 2.746 3.21 3.21 0 0 1-3.183-2.746zm-6.365-.94A3.23 3.23 0 0 1 7.686 8.66v2.71zm10.053-2.746a3.23 3.23 0 0 1-2.711 2.71v-2.71zM11.843 4C9.734 4 7.937 5.624 7.712 7.712A4.18 4.18 0 0 0 4 11.843 4.16 4.16 0 0 0 8.157 16c2.109 0 3.909-1.624 4.131-3.712C14.376 12.063 16 10.266 16 8.157A4.16 4.16 0 0 0 11.843 4`,fill:`#fff`})]})}export{n as OkxIcon};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SVGProps } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/icons/exchanges/RobinhoodIcon.d.ts
|
|
5
|
+
declare function RobinhoodIcon(props: SVGProps<SVGSVGElement>): _$react_jsx_runtime0.JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { RobinhoodIcon };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";function n(n){return t(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 25 25`,fill:`none`,"aria-hidden":!0,...n,children:[e(`rect`,{width:`25`,height:`25`,rx:`5.357`,fill:`#fff`}),t(`g`,{clipPath:`url(#robinhood-icon-a)`,children:[e(`mask`,{id:`robinhood-icon-b`,maskUnits:`userSpaceOnUse`,x:`5`,y:`5`,width:`15`,height:`15`,style:{maskType:`luminance`},children:e(`path`,{d:`M5 5h15v15H5V5Z`,fill:`#fff`})}),e(`g`,{mask:`url(#robinhood-icon-b)`,children:e(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.5 16.625a4.125 4.125 0 0 1 0-8.25V5a7.5 7.5 0 1 0 7.5 7.5h-3.375a4.125 4.125 0 0 1-4.125 4.125Z`,fill:`#2354E6`})}),e(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.5 12.5h4.125V8.375H12.5V12.5Z`,fill:`#17E6A1`})]}),e(`defs`,{children:e(`clipPath`,{id:`robinhood-icon-a`,children:e(`path`,{fill:`#fff`,transform:`translate(5 5)`,d:`M0 0h15v15H0z`})})})]})}export{n as RobinhoodIcon};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./BinanceIcon.js";import"./CoinbaseIcon.js";import"./KrakenIcon.js";import"./OkxIcon.js";import"./RobinhoodIcon.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useLingui as e}from"../i18n/useLingui.js";import"../../i18n/index.js";import{useCallback as t}from"react";function n(){let{_:n}=e();return t((e,t)=>{switch(e){case`slippage`:return n({id:`oBNGNc`,message:`The route's expected output drifted while your transaction was pending.`});case`insufficient-gas`:return n({id:`cHPbBJ`,message:`The bridge could not fund the destination transaction (gas budget exhausted).`});case`execution-reverted`:return n({id:`mgLWEL`,message:`The destination-leg transaction reverted on-chain.`});default:return t??n({id:`ob8R_m`,message:`Please try again or contact us if the issue persists.`})}},[n])}export{n as useFailureReasonForKind};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./failureReason.js";import"./toFailure.js";import"./useDialogLifecycle.js";import"./useDriverSettlementListener.js";import"./useEffectiveState.js";import"./userRejection.js";import"./useSettlementWatcher.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){if(e instanceof Error){let n=e.cause;if(n&&typeof n==`object`){let r=n;if(r.success===!1&&typeof r.error==`string`&&r.error.trim())return{reason:e.message||t,code:r.error}}return{reason:e.message||t,code:e.name}}return{reason:t}}export{e as toFailure};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/shared/orchestrator/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Shared orchestrator-layer types. Both deposit and withdraw FSMs route quote / submission
|
|
4
|
+
* rejections through the same failure record, so the type lives here rather than in either
|
|
5
|
+
* flow's `orchestrator/types.ts`. Per-flow modules re-export for back-compat with their public
|
|
6
|
+
* surfaces.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Failure detail produced by a quote / submission rejection — distinct from settlement failures
|
|
10
|
+
* (which are surfaced via the driver's `settlement` entity in the `failed` variant). `code` is a
|
|
11
|
+
* stable machine-readable discriminator (`"UserRejectedRequestError"`, `"ACTION_REJECTED"`,
|
|
12
|
+
* backend error code, etc.) populated by {@link import("./toFailure").toFailure} from the wire
|
|
13
|
+
* envelope or the raw thrown `Error`.
|
|
14
|
+
*/
|
|
15
|
+
interface FailureInfo {
|
|
16
|
+
reason: string;
|
|
17
|
+
code?: string;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { FailureInfo };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as e,useRef as t}from"react";function n(n){let r=t(n);r.current=n;let i=t(n.state),a=t(null),o=t(null);e(()=>{let e=i.current;try{e!==n.state&&r.current.fireFsm(e,n.state)}finally{i.current=n.state}},[n.state]),e(()=>{let e=n.settlement,t=e.status===`ready`||e.status===`stale`?e.payload.kind:null,i=a.current;try{t&&(t!==i||t===`pending`)&&r.current.fireSettlement(i,e)}finally{a.current=t}},[n.settlement]),e(()=>{let e=n.quote,t=o.current;try{e.status!==t&&r.current.fireQuote(t,e)}finally{o.current=e.status}},[n.quote])}export{n as useDialogLifecycle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as e,useRef as t}from"react";function n(n,r){let i=t(r);i.current=r;let a=t(null);e(()=>{a.current=null;let e=()=>{let e=n.getSnapshot(),t=e.settlement,r=t.status===`ready`||t.status===`stale`?t.payload.kind:t.status;r!==a.current&&(a.current=r,i.current(r,e))},t=n.subscribe(e);return e(),t},[n])}export{n as useDriverSettlementListener};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useRef as e}from"react";function t(t,n=`closed`){let r=e(t);return t.name!==n&&(r.current=t),t.name===n?r.current:t}export{t as useEffectiveState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as e}from"react";function t(t,n){let r=n?.hash;e(()=>{if(!n)return;let e=new AbortController;return t.watchSettlement({tx:n},()=>void 0,e.signal),()=>e.abort()},[r,t])}export{t as useSettlementWatcher};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=new Set([`UserRejectedRequestError`,`ACTION_REJECTED`]);function t(t){return t?.code?e.has(t.code):!1}export{e as USER_REJECTION_CODES,t as isUserRejectionFailure};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TxHashValueProps } from "./types.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/primitives/TxHashValue/TxHashValue.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Renders a pre-formatted transaction hash as `0x…<tail> ↗`. Pure layout: the caller is
|
|
7
|
+
* responsible for truncation (driver transformer code calls `shortenAddress`).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <TxHashValue hash={depositTx.hash.formatted} explorerUrl={depositTx.explorerUrl} />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare function TxHashValue({
|
|
15
|
+
hash,
|
|
16
|
+
explorerUrl,
|
|
17
|
+
linkColor
|
|
18
|
+
}: TxHashValueProps): _$react_jsx_runtime0.JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { TxHashValue };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{ExternalLinkIcon as e}from"../../icons/ExternalLinkIcon.js";import"../../../icons/index.js";import{toSafeHref as t}from"../../ui/ExternalLink/toSafeHref.js";import{ExternalLink as n}from"../../ui/ExternalLink/ExternalLink.js";import"../../ui/ExternalLink/index.js";import{LtrAtom as r}from"../../ui/LtrAtom/LtrAtom.js";import"../../ui/LtrAtom/index.js";import{text as i}from"../../ui/Text/Text.js";import"../../ui/Text/index.js";import{TX_HASH_VALUE_SLOTS as a}from"./TxHashValue.slots.js";import{styles as o}from"./TxHashValue.styles.js";import{jsx as s}from"react/jsx-runtime";import*as c from"@stylexjs/stylex";function l({hash:l,explorerUrl:u,linkColor:d=`var(--stridge-kit-primary)`}){let f=t(u),p=c.props(o.root),m=s(i.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,tracking:`normal`,font:`mono`,color:`inherit`,children:s(r,{children:l})});return f?s(n,{dir:`ltr`,href:f,suffix:s(e,{"aria-hidden":!0}),"data-stridge-slot":a.root,className:p.className,style:{...p.style,color:d},children:m}):s(`span`,{dir:`ltr`,"data-stridge-slot":a.root,className:p.className,style:p.style,children:m})}export{l as TxHashValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={root:`tx-hash-value`};export{e as TX_HASH_VALUE_SLOTS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={root:{"TxHashValue__styles.root":`TxHashValue__styles.root`,"display-k1xSpc":`x3nfvp2`,"alignItems-kGNEyG":`x6s0dn4`,"gap-kOIVth":`x17d4w8g`,$$css:`@stridge/kit:src/shared/primitives/TxHashValue/TxHashValue.styles.ts:3`}};export{e as styles};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./TxHashValue.slots.js";import"./TxHashValue.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/shared/primitives/TxHashValue/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Public props for the `TxHashValue` primitive — `0x<head>…<tail> ↗`, the canonical composition
|
|
4
|
+
* rendered inside the Source-tx row across the kit's gateway widgets.
|
|
5
|
+
*
|
|
6
|
+
* The primitive is pure layout: the caller passes a pre-formatted hash (driver-truncated to
|
|
7
|
+
* `0x…<last 4>`) and the primitive never reformats. When `explorerUrl` resolves to a valid
|
|
8
|
+
* `http(s)` URL via `toSafeHref` the value renders as an external link in
|
|
9
|
+
* {@link TxHashValueProps.linkColor} with an external-link glyph appended; otherwise it falls
|
|
10
|
+
* through to plain mono text.
|
|
11
|
+
*/
|
|
12
|
+
interface TxHashValueProps {
|
|
13
|
+
/** Pre-formatted hash string (e.g. `"0x…f6b72a"`). */
|
|
14
|
+
hash: string;
|
|
15
|
+
/** Optional explorer URL the row links out to. */
|
|
16
|
+
explorerUrl?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Override the link color. Defaults to `var(--stridge-kit-primary)` so the kit accent flows
|
|
19
|
+
* through automatically. Consumers that need a different tone (e.g. an error context) pass
|
|
20
|
+
* an explicit CSS color string here.
|
|
21
|
+
*/
|
|
22
|
+
linkColor?: string;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { TxHashValueProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { WalletRowDensity } from "../../ui/WalletRow/WalletRow.js";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/primitives/WalletValue/WalletValue.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Typography rhythm for the wallet name span. Defaults to `"regular"`.
|
|
7
|
+
*/
|
|
8
|
+
type WalletValueDensity = WalletRowDensity;
|
|
9
|
+
/**
|
|
10
|
+
* Public props for the compound's `WalletValue` helper. Widgets expect pre-formatted strings —
|
|
11
|
+
* pass the driver-formatted address (e.g. `wallet.payload.address.formatted`) as `address`.
|
|
12
|
+
*/
|
|
13
|
+
interface WalletValueProps {
|
|
14
|
+
/** Pre-formatted wallet address (driver-truncated to `0x…<last 4>`). */
|
|
15
|
+
address: string;
|
|
16
|
+
/** Wallet display name (e.g. `"Wallet"`). */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Optional URL of the wallet brand icon. */
|
|
19
|
+
iconUrl?: string;
|
|
20
|
+
/** Optional explorer URL. When valid, the row becomes an external link. */
|
|
21
|
+
explorerUrl?: string;
|
|
22
|
+
/** Typography rhythm for the name span. Defaults to `"regular"`. */
|
|
23
|
+
density?: WalletValueDensity;
|
|
24
|
+
/** When `true`, suppress the leading icon. */
|
|
25
|
+
hideIcon?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Compound-surface re-export of {@link WalletRow}. Same semantics, but accepts the address as a
|
|
29
|
+
* pre-formatted string field. New code can reach for `<WalletRow>` directly.
|
|
30
|
+
*/
|
|
31
|
+
declare function WalletValue({
|
|
32
|
+
address,
|
|
33
|
+
name,
|
|
34
|
+
iconUrl,
|
|
35
|
+
explorerUrl,
|
|
36
|
+
density,
|
|
37
|
+
hideIcon
|
|
38
|
+
}: WalletValueProps): _$react_jsx_runtime0.JSX.Element;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { WalletValue, WalletValueDensity, WalletValueProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{WalletRow as e}from"../../ui/WalletRow/WalletRow.js";import"../../ui/WalletRow/index.js";import{jsx as t}from"react/jsx-runtime";function n({address:n,name:r,iconUrl:i,explorerUrl:a,density:o,hideIcon:s}){return t(e,{formattedAddress:n,name:r,...i===void 0?{}:{iconUrl:i},...a===void 0?{}:{explorerUrl:a},...o===void 0?{}:{density:o},...s===void 0?{}:{hideIcon:s}})}export{n as WalletValue};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { WalletValue, WalletValueDensity, WalletValueProps } from "./WalletValue.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./WalletValue.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./useQuoteCountdown.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useEffect as e,useState as t}from"react";function n({expiresAt:n,enabled:r,tickMs:i=1e3}){let[a,o]=t(()=>Date.now()),s=r&&n!==void 0;if(e(()=>{if(!s)return;o(Date.now());let e=setInterval(()=>o(Date.now()),i);return()=>clearInterval(e)},[s,i]),!(!s||n===void 0))return Math.max(0,Math.ceil((n-a)/1e3))}export{n as useQuoteCountdown};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={background:`var(--stridge-kit-background)`,foreground:`var(--stridge-kit-foreground)`,card:`var(--stridge-kit-card)`,cardForeground:`var(--stridge-kit-card-foreground)`,popover:`var(--stridge-kit-popover)`,popoverForeground:`var(--stridge-kit-popover-foreground)`,primary:`var(--stridge-kit-primary)`,primaryForeground:`var(--stridge-kit-primary-foreground)`,secondary:`var(--stridge-kit-secondary)`,secondaryForeground:`var(--stridge-kit-secondary-foreground)`,muted:`var(--stridge-kit-muted)`,mutedForeground:`var(--stridge-kit-muted-foreground)`,mutedForegroundFaint:`var(--stridge-kit-muted-foreground-faint)`,iconStroke:`var(--stridge-kit-icon-stroke)`,surfaceHover:`var(--stridge-kit-surface-hover)`,accent:`var(--stridge-kit-accent)`,accentForeground:`var(--stridge-kit-accent-foreground)`,destructive:`var(--stridge-kit-destructive)`,destructiveForeground:`var(--stridge-kit-destructive-foreground)`,destructiveSoft:`var(--stridge-kit-destructive-soft)`,destructiveSoftForeground:`var(--stridge-kit-destructive-soft-foreground)`,destructiveBorder:`var(--stridge-kit-destructive-border)`,success:`var(--stridge-kit-success)`,successForeground:`var(--stridge-kit-success-foreground)`,warning:`var(--stridge-kit-warning)`,warningForeground:`var(--stridge-kit-warning-foreground)`,info:`var(--stridge-kit-info)`,infoForeground:`var(--stridge-kit-info-foreground)`,border:`var(--stridge-kit-border)`,input:`var(--stridge-kit-input)`,ring:`var(--stridge-kit-ring)`,overlay:`var(--stridge-kit-overlay)`};export{e as colors};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/ui/Alert/Alert.d.ts
|
|
5
|
+
type AlertVariant = "default" | "primary" | "info" | "success" | "warning" | "danger";
|
|
6
|
+
/**
|
|
7
|
+
* Notice banner with an optional leading icon and freeform body content. Use for status messages — info banners,
|
|
8
|
+
* success confirmations, warnings, and inline error notices.
|
|
9
|
+
*
|
|
10
|
+
* Body text stays neutral; the icon and any nested {@link Alert.Link} inherit the variant accent automatically.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Alert variant="primary" icon={<InfoIcon />}>
|
|
15
|
+
* Experiencing problems? <Alert.Link href="/help">Get help.</Alert.Link>
|
|
16
|
+
* </Alert>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function Alert({
|
|
20
|
+
variant,
|
|
21
|
+
role,
|
|
22
|
+
icon,
|
|
23
|
+
className,
|
|
24
|
+
style,
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}: Alert.Props): _$react_jsx_runtime0.JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* Raw alert shell. Renders the same bordered surface and variant styles as {@link Alert} but does not inject an
|
|
30
|
+
* `Alert.Icon` wrapper — the consumer composes {@link Alert.Icon} and content children themselves.
|
|
31
|
+
*
|
|
32
|
+
* Use when the icon placement or markup structure must differ from `Alert`'s fixed icon-then-content layout.
|
|
33
|
+
*/
|
|
34
|
+
declare function AlertRoot({
|
|
35
|
+
variant,
|
|
36
|
+
role,
|
|
37
|
+
className,
|
|
38
|
+
style,
|
|
39
|
+
children,
|
|
40
|
+
...props
|
|
41
|
+
}: Alert.RootProps): _$react_jsx_runtime0.JSX.Element;
|
|
42
|
+
/**
|
|
43
|
+
* Icon slot for an alert. Renders `aria-hidden` and applies the variant accent color — inherited from the nearest
|
|
44
|
+
* `AlertVariantContext` when `variant` is omitted. Stretches the icon node to fill the slot via `cloneElement`.
|
|
45
|
+
*/
|
|
46
|
+
declare function AlertIcon({
|
|
47
|
+
variant: variantProp,
|
|
48
|
+
children,
|
|
49
|
+
className,
|
|
50
|
+
style,
|
|
51
|
+
...props
|
|
52
|
+
}: Alert.IconProps): _$react_jsx_runtime0.JSX.Element;
|
|
53
|
+
/**
|
|
54
|
+
* Inline anchor styled to match the parent alert's variant accent. Inherits `variant` from
|
|
55
|
+
* `AlertVariantContext`; an explicit `variant` prop overrides the context value.
|
|
56
|
+
*/
|
|
57
|
+
declare function AlertLink({
|
|
58
|
+
variant: variantProp,
|
|
59
|
+
className,
|
|
60
|
+
style,
|
|
61
|
+
...props
|
|
62
|
+
}: Alert.LinkProps): _$react_jsx_runtime0.JSX.Element;
|
|
63
|
+
declare namespace Alert {
|
|
64
|
+
type Props = ComponentProps<"div"> & {
|
|
65
|
+
/**
|
|
66
|
+
* Color treatment. Defaults to `"default"`.
|
|
67
|
+
*/
|
|
68
|
+
variant?: AlertVariant;
|
|
69
|
+
/**
|
|
70
|
+
* Leading icon node. Omit to render without an indicator.
|
|
71
|
+
*/
|
|
72
|
+
icon?: ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* ARIA role. Defaults to `"status"`; escalate to `"alert"` for urgent failure states.
|
|
75
|
+
*/
|
|
76
|
+
role?: ComponentProps<"div">["role"];
|
|
77
|
+
};
|
|
78
|
+
type RootProps = ComponentProps<"div"> & {
|
|
79
|
+
/**
|
|
80
|
+
* Color treatment. Defaults to `"default"`.
|
|
81
|
+
*/
|
|
82
|
+
variant?: AlertVariant;
|
|
83
|
+
/**
|
|
84
|
+
* ARIA role. Defaults to `"status"`; escalate to `"alert"` for urgent failure states.
|
|
85
|
+
*/
|
|
86
|
+
role?: ComponentProps<"div">["role"];
|
|
87
|
+
};
|
|
88
|
+
type IconProps = ComponentProps<"span"> & {
|
|
89
|
+
/**
|
|
90
|
+
* Override the variant inherited from the parent Alert.
|
|
91
|
+
*/
|
|
92
|
+
variant?: AlertVariant;
|
|
93
|
+
};
|
|
94
|
+
type LinkProps = ComponentProps<"a"> & {
|
|
95
|
+
/**
|
|
96
|
+
* Override the variant inherited from the parent Alert.
|
|
97
|
+
*/
|
|
98
|
+
variant?: AlertVariant;
|
|
99
|
+
};
|
|
100
|
+
const Root: typeof AlertRoot;
|
|
101
|
+
const Icon: typeof AlertIcon;
|
|
102
|
+
const Link: typeof AlertLink;
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { Alert, AlertVariant };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{joinClassNames as e}from"../../utils/joinClassNames.js";import{ALERT_SLOTS as t}from"./Alert.slots.js";import{accentColorStyles as n,styles as r,variantStyles as i}from"./Alert.styles.js";import{cloneElement as a,createContext as o,isValidElement as s,use as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import*as d from"@stylexjs/stylex";const f=o(`default`);function p({variant:n=`default`,role:a=`status`,icon:o,className:s,style:c,children:p,...m}){let g=d.props(r.root,i[n]);return l(f.Provider,{value:n,children:u(`div`,{"data-stridge-slot":t.root,"data-variant":n,...m,role:a,className:e(g.className,s),style:{...g.style,...c},children:[o==null?null:l(h,{children:o}),l(`div`,{"data-stridge-slot":t.content,...d.props(r.content),children:p})]})})}function m({variant:n=`default`,role:a=`status`,className:o,style:s,children:c,...u}){let p=d.props(r.root,i[n]);return l(f.Provider,{value:n,children:l(`div`,{"data-stridge-slot":t.root,"data-variant":n,...u,role:a,className:e(p.className,o),style:{...p.style,...s},children:c})})}function h({variant:i,children:a,className:o,style:s,...u}){let p=c(f),m=i??p,h=d.props(r.icon,n[m]);return l(`span`,{"aria-hidden":!0,"data-stridge-slot":t.icon,...u,className:e(h.className,o),style:{...h.style,...s},children:_(a)})}function g({variant:i,className:a,style:o,...s}){let u=c(f),p=i??u,m=d.props(r.link,n[p]);return l(`a`,{"data-stridge-slot":t.link,...s,className:e(m.className,a),style:{...m.style,...o}})}function _(e){if(!s(e))return e;let t=d.props(r.iconSvg);return a(e,{className:[e.props.className,t.className].filter(Boolean).join(` `),style:{...e.props.style,...t.style}})}(function(e){e.Root=m,e.Icon=h,e.Link=g})(p||={});export{p as Alert};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/shared/ui/Alert/Alert.slots.d.ts
|
|
2
|
+
declare const ALERT_SLOTS: {
|
|
3
|
+
readonly root: "alert";
|
|
4
|
+
readonly icon: "alert-icon";
|
|
5
|
+
readonly content: "alert-content";
|
|
6
|
+
readonly link: "alert-link";
|
|
7
|
+
};
|
|
8
|
+
type AlertSlot = (typeof ALERT_SLOTS)[keyof typeof ALERT_SLOTS];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ALERT_SLOTS, AlertSlot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={root:`alert`,icon:`alert-icon`,content:`alert-content`,link:`alert-link`};export{e as ALERT_SLOTS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={root:{"Alert__styles.root":`Alert__styles.root`,"display-k1xSpc":`x78zum5`,"alignItems-kGNEyG":`x6s0dn4`,"flexShrink-kmuXW":`x2lah0s`,"gap-kOIVth":`x883omv`,"overflow-kVQacm":`xb3r6kr`,"paddingBlock-k8WAf4":`x10dr8xq`,"paddingInline-kg3NbH":`xqin4a2`,"borderRadius-kaIpWk":`x12ur2as`,"borderWidth-kMzoRj":`xmkeg23`,"borderStyle-ksu8eU":`x1y0btm7`,"fontFamily-kMv6JI":`xlaww2m`,"fontSize-kGuDYH":`x4z9k3i`,"fontWeight-k63SB2":`xxjjie5`,"lineHeight-kLWn49":`x1d3mw78`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:4`},content:{"Alert__styles.content":`Alert__styles.content`,"flexGrow-kzQI83":`x1iyjqo2`,"minWidth-k7Eaqz":`xeuugli`,"textWrap-kN2L0X":`x1fzhlzt`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:20`},icon:{"Alert__styles.icon":`Alert__styles.icon`,"display-k1xSpc":`x3nfvp2`,"alignItems-kGNEyG":`x6s0dn4`,"justifyContent-kjj79g":`xl56j7k`,"flexShrink-kmuXW":`x2lah0s`,"width-kzqmXN":`x1kky2od`,"height-kZKoxP":`xlup9mm`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:25`},iconSvg:{"Alert__styles.iconSvg":`Alert__styles.iconSvg`,"display-k1xSpc":`x1lliihq`,"width-kzqmXN":`x1kky2od`,"height-kZKoxP":`xlup9mm`,"flexShrink-kmuXW":`x2lah0s`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:33`},link:{"Alert__styles.link":`Alert__styles.link`,"fontWeight-k63SB2":`xi0sa8g`,"textDecorationLine-kMnn75":`xujl8zx`,"textDecorationThickness-kNySMw":`xyi4chj`,"textUnderlineOffset-kcSHmL":`xda060z`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:39`}},t={default:{"Alert__variantStyles.default":`Alert__variantStyles.default`,"backgroundColor-kWkggS":`xfg9wsz`,"borderColor-kVAM5u":`x12c9lpl`,"color-kMwMTN":`xzn0pkc`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:47`},primary:{"Alert__variantStyles.primary":`Alert__variantStyles.primary`,"backgroundColor-kWkggS":`x1mkdsbu`,"borderColor-kVAM5u":`xx0pcxh`,"color-kMwMTN":`xzn0pkc`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:52`},info:{"Alert__variantStyles.info":`Alert__variantStyles.info`,"backgroundColor-kWkggS":`x15josac`,"borderColor-kVAM5u":`xqx95iw`,"color-kMwMTN":`xzn0pkc`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:57`},success:{"Alert__variantStyles.success":`Alert__variantStyles.success`,"backgroundColor-kWkggS":`x15q4ulg`,"borderColor-kVAM5u":`x1u8w7k4`,"color-kMwMTN":`xzn0pkc`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:62`},warning:{"Alert__variantStyles.warning":`Alert__variantStyles.warning`,"backgroundColor-kWkggS":`x19hrvbb`,"borderColor-kVAM5u":`x6rlbl3`,"color-kMwMTN":`xzn0pkc`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:67`},danger:{"Alert__variantStyles.danger":`Alert__variantStyles.danger`,"backgroundColor-kWkggS":`xfhhmty`,"borderColor-kVAM5u":`x1smv8d1`,"color-kMwMTN":`x19vemxs`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:72`}},n={default:{"Alert__accentColorStyles.default":`Alert__accentColorStyles.default`,"color-kMwMTN":`xi96bwj`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:79`},primary:{"Alert__accentColorStyles.primary":`Alert__accentColorStyles.primary`,"color-kMwMTN":`x1me39qh`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:82`},info:{"Alert__accentColorStyles.info":`Alert__accentColorStyles.info`,"color-kMwMTN":`x1b9tnpo`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:85`},success:{"Alert__accentColorStyles.success":`Alert__accentColorStyles.success`,"color-kMwMTN":`xwiqrka`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:88`},warning:{"Alert__accentColorStyles.warning":`Alert__accentColorStyles.warning`,"color-kMwMTN":`x1a3v400`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:91`},danger:{"Alert__accentColorStyles.danger":`Alert__accentColorStyles.danger`,"color-kMwMTN":`xreodjm`,$$css:`@stridge/kit:src/shared/ui/Alert/Alert.styles.ts:94`}};export{n as accentColorStyles,e as styles,t as variantStyles};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./Alert.slots.js";import"./Alert.js";
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/shared/ui/AmountInput/AmountInput.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Amount input with caret-preserving live formatting, locale-aware grouping/decimal rules, and an auto-shrinking
|
|
7
|
+
* font-size that lets the visible digits dominate the row without overflowing.
|
|
8
|
+
*
|
|
9
|
+
* Compose with {@link AmountInput.Prefix}, {@link AmountInput.Field}, and {@link AmountInput.Suffix}. Wire up
|
|
10
|
+
* through `value` / `defaultValue` (locale-formatted strings) and `onValueChange`. Use {@link parseAmountInputValue}
|
|
11
|
+
* to convert the display string to a number.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <AmountInput value={value} onValueChange={setValue}>
|
|
16
|
+
* <AmountInput.Prefix>$</AmountInput.Prefix>
|
|
17
|
+
* <AmountInput.Field />
|
|
18
|
+
* <AmountInput.Suffix>USDC</AmountInput.Suffix>
|
|
19
|
+
* </AmountInput>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare function AmountInput({
|
|
23
|
+
value,
|
|
24
|
+
defaultValue,
|
|
25
|
+
onValueChange,
|
|
26
|
+
locale,
|
|
27
|
+
maxDecimals,
|
|
28
|
+
useGrouping,
|
|
29
|
+
decimalsColor,
|
|
30
|
+
placeholder,
|
|
31
|
+
disabled,
|
|
32
|
+
children,
|
|
33
|
+
className,
|
|
34
|
+
role,
|
|
35
|
+
style,
|
|
36
|
+
...rest
|
|
37
|
+
}: AmountInput.Props): _$react_jsx_runtime0.JSX.Element;
|
|
38
|
+
/**
|
|
39
|
+
* Leading slot rendered before the input field within the `AmountInput` row. Stamped with the
|
|
40
|
+
* `prefix` slot so host styles can target it, and measured by the auto-shrink hook to account for
|
|
41
|
+
* its width when computing font size.
|
|
42
|
+
*/
|
|
43
|
+
declare function AmountInputPrefix({
|
|
44
|
+
children,
|
|
45
|
+
className,
|
|
46
|
+
style,
|
|
47
|
+
...props
|
|
48
|
+
}: AmountInput.PrefixProps): _$react_jsx_runtime0.JSX.Element;
|
|
49
|
+
/**
|
|
50
|
+
* Trailing slot rendered after the input field within the `AmountInput` row. Stamped with the
|
|
51
|
+
* `suffix` slot so host styles can target it, and measured by the auto-shrink hook to account for
|
|
52
|
+
* its width when computing font size.
|
|
53
|
+
*/
|
|
54
|
+
declare function AmountInputSuffix({
|
|
55
|
+
children,
|
|
56
|
+
className,
|
|
57
|
+
style,
|
|
58
|
+
...props
|
|
59
|
+
}: AmountInput.SuffixProps): _$react_jsx_runtime0.JSX.Element;
|
|
60
|
+
/**
|
|
61
|
+
* Input slot that renders the formatted `<input>` and, when `decimalsColor` is set, an
|
|
62
|
+
* `aria-hidden` overlay that splits the display value into integer and decimal spans so the
|
|
63
|
+
* fraction digits can be colored independently. Forwards `ref` to `ctx.inputRef` so both the
|
|
64
|
+
* auto-shrink hook and any consumer-supplied ref share the same node. Blurs on `wheel` events
|
|
65
|
+
* to prevent scroll from changing the numeric value.
|
|
66
|
+
*/
|
|
67
|
+
declare function AmountInputField({
|
|
68
|
+
className,
|
|
69
|
+
style,
|
|
70
|
+
inputClassName,
|
|
71
|
+
inputStyle,
|
|
72
|
+
ref,
|
|
73
|
+
...props
|
|
74
|
+
}: AmountInput.FieldProps): _$react_jsx_runtime0.JSX.Element;
|
|
75
|
+
declare namespace AmountInput {
|
|
76
|
+
interface Props extends Omit<ComponentProps<"div">, "children" | "onChange" | "defaultValue" | "ref"> {
|
|
77
|
+
/**
|
|
78
|
+
* Controlled display value (locale-formatted).
|
|
79
|
+
*/
|
|
80
|
+
value?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Initial value when uncontrolled. Defaults to `""`.
|
|
83
|
+
*/
|
|
84
|
+
defaultValue?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Fired with the post-normalization display value on every change.
|
|
87
|
+
*/
|
|
88
|
+
onValueChange?: (value: string) => void;
|
|
89
|
+
/**
|
|
90
|
+
* Locale used for thousand/decimal separators. Defaults to `"en-US"`.
|
|
91
|
+
*/
|
|
92
|
+
locale?: Intl.LocalesArgument;
|
|
93
|
+
/**
|
|
94
|
+
* Cap on fraction digits. Defaults to `5`.
|
|
95
|
+
*/
|
|
96
|
+
maxDecimals?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Insert locale-aware grouping separators as the user types. Defaults to `true`.
|
|
99
|
+
*/
|
|
100
|
+
useGrouping?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* CSS color for the fraction-digits overlay. When set, decimals render in this color.
|
|
103
|
+
*/
|
|
104
|
+
decimalsColor?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Placeholder shown when the value is empty. Defaults to `"0"`.
|
|
107
|
+
*/
|
|
108
|
+
placeholder?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Disables editing while preserving the current display value.
|
|
111
|
+
*/
|
|
112
|
+
disabled?: boolean;
|
|
113
|
+
children?: ReactNode;
|
|
114
|
+
}
|
|
115
|
+
type PrefixProps = ComponentProps<"span">;
|
|
116
|
+
type SuffixProps = ComponentProps<"span">;
|
|
117
|
+
interface FieldProps extends Omit<ComponentProps<"input">, "value" | "defaultValue" | "onChange"> {
|
|
118
|
+
/**
|
|
119
|
+
* Class name applied to the underlying `<input>`.
|
|
120
|
+
*/
|
|
121
|
+
inputClassName?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Style applied to the underlying `<input>`.
|
|
124
|
+
*/
|
|
125
|
+
inputStyle?: CSSProperties;
|
|
126
|
+
}
|
|
127
|
+
const Prefix: typeof AmountInputPrefix;
|
|
128
|
+
const Suffix: typeof AmountInputSuffix;
|
|
129
|
+
const Field: typeof AmountInputField;
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
export { AmountInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{joinClassNames as e}from"../../utils/joinClassNames.js";import{AMOUNT_INPUT_SLOTS as t}from"./AmountInput.slots.js";import{styles as n}from"./AmountInput.styles.js";import{getNumberSeparators as r}from"./utils.js";import{attachInputNormalization as i}from"./attachInputNormalization.js";import{AmountInputContext as a,useAmountInputContext as o}from"./context.js";import{useAutoShrinkFontSize as s}from"./useAutoShrinkFontSize.js";import{useCallback as c,useEffect as l,useLayoutEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import*as g from"@stylexjs/stylex";function _({value:i,defaultValue:o=``,onValueChange:l,locale:u=`en-US`,maxDecimals:h=5,useGrouping:_=!0,decimalsColor:v,placeholder:y=`0`,disabled:b=!1,children:x,className:S,role:C=`group`,style:w,...T}){let E=f(i!==void 0).current,[D,O]=p(o),k=E?i??``:D,A=c(e=>{E||O(e),l?.(e)},[E,l]),j=f(null),M=f(null),N=f(null),P=f(null),F=d(()=>r(u),[u]),{fontSize:I,inputWidth:L,isInitial:R}=s({rootRef:j,inputRef:M,prefixRef:N,suffixRef:P,text:k||y}),z=d(()=>({value:k,setInputValue:A,locale:u,maxDecimals:h,useGrouping:_,decimalsColor:v,placeholder:y,disabled:b,separators:F,fontSize:I,inputRef:M,prefixRef:N,suffixRef:P}),[k,A,u,h,_,v,y,b,F,I]),B=g.props(n.root),V={...B.style,fontSize:`${I}px`,...L===null?null:{width:`${L}px`},...R?{transition:`none`}:null,...v?{"--stridge-amt-decimals-color":v}:null,...w};return m(a.Provider,{value:z,children:m(`div`,{...T,ref:j,"data-stridge-slot":t.root,"data-disabled":b?``:void 0,role:C,className:e(B.className,S),style:V,children:x})})}function v({children:r,className:i,style:a,...s}){let c=o(`AmountInput.Prefix`),l=g.props(n.affix);return m(`span`,{...s,ref:c.prefixRef,"data-stridge-slot":t.prefix,className:e(l.className,i),style:{...l.style,...a},children:r})}function y({children:r,className:i,style:a,...s}){let c=o(`AmountInput.Suffix`),l=g.props(n.affix);return m(`span`,{...s,ref:c.suffixRef,"data-stridge-slot":t.suffix,className:e(l.className,i),style:{...l.style,...a},children:r})}function b({className:r,style:a,inputClassName:s,inputStyle:d,ref:f,...p}){let _=o(`AmountInput.Field`),v=c(e=>{_.inputRef.current=e,typeof f==`function`?f(e):f&&(f.current=e)},[_.inputRef,f]);u(()=>{let e=_.inputRef.current;e&&e.value!==_.value&&(e.value=_.value)},[_.value,_.inputRef]),l(()=>{let e=_.inputRef.current;if(e)return i(e,_.maxDecimals,_.locale,_.useGrouping)},[_.inputRef,_.maxDecimals,_.locale,_.useGrouping]);let y=c(e=>{_.setInputValue(e.target.value)},[_.setInputValue]),b=_.value.indexOf(_.separators.decimalSeparator),x=_.value===``,S=x?_.placeholder:b===-1?_.value:_.value.slice(0,b),C=!x&&b!==-1?_.value.slice(b):null,w=_.decimalsColor!==void 0,T=g.props(n.field),E=g.props(n.overlay,x&&n.overlayPlaceholder,!w&&n.overlayHidden),D=g.props(n.overlayDecimal),O=g.props(n.input,w?n.inputDimmed:n.inputSolid,_.disabled&&n.inputDisabled);return h(`span`,{"data-stridge-slot":t.field,className:e(T.className,r),style:{...T.style,...a},children:[h(`span`,{"aria-hidden":!0,className:E.className,style:E.style,children:[m(`span`,{children:S}),C===null?null:m(`span`,{className:D.className,style:D.style,children:C})]}),m(`input`,{"data-stridge-slot":t.input,placeholder:_.placeholder,disabled:_.disabled,...p,inputMode:`decimal`,spellCheck:!1,autoComplete:`off`,ref:v,value:_.value,onChange:y,onWheel:e=>{e.currentTarget.blur(),p.onWheel?.(e)},className:e(O.className,s),style:{...O.style,...d}})]})}(function(e){e.Prefix=v,e.Suffix=y,e.Field=b})(_||={});export{_ as AmountInput};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/shared/ui/AmountInput/AmountInput.slots.d.ts
|
|
2
|
+
declare const AMOUNT_INPUT_SLOTS: {
|
|
3
|
+
readonly root: "amount-input";
|
|
4
|
+
readonly prefix: "amount-input-prefix";
|
|
5
|
+
readonly suffix: "amount-input-suffix";
|
|
6
|
+
readonly field: "amount-input-field";
|
|
7
|
+
readonly input: "amount-input-input";
|
|
8
|
+
};
|
|
9
|
+
type AmountInputSlot = (typeof AMOUNT_INPUT_SLOTS)[keyof typeof AMOUNT_INPUT_SLOTS];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { AMOUNT_INPUT_SLOTS, AmountInputSlot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={root:`amount-input`,prefix:`amount-input-prefix`,suffix:`amount-input-suffix`,field:`amount-input-field`,input:`amount-input-input`};export{e as AMOUNT_INPUT_SLOTS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={root:{"AmountInput__styles.root":`AmountInput__styles.root`,"display-k1xSpc":`x3nfvp2`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x1pha0wt`,"justifyContent-kjj79g":`xl56j7k`,"position-kVAEAm":`x1n2onr6`,"maxWidth-ks0D6T":`x193iq5w`,"color-kMwMTN":`x1heor9g`,"fontFamily-kMv6JI":`x47j52l`,"fontWeight-k63SB2":`xk50ysn`,"fontVariantNumeric-kcqcaj":`xss6m8b`,"letterSpacing-kb6lSQ":`xo2cfqc`,"whiteSpace-khDVqt":`xuxw1ft`,"transitionProperty-k1ekBW":`x1vma9ed`,"transitionDuration-kIyJzY":`x16gg8jk`,"transitionTimingFunction-kAMwcw":`x1f7qsgr`,$$css:`@stridge/kit:src/shared/ui/AmountInput/AmountInput.styles.ts:4`},affix:{"AmountInput__styles.affix":`AmountInput__styles.affix`,"display-k1xSpc":`x1rg5ohu`,"flexShrink-kmuXW":`x2lah0s`,"whiteSpace-khDVqt":`x1sdyfia`,"userSelect-kfSwDN":`x87ps6o`,$$css:`@stridge/kit:src/shared/ui/AmountInput/AmountInput.styles.ts:21`},field:{"AmountInput__styles.field":`AmountInput__styles.field`,"position-kVAEAm":`x1n2onr6`,"display-k1xSpc":`x1rg5ohu`,"verticalAlign-kXLuUW":`x11njtxf`,"maxWidth-ks0D6T":`x193iq5w`,"minWidth-k7Eaqz":`x17g2nzx`,$$css:`@stridge/kit:src/shared/ui/AmountInput/AmountInput.styles.ts:27`},overlay:{"AmountInput__styles.overlay":`AmountInput__styles.overlay`,"display-k1xSpc":`x1rg5ohu`,"position-kVAEAm":`x1n2onr6`,"whiteSpace-khDVqt":`x1sdyfia`,"pointerEvents-kfzvcC":`x47corl`,"userSelect-kfSwDN":`x87ps6o`,"visibility-k33iCy":`xnpuxes`,$$css:`@stridge/kit:src/shared/ui/AmountInput/AmountInput.styles.ts:34`},overlayHidden:{"AmountInput__styles.overlayHidden":`AmountInput__styles.overlayHidden`,"visibility-k33iCy":`xlshs6z`,$$css:`@stridge/kit:src/shared/ui/AmountInput/AmountInput.styles.ts:42`},overlayDecimal:{"AmountInput__styles.overlayDecimal":`AmountInput__styles.overlayDecimal`,"color-kMwMTN":`x9h8u6b`,$$css:`@stridge/kit:src/shared/ui/AmountInput/AmountInput.styles.ts:45`},overlayPlaceholder:{"AmountInput__styles.overlayPlaceholder":`AmountInput__styles.overlayPlaceholder`,"opacity-kSiTet":`xwq05k6`,$$css:`@stridge/kit:src/shared/ui/AmountInput/AmountInput.styles.ts:48`},input:{"AmountInput__styles.input":`AmountInput__styles.input`,"position-kVAEAm":`x10l6tqk`,"top-k87sOh":`x13vifvy`,"insetInlineStart-kLqNvP":`x1o0tod`,"width-kzqmXN":`xh8yej3`,"height-kZKoxP":`x5yr21d`,"margin-kogj98":`x1ghz6dp`,"padding-kmVPX3":`x1717udv`,"outline-kI3sdo":`x1a2a7pz`,"backgroundColor-kWkggS":`xjbqb8w`,"textAlign-k9WMMc":`x16tdsg8`,"cursor-kkrTdU":`x1ed109x`,"whiteSpace-khDVqt":`x1sdyfia`,"fontFamily-kMv6JI":`xjb2p0i`,"fontSize-kGuDYH":`x1qlqyl8`,"fontWeight-k63SB2":`x1pd3egz`,"letterSpacing-kb6lSQ":`x4gjf66`,"lineHeight-kLWn49":`x15bjb6t`,"fontVariantNumeric-kcqcaj":`x1wgrp8u`,$$css:`@stridge/kit:src/shared/ui/AmountInput/AmountInput.styles.ts:51`},inputDimmed:{"AmountInput__styles.inputDimmed":`AmountInput__styles.inputDimmed`,"color-kMwMTN":`x19co3pv`,"caretColor-knGrYV":`x1lwfdfr`,$$css:`@stridge/kit:src/shared/ui/AmountInput/AmountInput.styles.ts:72`},inputSolid:{"AmountInput__styles.inputSolid":`AmountInput__styles.inputSolid`,"color-kMwMTN":`x1heor9g`,"caretColor-knGrYV":`xv247kb`,$$css:`@stridge/kit:src/shared/ui/AmountInput/AmountInput.styles.ts:76`},inputDisabled:{"AmountInput__styles.inputDisabled":`AmountInput__styles.inputDisabled`,"cursor-kkrTdU":`x1h6gzvc`,$$css:`@stridge/kit:src/shared/ui/AmountInput/AmountInput.styles.ts:80`}};export{e as styles};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getNumberSeparators as e,parseNumberInputValue as t,reformatDecimalPart as n,reformatIntegerPart as r,replaceStringRange as i}from"./utils.js";function a(a,o,s,c=!0){let l=e(s),{decimalSeparator:u,groupSeparator:d}=l;function f(){a.setRangeText(``,0,a.value.length,`end`),a.dispatchEvent(new Event(`input`,{bubbles:!0}))}function p(e,t){a.setRangeText(e,0,a.value.length,`end`),t!==void 0&&a.setSelectionRange(t,t),a.dispatchEvent(new Event(`input`,{bubbles:!0}))}function m(e){let n=a.value,{decimalPart:r,integerPart:i}=t(n,l);if(e!==0){if(n[e-1]?.match(d)){g(e-2,e,``);return}if(e===1&&i.length===1){if(!r?.match(/[1-9]/)){f();return}a.setRangeText(`0`,0,1,`end`),a.dispatchEvent(new Event(`input`,{bubbles:!0}));return}g(e-1,e,``)}}function h(e){let n=a.value,{decimalPart:r,integerPart:i}=t(n,l);if(e!==n.length){if(n[e]?.match(d)){g(e,e+2,``);return}if(e===0&&i.length===1){if(!r?.match(/[1-9]/)){f();return}a.setRangeText(`0`,0,1,`end`),a.dispatchEvent(new Event(`input`,{bubbles:!0}));return}g(e,e+1,``)}}function g(e,m,h){let g=a.value,{amountString:_}=t(g,l);if(h===u||h===`.`){if(o===0)return;let t=r(_.slice(0,e).replace(/[^0-9]/g,``),s,!1,c);p(`${t}${u}${n(_.slice(m).replace(/[^0-9]/g,``),o)}`,t.length+1);return}let v=h===``?``:h.match(RegExp(`[0-9]+(${d.source}[0-9]+)*([${u}.][0-9]*)?`))?.[0]?.replace(`.`,h.includes(u)?`.`:u);if(v===void 0)return;let y=i(_,v,e,m);if(_&&!y){f();return}let b=y.split(u,2),x=b[0]??``,S=b[1]?.replace(/[^0-9]/g,``)??null,C=r(x,s,!x.slice(0,e).match(/[1-9]/)&&(!v||v.startsWith(`0`)),c),w=S===null?C:`${C}${u}${n(S,o)}`,T=e+v.length;T>0&&(T<x.length?T=C.length-r(x.slice(T),s,!0,c).length:T+=C.length-x.length),p(w,T)}function _(e){switch(e.inputType){case`deleteContentBackward`:{let t=a.selectionStart;if(t!==null){let n=a.selectionEnd??t;n===t?m(t):g(t,n,``),e.preventDefault()}break}case`deleteContentForward`:{let t=a.selectionStart;if(t!==null){let n=a.selectionEnd??t;n===t?h(t):g(t,n,``),e.preventDefault()}break}case`insertFromDrop`:case`insertFromPaste`:case`insertText`:{let t=a.selectionStart;t!==null&&e.data!=null&&(g(t,a.selectionEnd??t,e.data),e.preventDefault());break}case`historyRedo`:case`historyUndo`:e.preventDefault();break}}return a.addEventListener(`beforeinput`,_),()=>a.removeEventListener(`beforeinput`,_)}export{a as attachInputNormalization};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createContext as e,use as t}from"react";const n=e(null);function r(e){let r=t(n);if(!r)throw Error(`${e} must be rendered inside <AmountInput>.`);return r}export{n as AmountInputContext,r as useAmountInputContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./AmountInput.slots.js";import"./utils.js";import"./AmountInput.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";import{useCallback as e,useEffect as t,useLayoutEffect as n,useState as r}from"react";function i({rootRef:i,inputRef:c,prefixRef:l,suffixRef:u,text:d}){let[f,p]=r(57),[m,h]=r(null),[g,_]=r(!0),v=e(()=>{let e=i.current,t=c.current;if(!e||!t)return;let n=window.getComputedStyle(e),r=a(n,`--stridge-amt-max-font-size`,57),d=a(n,`--stridge-amt-min-font-size`,16),f=o(e);if(f<=0){p(e=>e===r?e:r);return}let m=t.value||t.placeholder||``,g=l.current?.textContent??``,_=u.current?.textContent??``,v=g+m+_,y=s(t,v,r);if(y===0){p(e=>e===r?e:r),h(0);return}let b=Math.min(r,Math.max(d,Math.floor(r*f/y))),x=b===r?y:s(t,v,b);b<r&&x>f&&b>d&&(--b,x=s(t,v,b)),p(e=>e===b?e:b),h(e=>e===x?e:x)},[i,c,l,u]);return n(()=>{v()},[v,d]),t(()=>{_(!1)},[]),t(()=>{let e=i.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(v);t.observe(e);let n=e.parentElement;return n&&t.observe(n),()=>t.disconnect()},[v,i]),{fontSize:f,inputWidth:m,isInitial:g}}function a(e,t,n){let r=e.getPropertyValue(t).trim();if(!r)return n;let i=Number.parseFloat(r);return Number.isFinite(i)?i:n}function o(e){let t=a(window.getComputedStyle(e),`--stridge-amt-available-width`,NaN);if(Number.isFinite(t)&&t>0)return t;let n=e.parentElement;if(!n)return e.clientWidth;let r=window.getComputedStyle(n),i=(Number.parseFloat(r.paddingInlineStart)||0)+(Number.parseFloat(r.paddingInlineEnd)||0),o=n.clientWidth-i;return o>0?o:e.clientWidth}function s(e,t,n){if(t===``)return 0;let r=window.getComputedStyle(e),i=document.createElement(`span`);i.style.cssText=`
|
|
2
|
+
position: absolute;
|
|
3
|
+
visibility: hidden;
|
|
4
|
+
white-space: nowrap;
|
|
5
|
+
width: max-content;
|
|
6
|
+
padding: 0;
|
|
7
|
+
margin: 0;
|
|
8
|
+
font-family: ${r.fontFamily};
|
|
9
|
+
font-weight: ${r.fontWeight};
|
|
10
|
+
font-size: ${n}px;
|
|
11
|
+
letter-spacing: ${r.letterSpacing};
|
|
12
|
+
text-transform: ${r.textTransform};
|
|
13
|
+
font-variant-numeric: ${r.fontVariantNumeric};
|
|
14
|
+
`,i.textContent=t,document.body.appendChild(i);let a=i.offsetWidth;return document.body.removeChild(i),Math.ceil(a)}export{i as useAutoShrinkFontSize};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/shared/ui/AmountInput/utils.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Parse an {@link AmountInput} display value to a number, or `null` when blank or invalid.
|
|
4
|
+
*/
|
|
5
|
+
declare function parseAmountInputValue(value: string, locale?: Intl.LocalesArgument): number | null;
|
|
6
|
+
/**
|
|
7
|
+
* Format a numeric amount as a locale-formatted display string suitable for {@link AmountInput}'s `value` or
|
|
8
|
+
* `defaultValue`.
|
|
9
|
+
*/
|
|
10
|
+
declare function formatAmountForInput(value: number, locale?: Intl.LocalesArgument, maxDecimals?: number, useGrouping?: boolean): string;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { formatAmountForInput, parseAmountInputValue };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t=new Intl.NumberFormat(e,{currency:`USD`,currencyDisplay:`narrowSymbol`,style:`currency`}).formatToParts(123456789.123456),n=`.`,r=`,`;for(let e of t)e.type===`group`?r=e.value:e.type===`decimal`&&(n=e.value);return{decimalSeparator:n,groupSeparator:r.match(/\s/)?/[^\S\t\r\n\f\v]/g:RegExp(`[${r}]`,`g`)}}function t(e,t){let{decimalSeparator:n,groupSeparator:r}=t,i=RegExp(`^[0-9]+(${r.source}[0-9]+)*([${n}][0-9]*)?$`),a=e.match(i);if(a===null)return{amount:null,amountString:``,amountStringNormalized:``,decimalPart:null,integerPart:``};let o=a[0],s=o.replace(RegExp(`[^0-9${n}]`,`g`),``).replace(RegExp(`[${n}]`,`g`),`.`),[c,l=null]=o.split(n),u=Number.parseFloat(s);return{amount:Number.isFinite(u)?u:null,amountString:o,amountStringNormalized:s,decimalPart:l,integerPart:c??``}}function n(e,t,n,r){return e.slice(0,Math.max(0,n))+t+e.slice(r)}function r(e,t){return e.slice(0,t)}function i(e,t,n,r=!0){let i=e.replace(/[^0-9]/g,``)||`0`;return n?new Intl.NumberFormat(t,{useGrouping:r}).format(Number.parseInt(`1${i}`,10)).replace(/^[1-9][^0-9]*/,``):new Intl.NumberFormat(t,{useGrouping:r}).format(Number.parseInt(i,10))}function a(n,r=`en-US`){let i=n.trim();if(i===``)return null;let{amount:a}=t(i,e(r));return a}function o(e,t=`en-US`,n=5,r=!0){return new Intl.NumberFormat(t,{maximumFractionDigits:n,useGrouping:r}).format(e)}export{o as formatAmountForInput,e as getNumberSeparators,a as parseAmountInputValue,t as parseNumberInputValue,r as reformatDecimalPart,i as reformatIntegerPart,n as replaceStringRange};
|