diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d450200..c376c0f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [[0.0.13](https://github.com/multiversx/mx-sdk-dapp-ui/pull/161)] - 2025-07-10 + +- [UI updates on icons for failed transactions and Firefox extension.](https://github.com/multiversx/mx-sdk-dapp-ui/pull/160) + ## [[0.0.12](https://github.com/multiversx/mx-sdk-dapp-ui/pull/159)] - 2025-07-10 - [Added Check your device text on ledger connect](https://github.com/multiversx/mx-sdk-dapp-ui/pull/158) diff --git a/package.json b/package.json index b9ae706f..d3f024cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-dapp-ui", - "version": "0.0.12", + "version": "0.0.13", "description": "A library to hold UI components for a dApp on the MultiversX blockchain", "author": "MultiversX", "license": "MIT", diff --git a/src/components.d.ts b/src/components.d.ts index 49ca542f..0ada45c3 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -64,8 +64,14 @@ export namespace Components { interface MvxCloseIcon { } interface MvxCopyButton { + /** + * @default 'copy-button' + */ "class"?: string; "copyIcon"?: IconDefinition | string; + /** + * @default 'copy-button-icon' + */ "iconClass"?: string; "successIcon"?: IconDefinition | string; "text": string; @@ -91,6 +97,9 @@ export namespace Components { "width"?: number; } interface MvxFaIcon { + /** + * @default 'fa-icon' + */ "class"?: string; "description"?: string; "icon": IconDefinition | string; @@ -102,6 +111,9 @@ export namespace Components { "isValid": boolean; "label"?: string; "labelClass"?: string; + /** + * @default true + */ "showLabel"?: boolean; "valueDecimal": string; "valueInteger": string; @@ -113,6 +125,9 @@ export namespace Components { "confirmScreenData": IConfirmScreenData; } interface MvxLedgerConnect { + /** + * @default { accountScreenData: null, confirmScreenData: null, connectScreenData: {}, } + */ "data": ILedgerConnectPanelData; "getEventBus": () => Promise; } @@ -121,6 +136,9 @@ export namespace Components { } interface MvxLedgerIntro { "connectScreenData"?: IConnectScreenData; + /** + * @default false + */ "isAwaiting"?: boolean; } interface MvxLedgerProviderIcon { @@ -141,14 +159,26 @@ export namespace Components { } interface MvxPagination { "class"?: string; + /** + * @default 1 + */ "currentPage": number; + /** + * @default false + */ "isDisabled"?: boolean; "totalPages": number; } interface MvxPaginationEllipsis { + /** + * @default false + */ "isActive": boolean; } interface MvxPaginationEllipsisForm { + /** + * @default false + */ "isVisible": boolean; "maxPageToSearchFor": number; } @@ -166,27 +196,54 @@ export namespace Components { "class"?: string; } interface MvxProviderIdleScreen { + /** + * @default '' + */ "introText": string; + /** + * @default 'Requesting Connection' + */ "introTitle": string; + /** + * @default null + */ "provider": IProviderBase | null; } interface MvxSidePanel { "hasBackButton"?: boolean; + /** + * @default false + */ "isOpen": boolean; "panelClassName"?: string; "panelTitle": string; + /** + * @default true + */ "showHeader"?: boolean; } interface MvxSidePanelHeader { + /** + * @default true + */ "hasLeftButton"?: boolean; + /** + * @default true + */ "hasRightButton"?: boolean; "panelClassName"?: string; "panelTitle": string; } interface MvxSidePanelSwiper { "close": () => Promise; + /** + * @default false + */ "open": boolean; "openToSnapPoint": (snapIndex?: number) => Promise; + /** + * @default '' + */ "sidePanelIdentifier": string; } interface MvxSignTransactionsAdvanced { @@ -198,7 +255,13 @@ export namespace Components { "highlight"?: string; } interface MvxSignTransactionsAdvancedDataDecode { + /** + * @default DecodeMethodEnum.decimal + */ "currentDecodeMethod": DecodeMethodEnum; + /** + * @default false + */ "isToggled": boolean; } interface MvxSignTransactionsFooter { @@ -211,7 +274,13 @@ export namespace Components { "identifier": string; "interactor": string; "interactorIconUrl": string; + /** + * @default false + */ "isApp": boolean; + /** + * @default '~$0.00078' + */ "networkFee": string; "tokenIconUrl": string; "usdValue": string; @@ -240,8 +309,14 @@ export namespace Components { } interface MvxTooltip { "class"?: string; + /** + * @default 'top' + */ "position": 'top' | 'bottom'; "trigger": HTMLElement; + /** + * @default false + */ "triggerOnClick"?: boolean; } interface MvxTransactionAccount { @@ -249,6 +324,9 @@ export namespace Components { "class"?: string; "dataTestId"?: string; "scope": 'receiver' | 'sender'; + /** + * @default false + */ "showLockedAccounts": boolean; } interface MvxTransactionAccountName { @@ -293,10 +371,19 @@ export namespace Components { } interface MvxTransactionToast { "fullWidth"?: boolean; + /** + * @default '' + */ "processedTransactionsStatus": string | JSX.Element; "toastDataState": IToastDataState; + /** + * @default '' + */ "toastId": string; "transactionProgressState"?: ITransactionProgressState; + /** + * @default [] + */ "transactions": ITransactionListItem[]; "wrapperClass": string; } @@ -307,6 +394,9 @@ export namespace Components { "transactions": ITransactionListItem[]; } interface MvxTransactionToastDetails { + /** + * @default 5 + */ "maxShownTransactions": number; "processedTransactionsStatus"?: string | JSX.Element; "transactionClass": string; @@ -317,6 +407,9 @@ export namespace Components { "index": string; "link": string; "status"?: string; + /** + * @default 'transaction-details-list-item' + */ "transactionClass"?: string; } interface MvxTransactionToastProgress { @@ -356,6 +449,9 @@ export namespace Components { } interface MvxUnlockPanelGroup { "class"?: string; + /** + * @default [] + */ "providers": IProviderBase[]; } interface MvxUnlockProviderButton { @@ -363,8 +459,14 @@ export namespace Components { "provider": IProviderBase; } interface MvxWalletConnect { + /** + * @default { wcURI: '' } + */ "data": IWalletConnectPanelData; "getEventBus": () => Promise; + /** + * @default '' + */ "qrCodeSvg": string; } interface MvxWalletConnectAppGalleryIcon { @@ -381,7 +483,13 @@ export namespace Components { } interface MvxWalletConnectScan { "class"?: string; + /** + * @default '' + */ "qrCodeSvg": string; + /** + * @default '' + */ "walletConnectDeepLink"?: string; } interface MvxWalletProviderIcon { @@ -390,6 +498,9 @@ export namespace Components { interface MvxXaliasProviderIcon { } interface MvxXportalDownloadQrIcon { + /** + * @default '' + */ "class"?: string; } interface MvxXportalQrCodePreloader { @@ -1287,8 +1398,14 @@ declare namespace LocalJSX { interface MvxCloseIcon { } interface MvxCopyButton { + /** + * @default 'copy-button' + */ "class"?: string; "copyIcon"?: IconDefinition | string; + /** + * @default 'copy-button-icon' + */ "iconClass"?: string; "successIcon"?: IconDefinition | string; "text"?: string; @@ -1315,6 +1432,9 @@ declare namespace LocalJSX { "width"?: number; } interface MvxFaIcon { + /** + * @default 'fa-icon' + */ "class"?: string; "description"?: string; "icon"?: IconDefinition | string; @@ -1326,6 +1446,9 @@ declare namespace LocalJSX { "isValid"?: boolean; "label"?: string; "labelClass"?: string; + /** + * @default true + */ "showLabel"?: boolean; "valueDecimal"?: string; "valueInteger"?: string; @@ -1338,6 +1461,9 @@ declare namespace LocalJSX { "confirmScreenData"?: IConfirmScreenData; } interface MvxLedgerConnect { + /** + * @default { accountScreenData: null, confirmScreenData: null, connectScreenData: {}, } + */ "data"?: ILedgerConnectPanelData; } interface MvxLedgerIcon { @@ -1345,6 +1471,9 @@ declare namespace LocalJSX { } interface MvxLedgerIntro { "connectScreenData"?: IConnectScreenData; + /** + * @default false + */ "isAwaiting"?: boolean; "onConnect"?: (event: MvxLedgerIntroCustomEvent) => void; } @@ -1364,15 +1493,27 @@ declare namespace LocalJSX { } interface MvxPagination { "class"?: string; + /** + * @default 1 + */ "currentPage"?: number; + /** + * @default false + */ "isDisabled"?: boolean; "onPageChange"?: (event: MvxPaginationCustomEvent) => void; "totalPages"?: number; } interface MvxPaginationEllipsis { + /** + * @default false + */ "isActive"?: boolean; } interface MvxPaginationEllipsisForm { + /** + * @default false + */ "isVisible"?: boolean; "maxPageToSearchFor"?: number; "onSearch"?: (event: MvxPaginationEllipsisFormCustomEvent) => void; @@ -1389,23 +1530,44 @@ declare namespace LocalJSX { "class"?: string; } interface MvxProviderIdleScreen { + /** + * @default '' + */ "introText"?: string; + /** + * @default 'Requesting Connection' + */ "introTitle"?: string; "onAccess"?: (event: MvxProviderIdleScreenCustomEvent) => void; "onClose"?: (event: MvxProviderIdleScreenCustomEvent) => void; + /** + * @default null + */ "provider"?: IProviderBase | null; } interface MvxSidePanel { "hasBackButton"?: boolean; + /** + * @default false + */ "isOpen"?: boolean; "onBack"?: (event: MvxSidePanelCustomEvent) => void; "onClose"?: (event: MvxSidePanelCustomEvent) => void; "panelClassName"?: string; "panelTitle"?: string; + /** + * @default true + */ "showHeader"?: boolean; } interface MvxSidePanelHeader { + /** + * @default true + */ "hasLeftButton"?: boolean; + /** + * @default true + */ "hasRightButton"?: boolean; "onLeftButtonClick"?: (event: MvxSidePanelHeaderCustomEvent) => void; "onRightButtonClick"?: (event: MvxSidePanelHeaderCustomEvent) => void; @@ -1415,7 +1577,13 @@ declare namespace LocalJSX { interface MvxSidePanelSwiper { "onSheetDismiss"?: (event: MvxSidePanelSwiperCustomEvent) => void; "onSheetSnapChange"?: (event: MvxSidePanelSwiperCustomEvent<{ index: number; snapPoint: string }>) => void; + /** + * @default false + */ "open"?: boolean; + /** + * @default '' + */ "sidePanelIdentifier"?: string; } interface MvxSignTransactionsAdvanced { @@ -1427,7 +1595,13 @@ declare namespace LocalJSX { "highlight"?: string; } interface MvxSignTransactionsAdvancedDataDecode { + /** + * @default DecodeMethodEnum.decimal + */ "currentDecodeMethod"?: DecodeMethodEnum; + /** + * @default false + */ "isToggled"?: boolean; } interface MvxSignTransactionsFooter { @@ -1440,7 +1614,13 @@ declare namespace LocalJSX { "identifier"?: string; "interactor"?: string; "interactorIconUrl"?: string; + /** + * @default false + */ "isApp"?: boolean; + /** + * @default '~$0.00078' + */ "networkFee"?: string; "tokenIconUrl"?: string; "usdValue"?: string; @@ -1468,8 +1648,14 @@ declare namespace LocalJSX { interface MvxTooltip { "class"?: string; "onTriggerRender"?: (event: MvxTooltipCustomEvent) => void; + /** + * @default 'top' + */ "position"?: 'top' | 'bottom'; "trigger"?: HTMLElement; + /** + * @default false + */ "triggerOnClick"?: boolean; } interface MvxTransactionAccount { @@ -1477,6 +1663,9 @@ declare namespace LocalJSX { "class"?: string; "dataTestId"?: string; "scope"?: 'receiver' | 'sender'; + /** + * @default false + */ "showLockedAccounts"?: boolean; } interface MvxTransactionAccountName { @@ -1522,10 +1711,19 @@ declare namespace LocalJSX { interface MvxTransactionToast { "fullWidth"?: boolean; "onDeleteToast"?: (event: MvxTransactionToastCustomEvent) => void; + /** + * @default '' + */ "processedTransactionsStatus"?: string | JSX.Element; "toastDataState"?: IToastDataState; + /** + * @default '' + */ "toastId"?: string; "transactionProgressState"?: ITransactionProgressState; + /** + * @default [] + */ "transactions"?: ITransactionListItem[]; "wrapperClass"?: string; } @@ -1537,6 +1735,9 @@ declare namespace LocalJSX { "transactions"?: ITransactionListItem[]; } interface MvxTransactionToastDetails { + /** + * @default 5 + */ "maxShownTransactions"?: number; "processedTransactionsStatus"?: string | JSX.Element; "transactionClass"?: string; @@ -1547,6 +1748,9 @@ declare namespace LocalJSX { "index"?: string; "link"?: string; "status"?: string; + /** + * @default 'transaction-details-list-item' + */ "transactionClass"?: string; } interface MvxTransactionToastProgress { @@ -1585,6 +1789,9 @@ declare namespace LocalJSX { interface MvxUnlockPanelGroup { "class"?: string; "onLogin"?: (event: MvxUnlockPanelGroupCustomEvent) => void; + /** + * @default [] + */ "providers"?: IProviderBase[]; } interface MvxUnlockProviderButton { @@ -1592,7 +1799,13 @@ declare namespace LocalJSX { "provider"?: IProviderBase; } interface MvxWalletConnect { + /** + * @default { wcURI: '' } + */ "data"?: IWalletConnectPanelData; + /** + * @default '' + */ "qrCodeSvg"?: string; } interface MvxWalletConnectAppGalleryIcon { @@ -1610,7 +1823,13 @@ declare namespace LocalJSX { interface MvxWalletConnectScan { "class"?: string; "onDownloadClick"?: (event: MvxWalletConnectScanCustomEvent) => void; + /** + * @default '' + */ "qrCodeSvg"?: string; + /** + * @default '' + */ "walletConnectDeepLink"?: string; } interface MvxWalletProviderIcon { @@ -1619,6 +1838,9 @@ declare namespace LocalJSX { interface MvxXaliasProviderIcon { } interface MvxXportalDownloadQrIcon { + /** + * @default '' + */ "class"?: string; } interface MvxXportalQrCodePreloader { diff --git a/src/components/common/provider-idle-screen/provider-idle-screen.tsx b/src/components/common/provider-idle-screen/provider-idle-screen.tsx index 8c8767b8..e7cc7610 100644 --- a/src/components/common/provider-idle-screen/provider-idle-screen.tsx +++ b/src/components/common/provider-idle-screen/provider-idle-screen.tsx @@ -3,6 +3,7 @@ import { Component, Event, Fragment, h, Prop } from '@stencil/core'; import { getProviderButtonIcon } from 'components/functional/unlock-panel/helpers'; import type { IProviderBase } from 'types/provider.types'; import { ProviderTypeEnum } from 'types/provider.types'; +import { isFirefox } from 'utils/isFirefox'; const getProviderIntroText = (providerType?: IProviderBase['type']) => { switch (providerType) { @@ -71,7 +72,7 @@ export class ProviderIdleScreen { />
- {isExtensionProvider ? ( + {isExtensionProvider && !isFirefox() ? (
diff --git a/src/components/functional/toasts-list/components/transaction-toast/components/transaction-toast-content/transaction-toast-content.scss b/src/components/functional/toasts-list/components/transaction-toast/components/transaction-toast-content/transaction-toast-content.scss index 6059ef78..3aa195db 100644 --- a/src/components/functional/toasts-list/components/transaction-toast/components/transaction-toast-content/transaction-toast-content.scss +++ b/src/components/functional/toasts-list/components/transaction-toast/components/transaction-toast-content/transaction-toast-content.scss @@ -24,6 +24,10 @@ .transaction-toast-icon { @apply mvx:rounded-full mvx:w-5 mvx:h-5; + &.transaction-toast-icon-failed { + color: var(--mvx-error-color); + } + svg, img, .svg-inline--fa { @@ -52,6 +56,14 @@ @apply mvx:flex mvx:text-sm mvx:font-medium mvx:leading-4 mvx:tracking-tight; color: var(--mvx-text-color-primary); + &.amount-positive { + color: var(--mvx-success-color); + } + + &.transaction-toast-failed { + color: var(--mvx-error-color); + } + .transaction-amount-decimal { @apply mvx:opacity-70; } diff --git a/src/components/functional/toasts-list/components/transaction-toast/components/transaction-toast-content/transaction-toast-content.tsx b/src/components/functional/toasts-list/components/transaction-toast/components/transaction-toast-content/transaction-toast-content.tsx index ec52b2d7..c818b0a3 100644 --- a/src/components/functional/toasts-list/components/transaction-toast/components/transaction-toast-content/transaction-toast-content.tsx +++ b/src/components/functional/toasts-list/components/transaction-toast/components/transaction-toast-content/transaction-toast-content.tsx @@ -1,6 +1,7 @@ import { faTimes } from '@fortawesome/free-solid-svg-icons'; import type { EventEmitter, JSX } from '@stencil/core'; import { Component, Event, h, Prop } from '@stencil/core'; +import classNames from 'classnames'; import { IconSizeEnumType } from 'components/common/transaction-asset-icon/transaction-asset-icon'; import { getAmountParts } from 'components/functional/toasts-list/helpers'; import type { ITransactionListItem } from 'components/visual/transaction-list-item/transaction-list-item.types'; @@ -46,7 +47,11 @@ export class TransactionToastContent { class={`transaction-toast-icon ${this.toastDataState.iconClassName ?? ''}`} > ) : ( -
+
)} @@ -62,7 +67,11 @@ export class TransactionToastContent { {showAmount && ( { switch (providerType) { case ProviderTypeEnum.extension: - return ; + return isFirefox() ? : ; case ProviderTypeEnum.metamask: return ; case ProviderTypeEnum.passkey: diff --git a/src/components/visual/transaction-list-item/transaction-list-item.scss b/src/components/visual/transaction-list-item/transaction-list-item.scss index 3462aa98..0b597563 100644 --- a/src/components/visual/transaction-list-item/transaction-list-item.scss +++ b/src/components/visual/transaction-list-item/transaction-list-item.scss @@ -16,6 +16,10 @@ @apply mvx:w-8 mvx:h-8 mvx:rounded-full; color: var(--mvx-text-color-primary); + &.transaction-icon-failed { + color: var(--mvx-error-color); + } + img { @apply mvx:w-full mvx:h-full mvx:object-cover; } diff --git a/src/components/visual/transaction-list-item/transaction-list-item.tsx b/src/components/visual/transaction-list-item/transaction-list-item.tsx index 98032834..c9e52f4f 100644 --- a/src/components/visual/transaction-list-item/transaction-list-item.tsx +++ b/src/components/visual/transaction-list-item/transaction-list-item.tsx @@ -21,7 +21,11 @@ export class TransactionListItem { return (
-
+
diff --git a/src/utils/isFirefox.ts b/src/utils/isFirefox.ts index ac53697d..a91b6e5e 100644 --- a/src/utils/isFirefox.ts +++ b/src/utils/isFirefox.ts @@ -1 +1,3 @@ -export const isFirefox = () => navigator.userAgent.match('Firefox'); +import { safeWindow } from 'constants/window.constants'; + +export const isFirefox = () => safeWindow?.navigator?.userAgent.match('Firefox');