From 2f9af5998547a3555dc1cfc24b9171fa7a575497 Mon Sep 17 00:00:00 2001 From: Alissa Crane Date: Mon, 10 Jun 2024 14:39:27 -0400 Subject: [PATCH] update types and remove export --- site/docs/pages/swap/swap-amount-input.mdx | 2 +- site/docs/pages/swap/types.mdx | 17 +++++++++++++++++ site/docs/pages/token/types.mdx | 14 -------------- src/token/index.ts | 1 - 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/site/docs/pages/swap/swap-amount-input.mdx b/site/docs/pages/swap/swap-amount-input.mdx index cbee2f4c1f..7dad038f26 100644 --- a/site/docs/pages/swap/swap-amount-input.mdx +++ b/site/docs/pages/swap/swap-amount-input.mdx @@ -78,7 +78,7 @@ The `SwapAmountInput` component is a stylized input field designed for users to ## Props -[`SwapAmountInputReact`](/token/types#SwapAmountInputreact) +[`SwapAmountInputReact`](/swap/types#SwapAmountInputReact) ## CSS diff --git a/site/docs/pages/swap/types.mdx b/site/docs/pages/swap/types.mdx index 0cf726de84..79e2c8816c 100644 --- a/site/docs/pages/swap/types.mdx +++ b/site/docs/pages/swap/types.mdx @@ -4,3 +4,20 @@ description: Glossary of Types in Swap Kit. --- # Types [Glossary of Types in Swap Kit.] + +## `SwapAmountInputReact` + +```ts +type SwapAmountInputReact = { + label: string; // Descriptive label for the input field + amount?: string; // Token amount + token?: Token; // Selected token + swappableTokens?: Token[]; + tokenBalance?: string; + onMaxButtonClick: () => void; + onAmountChange: (amount: string) => void; // Callback function when the amount changes + onTokenSelectorClick: () => void; // Callback function when the token selector is clicked + onSelectTokenToggle: () => void; + disabled?: boolean; // Whether the input is disabled +}; +``` diff --git a/site/docs/pages/token/types.mdx b/site/docs/pages/token/types.mdx index ee0aa8c9be..2cd6fdfc16 100644 --- a/site/docs/pages/token/types.mdx +++ b/site/docs/pages/token/types.mdx @@ -107,18 +107,4 @@ export type TokenSelectorDropdownReact = { options: Token[]; // List of tokens setToken: (token: Token) => void; // Token setter }; -``` - -## `TokenAmountInputReact` - -```ts -type TokenAmountInputReact = { - label: string; // Descriptive label for the input field - amount?: string; // Token amount - onAmountChange: (amount: string) => void; // Callback function when the amount changes - onTokenSelectorClick: () => void; // Callback function when the token selector is clicked - token?: Token; // Selected token - estimatedAmountInFiat?: string; // Estimated amount in fiat currency - disabled?: boolean; // Whether the input is disabled -}; ``` \ No newline at end of file diff --git a/src/token/index.ts b/src/token/index.ts index 5bbd8e11e7..61c4c525d1 100644 --- a/src/token/index.ts +++ b/src/token/index.ts @@ -7,7 +7,6 @@ export { TokenSelector } from './components/TokenSelector'; export { TokenSelectorDropdown } from './components/TokenSelectorDropdown'; export { formatAmount } from './core/formatAmount'; export { getTokens } from './core/getTokens'; -export { TokenAmountInput } from './components/TokenAmountInput'; export type { GetTokensError, GetTokensOptions,