@gearbox-protocol/ui-kit 3.14.0-next.14 → 3.14.0-next.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -0
  2. package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountPair.cjs +1 -0
  3. package/dist/cjs/components/composites/tx-preview/confirm/amounts/constants.cjs +1 -0
  4. package/dist/cjs/components/composites/tx-preview/confirm/amounts/formatUsdAmount.cjs +1 -0
  5. package/dist/cjs/components/composites/tx-preview/confirm/amounts/index.cjs +1 -0
  6. package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.cjs +1 -1
  7. package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.cjs +1 -0
  8. package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.cjs +1 -0
  9. package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.constants.cjs +1 -0
  10. package/dist/cjs/components/composites/tx-preview/confirm/dialog/computeTransactionConfirmDialogLayout.cjs +1 -0
  11. package/dist/cjs/components/composites/tx-preview/confirm/dialog/constants.cjs +1 -1
  12. package/dist/cjs/components/composites/tx-preview/confirm/dialog/index.cjs +1 -1
  13. package/dist/cjs/components/composites/tx-preview/confirm/dialog/transactionConfirmPhase.cjs +1 -0
  14. package/dist/cjs/components/composites/tx-preview/confirm/dialog/useTransactionConfirmFlow.cjs +1 -0
  15. package/dist/cjs/components/composites/tx-preview/confirm/execution/TransactionConfirmExecuteButton.cjs +1 -0
  16. package/dist/cjs/components/composites/tx-preview/confirm/execution/index.cjs +1 -0
  17. package/dist/cjs/components/composites/tx-preview/confirm/index.cjs +1 -1
  18. package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.cjs +1 -0
  19. package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessIcon.cjs +1 -0
  20. package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.cjs +1 -0
  21. package/dist/cjs/components/composites/tx-preview/confirm/result/TransactionConfirmTxHashRow.cjs +1 -0
  22. package/dist/cjs/components/composites/tx-preview/confirm/result/constants.cjs +1 -0
  23. package/dist/cjs/components/composites/tx-preview/confirm/result/index.cjs +1 -0
  24. package/dist/cjs/components/composites/tx-preview/confirm/stepper/TransactionProgressStepper.cjs +1 -0
  25. package/dist/cjs/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.cjs +1 -1
  26. package/dist/cjs/components/composites/tx-preview/confirm/stepper/constants.cjs +1 -1
  27. package/dist/cjs/components/composites/tx-preview/confirm/stepper/index.cjs +1 -1
  28. package/dist/cjs/components/composites/tx-preview/confirm/stepper/useCompletedStepsInSession.cjs +1 -1
  29. package/dist/cjs/components/composites/tx-preview/confirm/summary/PoolOperationConfirmDetails.cjs +1 -0
  30. package/dist/cjs/components/composites/tx-preview/confirm/summary/constants.cjs +1 -1
  31. package/dist/cjs/components/composites/tx-preview/confirm/summary/index.cjs +1 -1
  32. package/dist/cjs/components/composites/tx-preview/index.cjs +1 -1
  33. package/dist/cjs/components/confirm-menu/confirm-menu.cjs +1 -1
  34. package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +63 -0
  35. package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountPair.js +52 -0
  36. package/dist/esm/components/composites/tx-preview/confirm/amounts/constants.js +10 -0
  37. package/dist/esm/components/composites/tx-preview/confirm/amounts/formatUsdAmount.js +21 -0
  38. package/dist/esm/components/composites/tx-preview/confirm/amounts/index.js +9 -0
  39. package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.js +34 -51
  40. package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.js +70 -0
  41. package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.constants.js +6 -0
  42. package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.js +79 -0
  43. package/dist/esm/components/composites/tx-preview/confirm/dialog/computeTransactionConfirmDialogLayout.js +35 -0
  44. package/dist/esm/components/composites/tx-preview/confirm/dialog/constants.js +10 -5
  45. package/dist/esm/components/composites/tx-preview/confirm/dialog/index.js +18 -7
  46. package/dist/esm/components/composites/tx-preview/confirm/dialog/transactionConfirmPhase.js +1 -0
  47. package/dist/esm/components/composites/tx-preview/confirm/dialog/useTransactionConfirmFlow.js +36 -0
  48. package/dist/esm/components/composites/tx-preview/confirm/execution/TransactionConfirmExecuteButton.js +30 -0
  49. package/dist/esm/components/composites/tx-preview/confirm/execution/index.js +4 -0
  50. package/dist/esm/components/composites/tx-preview/confirm/index.js +60 -24
  51. package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.js +55 -0
  52. package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessIcon.js +25 -0
  53. package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.js +60 -0
  54. package/dist/esm/components/composites/tx-preview/confirm/result/TransactionConfirmTxHashRow.js +21 -0
  55. package/dist/esm/components/composites/tx-preview/confirm/result/constants.js +24 -0
  56. package/dist/esm/components/composites/tx-preview/confirm/result/index.js +15 -0
  57. package/dist/esm/components/composites/tx-preview/confirm/stepper/TransactionProgressStepper.js +67 -0
  58. package/dist/esm/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.js +26 -18
  59. package/dist/esm/components/composites/tx-preview/confirm/stepper/constants.js +3 -3
  60. package/dist/esm/components/composites/tx-preview/confirm/stepper/index.js +12 -9
  61. package/dist/esm/components/composites/tx-preview/confirm/stepper/useCompletedStepsInSession.js +37 -31
  62. package/dist/esm/components/composites/tx-preview/confirm/summary/PoolOperationConfirmDetails.js +65 -0
  63. package/dist/esm/components/composites/tx-preview/confirm/summary/constants.js +3 -3
  64. package/dist/esm/components/composites/tx-preview/confirm/summary/index.js +4 -4
  65. package/dist/esm/components/composites/tx-preview/index.js +106 -70
  66. package/dist/esm/components/confirm-menu/confirm-menu.js +28 -25
  67. package/dist/globals.css +1 -1
  68. package/dist/types/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.d.ts +12 -0
  69. package/dist/types/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountPair.d.ts +15 -0
  70. package/dist/types/components/composites/tx-preview/confirm/amounts/constants.d.ts +6 -0
  71. package/dist/types/components/composites/tx-preview/confirm/amounts/formatUsdAmount.d.ts +1 -0
  72. package/dist/types/components/composites/tx-preview/confirm/amounts/index.d.ts +3 -0
  73. package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmDialogView.d.ts +9 -4
  74. package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmPageView.d.ts +23 -0
  75. package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.constants.d.ts +3 -0
  76. package/dist/types/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.d.ts +19 -0
  77. package/dist/types/components/composites/tx-preview/confirm/dialog/computeTransactionConfirmDialogLayout.d.ts +8 -0
  78. package/dist/types/components/composites/tx-preview/confirm/dialog/constants.d.ts +5 -1
  79. package/dist/types/components/composites/tx-preview/confirm/dialog/index.d.ts +6 -0
  80. package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmPhase.d.ts +4 -0
  81. package/dist/types/components/composites/tx-preview/confirm/dialog/useTransactionConfirmFlow.d.ts +14 -0
  82. package/dist/types/components/composites/tx-preview/confirm/execution/TransactionConfirmExecuteButton.d.ts +6 -0
  83. package/dist/types/components/composites/tx-preview/confirm/execution/index.d.ts +1 -0
  84. package/dist/types/components/composites/tx-preview/confirm/index.d.ts +3 -0
  85. package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmFailureResult.d.ts +8 -0
  86. package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessIcon.d.ts +2 -0
  87. package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmSuccessResult.d.ts +8 -0
  88. package/dist/types/components/composites/tx-preview/confirm/result/TransactionConfirmTxHashRow.d.ts +6 -0
  89. package/dist/types/components/composites/tx-preview/confirm/result/constants.d.ts +18 -0
  90. package/dist/types/components/composites/tx-preview/confirm/result/index.d.ts +5 -0
  91. package/dist/types/components/composites/tx-preview/confirm/stepper/{HorizontalTransactionStepper.d.ts → TransactionProgressStepper.d.ts} +2 -2
  92. package/dist/types/components/composites/tx-preview/confirm/stepper/computeTransactionExecutionSteps.d.ts +2 -0
  93. package/dist/types/components/composites/tx-preview/confirm/stepper/constants.d.ts +1 -1
  94. package/dist/types/components/composites/tx-preview/confirm/stepper/index.d.ts +1 -1
  95. package/dist/types/components/composites/tx-preview/confirm/stepper/useCompletedStepsInSession.d.ts +3 -1
  96. package/dist/types/components/composites/tx-preview/confirm/summary/PoolOperationConfirmDetails.d.ts +15 -0
  97. package/dist/types/components/composites/tx-preview/confirm/summary/constants.d.ts +1 -1
  98. package/dist/types/components/composites/tx-preview/confirm/summary/index.d.ts +1 -1
  99. package/dist/types/components/confirm-menu/confirm-menu.d.ts +4 -2
  100. package/package.json +1 -1
  101. package/dist/cjs/components/composites/tx-preview/confirm/stepper/HorizontalTransactionStepper.cjs +0 -1
  102. package/dist/cjs/components/composites/tx-preview/confirm/summary/PoolOperationConfirmSummary.cjs +0 -1
  103. package/dist/esm/components/composites/tx-preview/confirm/stepper/HorizontalTransactionStepper.js +0 -136
  104. package/dist/esm/components/composites/tx-preview/confirm/summary/PoolOperationConfirmSummary.js +0 -92
  105. package/dist/types/components/composites/tx-preview/confirm/summary/PoolOperationConfirmSummary.d.ts +0 -18
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { TokenFullData } from '../../../../../types/common';
3
+ export interface TransactionConfirmAmountFieldProps {
4
+ readonly label: React.ReactNode;
5
+ readonly amount: string;
6
+ readonly token?: Omit<TokenFullData, "address">;
7
+ readonly usdPrice?: number;
8
+ readonly loading?: boolean;
9
+ readonly position: "primary" | "receive";
10
+ readonly size?: "sm" | "md";
11
+ }
12
+ export declare function TransactionConfirmAmountField({ label, amount, token, usdPrice, loading, position, size, }: TransactionConfirmAmountFieldProps): React.ReactElement;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ import { TokenFullData } from '../../../../../types/common';
3
+ export interface TransactionConfirmAmountPairProps {
4
+ readonly primaryLabel: React.ReactNode;
5
+ readonly primaryAmount: string;
6
+ readonly primaryToken?: Omit<TokenFullData, "address">;
7
+ readonly primaryUsdPrice?: number;
8
+ readonly receiveLabel: React.ReactNode;
9
+ readonly receiveAmount: string;
10
+ readonly receiveToken?: Omit<TokenFullData, "address">;
11
+ readonly receiveUsdPrice?: number;
12
+ readonly loading?: boolean;
13
+ readonly size?: "sm" | "md";
14
+ }
15
+ export declare function TransactionConfirmAmountPair({ primaryLabel, primaryAmount, primaryToken, primaryUsdPrice, receiveLabel, receiveAmount, receiveToken, receiveUsdPrice, loading, size, }: TransactionConfirmAmountPairProps): React.ReactElement;
@@ -0,0 +1,6 @@
1
+ export declare class TransactionConfirmAmountFieldTest {
2
+ static root: string;
3
+ }
4
+ export declare class TransactionConfirmAmountPairTest {
5
+ static root: string;
6
+ }
@@ -0,0 +1 @@
1
+ export declare function formatUsdAmount(amount: string, usdPrice: number): string | null;
@@ -0,0 +1,3 @@
1
+ export * from './constants';
2
+ export * from './TransactionConfirmAmountField';
3
+ export * from './TransactionConfirmAmountPair';
@@ -1,15 +1,20 @@
1
1
  import { default as React } from 'react';
2
- import { TransactionExecutionStepView } from '../stepper';
2
+ import { TransactionExecutionStepView } from '../stepper/computeTransactionExecutionSteps';
3
+ import { TransactionConfirmPhase } from './transactionConfirmPhase';
3
4
  export interface TransactionConfirmDialogViewProps {
4
5
  readonly open: boolean;
5
6
  readonly onClose: () => void;
7
+ readonly phase?: TransactionConfirmPhase;
6
8
  readonly title: React.ReactNode;
9
+ readonly titleAddon?: React.ReactNode;
7
10
  readonly preview: React.ReactNode;
8
11
  readonly previewLoading?: boolean;
9
12
  readonly previewError?: Error | null;
10
13
  readonly previewErrorTitle?: string;
11
14
  readonly execution: React.ReactNode;
12
- readonly steps: ReadonlyArray<TransactionExecutionStepView>;
13
- readonly renderStepLabel: (step: TransactionExecutionStepView) => React.ReactNode;
15
+ readonly progressSteps?: ReadonlyArray<TransactionExecutionStepView>;
16
+ readonly renderProgressStepLabel?: (step: TransactionExecutionStepView) => React.ReactNode;
17
+ readonly result?: React.ReactNode;
18
+ readonly hideTitleAddonOnResult?: boolean;
14
19
  }
15
- export declare function TransactionConfirmDialogView({ open, onClose, title, preview, previewLoading, previewError, previewErrorTitle, execution, steps, renderStepLabel, }: TransactionConfirmDialogViewProps): React.ReactElement | null;
20
+ export declare function TransactionConfirmDialogView({ open, onClose, phase, title, titleAddon, preview, previewLoading, previewError, previewErrorTitle, execution, progressSteps, renderProgressStepLabel, result, hideTitleAddonOnResult, }: TransactionConfirmDialogViewProps): React.ReactElement | null;
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ import { TransactionExecutionStepView } from '../stepper/computeTransactionExecutionSteps';
3
+ import { TransactionConfirmPhase } from './transactionConfirmPhase';
4
+ export interface TransactionConfirmPageViewProps {
5
+ readonly phase?: TransactionConfirmPhase;
6
+ readonly onClose?: () => void;
7
+ readonly title: React.ReactNode;
8
+ readonly titleAddon?: React.ReactNode;
9
+ readonly preview: React.ReactNode;
10
+ readonly previewLoading?: boolean;
11
+ readonly previewError?: Error | null;
12
+ readonly previewErrorTitle?: string;
13
+ readonly previewClassName?: string;
14
+ readonly execution: React.ReactNode;
15
+ readonly progressSteps?: ReadonlyArray<TransactionExecutionStepView>;
16
+ readonly renderProgressStepLabel?: (step: TransactionExecutionStepView) => React.ReactNode;
17
+ readonly result?: React.ReactNode;
18
+ readonly hideTitleAddonOnResult?: boolean;
19
+ readonly containerClassName?: string;
20
+ readonly containerTestId?: string;
21
+ readonly shellTestId?: string;
22
+ }
23
+ export declare function TransactionConfirmPageView({ onClose, phase, title, titleAddon, preview, previewLoading, previewError, previewErrorTitle, previewClassName, execution, progressSteps, renderProgressStepLabel, result, hideTitleAddonOnResult, containerClassName, containerTestId, shellTestId, }: TransactionConfirmPageViewProps): React.ReactElement;
@@ -0,0 +1,3 @@
1
+ export declare class TransactionConfirmShellTest {
2
+ static root: string;
3
+ }
@@ -0,0 +1,19 @@
1
+ import { default as React } from 'react';
2
+ import { TransactionExecutionStepView } from '../stepper/computeTransactionExecutionSteps';
3
+ import { TransactionConfirmPhase } from './transactionConfirmPhase';
4
+ export interface TransactionConfirmShellProps {
5
+ readonly phase?: TransactionConfirmPhase;
6
+ readonly header?: React.ReactNode;
7
+ readonly preview: React.ReactNode;
8
+ readonly previewLoading?: boolean;
9
+ readonly previewError?: Error | null;
10
+ readonly previewErrorTitle?: string;
11
+ readonly previewClassName?: string;
12
+ readonly execution: React.ReactNode;
13
+ readonly progressSteps?: ReadonlyArray<TransactionExecutionStepView>;
14
+ readonly renderProgressStepLabel?: (step: TransactionExecutionStepView) => React.ReactNode;
15
+ readonly result?: React.ReactNode;
16
+ readonly className?: string;
17
+ readonly "data-testid"?: string;
18
+ }
19
+ export declare function TransactionConfirmShell({ phase, header, preview, previewLoading, previewError, previewErrorTitle, previewClassName, execution, progressSteps, renderProgressStepLabel, result, className, "data-testid": dataTestId, }: TransactionConfirmShellProps): React.ReactElement;
@@ -0,0 +1,8 @@
1
+ import { TransactionConfirmPhase } from './transactionConfirmPhase';
2
+ export interface TransactionConfirmDialogLayout {
3
+ readonly showPreview: boolean;
4
+ readonly showExecution: boolean;
5
+ readonly showProgressStepper: boolean;
6
+ readonly showResult: boolean;
7
+ }
8
+ export declare function computeTransactionConfirmDialogLayout(phase: TransactionConfirmPhase, hasProgressSteps: boolean): TransactionConfirmDialogLayout;
@@ -1,7 +1,11 @@
1
1
  export declare class TransactionConfirmDialogTest {
2
2
  static root: string;
3
3
  static execution: string;
4
+ static progress: string;
5
+ static result: string;
4
6
  }
5
- /** Mobile-first: full width on mobile, fixed 560px from md up. */
7
+ /** Outer dialog card: mobile-first full width, fixed 560px from md up. */
6
8
  export declare const transactionConfirmDialogShellVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
9
+ /** Inner shell content: fill the padded dialog container without re-applying width. */
10
+ export declare const transactionConfirmShellContentVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
7
11
  export type TransactionConfirmAuthPhase = "agreement" | "awaiting_signature" | "blocked" | "ready";
@@ -1,3 +1,9 @@
1
+ export * from './computeTransactionConfirmDialogLayout';
1
2
  export * from './constants';
2
3
  export * from './TransactionConfirmDialogView';
4
+ export * from './TransactionConfirmPageView';
5
+ export * from './TransactionConfirmShell';
6
+ export * from './TransactionConfirmShell.constants';
7
+ export * from './transactionConfirmPhase';
3
8
  export * from './useTransactionConfirmDialog';
9
+ export * from './useTransactionConfirmFlow';
@@ -0,0 +1,4 @@
1
+ export type TransactionConfirmPhase = "confirm" | "awaiting_receipt" | "success" | "failure";
2
+ export interface TransactionConfirmSubmittedTx {
3
+ readonly hash: `0x${string}`;
4
+ }
@@ -0,0 +1,14 @@
1
+ import { TransactionConfirmPhase, TransactionConfirmSubmittedTx } from './transactionConfirmPhase';
2
+ export interface UseTransactionConfirmFlowReturn {
3
+ readonly open: boolean;
4
+ readonly phase: TransactionConfirmPhase;
5
+ readonly submittedTx: TransactionConfirmSubmittedTx | undefined;
6
+ readonly refreshNonce: number;
7
+ readonly openDialog: () => void;
8
+ readonly closeDialog: () => void;
9
+ readonly bumpRefreshNonce: () => void;
10
+ readonly beginAwaitingReceipt: (tx: TransactionConfirmSubmittedTx) => void;
11
+ readonly markSuccess: () => void;
12
+ readonly markFailure: () => void;
13
+ }
14
+ export declare function useTransactionConfirmFlow(): UseTransactionConfirmFlowReturn;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ import { ButtonProps } from '../../../../buttons/button/button';
3
+ export interface TransactionConfirmExecuteButtonProps extends ButtonProps {
4
+ readonly isLoading?: boolean;
5
+ }
6
+ export declare function TransactionConfirmExecuteButton({ isLoading, disabled, children, width, size, ...rest }: TransactionConfirmExecuteButtonProps): React.ReactElement;
@@ -0,0 +1 @@
1
+ export * from './TransactionConfirmExecuteButton';
@@ -1,5 +1,8 @@
1
+ export * from './amounts';
1
2
  export * from './dialog';
3
+ export * from './execution';
2
4
  export * from './hooks';
3
5
  export * from './preview';
6
+ export * from './result';
4
7
  export * from './stepper';
5
8
  export * from './summary';
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface TransactionConfirmFailureResultProps {
3
+ readonly title: React.ReactNode;
4
+ readonly description: React.ReactNode;
5
+ readonly footerAction?: React.ReactNode;
6
+ readonly iconSize?: number;
7
+ }
8
+ export declare function TransactionConfirmFailureResult({ title, description, footerAction, iconSize, }: TransactionConfirmFailureResultProps): React.ReactElement;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare function TransactionConfirmSuccessIcon(): React.ReactElement;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface TransactionConfirmSuccessResultProps {
3
+ readonly headline: React.ReactNode;
4
+ readonly subtitle: React.ReactNode;
5
+ readonly txHashRow?: React.ReactNode;
6
+ readonly footerAction?: React.ReactNode;
7
+ }
8
+ export declare function TransactionConfirmSuccessResult({ headline, subtitle, txHashRow, footerAction, }: TransactionConfirmSuccessResultProps): React.ReactElement;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface TransactionConfirmTxHashRowProps {
3
+ readonly txHashLink: React.ReactNode;
4
+ readonly addToWalletLink?: React.ReactNode;
5
+ }
6
+ export declare function TransactionConfirmTxHashRow({ txHashLink, addToWalletLink, }: TransactionConfirmTxHashRowProps): React.ReactElement;
@@ -0,0 +1,18 @@
1
+ export declare class TransactionConfirmSuccessResultTest {
2
+ static root: string;
3
+ static headline: string;
4
+ static subtitle: string;
5
+ static footer: string;
6
+ }
7
+ export declare class TransactionConfirmFailureResultTest {
8
+ static root: string;
9
+ static footer: string;
10
+ }
11
+ export declare class TransactionConfirmTxHashRowTest {
12
+ static root: string;
13
+ static txHashLink: string;
14
+ static addToWallet: string;
15
+ }
16
+ export declare class TransactionConfirmExecuteButtonTest {
17
+ static root: string;
18
+ }
@@ -0,0 +1,5 @@
1
+ export * from './constants';
2
+ export * from './TransactionConfirmFailureResult';
3
+ export * from './TransactionConfirmSuccessIcon';
4
+ export * from './TransactionConfirmSuccessResult';
5
+ export * from './TransactionConfirmTxHashRow';
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { TransactionExecutionStepView } from './computeTransactionExecutionSteps';
3
- export interface HorizontalTransactionStepperProps {
3
+ export interface TransactionProgressStepperProps {
4
4
  readonly steps: ReadonlyArray<TransactionExecutionStepView>;
5
5
  readonly renderLabel: (step: TransactionExecutionStepView) => React.ReactNode;
6
6
  }
7
- export declare function HorizontalTransactionStepper({ steps, renderLabel, }: HorizontalTransactionStepperProps): React.ReactElement;
7
+ export declare function TransactionProgressStepper({ steps, renderLabel, }: TransactionProgressStepperProps): React.ReactElement;
@@ -22,7 +22,9 @@ export interface TransactionExecutionStepView {
22
22
  status: StepStatus;
23
23
  }
24
24
  export declare function getTransactionExecutionStepRequirements(input: Pick<TransactionExecutionStepInput, "needsApproval" | "allowWalletBatching" | "isAuthReady" | "isApprovalPending">): TransactionExecutionStepRequirements;
25
+ export declare function shouldShowTransactionProgressStepper(steps: ReadonlyArray<Pick<TransactionExecutionStepView, "id">>): boolean;
25
26
  export declare function computeTransactionExecutionSteps(input: TransactionExecutionStepInput): {
26
27
  steps: TransactionExecutionStepView[];
27
28
  activeStepId: TransactionExecutionStepId;
29
+ showProgressStepper: boolean;
28
30
  };
@@ -1,3 +1,3 @@
1
- export declare class TransactionStepperTest {
1
+ export declare class TransactionProgressStepperTest {
2
2
  static root: string;
3
3
  }
@@ -1,4 +1,4 @@
1
1
  export * from './computeTransactionExecutionSteps';
2
2
  export * from './constants';
3
- export * from './HorizontalTransactionStepper';
3
+ export * from './TransactionProgressStepper';
4
4
  export * from './useCompletedStepsInSession';
@@ -1,4 +1,6 @@
1
- import { TransactionExecutionPrerequisiteStepId } from './computeTransactionExecutionSteps';
1
+ import { TransactionExecutionPrerequisiteStepId, TransactionExecutionStepRequirements } from './computeTransactionExecutionSteps';
2
+ export declare function mergeStepsSeenInSession(prev: ReadonlyArray<TransactionExecutionPrerequisiteStepId>, requirements: TransactionExecutionStepRequirements): TransactionExecutionPrerequisiteStepId[];
3
+ export declare function mergeCompletedStepsInSession(prev: ReadonlyArray<TransactionExecutionPrerequisiteStepId>, stepsSeenInSession: ReadonlyArray<TransactionExecutionPrerequisiteStepId>, requirements: TransactionExecutionStepRequirements): TransactionExecutionPrerequisiteStepId[];
2
4
  export interface UseCompletedStepsInSessionInput {
3
5
  /** When false, session memory is cleared (e.g. confirm modal closed). */
4
6
  readonly sessionActive: boolean;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ export interface PoolOperationConfirmDetailsProps {
3
+ readonly apyLabel?: React.ReactNode;
4
+ readonly apy?: React.ReactNode;
5
+ readonly apyLoading?: boolean;
6
+ readonly poolTvlLabel: React.ReactNode;
7
+ readonly poolTvl: React.ReactNode;
8
+ readonly poolUtilizationLabel: React.ReactNode;
9
+ readonly poolUtilization: React.ReactNode;
10
+ readonly curatorLabel: React.ReactNode;
11
+ readonly curatorValue: React.ReactNode;
12
+ readonly poolLabel: React.ReactNode;
13
+ readonly poolContractValue: React.ReactNode;
14
+ }
15
+ export declare function PoolOperationConfirmDetails({ apyLabel, apy, apyLoading, poolTvlLabel, poolTvl, poolUtilizationLabel, poolUtilization, curatorLabel, curatorValue, poolLabel, poolContractValue, }: PoolOperationConfirmDetailsProps): React.ReactElement;
@@ -1,3 +1,3 @@
1
- export declare class PoolOperationConfirmSummaryTest {
1
+ export declare class PoolOperationConfirmDetailsTest {
2
2
  static root: string;
3
3
  }
@@ -1,2 +1,2 @@
1
1
  export * from './constants';
2
- export * from './PoolOperationConfirmSummary';
2
+ export * from './PoolOperationConfirmDetails';
@@ -2,8 +2,10 @@ import * as React from "react";
2
2
  export interface ConfirmMenuProps {
3
3
  /** Title text or element shown in the header */
4
4
  title: React.ReactNode;
5
- /** Callback when the close button is clicked */
6
- onClose: () => void;
5
+ /** Optional badge or addon rendered after the title (e.g. LP pill). */
6
+ titleAddon?: React.ReactNode;
7
+ /** Callback when the close button is clicked. Omit to hide the close control. */
8
+ onClose?: () => void;
7
9
  /** Additional CSS class applied to the root element */
8
10
  className?: string;
9
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "3.14.0-next.14",
3
+ "version": "3.14.0-next.15",
4
4
  "description": "Internal UI components",
5
5
  "repository": "https://github.com/gearbox-protocol/ui-kit",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");require("@gearbox-protocol/sdk");const s=require("../../../../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../../../utils/z-index.cjs");const x=require("./constants.cjs"),a=12,g=24,m=a+g;function f({status:t,stepNumber:i}){const r=t==="active";return t==="completed"?e.jsx("div",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-gray-40","aria-hidden":!0,children:e.jsxs("svg",{width:"12",height:"10",viewBox:"0 0 12 10",fill:"none",className:"text-gray-110",role:"img","aria-hidden":!0,children:[e.jsx("title",{children:"Completed step"}),e.jsx("path",{d:"M1 5L4.5 8.5L11 1.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}):e.jsx("div",{className:s.cn("flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",r?"bg-white text-gray-10":"bg-gray-40 text-gray-110"),"aria-hidden":!0,children:i})}function y({active:t}){return e.jsx("span",{className:s.cn("pointer-events-none absolute top-0 z-10 block h-full",t?"bg-gray-40":"bg-gray-10"),style:{right:-a,width:a,clipPath:"polygon(0 0, 100% 50%, 0 100%)"},"aria-hidden":!0})}function j({step:t,stepNumber:i,index:r,total:n,label:p}){const{status:u}=t,l=r===0,d=r===n-1,c=n===1,o=u==="active",h=l?g:m;return e.jsx("li",{className:s.cn("relative min-w-0 flex-1 list-none",!l&&"-ml-3"),style:{zIndex:n-r},"aria-current":o?"step":void 0,children:e.jsxs("div",{className:s.cn("relative flex min-h-12 w-full items-center gap-2 py-2.5 text-xs",o?"bg-gray-40 text-foreground":"bg-gray-10 text-gray-110",c&&"rounded-lg pr-6",!c&&l&&"rounded-l-lg pr-2",!c&&d&&"rounded-r-lg pr-6"),style:{paddingLeft:h},children:[e.jsx(f,{status:u,stepNumber:i}),e.jsx("span",{className:s.cn("min-w-0 truncate",o&&"font-bold"),children:p}),d?null:e.jsx(y,{active:o})]})})}function v({steps:t,renderLabel:i}){return e.jsx("ol",{className:"flex w-full list-none p-0 m-0","data-testid":x.TransactionStepperTest.root,children:t.map((r,n)=>e.jsx(j,{step:r,stepNumber:n+1,index:n,total:t.length,label:i(r)},r.id))})}exports.HorizontalTransactionStepper=v;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("@gearbox-protocol/sdk"),v=require("../../../../fadeout-loading/fadeout-loading.cjs"),y=require("../../../../tip-card/tip-card.cjs"),t=require("../../../../vertical-indicator/vertical-indicator.cjs"),C=require("../../../../vertical-list/vertical-list.cjs"),b=require("../../../../with-copy/with-copy.cjs"),f=require("./constants.cjs");function n({amount:o,symbol:i}){return e.jsxs("span",{children:[o," ",i]})}function q({primaryLabel:o,primaryAmount:i,primaryTokenSymbol:a,receiveLabel:l,receiveAmount:c,receiveTokenSymbol:m,apyLabel:u,apy:r,apyLoading:d=!1,curatorLabel:p,curatorName:x,poolLabel:j,poolAddress:s}){const _=h.shortAddress(s);return e.jsx(y.TipCard,{textColor:"light","data-testid":f.PoolOperationConfirmSummaryTest.root,children:e.jsxs(C.VerticalList,{children:[e.jsx(t.VerticalIndicator,{size:"sm",label:o,value:e.jsx(n,{amount:i,symbol:a})}),e.jsx(t.VerticalIndicator,{size:"sm",label:l,value:e.jsx(n,{amount:c,symbol:m})}),r!==void 0?e.jsx(t.VerticalIndicator,{size:"sm",label:u,value:e.jsx(v.FadeoutLoading,{loading:d,children:r})}):null,e.jsx(t.VerticalIndicator,{size:"sm",label:p,value:x}),e.jsx(t.VerticalIndicator,{size:"sm",label:j,value:e.jsx(b.WithCopy,{toCopy:s,children:e.jsx("span",{children:_})})})]})})}exports.PoolOperationConfirmSummary=q;
@@ -1,136 +0,0 @@
1
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
- import "react";
3
- import "@gearbox-protocol/sdk";
4
- import { cn as o } from "../../../../../utils/cn.js";
5
- import "sonner";
6
- import "@gearbox-protocol/sdk/common-utils";
7
- import "luxon";
8
- import "../../../../../utils/z-index.js";
9
- import { TransactionStepperTest as f } from "./constants.js";
10
- const c = 12, u = 24, y = c + u;
11
- function x({
12
- status: t,
13
- stepNumber: i
14
- }) {
15
- const r = t === "active";
16
- return t === "completed" ? /* @__PURE__ */ e(
17
- "div",
18
- {
19
- className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-gray-40",
20
- "aria-hidden": !0,
21
- children: /* @__PURE__ */ p(
22
- "svg",
23
- {
24
- width: "12",
25
- height: "10",
26
- viewBox: "0 0 12 10",
27
- fill: "none",
28
- className: "text-gray-110",
29
- role: "img",
30
- "aria-hidden": !0,
31
- children: [
32
- /* @__PURE__ */ e("title", { children: "Completed step" }),
33
- /* @__PURE__ */ e(
34
- "path",
35
- {
36
- d: "M1 5L4.5 8.5L11 1.5",
37
- stroke: "currentColor",
38
- strokeWidth: "2",
39
- strokeLinecap: "round",
40
- strokeLinejoin: "round"
41
- }
42
- )
43
- ]
44
- }
45
- )
46
- }
47
- ) : /* @__PURE__ */ e(
48
- "div",
49
- {
50
- className: o(
51
- "flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",
52
- r ? "bg-white text-gray-10" : "bg-gray-40 text-gray-110"
53
- ),
54
- "aria-hidden": !0,
55
- children: i
56
- }
57
- );
58
- }
59
- function v({ active: t }) {
60
- return /* @__PURE__ */ e(
61
- "span",
62
- {
63
- className: o(
64
- "pointer-events-none absolute top-0 z-10 block h-full",
65
- t ? "bg-gray-40" : "bg-gray-10"
66
- ),
67
- style: {
68
- right: -c,
69
- width: c,
70
- clipPath: "polygon(0 0, 100% 50%, 0 100%)"
71
- },
72
- "aria-hidden": !0
73
- }
74
- );
75
- }
76
- function N({
77
- step: t,
78
- stepNumber: i,
79
- index: r,
80
- total: n,
81
- label: g
82
- }) {
83
- const { status: d } = t, s = r === 0, m = r === n - 1, a = n === 1, l = d === "active", h = s ? u : y;
84
- return /* @__PURE__ */ e(
85
- "li",
86
- {
87
- className: o("relative min-w-0 flex-1 list-none", !s && "-ml-3"),
88
- style: { zIndex: n - r },
89
- "aria-current": l ? "step" : void 0,
90
- children: /* @__PURE__ */ p(
91
- "div",
92
- {
93
- className: o(
94
- "relative flex min-h-12 w-full items-center gap-2 py-2.5 text-xs",
95
- l ? "bg-gray-40 text-foreground" : "bg-gray-10 text-gray-110",
96
- a && "rounded-lg pr-6",
97
- !a && s && "rounded-l-lg pr-2",
98
- !a && m && "rounded-r-lg pr-6"
99
- ),
100
- style: { paddingLeft: h },
101
- children: [
102
- /* @__PURE__ */ e(x, { status: d, stepNumber: i }),
103
- /* @__PURE__ */ e("span", { className: o("min-w-0 truncate", l && "font-bold"), children: g }),
104
- m ? null : /* @__PURE__ */ e(v, { active: l })
105
- ]
106
- }
107
- )
108
- }
109
- );
110
- }
111
- function _({
112
- steps: t,
113
- renderLabel: i
114
- }) {
115
- return /* @__PURE__ */ e(
116
- "ol",
117
- {
118
- className: "flex w-full list-none p-0 m-0",
119
- "data-testid": f.root,
120
- children: t.map((r, n) => /* @__PURE__ */ e(
121
- N,
122
- {
123
- step: r,
124
- stepNumber: n + 1,
125
- index: n,
126
- total: t.length,
127
- label: i(r)
128
- },
129
- r.id
130
- ))
131
- }
132
- );
133
- }
134
- export {
135
- _ as HorizontalTransactionStepper
136
- };
@@ -1,92 +0,0 @@
1
- import { jsx as o, jsxs as a } from "react/jsx-runtime";
2
- import { shortAddress as y } from "@gearbox-protocol/sdk";
3
- import { FadeoutLoading as C } from "../../../../fadeout-loading/fadeout-loading.js";
4
- import { TipCard as z } from "../../../../tip-card/tip-card.js";
5
- import { VerticalIndicator as r } from "../../../../vertical-indicator/vertical-indicator.js";
6
- import { VerticalList as x } from "../../../../vertical-list/vertical-list.js";
7
- import { WithCopy as g } from "../../../../with-copy/with-copy.js";
8
- import { PoolOperationConfirmSummaryTest as P } from "./constants.js";
9
- function m({
10
- amount: i,
11
- symbol: t
12
- }) {
13
- return /* @__PURE__ */ a("span", { children: [
14
- i,
15
- " ",
16
- t
17
- ] });
18
- }
19
- function F({
20
- primaryLabel: i,
21
- primaryAmount: t,
22
- primaryTokenSymbol: n,
23
- receiveLabel: s,
24
- receiveAmount: d,
25
- receiveTokenSymbol: u,
26
- apyLabel: p,
27
- apy: e,
28
- apyLoading: f = !1,
29
- curatorLabel: c,
30
- curatorName: h,
31
- poolLabel: b,
32
- poolAddress: l
33
- }) {
34
- const v = y(l);
35
- return /* @__PURE__ */ o(
36
- z,
37
- {
38
- textColor: "light",
39
- "data-testid": P.root,
40
- children: /* @__PURE__ */ a(x, { children: [
41
- /* @__PURE__ */ o(
42
- r,
43
- {
44
- size: "sm",
45
- label: i,
46
- value: /* @__PURE__ */ o(
47
- m,
48
- {
49
- amount: t,
50
- symbol: n
51
- }
52
- )
53
- }
54
- ),
55
- /* @__PURE__ */ o(
56
- r,
57
- {
58
- size: "sm",
59
- label: s,
60
- value: /* @__PURE__ */ o(
61
- m,
62
- {
63
- amount: d,
64
- symbol: u
65
- }
66
- )
67
- }
68
- ),
69
- e !== void 0 ? /* @__PURE__ */ o(
70
- r,
71
- {
72
- size: "sm",
73
- label: p,
74
- value: /* @__PURE__ */ o(C, { loading: f, children: e })
75
- }
76
- ) : null,
77
- /* @__PURE__ */ o(r, { size: "sm", label: c, value: h }),
78
- /* @__PURE__ */ o(
79
- r,
80
- {
81
- size: "sm",
82
- label: b,
83
- value: /* @__PURE__ */ o(g, { toCopy: l, children: /* @__PURE__ */ o("span", { children: v }) })
84
- }
85
- )
86
- ] })
87
- }
88
- );
89
- }
90
- export {
91
- F as PoolOperationConfirmSummary
92
- };
@@ -1,18 +0,0 @@
1
- import { default as React } from 'react';
2
- import { Address } from 'viem';
3
- export interface PoolOperationConfirmSummaryProps {
4
- readonly primaryLabel: React.ReactNode;
5
- readonly primaryAmount: string;
6
- readonly primaryTokenSymbol: string;
7
- readonly receiveLabel: React.ReactNode;
8
- readonly receiveAmount: string;
9
- readonly receiveTokenSymbol: string;
10
- readonly apyLabel?: React.ReactNode;
11
- readonly apy?: React.ReactNode;
12
- readonly apyLoading?: boolean;
13
- readonly curatorLabel: React.ReactNode;
14
- readonly curatorName: string;
15
- readonly poolLabel: React.ReactNode;
16
- readonly poolAddress: Address;
17
- }
18
- export declare function PoolOperationConfirmSummary({ primaryLabel, primaryAmount, primaryTokenSymbol, receiveLabel, receiveAmount, receiveTokenSymbol, apyLabel, apy, apyLoading, curatorLabel, curatorName, poolLabel, poolAddress, }: PoolOperationConfirmSummaryProps): React.ReactElement;