@funkit/connect 7.1.0-next.11 → 7.1.0-next.12

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 7.1.0-next.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 49c1537: Fix tooltip closing when hovering over its content
8
+ - 573e04e: feat(connect): update border color on fun powered tagline component
9
+ - d4b06e4: add cutOffTimeMs and jsdoc to useRecentDeposit hook
10
+ - 6f08927: Refactor FunTooltip to use Radix UI primitives for improved accessibility and mobile support
11
+ - 89d00a4: Rename useRecentDirectExecutions hook to useRecentDeposits and add optional batchSize parameter
12
+ - adac1ea: feat(connect): added option to display selected route on confirmation screen
13
+ - Updated dependencies [8a48f13]
14
+ - Updated dependencies [fd2812b]
15
+ - @funkit/api-base@1.12.22-next.5
16
+
3
17
  ## 7.1.0-next.11
4
18
 
5
19
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import type { DirectExecution } from '@funkit/api-base';
2
2
  import React from 'react';
3
- import type { MergedMultiStepDirectExecution } from '~/hooks/queries/useRecentDirectExecutions';
3
+ import type { MergedMultiStepDirectExecution } from '~/hooks/queries/useRecentDeposits';
4
4
  import type { TextConfigStatus, TextConfigSteps } from '../TransactionStatus/TransactionStatus';
5
5
  import type { FunDirectExecutionStatusProps } from './FunDirectExecutionStatus';
6
6
  export declare function FunDirectExecutionHistoryDetail({ bottomBarId, directExecution, isActiveCheckout, onClose, onAnimationComplete, showCheckoutStatus, customTextConfigStatus, customTextConfigSteps, dangerousCustomDelayedAutoTriggerCutoff, disableAutoUpdate, hideYouReceive, }: {
@@ -1,6 +1,2 @@
1
- export declare const tooltipContainer: string;
2
- export declare const tooltipStyle: string;
3
- export declare const tooltipStyleBottom: string;
4
- export declare const tooltipStyleCenter: string;
5
- export declare const tooltipStyleRight: string;
6
- export declare const tooltipStyleLeft: string;
1
+ export declare const tooltipTrigger: string;
2
+ export declare const tooltipContent: string;
@@ -3,36 +3,31 @@ import { type BoxProps } from '../Box/Box';
3
3
  export interface FunTooltipProps {
4
4
  content: ReactNode;
5
5
  children?: ReactNode;
6
+ /**
7
+ * @deprecated No longer needed. Radix handles collision detection automatically.
8
+ */
6
9
  wrapperElementRef?: React.RefObject<HTMLDivElement>;
7
- /** Renders the open tooltip based on available horizontal space, ie. ignoring the `tooltipPosition` prop,
8
- * if the tooltip were to overflow beyond the boundaries of the provided `wrapperElementRef` element
9
- * it renders either to the left or right side based on available horizontal space */
10
+ /**
11
+ * @deprecated No longer needed. Radix handles collision detection automatically.
12
+ */
10
13
  enableDynamicPositioning?: boolean;
11
14
  /**
12
- * To be expanded as needed, currently supports these positions:
13
- * center: above children,center
14
- * left: left of children, center
15
- * right: above children, right
15
+ * Tooltip position relative to trigger:
16
+ * - 'center': above trigger, centered (default)
17
+ * - 'left': above trigger, aligned to left edge
18
+ * - 'right': above trigger, aligned to right edge
16
19
  */
17
20
  tooltipPosition?: 'center' | 'left' | 'right';
18
21
  /**
19
- * Bottom offset of the tooltip from the children element, by default it is 6px
20
- * This is used to adjust the tooltip position when it is rendered in the center
22
+ * Offset from trigger element in pixels. Defaults to 6px.
21
23
  */
22
- bottomOffset?: boolean;
24
+ sideOffset?: number;
23
25
  maxWidth?: number;
24
- /** Whether to display the tooltip on hover or after clicking */
25
- displayType?: 'hover' | 'click';
26
- /**
27
- * Delay after which the tooltip is hidden. Defaults to 150ms
28
- * Based on display type the countdown starts immediately ('click') or after no longer hovering ('hover')
29
- */
30
- hideDelay?: number;
31
26
  /**
32
- * Delay before the tooltip is shown. Defaults to 0ms. Primarily used when displayType is set to hover and we want to prevent multiple tooltips from being visible due to rapid mouse movements.
27
+ * Delay in ms before showing the tooltip. Defaults to 0ms.
33
28
  */
34
29
  startDelay?: number;
35
30
  width?: BoxProps['width'];
36
31
  }
37
32
  export declare const TooltipAnchorRefContext: React.Context<React.RefObject<HTMLElement> | null>;
38
- export declare const FunTooltip: ({ content, children, wrapperElementRef, tooltipPosition, enableDynamicPositioning, bottomOffset, maxWidth, displayType, hideDelay, startDelay, width, }: FunTooltipProps) => React.JSX.Element;
33
+ export declare const FunTooltip: ({ content, children, tooltipPosition, sideOffset, maxWidth, startDelay, width, }: FunTooltipProps) => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const RelayIcon: ({ size }: {
3
+ size?: number;
4
+ }) => React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import type { FeeBreakdownV2 } from '@funkit/api-base';
2
- import type { RelayQuote } from '@funkit/fun-relay';
2
+ import type { RelayExecute, RelayQuote } from '@funkit/fun-relay';
3
3
  export declare const KATANA_BRIDGE_ALERT_THRESHOLD_PERCENT = 0.5;
4
4
  export type RelayQuoteMetadata = {
5
5
  relayQuote: RelayQuote['metadata']['relayQuote'];
@@ -8,3 +8,17 @@ export type RelayQuoteMetadata = {
8
8
  export declare function extractRelayFeeInfo({ relayQuote, feeBreakdown, }?: {
9
9
  [x: string]: unknown;
10
10
  }): FeeBreakdownV2;
11
+ type RelayQuoteDetails = NonNullable<RelayExecute['details']>;
12
+ /** Checks if input and output are the same token on the same chain. */
13
+ export declare function isRelayQuoteSameChainAndAsset(details: RelayQuoteDetails): boolean;
14
+ /** Checks if the quote is a native token wrap (e.g., ETH → WETH). */
15
+ export declare function isRelayQuoteWrapOperation(details: RelayQuoteDetails): boolean;
16
+ /** Checks if the quote has a 1:1 exchange rate (no price conversion). */
17
+ export declare function hasRelayQuoteUnitRate(details: RelayQuoteDetails): boolean;
18
+ /**
19
+ * Checks if Relay is acting as a passthrough (no solver, no fees).
20
+ * True when the quote has a 1:1 rate AND is either a same-chain/same-asset
21
+ * transfer or a native token wrap operation.
22
+ */
23
+ export declare function isRelayPassthrough(details: RelayQuoteDetails): boolean;
24
+ export {};
@@ -0,0 +1,46 @@
1
+ import { type DirectExecution } from '@funkit/api-base';
2
+ /**
3
+ * Query parameters for the useRecentDeposits hook.
4
+ */
5
+ interface RecentDirectExecutionsQuery {
6
+ /**
7
+ * Controls whether the hook should fetch and return data.
8
+ * When false, the query is disabled and no data will be fetched.
9
+ */
10
+ isVisible: boolean;
11
+ /**
12
+ * Optional filter function to further refine which deposits are returned.
13
+ * WARNING: Must be a stable reference (wrap in useMemo), otherwise the hook will constantly re-render.
14
+ * @param de - The DirectExecution to filter
15
+ * @returns true to include the deposit, false to exclude it
16
+ */
17
+ memoizedFilterFunc?: (de: DirectExecution) => boolean;
18
+ /**
19
+ * Maximum number of deposits to fetch from the API.
20
+ * @default 5
21
+ */
22
+ batchSize?: number;
23
+ /**
24
+ * Custom cutoff time in milliseconds for determining which deposits are "recent".
25
+ * Deposits created after this timestamp will be included.
26
+ * If not provided, uses Fun's default strategy.
27
+ */
28
+ cutOffTimeMs?: number;
29
+ }
30
+ export interface MergedMultiStepDirectExecution extends DirectExecution {
31
+ /**
32
+ * In a multi-step DE chain, represents the latest **present** DE of the chain.
33
+ *
34
+ * Always `undefined` for single-step DEs.
35
+ */
36
+ latestStep?: DirectExecution;
37
+ }
38
+ export declare function isTokenTransferDirectExecution(de: DirectExecution): boolean;
39
+ export declare function isWithdrawalDirectExecution(de: DirectExecution): boolean;
40
+ /**
41
+ * @returns recent direct executions tied to a recipient address used in the token transfer flow
42
+ */
43
+ export declare const useRecentDeposits: ({ isVisible, memoizedFilterFunc, batchSize, cutOffTimeMs, }: RecentDirectExecutionsQuery) => {
44
+ data: MergedMultiStepDirectExecution[] | undefined;
45
+ };
46
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { CheckoutRefundState, CheckoutState, type DirectExecution, RelayExecutionStatus } from '@funkit/api-base';
2
- import type { MergedMultiStepDirectExecution } from './queries/useRecentDirectExecutions';
2
+ import type { MergedMultiStepDirectExecution } from './queries/useRecentDeposits';
3
3
  export declare function mapRelayExecutionStatusToCheckoutState(status: RelayExecutionStatus): CheckoutState;
4
4
  export declare function mapRelayExecutionStatusToRefundState(status: RelayExecutionStatus): CheckoutRefundState | undefined;
5
5
  export declare function useCheckoutDirectExecutionHistory({ initDirectExecution, disabled, }: {
@@ -0,0 +1 @@
1
+ export declare function useHasHover(): boolean;
package/dist/index.css CHANGED
@@ -9826,34 +9826,7 @@
9826
9826
  box-shadow: 0px -1px 1px 0px rgba(0, 0, 0, 0.09) inset;
9827
9827
  }
9828
9828
 
9829
- /* vanilla-extract-css-ns:src/components/FunTooltip/FunTooltip.css.ts.vanilla.css?source=LnoxbDM4aTAgewogIHBvc2l0aW9uOiByZWxhdGl2ZTsKICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7CiAgei1pbmRleDogMjsKfQouejFsMzhpMiB7CiAgcG9zaXRpb246IGFic29sdXRlOwogIGJvdHRvbTogY2FsYygxMDAlICsgNnB4KTsKICB3aWR0aDogbWF4LWNvbnRlbnQ7CiAgd29yZC1icmVhazogYnJlYWstd29yZDsKfQouejFsMzhpMyB7CiAgYm90dG9tOiBjYWxjKDEwMCUpOwp9Ci56MWwzOGk0IHsKICBsZWZ0OiA1MCU7CiAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKC01MCUpOwp9Ci56MWwzOGk1IHsKICBsZWZ0OiAwOwp9Ci56MWwzOGk2IHsKICB0cmFuc2Zvcm06IHRyYW5zbGF0ZShjYWxjKC0xMDAlIC0gMThweCksIDEwMCUpOwp9 */
9830
- [data-rk] .z1l38i0 {
9831
- position: relative;
9832
- display: inline-block;
9833
- z-index: 2;
9834
- }
9835
- [data-rk] .z1l38i2 {
9836
- position: absolute;
9837
- bottom: calc(100% + 6px);
9838
- width: -moz-max-content;
9839
- width: max-content;
9840
- word-break: break-word;
9841
- }
9842
- [data-rk] .z1l38i3 {
9843
- bottom: calc(100%);
9844
- }
9845
- [data-rk] .z1l38i4 {
9846
- left: 50%;
9847
- transform: translateX(-50%);
9848
- }
9849
- [data-rk] .z1l38i5 {
9850
- left: 0;
9851
- }
9852
- [data-rk] .z1l38i6 {
9853
- transform: translate(calc(-100% - 18px), 100%);
9854
- }
9855
-
9856
- /* vanilla-extract-css-ns:src/components/FunPoweredTagline/FunPoweredTagline.css.ts.vanilla.css?source=Ll8xd2RnazZpMCB7CiAgcG9zaXRpb246IHJlbGF0aXZlOwogIG1hcmdpbi10b3A6IDZweDsKICBwYWRkaW5nLXRvcDogdmFyKC0tcmstc3BhY2luZy1tb2RhbFBhZGRpbmdCb3R0b21Mb3dlcik7Cn0KLl8xd2RnazZpMDo6YmVmb3JlIHsKICBjb250ZW50OiAiIjsKICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1yay1jb2xvcnMtbGlnaHRTdHJva2UpOwogIGhlaWdodDogMXB4OwogIHBvc2l0aW9uOiBhYnNvbHV0ZTsKICB0b3A6IDA7CiAgbGVmdDogY2FsYygtMSAqICh2YXIoLS1yay1zcGFjaW5nLW1vZGFsQmFzZUhvcml6b250YWxQYWRkaW5nKSArIHZhcigtLXJrLXNwYWNpbmctbW9kYWxCb3R0b21Ib3Jpem9udGFsUGFkZGluZykpKTsKICByaWdodDogY2FsYygtMSAqICh2YXIoLS1yay1zcGFjaW5nLW1vZGFsQmFzZUhvcml6b250YWxQYWRkaW5nKSArIHZhcigtLXJrLXNwYWNpbmctbW9kYWxCb3R0b21Ib3Jpem9udGFsUGFkZGluZykpKTsKfQ== */
9829
+ /* vanilla-extract-css-ns:src/components/FunPoweredTagline/FunPoweredTagline.css.ts.vanilla.css?source=Ll8xd2RnazZpMCB7CiAgcG9zaXRpb246IHJlbGF0aXZlOwogIG1hcmdpbi10b3A6IDZweDsKICBwYWRkaW5nLXRvcDogdmFyKC0tcmstc3BhY2luZy1tb2RhbFBhZGRpbmdCb3R0b21Mb3dlcik7Cn0KLl8xd2RnazZpMDo6YmVmb3JlIHsKICBjb250ZW50OiAiIjsKICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1yay1jb2xvcnMtbW9kYWxGb290ZXJEaXZpZGVyKTsKICBoZWlnaHQ6IDFweDsKICBwb3NpdGlvbjogYWJzb2x1dGU7CiAgdG9wOiAwOwogIGxlZnQ6IGNhbGMoLTEgKiAodmFyKC0tcmstc3BhY2luZy1tb2RhbEJhc2VIb3Jpem9udGFsUGFkZGluZykgKyB2YXIoLS1yay1zcGFjaW5nLW1vZGFsQm90dG9tSG9yaXpvbnRhbFBhZGRpbmcpKSk7CiAgcmlnaHQ6IGNhbGMoLTEgKiAodmFyKC0tcmstc3BhY2luZy1tb2RhbEJhc2VIb3Jpem9udGFsUGFkZGluZykgKyB2YXIoLS1yay1zcGFjaW5nLW1vZGFsQm90dG9tSG9yaXpvbnRhbFBhZGRpbmcpKSk7Cn0= */
9857
9830
  [data-rk] ._1wdgk6i0 {
9858
9831
  position: relative;
9859
9832
  margin-top: 6px;
@@ -9861,7 +9834,7 @@
9861
9834
  }
9862
9835
  [data-rk] ._1wdgk6i0::before {
9863
9836
  content: "";
9864
- background-color: var(--rk-colors-lightStroke);
9837
+ background-color: var(--rk-colors-modalFooterDivider);
9865
9838
  height: 1px;
9866
9839
  position: absolute;
9867
9840
  top: 0;
@@ -9877,6 +9850,94 @@
9877
9850
  flex: 1;
9878
9851
  }
9879
9852
 
9853
+ /* vanilla-extract-css-ns:src/components/FunTooltip/FunTooltip.css.ts.vanilla.css?source=#H4sIAAAAAAAAA7WTy27CMBBF93yFlRWVMEp4tFUQEp9BVbEwziRM8SOyB0Go+PcqBkqLlCxCu8rEM3N8cqUstlDlTmjw7Jio8SvG7LPHWO6sDgVjthQSqUpZPAvv5ITxuXU6PZdKELz1R+Xhqe6feoyRvV9N2lbjy+Kpt7iXSbrJ8P+xGXWxWXaPZtkmM+4m0z2aVptJo03SfFl8xQ3PkGkYyNCXSlQpQ6PQAM8VHOpBobAwHAm0T5kEQ+Dq44+dJ8wrLq0hMHRrfWNfAnZvXcbXDsQ2ZeHB65MANqgFoTU827lQpCyZxtr/bhJqNAXPd0aeZ+RujZKv4Yjg+vEweR6wZMDi4XjAkpDUHpXiciNMAekt0sE1gJ+K75kgwT0JgnmUgRIVZNyWYKLVpYUZzCOyZbQKn3PzMkJDev1fOjDXlsjqVmzcAasgp1bouAPUYbFpp44aqWg8CUN/mmoz86FUm7EPpNoMfSRVqayHrHV5MuudvgAzMmc8ZwYAAA== */
9854
+ @keyframes z1l38i0 {
9855
+ from {
9856
+ opacity: 0;
9857
+ transform: translateY(2px);
9858
+ }
9859
+ to {
9860
+ opacity: 1;
9861
+ transform: translateY(0);
9862
+ }
9863
+ }
9864
+ @keyframes z1l38i1 {
9865
+ from {
9866
+ opacity: 0;
9867
+ transform: translateY(-2px);
9868
+ }
9869
+ to {
9870
+ opacity: 1;
9871
+ transform: translateY(0);
9872
+ }
9873
+ }
9874
+ @keyframes z1l38i2 {
9875
+ from {
9876
+ opacity: 0;
9877
+ transform: translateX(2px);
9878
+ }
9879
+ to {
9880
+ opacity: 1;
9881
+ transform: translateX(0);
9882
+ }
9883
+ }
9884
+ @keyframes z1l38i3 {
9885
+ from {
9886
+ opacity: 0;
9887
+ transform: translateX(-2px);
9888
+ }
9889
+ to {
9890
+ opacity: 1;
9891
+ transform: translateX(0);
9892
+ }
9893
+ }
9894
+ @keyframes z1l38i4 {
9895
+ from {
9896
+ opacity: 1;
9897
+ }
9898
+ to {
9899
+ opacity: 0;
9900
+ }
9901
+ }
9902
+ [data-rk] .z1l38i5 {
9903
+ display: inline-flex;
9904
+ align-items: center;
9905
+ justify-content: center;
9906
+ }
9907
+ [data-rk] .z1l38i7 {
9908
+ word-break: break-word;
9909
+ animation-duration: 150ms;
9910
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
9911
+ will-change: transform, opacity;
9912
+ }
9913
+ [data-rk] .z1l38i7[data-state=delayed-open][data-side=top] {
9914
+ animation-name: z1l38i1;
9915
+ }
9916
+ [data-rk] .z1l38i7[data-state=delayed-open][data-side=bottom] {
9917
+ animation-name: z1l38i0;
9918
+ }
9919
+ [data-rk] .z1l38i7[data-state=delayed-open][data-side=left] {
9920
+ animation-name: z1l38i3;
9921
+ }
9922
+ [data-rk] .z1l38i7[data-state=delayed-open][data-side=right] {
9923
+ animation-name: z1l38i2;
9924
+ }
9925
+ [data-rk] .z1l38i7[data-state=instant-open][data-side=top] {
9926
+ animation-name: z1l38i1;
9927
+ }
9928
+ [data-rk] .z1l38i7[data-state=instant-open][data-side=bottom] {
9929
+ animation-name: z1l38i0;
9930
+ }
9931
+ [data-rk] .z1l38i7[data-state=instant-open][data-side=left] {
9932
+ animation-name: z1l38i3;
9933
+ }
9934
+ [data-rk] .z1l38i7[data-state=instant-open][data-side=right] {
9935
+ animation-name: z1l38i2;
9936
+ }
9937
+ [data-rk] .z1l38i7[data-state=closed] {
9938
+ animation-name: z1l38i4;
9939
+ }
9940
+
9880
9941
  /* vanilla-extract-css-ns:src/components/FunInput/FunInput.css.ts.vanilla.css?source=#H4sIAAAAAAAAA82TQUsDMRCF7/sr5iJU2CxZbYukeNKf4E08TLJDDc1OltmstRX/u3Rr6UpRxFroMeHlve9NkmLdkfZTDW8ZQBLk1icf2QCGAOVE1y24znqnLK09yUgX1znoHHShpzmUl7PsPSu2HuWBB0emgeDKGLUku/BJxS6RqLbxrGyXUuQcDkWe+auoD6hR5p4N6FkGsJNi0xAKsqPD1Me0auiWu9qSPPUWqo7rn46Me5VFt5hL7LhSLoYoZtutQSFOm3AbpSLZnQaIXQqeab+x9FV6NlBqfTE7erxjY5qAjp5jqEh6wk+sF5SRUrLYYraqJRe5Qlk90GsaWkxP0WvvfjzgzRkNHiA26HxaGdDFZAj5657oNpl3m8W9b9EGqoZt8TRtv8HG/8J2Z3RJe6jjHx+d9HfQ3wE/ALoQWt+kBQAA */
9881
9942
  [data-rk] .zue0i60 {
9882
9943
  transition: all 150ms cubic-bezier(0.3, 0, 0.06, 1);
package/dist/index.d.ts CHANGED
@@ -26,6 +26,7 @@ export type { FunkitConfig } from './providers/FunkitConfigContext';
26
26
  export type { FunkitConnectChain as Chain } from './providers/FunkitConnectChainContext';
27
27
  export type { ModalSizes } from './providers/ModalSizeContext';
28
28
  export { useCheckoutListenerByCheckoutId, useCheckoutsListenerByUserId, } from './providers/FunkitHistoryContext';
29
+ export { useRecentDeposits } from './hooks/queries/useRecentDeposits';
29
30
  export type { FunkitWagmiConfig, FunkitProviderProps, } from './providers/FunkitProvider';
30
31
  export { FunkitProvider } from './providers/FunkitProvider';
31
32
  export type { Theme, ThemeSet } from './providers/FunkitThemeProvider';