Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NO CHANGELOG] Upgrade biome design-tokens to 0.4.4 and react to 0.27.2 #2219

Merged
merged 18 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it kinda depends on how many icons we want to support in here. If we want to support Dual and Single icon variants properly, then we should maybe do as above and use the typeGuard: isDualVariantIcon()

/>
<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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Message() {
return (
<CardStack title="Message">
<Sticker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glomotion should this version upgrade have any impact on the Sticker component?
Left is after this version bump, right is prior

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haydenfowler so stickers have not changed, but Sticker.FramedIcon has. 😅 Think we just need one extra prop here. Ill fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK this commit should fix it: 819e41e

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glomotion Same result unfortunately 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haydenfowler OK should definitely be fixed this time. Sorry for the false start. 🤪

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