@coin-voyage/paykit 2.2.7-beta.2 → 2.2.7-beta.3
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/dist/components/Pages/About/index.js +86 -80
- package/dist/components/Pages/Confirmation/index.js +8 -7
- package/dist/components/Pages/PayToAddress/copyable-info.d.ts +8 -0
- package/dist/components/Pages/PayToAddress/copyable-info.js +11 -0
- package/dist/components/Pages/PayToAddress/index.d.ts +1 -0
- package/dist/components/Pages/PayToAddress/index.js +77 -0
- package/dist/components/Pages/PayToAddress/styles.d.ts +7 -0
- package/dist/components/Pages/PayToAddress/styles.js +36 -0
- package/dist/components/Pages/PayWithToken/index.js +19 -18
- package/dist/components/Pages/SelectChain/index.d.ts +1 -0
- package/dist/components/Pages/SelectChain/index.js +30 -0
- package/dist/components/Pages/SelectMethod/index.js +4 -9
- package/dist/components/Pages/SelectPayToAddressChain/index.d.ts +1 -0
- package/dist/components/Pages/SelectPayToAddressChain/index.js +14 -0
- package/dist/components/Pages/SelectPayToAddressToken/index.d.ts +1 -0
- package/dist/components/Pages/SelectPayToAddressToken/index.js +10 -0
- package/dist/components/Pages/SelectToken/index.js +11 -15
- package/dist/components/pay-modal/index.js +18 -4
- package/dist/components/ui/CircleTimer/index.d.ts +11 -0
- package/dist/components/ui/CircleTimer/index.js +40 -0
- package/dist/components/ui/CopyableInfo/index.d.ts +9 -0
- package/dist/components/ui/CopyableInfo/index.js +25 -0
- package/dist/components/ui/CopyableInfo/styles.d.ts +8 -0
- package/dist/components/ui/CopyableInfo/styles.js +63 -0
- package/dist/components/ui/CountDownTimer/index.d.ts +6 -0
- package/dist/components/ui/CountDownTimer/index.js +14 -0
- package/dist/components/ui/CountDownTimer/styles.d.ts +2 -0
- package/dist/components/ui/CountDownTimer/styles.js +12 -0
- package/dist/components/ui/CustomQRCode/styles.js +1 -1
- package/dist/components/ui/Modal/index.js +1 -0
- package/dist/components/ui/Modal/useModalTransition.d.ts +16 -2
- package/dist/components/ui/Modal/useModalTransition.js +72 -4
- package/dist/components/ui/SelectAnotherMethod/index.d.ts +6 -0
- package/dist/components/ui/SelectAnotherMethod/index.js +6 -0
- package/dist/config/route-config.js +40 -4
- package/dist/hooks/useChainOptions.d.ts +12 -0
- package/dist/hooks/useChainOptions.js +107 -0
- package/dist/hooks/useCountdown.d.ts +1 -0
- package/dist/hooks/useCountdown.js +23 -0
- package/dist/hooks/useDepositAddressQuery.d.ts +6 -0
- package/dist/hooks/useDepositAddressQuery.js +29 -0
- package/dist/hooks/useLockBodyScroll.js +11 -27
- package/dist/hooks/useMethodOptions.d.ts +3 -5
- package/dist/hooks/useMethodOptions.js +31 -101
- package/dist/hooks/usePayOrderQuotes.d.ts +3 -3
- package/dist/hooks/usePayToAddress.d.ts +10 -0
- package/dist/hooks/usePayToAddress.js +22 -0
- package/dist/hooks/usePayToAddressChainOptions.d.ts +14 -0
- package/dist/hooks/usePayToAddressChainOptions.js +27 -0
- package/dist/hooks/usePayToAddressTokens.d.ts +9 -0
- package/dist/hooks/usePayToAddressTokens.js +33 -0
- package/dist/hooks/usePayWithToken.d.ts +5 -4
- package/dist/hooks/usePayWithToken.js +29 -34
- package/dist/hooks/usePaymentState.d.ts +15 -5
- package/dist/hooks/usePaymentState.js +24 -8
- package/dist/hooks/useTokenOptions.js +2 -2
- package/dist/hooks/useWalletConnectUri.js +1 -1
- package/dist/lib/api/payment-details.d.ts +3 -0
- package/dist/lib/api/payment-details.js +9 -0
- package/dist/lib/localizations/locales/ar-AE.js +14 -0
- package/dist/lib/localizations/locales/ca-AD.js +14 -0
- package/dist/lib/localizations/locales/de-DE.d.ts +14 -0
- package/dist/lib/localizations/locales/de-DE.js +14 -0
- package/dist/lib/localizations/locales/ee-EE.js +14 -0
- package/dist/lib/localizations/locales/en-US.d.ts +14 -0
- package/dist/lib/localizations/locales/en-US.js +14 -0
- package/dist/lib/localizations/locales/es-ES.js +14 -0
- package/dist/lib/localizations/locales/fa-IR.js +14 -0
- package/dist/lib/localizations/locales/fr-FR.js +14 -0
- package/dist/lib/localizations/locales/ja-JP.js +14 -0
- package/dist/lib/localizations/locales/pt-BR.js +14 -0
- package/dist/lib/localizations/locales/ru-RU.js +14 -0
- package/dist/lib/localizations/locales/tr-TR.js +14 -0
- package/dist/lib/localizations/locales/vi-VN.js +14 -0
- package/dist/lib/localizations/locales/zh-CN.js +14 -0
- package/dist/providers/paykit-provider.js +30 -4
- package/dist/types/enums.d.ts +4 -0
- package/dist/types/enums.js +5 -0
- package/dist/types/payment-details.d.ts +6 -0
- package/dist/types/payment-details.js +1 -0
- package/dist/types/route-config.d.ts +10 -4
- package/dist/types/routes.d.ts +4 -0
- package/dist/types/routes.js +4 -0
- package/dist/types/state.d.ts +4 -1
- package/dist/types.d.ts +5 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +5 -0
- package/package.json +3 -3
- package/dist/components/Pages/SelectMethod/styles.d.ts +0 -9
- package/dist/components/Pages/SelectMethod/styles.js +0 -237
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useInWagmiContext } from "@coin-voyage/crypto/evm/provider/provider";
|
|
3
3
|
import { useAccount, useConnectCallback } from "@coin-voyage/crypto/hooks";
|
|
4
|
+
import { getChainMetadata, getToken } from "@coin-voyage/shared/common";
|
|
4
5
|
import { PayOrderMode, PayOrderStatus } from "@coin-voyage/shared/types";
|
|
5
6
|
import { Buffer } from "buffer";
|
|
6
7
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
@@ -10,6 +11,7 @@ import { PayModal } from "../components/pay-modal/index";
|
|
|
10
11
|
import { useThemeFont } from "../hooks/useGoogleFont";
|
|
11
12
|
import { usePaymentState } from "../hooks/usePaymentState";
|
|
12
13
|
import defaultTheme from "../styles/defaultTheme";
|
|
14
|
+
import { PaymentMethod } from "../types/enums";
|
|
13
15
|
import { ROUTES } from "../types/routes";
|
|
14
16
|
import { ApiProvider } from "./api-provider";
|
|
15
17
|
const defaultOptions = {
|
|
@@ -23,6 +25,7 @@ const defaultOptions = {
|
|
|
23
25
|
disclaimer: null,
|
|
24
26
|
bufferPolyfill: true,
|
|
25
27
|
overlayBlur: undefined,
|
|
28
|
+
optimisticConfirmation: true,
|
|
26
29
|
};
|
|
27
30
|
export const PayKitProvider = ({ apiKey, environment = "production", ...props }) => {
|
|
28
31
|
const inWagmiContext = useInWagmiContext();
|
|
@@ -171,7 +174,7 @@ function PayKitProviderInternal({ theme = "auto", mode = "auto", customTheme, op
|
|
|
171
174
|
clearTimeout(timeout);
|
|
172
175
|
};
|
|
173
176
|
}, [payOrder, refreshOrder]);
|
|
174
|
-
const showModal = useCallback((modalOptions) => {
|
|
177
|
+
const showModal = useCallback(async (modalOptions) => {
|
|
175
178
|
setModalOptions(modalOptions);
|
|
176
179
|
setOpen(true);
|
|
177
180
|
const isConnected = account.isConnected;
|
|
@@ -179,17 +182,40 @@ function PayKitProviderInternal({ theme = "auto", mode = "auto", customTheme, op
|
|
|
179
182
|
paymentState.setConnectorChainType(account.chainType);
|
|
180
183
|
}
|
|
181
184
|
const payOrder = paymentState.payOrder;
|
|
182
|
-
|
|
185
|
+
const paymentMethod = paymentState.paymentMethod;
|
|
186
|
+
if (payOrder?.status !== PayOrderStatus.PENDING &&
|
|
187
|
+
payOrder?.status !== PayOrderStatus.AWAITING_PAYMENT &&
|
|
188
|
+
payOrder?.status !== PayOrderStatus.EXPIRED) {
|
|
183
189
|
setRoute(ROUTES.CONFIRMATION);
|
|
184
190
|
}
|
|
185
|
-
else if (
|
|
186
|
-
|
|
191
|
+
else if (paymentMethod === PaymentMethod.Wallet &&
|
|
192
|
+
payOrder?.status === PayOrderStatus.AWAITING_PAYMENT &&
|
|
193
|
+
payOrder.payment?.src) {
|
|
194
|
+
paymentState.setSelectedCurrencyOption(payOrder.payment.src);
|
|
187
195
|
setRoute(ROUTES.PAY_WITH_TOKEN);
|
|
188
196
|
}
|
|
197
|
+
else if (paymentMethod === PaymentMethod.DepositAddress &&
|
|
198
|
+
payOrder?.status === PayOrderStatus.AWAITING_PAYMENT &&
|
|
199
|
+
payOrder.payment?.src) {
|
|
200
|
+
const chainId = payOrder.payment.src.chain_id;
|
|
201
|
+
const [chainMetadata, token] = await Promise.all([getChainMetadata(chainId), getToken(payOrder.payment.src)]);
|
|
202
|
+
if (chainMetadata)
|
|
203
|
+
paymentState.setPayToAddressChain(chainMetadata);
|
|
204
|
+
if (token)
|
|
205
|
+
paymentState.setPayToAddressCurrency(token);
|
|
206
|
+
setRoute(ROUTES.PAY_TO_ADDRESS);
|
|
207
|
+
}
|
|
189
208
|
else {
|
|
190
209
|
setRoute(isConnected ? ROUTES.SELECT_TOKEN : ROUTES.SELECT_METHOD);
|
|
191
210
|
}
|
|
192
211
|
}, [account.isConnected, account.chainType, paymentState, setOpen]);
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
if (payOrder?.status !== PayOrderStatus.PENDING &&
|
|
214
|
+
payOrder?.status !== PayOrderStatus.AWAITING_PAYMENT &&
|
|
215
|
+
payOrder?.status !== PayOrderStatus.EXPIRED) {
|
|
216
|
+
setRoute(ROUTES.CONFIRMATION);
|
|
217
|
+
}
|
|
218
|
+
}, [payOrder?.status]);
|
|
193
219
|
const triggerResize = useCallback(() => onResize((prev) => prev + 1), []);
|
|
194
220
|
const value = {
|
|
195
221
|
theme: ckTheme,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { ROUTES } from "./routes";
|
|
3
|
+
import { Dispatch, SetStateAction } from "react";
|
|
4
|
+
import { ChainType } from "../server";
|
|
5
|
+
import { CurrencyAndQuoteID } from "./state";
|
|
6
|
+
import { ChainMetadata, Token } from "@coin-voyage/shared/common";
|
|
3
7
|
export interface RouteConfig {
|
|
4
8
|
component: React.ReactNode;
|
|
5
9
|
heading: string | ((ctx: HeadingContext) => string | undefined);
|
|
@@ -13,14 +17,16 @@ export interface HeadingContext {
|
|
|
13
17
|
walletName: string | undefined;
|
|
14
18
|
shouldUseQrcode: boolean;
|
|
15
19
|
isWalletConnectConnector: boolean;
|
|
16
|
-
|
|
20
|
+
selectedCurrencyOption: {
|
|
17
21
|
ticker: string;
|
|
18
22
|
chain_id: number;
|
|
19
23
|
} | undefined;
|
|
20
24
|
}
|
|
21
25
|
export interface BackNavigationActions {
|
|
22
|
-
setRoute:
|
|
23
|
-
setConnectorChainType:
|
|
24
|
-
|
|
26
|
+
setRoute: Dispatch<SetStateAction<ROUTES>>;
|
|
27
|
+
setConnectorChainType: Dispatch<SetStateAction<ChainType | undefined>>;
|
|
28
|
+
setPayToAddressChain: Dispatch<SetStateAction<ChainMetadata | undefined>>;
|
|
29
|
+
setPayToAddressCurrency: Dispatch<SetStateAction<Token | undefined>>;
|
|
30
|
+
setSelectedCurrencyOption: (option: CurrencyAndQuoteID | undefined) => void;
|
|
25
31
|
clearUserSelection: () => void;
|
|
26
32
|
}
|
package/dist/types/routes.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export declare enum ROUTES {
|
|
2
2
|
SELECT_METHOD = "paySelectMethod",
|
|
3
|
+
SELECT_PAY_TO_ADDRESS_CHAIN = "paySelectPayToAddressChain",
|
|
4
|
+
SELECT_PAY_TO_ADDRESS_TOKEN = "paySelectPayToAddressToken",
|
|
5
|
+
PAY_TO_ADDRESS = "payToAddress",
|
|
6
|
+
SELECT_CHAIN = "paySelectChain",
|
|
3
7
|
SELECT_TOKEN = "paySelectToken",
|
|
4
8
|
PAY_WITH_TOKEN = "payPayWithToken",
|
|
5
9
|
CONFIRMATION = "payConfirmation",
|
package/dist/types/routes.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export var ROUTES;
|
|
2
2
|
(function (ROUTES) {
|
|
3
3
|
ROUTES["SELECT_METHOD"] = "paySelectMethod";
|
|
4
|
+
ROUTES["SELECT_PAY_TO_ADDRESS_CHAIN"] = "paySelectPayToAddressChain";
|
|
5
|
+
ROUTES["SELECT_PAY_TO_ADDRESS_TOKEN"] = "paySelectPayToAddressToken";
|
|
6
|
+
ROUTES["PAY_TO_ADDRESS"] = "payToAddress";
|
|
7
|
+
ROUTES["SELECT_CHAIN"] = "paySelectChain";
|
|
4
8
|
ROUTES["SELECT_TOKEN"] = "paySelectToken";
|
|
5
9
|
ROUTES["PAY_WITH_TOKEN"] = "payPayWithToken";
|
|
6
10
|
ROUTES["CONFIRMATION"] = "payConfirmation";
|
package/dist/types/state.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChainType } from "@coin-voyage/shared/types";
|
|
1
|
+
import type { ChainType, CurrencyWithAmount } from "@coin-voyage/shared/types";
|
|
2
2
|
import { ROUTES } from "./routes";
|
|
3
3
|
export type InitState = {
|
|
4
4
|
payOrderId: string;
|
|
@@ -7,3 +7,6 @@ export type InitState = {
|
|
|
7
7
|
walletId: string;
|
|
8
8
|
route?: ROUTES;
|
|
9
9
|
};
|
|
10
|
+
export type CurrencyAndQuoteID = CurrencyWithAmount & {
|
|
11
|
+
quoteId?: string;
|
|
12
|
+
};
|
package/dist/types.d.ts
CHANGED
|
@@ -119,6 +119,11 @@ export type PayKitOptions = {
|
|
|
119
119
|
bufferPolyfill?: boolean;
|
|
120
120
|
/** Blur the background when the modal is open */
|
|
121
121
|
overlayBlur?: number;
|
|
122
|
+
/** Optimistically confirms the Order if the user executed the transaction and the transaction is validated on the blockchain. This
|
|
123
|
+
* allows for a faster and smoother user experience, but can lead to false positives if the transaction execution fails (e.g. due to a chain reorg, or tx cancellation).
|
|
124
|
+
* Not allowed for deposits. Defaults to true.
|
|
125
|
+
**/
|
|
126
|
+
optimisticConfirmation?: boolean;
|
|
122
127
|
};
|
|
123
128
|
/** Modal UI options, set on the pay button triggering that modal. */
|
|
124
129
|
export type PayModalOptions = {
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export declare const isCoinbaseWalletConnector: (connectorId?: string) => connec
|
|
|
8
8
|
export declare const isLedgerConnector: (connectorId?: string) => connectorId is "ledger";
|
|
9
9
|
export declare const isSafeConnector: (connectorId?: string) => connectorId is "safe";
|
|
10
10
|
export declare const isInjectedConnector: (connectorId?: string) => connectorId is "injected";
|
|
11
|
+
export declare const formatTime: (sec: number) => string;
|
|
11
12
|
export {};
|
package/dist/utils/index.js
CHANGED
|
@@ -20,3 +20,8 @@ export const isCoinbaseWalletConnector = (connectorId) => connectorId === "coinb
|
|
|
20
20
|
export const isLedgerConnector = (connectorId) => connectorId === "ledger";
|
|
21
21
|
export const isSafeConnector = (connectorId) => connectorId === "safe";
|
|
22
22
|
export const isInjectedConnector = (connectorId) => connectorId === "injected";
|
|
23
|
+
export const formatTime = (sec) => {
|
|
24
|
+
const m = `${Math.floor(sec / 60)}`.padStart(2, "0");
|
|
25
|
+
const s = `${sec % 60}`.padStart(2, "0");
|
|
26
|
+
return `${m}:${s}`;
|
|
27
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coin-voyage/paykit",
|
|
3
3
|
"description": "Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.",
|
|
4
|
-
"version": "2.2.7-beta.
|
|
4
|
+
"version": "2.2.7-beta.3",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"author": "Lars <lars@coinvoyage.io>",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"react-use-measure": "^2.1.1",
|
|
62
62
|
"styled-components": "^5.3.11",
|
|
63
63
|
"uuid": "13.0.0",
|
|
64
|
-
"@coin-voyage/
|
|
65
|
-
"@coin-voyage/
|
|
64
|
+
"@coin-voyage/crypto": "2.2.2",
|
|
65
|
+
"@coin-voyage/shared": "2.2.5-beta.5"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/qrcode": "1.5.5",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const InfoBox: any;
|
|
2
|
-
export declare const InfoBoxButtons: any;
|
|
3
|
-
export declare const LearnMoreContainer: any;
|
|
4
|
-
export declare const LearnMoreButton: any;
|
|
5
|
-
export declare const ConnectorsContainer: any;
|
|
6
|
-
export declare const ConnectorButton: any;
|
|
7
|
-
export declare const ConnectorRecentlyUsed: any;
|
|
8
|
-
export declare const ConnectorLabel: any;
|
|
9
|
-
export declare const ConnectorIcon: any;
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import { keyframes } from "styled-components";
|
|
2
|
-
import styled from "../../../styles/styled";
|
|
3
|
-
import { motion } from "framer-motion";
|
|
4
|
-
import { ModalBody } from "../../ui/Modal/styles";
|
|
5
|
-
const Shimmer = keyframes `
|
|
6
|
-
0%{ transform: translate(-100%) rotate(-45deg); }
|
|
7
|
-
100%{ transform: translate(100%) rotate(-80deg); }
|
|
8
|
-
`;
|
|
9
|
-
export const InfoBox = styled.div `
|
|
10
|
-
padding: 24px 24px 28px;
|
|
11
|
-
border-radius: var(--ck-tertiary-border-radius, 24px);
|
|
12
|
-
box-shadow: var(--ck-tertiary-box-shadow, none);
|
|
13
|
-
background: var(--ck-body-background-tertiary);
|
|
14
|
-
${ModalBody} {
|
|
15
|
-
max-width: none;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
export const InfoBoxButtons = styled.div `
|
|
19
|
-
display: grid;
|
|
20
|
-
grid-template-columns: 1fr 1fr;
|
|
21
|
-
gap: 16px;
|
|
22
|
-
margin: 5px -8px -12px;
|
|
23
|
-
button {
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
export const LearnMoreContainer = styled(motion.div) `
|
|
27
|
-
text-align: center;
|
|
28
|
-
margin-top: 16px;
|
|
29
|
-
margin-bottom: -6px;
|
|
30
|
-
`;
|
|
31
|
-
export const LearnMoreButton = styled(motion.button) `
|
|
32
|
-
appearance: none;
|
|
33
|
-
user-select: none;
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
display: inline-flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
justify-content: center;
|
|
38
|
-
gap: 10px;
|
|
39
|
-
height: 42px;
|
|
40
|
-
padding: 0 16px;
|
|
41
|
-
border-radius: 6px;
|
|
42
|
-
background: none;
|
|
43
|
-
color: var(--ck-body-color-muted);
|
|
44
|
-
font-size: 15px;
|
|
45
|
-
line-height: 18px;
|
|
46
|
-
font-weight: 500;
|
|
47
|
-
/* will-change: transform; */
|
|
48
|
-
transition:
|
|
49
|
-
color 200ms ease,
|
|
50
|
-
transform 100ms ease;
|
|
51
|
-
svg {
|
|
52
|
-
transition: all 100ms ease-out;
|
|
53
|
-
display: block;
|
|
54
|
-
position: relative;
|
|
55
|
-
top: 2px;
|
|
56
|
-
left: 2px;
|
|
57
|
-
transform: translateZ(0px);
|
|
58
|
-
path,
|
|
59
|
-
circle {
|
|
60
|
-
transition: all 100ms ease-out;
|
|
61
|
-
}
|
|
62
|
-
path:last-of-type {
|
|
63
|
-
transform-origin: 0 0;
|
|
64
|
-
transform: scaleX(1.3) skewY(-12deg);
|
|
65
|
-
opacity: 0;
|
|
66
|
-
}
|
|
67
|
-
circle {
|
|
68
|
-
transform: translate(20%, -15%);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
&:hover {
|
|
72
|
-
color: var(--ck-body-color-muted-hover);
|
|
73
|
-
svg {
|
|
74
|
-
path,
|
|
75
|
-
circle {
|
|
76
|
-
opacity: 1;
|
|
77
|
-
transform: none;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
&:active {
|
|
82
|
-
transform: scale(0.96);
|
|
83
|
-
}
|
|
84
|
-
`;
|
|
85
|
-
export const ConnectorsContainer = styled(motion.div) `
|
|
86
|
-
display: flex;
|
|
87
|
-
flex-direction: column;
|
|
88
|
-
gap: 12px;
|
|
89
|
-
padding: 0 0 16px;
|
|
90
|
-
overflow-y: scroll;
|
|
91
|
-
max-height: 20rem;
|
|
92
|
-
|
|
93
|
-
&::-webkit-scrollbar {
|
|
94
|
-
display: none;
|
|
95
|
-
}
|
|
96
|
-
`;
|
|
97
|
-
export const ConnectorButton = styled(motion.button) `
|
|
98
|
-
cursor: pointer;
|
|
99
|
-
user-select: none;
|
|
100
|
-
position: relative;
|
|
101
|
-
display: flex;
|
|
102
|
-
align-items: center;
|
|
103
|
-
padding: 0 20px;
|
|
104
|
-
width: 100%;
|
|
105
|
-
height: 64px;
|
|
106
|
-
font-size: 17px;
|
|
107
|
-
font-weight: var(--ck-primary-button-font-weight, 500);
|
|
108
|
-
line-height: 20px;
|
|
109
|
-
text-align: var(--ck-body-button-text-align, left);
|
|
110
|
-
transition: 180ms ease;
|
|
111
|
-
transition-property: background, color, box-shadow, transform, opacity;
|
|
112
|
-
will-change: transform, box-shadow, background-color, color, opacity;
|
|
113
|
-
|
|
114
|
-
--fallback-color: var(--ck-primary-button-color);
|
|
115
|
-
--fallback-background: var(--ck-primary-button-background);
|
|
116
|
-
--fallback-box-shadow: var(--ck-primary-button-box-shadow);
|
|
117
|
-
--fallback-border-radius: var(--ck-primary-button-border-radius);
|
|
118
|
-
|
|
119
|
-
--color: var(--ck-primary-button-color, var(--fallback-color));
|
|
120
|
-
--background: var(--ck-primary-button-background, var(--fallback-background));
|
|
121
|
-
--box-shadow: var(--ck-primary-button-box-shadow, var(--fallback-box-shadow));
|
|
122
|
-
--border-radius: var(--ck-primary-button-border-radius, var(--fallback-border-radius));
|
|
123
|
-
|
|
124
|
-
--hover-color: var(--ck-primary-button-hover-color, var(--color));
|
|
125
|
-
--hover-background: var(--ck-primary-button-hover-background, var(--background));
|
|
126
|
-
--hover-box-shadow: var(--ck-primary-button-hover-box-shadow, var(--box-shadow));
|
|
127
|
-
--hover-border-radius: var(--ck-primary-button-hover-border-radius, var(--border-radius));
|
|
128
|
-
|
|
129
|
-
--active-color: var(--ck-primary-button-active-color, var(--hover-color));
|
|
130
|
-
--active-background: var(--ck-primary-button-active-background, var(--hover-background));
|
|
131
|
-
--active-box-shadow: var(--ck-primary-button-active-box-shadow, var(--hover-box-shadow));
|
|
132
|
-
--active-border-radius: var(--ck-primary-button-active-border-radius, var(--hover-border-radius));
|
|
133
|
-
|
|
134
|
-
color: var(--color);
|
|
135
|
-
background: var(--background);
|
|
136
|
-
box-shadow: var(--box-shadow);
|
|
137
|
-
border-radius: var(--border-radius);
|
|
138
|
-
|
|
139
|
-
&:disabled {
|
|
140
|
-
transition: 180ms ease;
|
|
141
|
-
opacity: 0.4;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
--bg: var(--background);
|
|
145
|
-
&:not(:disabled) {
|
|
146
|
-
&:hover {
|
|
147
|
-
color: var(--hover-color);
|
|
148
|
-
background: var(--hover-background);
|
|
149
|
-
box-shadow: var(--hover-box-shadow);
|
|
150
|
-
border-radius: var(--hover-border-radius);
|
|
151
|
-
--bg: var(--hover-background, var(--background));
|
|
152
|
-
}
|
|
153
|
-
&:focus-visible {
|
|
154
|
-
transition-duration: 100ms;
|
|
155
|
-
color: var(--hover-color);
|
|
156
|
-
background: var(--hover-background);
|
|
157
|
-
box-shadow: var(--hover-box-shadow);
|
|
158
|
-
border-radius: var(--hover-border-radius);
|
|
159
|
-
--bg: var(--hover-background, var(--background));
|
|
160
|
-
}
|
|
161
|
-
&:active {
|
|
162
|
-
color: var(--active-color);
|
|
163
|
-
background: var(--active-background);
|
|
164
|
-
box-shadow: var(--active-box-shadow);
|
|
165
|
-
border-radius: var(--active-border-radius);
|
|
166
|
-
--bg: var(--active-background, var(--background));
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
`;
|
|
170
|
-
export const ConnectorRecentlyUsed = styled(motion.span) `
|
|
171
|
-
position: relative;
|
|
172
|
-
top: var(--ck-recent-badge-top-offset, 0.5px);
|
|
173
|
-
display: inline-block;
|
|
174
|
-
padding: 10px 7px;
|
|
175
|
-
line-height: 0;
|
|
176
|
-
font-size: 13px;
|
|
177
|
-
font-weight: 400;
|
|
178
|
-
border-radius: var(--ck-recent-badge-border-radius, var(--border-radius));
|
|
179
|
-
color: var(--ck-recent-badge-color, var(--ck-accent-color, var(--ck-body-color-muted, currentColor)));
|
|
180
|
-
background: var(--ck-recent-badge-background, transparent);
|
|
181
|
-
overflow: hidden;
|
|
182
|
-
span {
|
|
183
|
-
display: inline-block;
|
|
184
|
-
position: relative;
|
|
185
|
-
}
|
|
186
|
-
&:before {
|
|
187
|
-
z-index: 1;
|
|
188
|
-
content: "";
|
|
189
|
-
position: absolute;
|
|
190
|
-
inset: 0;
|
|
191
|
-
opacity: 0.4;
|
|
192
|
-
box-shadow: var(--ck-recent-badge-box-shadow, inset 0 0 0 1px currentColor);
|
|
193
|
-
border-radius: inherit;
|
|
194
|
-
}
|
|
195
|
-
&:after {
|
|
196
|
-
z-index: 2;
|
|
197
|
-
content: "";
|
|
198
|
-
position: absolute;
|
|
199
|
-
inset: -10%;
|
|
200
|
-
top: -110%;
|
|
201
|
-
aspect-ratio: 1/1;
|
|
202
|
-
opacity: 0.7;
|
|
203
|
-
background: linear-gradient(
|
|
204
|
-
170deg,
|
|
205
|
-
transparent 10%,
|
|
206
|
-
var(--ck-recent-badge-background, var(--bg)) 50%,
|
|
207
|
-
transparent 90%
|
|
208
|
-
);
|
|
209
|
-
animation: ${Shimmer} 2s linear infinite;
|
|
210
|
-
}
|
|
211
|
-
`;
|
|
212
|
-
export const ConnectorLabel = styled(motion.span) `
|
|
213
|
-
display: flex;
|
|
214
|
-
align-items: center;
|
|
215
|
-
gap: 9px;
|
|
216
|
-
width: 100%;
|
|
217
|
-
overflow: hidden;
|
|
218
|
-
white-space: nowrap;
|
|
219
|
-
text-overflow: ellipsis;
|
|
220
|
-
padding: 2px 0;
|
|
221
|
-
padding-right: 38px;
|
|
222
|
-
`;
|
|
223
|
-
export const ConnectorIcon = styled(motion.div) `
|
|
224
|
-
position: absolute;
|
|
225
|
-
right: 21px;
|
|
226
|
-
overflow: hidden;
|
|
227
|
-
svg,
|
|
228
|
-
img {
|
|
229
|
-
display: block;
|
|
230
|
-
position: relative;
|
|
231
|
-
pointer-events: none;
|
|
232
|
-
overflow: hidden;
|
|
233
|
-
border-radius: 27.5%;
|
|
234
|
-
width: 100%;
|
|
235
|
-
height: 100%;
|
|
236
|
-
}
|
|
237
|
-
`;
|