Skip to content

Commit

Permalink
[NO CHANGELOG] Upgrade biome design-tokens to 0.4.4 and react to 0.27…
Browse files Browse the repository at this point in the history
….2 (#2219)

Co-authored-by: tim <[email protected]>
  • Loading branch information
jiyounglee and glomotion committed Sep 26, 2024
1 parent 0b23fce commit 36c88a5
Show file tree
Hide file tree
Showing 15 changed files with 130 additions and 66 deletions.
2 changes: 1 addition & 1 deletion examples/passport/wallets-connect-with-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@examples/wallets-connect-with-nextjs",
"version": "0.1.0",
"dependencies": {
"@biom3/react": "^0.26.2",
"@biom3/react": "^0.27.3",
"@ethersproject/providers": "^5.7.2",
"@imtbl/sdk": "latest",
"@tanstack/react-query": "^5.51.11",
Expand Down
4 changes: 2 additions & 2 deletions packages/checkout/sdk-sample-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
]
},
"dependencies": {
"@biom3/design-tokens": "^0.4.2",
"@biom3/react": "^0.25.0",
"@biom3/design-tokens": "^0.4.4",
"@biom3/react": "^0.27.3",
"@ethersproject/providers": "^5.7.2",
"@imtbl/checkout-sdk": "0.0.0",
"@imtbl/checkout-widgets": "0.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/checkout/widgets-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
},
"dependencies": {
"@0xsquid/sdk": "^2.8.24",
"@biom3/design-tokens": "^0.4.2",
"@biom3/react": "^0.25.0",
"@biom3/design-tokens": "^0.4.4",
"@biom3/react": "^0.27.3",
"@ethersproject/bignumber": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@imtbl/bridge-sdk": "0.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
AllIconKeys, Body, Box, Icon,
AllDualVariantIconKeys,
Body, Box, Icon,
} from '@biom3/react';

import { statusBoxStyles, statusLogoFill } from './StatusViewStyles';
Expand All @@ -11,7 +12,7 @@ export interface StatusViewProps {
iconStyles?: Record<string, string>;
}

const status: Record<StatusType, AllIconKeys> = {
const status: Record<StatusType, AllDualVariantIconKeys> = {
[StatusType.SUCCESS]: 'TickWithCircle',
[StatusType.WARNING]: 'Shield',
[StatusType.FAILURE]: 'CloseWithCircle',
Expand Down
20 changes: 13 additions & 7 deletions packages/checkout/widgets-lib/src/views/top-up/TopUpMenuItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Box, MenuItem, IconProps } from '@biom3/react';
import { ReactNode } from 'react';
import {
AllSingleVariantIconKeys, Box, type IconProps, isDualVariantIcon, MenuItem,
} from '@biom3/react';
import type { ReactNode } from 'react';

export interface TopUpMenuItemProps {
testId: string;
Expand All @@ -25,15 +27,19 @@ export function TopUpMenuItem({
onClick={!isDisabled ? onClick : undefined}
sx={isDisabled ? { opacity: '0.5', cursor: 'not-allowed' } : {}}
>
<MenuItem.Icon
icon={icon}
variant={iconVariant}
/>
{isDualVariantIcon(icon) ? (
<MenuItem.Icon
icon={icon}
variant={iconVariant}
/>
) : (
<MenuItem.Icon icon={icon} />
)}
<MenuItem.Label size="medium">
{heading}
</MenuItem.Label>
<MenuItem.IntentIcon
icon={intentIcon}
icon={intentIcon as AllSingleVariantIconKeys}
/>
<MenuItem.Caption testId={`menu-item-caption-${testId}`}>
{caption}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IconProps, MenuItem, MenuItemSize } from '@biom3/react';
import { AllDualVariantIconKeys, MenuItem, MenuItemSize } from '@biom3/react';
import { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';
import { FiatOptionType } from '../types';
Expand All @@ -20,7 +20,7 @@ export function FiatOption<RC extends ReactElement | undefined = undefined>({
}: FiatOptionProps<RC>) {
const { t } = useTranslation();

const icon: Record<FiatOptionType, IconProps['icon']> = {
const icon: Record<FiatOptionType, AllDualVariantIconKeys> = {
[FiatOptionType.DEBIT]: 'BankCard',
[FiatOptionType.CREDIT]: 'BankCard',
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { IconProps, MenuItem, MenuItemSize } from '@biom3/react';
import { ReactElement } from 'react';
import {
type AllDualVariantIconKeys, MenuItem, type MenuItemSize,
} from '@biom3/react';
import type { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';

export enum OptionTypes {
Expand Down Expand Up @@ -27,7 +29,7 @@ export function Option<RC extends ReactElement | undefined = undefined>({
}: OptionProps<RC>) {
const { t } = useTranslation();

const icon: Record<OptionTypes, IconProps['icon']> = {
const icon: Record<OptionTypes, AllDualVariantIconKeys> = {
[OptionTypes.SWAP]: 'Coins',
[OptionTypes.DEBIT]: 'BankCard',
[OptionTypes.CREDIT]: 'BankCard',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IconProps, MenuItem, MenuItemSize } from '@biom3/react';
import { AllDualVariantIconKeys, MenuItem, MenuItemSize } from '@biom3/react';
import { SalePaymentTypes } from '@imtbl/checkout-sdk';
import { ReactElement } from 'react';
import { useTranslation } from 'react-i18next';
Expand All @@ -24,7 +24,7 @@ export function PaymentOption<RC extends ReactElement | undefined = undefined>({
}: PaymentOptionProps<RC>) {
const { t } = useTranslation();

const icon: Record<SalePaymentTypes, IconProps['icon']> = {
const icon: Record<SalePaymentTypes, AllDualVariantIconKeys> = {
[SalePaymentTypes.CRYPTO]: 'Coins',
[SalePaymentTypes.DEBIT]: 'BankCard',
[SalePaymentTypes.CREDIT]: 'BankCard',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import {
MenuItem, ButtCon, AllIconKeys, SxProps,
type AllDualVariantIconKeys, type AllIconKeys, ButtCon,
isDualVariantIcon,
MenuItem, type SxProps,
} from '@biom3/react';
import { Web3Provider } from '@ethersproject/providers';
import type { Web3Provider } from '@ethersproject/providers';
import { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { getWalletLogoByName } from '../../../../lib/logoUtils';
import { abbreviateWalletAddress } from '../../../../lib/utils';
import { getWalletProviderNameByProvider, isPassportProvider } from '../../../../lib/provider';
import {
UserJourney,
useAnalytics,
} from '../../../../context/analytics-provider/SegmentAnalyticsProvider';
import { getWalletLogoByName } from '../../../../lib/logoUtils';
import { getWalletProviderNameByProvider, isPassportProvider } from '../../../../lib/provider';
import { abbreviateWalletAddress } from '../../../../lib/utils';

const isCopiedStyle: SxProps = {
background: 'base.color.status.success.bright',
Expand Down Expand Up @@ -75,21 +77,37 @@ export function WalletAddress({
logo={getWalletLogoByName(getWalletProviderNameByProvider(provider))}
sx={{ backgroundColor: 'base.color.translucent.standard.200' }}
/>
{isDualVariantIcon(ctaIcon) ? (
<ButtCon
variant="tertiary"
iconVariant="bold"
size="small"
icon={ctaIcon}
iconSx={{
...(isCopied ? isCopiedIconStyle : {}),
}}
onClick={handleIconClick}
sx={{
cursor: 'pointer',
...(isCopied ? isCopiedStyle : {}),
}}
/>
) : (
<ButtCon
variant="tertiary"
size="small"
icon={ctaIcon as AllDualVariantIconKeys}
iconSx={{
...(isCopied ? isCopiedIconStyle : {}),
}}
onClick={handleIconClick}
sx={{
cursor: 'pointer',
...(isCopied ? isCopiedStyle : {}),
}}
/>
)}

<ButtCon
variant="tertiary"
iconVariant="bold"
size="small"
icon={ctaIcon}
iconSx={{
...(isCopied ? isCopiedIconStyle : {}),
}}
onClick={handleIconClick}
sx={{
cursor: 'pointer',
...(isCopied ? isCopiedStyle : {}),
}}
/>
<MenuItem.Label>{t('views.SETTINGS.walletAddress.label')}</MenuItem.Label>
<MenuItem.Caption testId="wallet-address">
{abbreviateWalletAddress(walletAddress)}
Expand Down
4 changes: 2 additions & 2 deletions packages/checkout/widgets-sample-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
]
},
"dependencies": {
"@biom3/design-tokens": "^0.4.2",
"@biom3/react": "^0.25.0",
"@biom3/design-tokens": "^0.4.4",
"@biom3/react": "^0.27.3",
"@ethersproject/providers": "^5.7.2",
"@imtbl/checkout-sdk": "0.0.0",
"@imtbl/checkout-widgets": "0.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/passport/sdk-sample-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@imtbl/passport-sdk-sample-app",
"version": "0.1.0",
"dependencies": {
"@biom3/design-tokens": "^0.4.2",
"@biom3/react": "^0.25.0",
"@biom3/design-tokens": "^0.4.4",
"@biom3/react": "^0.27.3",
"@imtbl/blockchain-data": "0.0.0",
"@imtbl/config": "0.0.0",
"@imtbl/generated-clients": "0.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/passport/sdk-sample-app/src/components/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Message() {
return (
<CardStack title="Message">
<Sticker
style={{ width: '100%' }}
sx={{ width: '100%' }}
position={{ x: 'right', y: 'top' }}
>
<Form>
Expand All @@ -36,6 +36,7 @@ function Message() {
<Sticker.FramedIcon
icon="Close"
circularFrame
emphasized
sx={{
cursor: 'pointer',
}}
Expand Down
2 changes: 1 addition & 1 deletion packages/x-provider/src/sample-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
]
},
"dependencies": {
"@biom3/react": "^0.25.0",
"@biom3/react": "^0.27.3",
"@imtbl/sdk": "0.0.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
Expand Down
8 changes: 4 additions & 4 deletions sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"@0xsequence/abi": "^1.4.3",
"@0xsequence/core": "^1.4.3",
"@0xsquid/sdk": "^2.8.24",
"@biom3/design-tokens": "^0.4.2",
"@biom3/react": "^0.25.0",
"@biom3/design-tokens": "^0.4.4",
"@biom3/react": "^0.27.3",
"@ethersproject/abi": "^5.7.0",
"@ethersproject/abstract-provider": "^5.7.0",
"@ethersproject/abstract-signer": "^5.7.0",
Expand Down Expand Up @@ -162,7 +162,7 @@
},
"repository": "immutable/ts-immutable-sdk.git",
"resolutions": {
"@biom3/design-tokens": "^0.4.2",
"@biom3/design-tokens": "^0.4.4",
"@openzeppelin/contracts": "3.4.2-solc-0.7"
},
"scripts": {
Expand All @@ -178,4 +178,4 @@
},
"type": "module",
"types": "./dist/index.d.ts"
}
}
Loading

0 comments on commit 36c88a5

Please sign in to comment.