Skip to content

Commit

Permalink
chore: update k2-components to core-k2-components
Browse files Browse the repository at this point in the history
  • Loading branch information
meeh0w committed Aug 1, 2024
1 parent ac96f03 commit 9066611
Show file tree
Hide file tree
Showing 363 changed files with 591 additions and 446 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"@avalabs/vm-module-types": "0.0.15",
"@avalabs/avalanchejs": "4.0.5",
"@avalabs/bridge-unified": "2.1.0",
"@avalabs/core-bridge-sdk": "2.8.0-canary.a436aaa.0",
"@avalabs/core-chains-sdk": "2.8.0-canary.a436aaa.0",
"@avalabs/core-coingecko-sdk": "2.8.0-canary.a436aaa.0",
"@avalabs/core-covalent-sdk": "2.8.0-canary.a436aaa.0",
"@avalabs/core-etherscan-sdk": "2.8.0-canary.a436aaa.0",
"@avalabs/core-snowtrace-sdk": "2.8.0-canary.a436aaa.0",
"@avalabs/core-token-prices-sdk": "2.8.0-canary.a436aaa.0",
"@avalabs/core-utils-sdk": "2.8.0-canary.a436aaa.0",
"@avalabs/core-wallets-sdk": "2.8.0-canary.a436aaa.0",
"@avalabs/core-bridge-sdk": "3.0.0",
"@avalabs/core-chains-sdk": "3.0.0",
"@avalabs/core-coingecko-sdk": "3.0.0",
"@avalabs/core-covalent-sdk": "3.0.0",
"@avalabs/core-etherscan-sdk": "3.0.0",
"@avalabs/core-snowtrace-sdk": "3.0.0",
"@avalabs/core-token-prices-sdk": "3.0.0",
"@avalabs/core-utils-sdk": "3.0.0",
"@avalabs/core-wallets-sdk": "3.0.0",
"@avalabs/glacier-sdk": "2.8.0-alpha.188",
"@avalabs/hw-app-avalanche": "0.14.1",
"@avalabs/k2-components": "4.18.0-alpha.41",
"@avalabs/core-k2-components": "4.18.0-alpha.44",
"@avalabs/types": "2.8.0-alpha.188",
"@blockaid/client": "0.10.0",
"@coinbase/cbpay-js": "1.6.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/AddressK2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Stack,
IconButton,
useTheme,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';
import { truncateAddress } from '@src/utils/truncateAddress';

interface AddressProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/AppBackground.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, styled } from '@avalabs/k2-components';
import { Stack, styled } from '@avalabs/core-k2-components';
import { Suspense } from 'react';

const FallbackImage = styled(Stack)`
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/ArcProgress.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useTheme } from '@avalabs/k2-components';
import { useTheme } from '@avalabs/core-k2-components';

type Props = {
size: number;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/BNInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Button,
styled,
CircularProgress,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';
import { bnToLocaleString, numberToBN } from '@avalabs/core-utils-sdk';

Big.PE = 99;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/BalanceColumn.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, styled } from '@avalabs/k2-components';
import { Stack, styled } from '@avalabs/core-k2-components';

export const BalanceColumn = styled(Stack)`
align-items: end;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/CameraAccessDeniedDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, Typography, Dialog, Button } from '@avalabs/k2-components';
import { Stack, Typography, Dialog, Button } from '@avalabs/core-k2-components';
import { useTranslation } from 'react-i18next';
import CameraBlockedIcon from '../icons/CameraAccessDeniedIcon';

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/CameraAccessPromptDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Button,
ExternalLinkIcon,
CircularProgress,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';
import { useTranslation } from 'react-i18next';

export const CameraAccessPromptDialog = ({ QRScanner }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/ConfirmationTracker.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Fragment, memo, useRef } from 'react';
import { Box, styled, Theme, Typography } from '@avalabs/k2-components';
import { Box, styled, Theme, Typography } from '@avalabs/core-k2-components';
import { keyframes } from '@emotion/react';
import { useTranslation } from 'react-i18next';

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/ConnectionIndicatorK2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
StackProps,
Box,
BoxProps,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';
import { useTranslation } from 'react-i18next';

interface ConnectionIndicatorProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/ContainedDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, StackProps, useTheme } from '@avalabs/k2-components';
import { Stack, StackProps, useTheme } from '@avalabs/core-k2-components';
import {
forwardRef,
MutableRefObject,
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/CustomFees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
Stack,
Typography,
styled,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';
import {
ApprovalSection,
ApprovalSectionBody,
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/CustomGasSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
TextField,
Tooltip,
Typography,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';
import { useSettingsContext } from '@src/contexts/SettingsProvider';
import { TextFieldLabel } from './TextFieldLabel';
import { parseUnits } from 'ethers';
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReactNode } from 'react';
import { Dialog as K2Dialog, Typography } from '@avalabs/k2-components';
import { Dialog as K2Dialog, Typography } from '@avalabs/core-k2-components';

export interface DialogProps {
open: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Select,
TextFieldProps,
useTheme,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';

const TriggerIcon = ({ ...rest }: IconBaseProps) => {
const theme = useTheme();
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/EmptyContent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, Grow, Typography } from '@avalabs/k2-components';
import { Stack, Grow, Typography } from '@avalabs/core-k2-components';

interface EmptyContentProps {
text: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Flipper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cloneElement } from 'react';
import { Box } from '@avalabs/k2-components';
import { Box } from '@avalabs/core-k2-components';

type FlipperProps = {
size: number;
Expand Down
6 changes: 5 additions & 1 deletion src/components/common/FunctionIsOffline.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { PropsWithChildren } from 'react';
import { PageTitle, PageTitleVariant } from './PageTitle';
import { t as translate } from 'i18next';
import { AlertCircleIcon, Stack, Typography } from '@avalabs/k2-components';
import {
AlertCircleIcon,
Stack,
Typography,
} from '@avalabs/core-k2-components';
import { useTranslation } from 'react-i18next';
import { FunctionNames } from '@src/hooks/useIsFunctionAvailable';

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/FunctionIsUnavailable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PropsWithChildren } from 'react';
import { PageTitle, PageTitleVariant } from './PageTitle';
import { Trans, useTranslation } from 'react-i18next';
import { getTranslatedFunctionName } from './FunctionIsOffline';
import { Stack, Typography } from '@avalabs/k2-components';
import { Stack, Typography } from '@avalabs/core-k2-components';
import { FunctionNames } from '@src/hooks/useIsFunctionAvailable';
interface FunctionIsOfflineProps {
functionName: FunctionNames;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/InAppApprovalOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import { Fade, Stack, useTheme } from '@avalabs/k2-components';
import { Fade, Stack, useTheme } from '@avalabs/core-k2-components';

import { useApprovalsContext } from '@src/contexts/ApprovalsProvider';
import { ApprovalRoutes } from '@src/popup/ApprovalRoutes';
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/InlineBold.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled } from '@avalabs/k2-components';
import { styled } from '@avalabs/core-k2-components';

export const InlineBold = styled('span')`
font-weight: bold;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/InlineTokenEllipsis.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled } from '@avalabs/k2-components';
import { styled } from '@avalabs/core-k2-components';
import { TokenEllipsis } from './TokenEllipsis';

export const InlineTokenEllipsis = styled(TokenEllipsis)`
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/InvalidQRCodeDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, Typography, Dialog, Button } from '@avalabs/k2-components';
import { Stack, Typography, Dialog, Button } from '@avalabs/core-k2-components';
import { useTranslation } from 'react-i18next';
import InvalidQRCodeIcon from '../icons/InvalidQRCodeIcon';

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/LoadingOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CircularProgress } from '@avalabs/k2-components';
import { CircularProgress } from '@avalabs/core-k2-components';
import { Overlay } from './Overlay';

export function LoadingOverlay() {
Expand Down
7 changes: 6 additions & 1 deletion src/components/common/NetworkLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { CheckIcon, GlobeIcon, Stack, styled } from '@avalabs/k2-components';
import {
CheckIcon,
GlobeIcon,
Stack,
styled,
} from '@avalabs/core-k2-components';
import { ipfsResolverWithFallback } from '@src/utils/ipsfResolverWithFallback';

export const GlobeIconContainer = styled('div')<NetworkLogoProps>`
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/NetworkLogoK2.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GlobeIcon, styled } from '@avalabs/k2-components';
import { GlobeIcon, styled } from '@avalabs/core-k2-components';
import { ipfsResolverWithFallback } from '@src/utils/ipsfResolverWithFallback';

export const GlobeIconContainer = styled('div')<NetworkLogoProps>`
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/NotSupportedByWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PropsWithChildren } from 'react';
import { PageTitle, PageTitleVariant } from './PageTitle';
import { Trans, useTranslation } from 'react-i18next';
import { getTranslatedFunctionName } from './FunctionIsOffline';
import { Stack, Typography } from '@avalabs/k2-components';
import { Stack, Typography } from '@avalabs/core-k2-components';
import { FunctionNames } from '@src/hooks/useIsFunctionAvailable';
interface NotSupportedByWalleteProps {
functionName: FunctionNames;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
SxProps,
Theme,
useTheme,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';

interface OverlayProps {
children: ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/PageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Typography,
styled,
keyframes,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';

const ShowThumbnailImageAnimation = keyframes`
0% {
Expand Down
7 changes: 6 additions & 1 deletion src/components/common/PasswordStrength.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { t as translate } from 'i18next';
import { useTranslation } from 'react-i18next';
import { useTheme, darkTheme, Typography, Stack } from '@avalabs/k2-components';
import {
useTheme,
darkTheme,
Typography,
Stack,
} from '@avalabs/core-k2-components';
import zxcvbn from 'zxcvbn';
import { useEffect } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/ProfitAndLoss.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, Trend, ProfitAndLoss } from '@avalabs/k2-components';
import { Stack, Trend, ProfitAndLoss } from '@avalabs/core-k2-components';
import { useSettingsContext } from '@src/contexts/SettingsProvider';

interface PandLProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/QRCodeWithLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QRCode from 'qrcode.react';
import { PropsWithChildren } from 'react';
import { Stack, useTheme } from '@avalabs/k2-components';
import { Stack, useTheme } from '@avalabs/core-k2-components';

export function QRCodeWithLogo({
value,
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/SimpleAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
toast,
CopyIcon,
TypographyProps,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';
import { useTranslation } from 'react-i18next';

import { truncateAddress } from '@src/utils/truncateAddress';
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/SiteAvatar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, styled } from '@avalabs/k2-components';
import { Stack, styled } from '@avalabs/core-k2-components';

export const SiteAvatar = styled(Stack)<{ margin?: string }>`
width: 80px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/StyledNumberList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled, Typography } from '@avalabs/k2-components';
import { styled, Typography } from '@avalabs/core-k2-components';

export const StyledNumberList = styled(Typography)`
${({ theme }) => ({
Expand Down
7 changes: 6 additions & 1 deletion src/components/common/TestnetBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { Slide, Stack, Typography, useTheme } from '@avalabs/k2-components';
import {
Slide,
Stack,
Typography,
useTheme,
} from '@avalabs/core-k2-components';
import { useNetworkContext } from '@src/contexts/NetworkProvider';
import { t } from 'i18next';

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/TextFieldLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Stack,
Tooltip,
Typography,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';

interface TextFieldLabelProps {
label: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/TokenAmount.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, Typography } from '@avalabs/k2-components';
import { Stack, Typography } from '@avalabs/core-k2-components';
import { useTranslation } from 'react-i18next';

import { TokenWithBalance } from '@src/background/services/balances/models';
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/TokenCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PropsWithChildren } from 'react';
import { Card, Stack, Typography } from '@avalabs/k2-components';
import { Card, Stack, Typography } from '@avalabs/core-k2-components';

interface TokenCardProps {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/TokenCardWithBalance.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Card, Stack, Tooltip, Typography } from '@avalabs/k2-components';
import { Card, Stack, Tooltip, Typography } from '@avalabs/core-k2-components';
import { useEffect, useRef, useState } from 'react';
import { PAndL } from './ProfitAndLoss';
import { TokenWithBalance } from '@src/background/services/balances/models';
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/TokenEllipsis.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PropsWithChildren } from 'react';
import { Tooltip } from '@avalabs/k2-components';
import { Tooltip } from '@avalabs/core-k2-components';
import { truncateAddress } from '@avalabs/core-utils-sdk';

interface TokenEllipsisProps {
Expand Down
6 changes: 5 additions & 1 deletion src/components/common/TokenIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { CircularProgress, Stack, Typography } from '@avalabs/k2-components';
import {
CircularProgress,
Stack,
Typography,
} from '@avalabs/core-k2-components';
import { ipfsResolverWithFallback } from '@src/utils/ipsfResolverWithFallback';
import { useEffect, useState } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/TokenSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
Divider,
Card,
SearchBar,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';
import { BNInput } from '@src/components/common/BNInput';
import { TokenSelector } from './TokenSelector';
import { TokenEllipsis } from './TokenEllipsis';
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/TokenSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ChevronDownIcon,
Stack,
ChevronUpIcon,
} from '@avalabs/k2-components';
} from '@avalabs/core-k2-components';
import { useTranslation } from 'react-i18next';

export interface Token {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/TxWarningBox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box } from '@avalabs/k2-components';
import { Box } from '@avalabs/core-k2-components';
import { AlertBox } from '@src/pages/Permissions/components/AlertBox';
import { WarningBox } from '@src/pages/Permissions/components/WarningBox';
import { useTranslation } from 'react-i18next';
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/VerticalStack.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, StackProps } from '@avalabs/k2-components';
import { Stack, StackProps } from '@avalabs/core-k2-components';

export const VerticalStack = (props: Exclude<StackProps, 'direction'>) => (
<Stack {...props} direction="column" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/VirtualizedList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled } from '@avalabs/k2-components';
import { styled } from '@avalabs/core-k2-components';
import { List } from 'react-virtualized';

const VirtualizedList = styled(List)`
Expand Down
7 changes: 6 additions & 1 deletion src/components/common/WalletChip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { useCallback, useState } from 'react';
import { Chip, ChipProps, Tooltip, Typography } from '@avalabs/k2-components';
import {
Chip,
ChipProps,
Tooltip,
Typography,
} from '@avalabs/core-k2-components';

import { WalletDetails } from '@src/background/services/wallet/models';
import { WalletTypeIcon } from '@src/pages/Accounts/components/WalletTypeIcon';
Expand Down
Loading

0 comments on commit 9066611

Please sign in to comment.