@gluwa/connect-kit 0.2.0-next.1 → 0.2.0-next.10

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 (99) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/assets/fonts/Inter-Medium.ttf +0 -0
  3. package/assets/fonts/Inter-Medium.woff2 +0 -0
  4. package/assets/fonts/Inter-Regular.ttf +0 -0
  5. package/assets/fonts/Inter-Regular.woff2 +0 -0
  6. package/assets/fonts/Inter-SemiBold.ttf +0 -0
  7. package/assets/fonts/Inter-SemiBold.woff2 +0 -0
  8. package/assets/graphic.png +0 -0
  9. package/assets/metamask.png +0 -0
  10. package/assets/penguinwallet.png +0 -0
  11. package/assets/wc-logo.svg +3 -0
  12. package/assets/wc-search.png +0 -0
  13. package/dist/chunk-VE5LB7BN.js +405 -0
  14. package/dist/credit-connect.js +2 -409
  15. package/dist/index.css +1903 -389
  16. package/dist/index.d.ts +21 -10
  17. package/dist/index.js +1507 -922
  18. package/dist/package.json +7 -6
  19. package/package.json +8 -8
  20. package/src/ConnectKitProvider.tsx +97 -65
  21. package/src/api/asset.ts +10 -0
  22. package/src/assets.d.ts +5 -0
  23. package/src/components/actionItem/index.tsx +50 -0
  24. package/src/components/actionItem/style.scss +47 -0
  25. package/src/components/copyLink/index.tsx +16 -0
  26. package/src/components/copyLink/style.scss +16 -0
  27. package/src/components/qrArea/index.tsx +72 -0
  28. package/src/components/qrArea/style.scss +122 -0
  29. package/src/components/searchBar/asset/Search.tsx +20 -0
  30. package/src/components/searchBar/asset/XMarkCircle.tsx +24 -0
  31. package/src/components/searchBar/index.tsx +44 -0
  32. package/src/components/searchBar/style.scss +58 -0
  33. package/src/components/toast/index.tsx +41 -0
  34. package/src/components/toast/style.scss +108 -0
  35. package/src/components/toggle/index.tsx +27 -0
  36. package/src/components/toggle/style.scss +53 -0
  37. package/src/components/walletGrid/index.tsx +64 -0
  38. package/src/components/walletGrid/style.scss +108 -0
  39. package/src/components/walletItem/index.tsx +49 -0
  40. package/src/components/walletItem/style.scss +70 -0
  41. package/src/connector-meta.ts +16 -11
  42. package/src/core/config.ts +20 -1
  43. package/src/creditConnectConnector.ts +23 -25
  44. package/src/events/account.ts +30 -3
  45. package/src/hooks/useConnectBanner.ts +79 -0
  46. package/src/hooks/useConnectTimeout.ts +92 -0
  47. package/src/hooks/useMetaMaskExtension.ts +29 -0
  48. package/src/hooks/useWCState.ts +21 -5
  49. package/src/hooks/useWagmiConnect.ts +35 -9
  50. package/src/index.ts +5 -2
  51. package/src/layout/allWallets/index.tsx +52 -0
  52. package/src/layout/allWallets/style.scss +57 -0
  53. package/src/layout/connectDialog/asset/backIcon.tsx +24 -0
  54. package/src/layout/connectDialog/asset/checkIcon.tsx +28 -0
  55. package/src/layout/connectDialog/asset/closeIcon.tsx +21 -0
  56. package/src/layout/connectDialog/asset/copyIcon.tsx +28 -0
  57. package/src/layout/connectDialog/asset/linkIcon.tsx +24 -0
  58. package/src/layout/connectDialog/asset/spinner.tsx +21 -0
  59. package/src/layout/connectDialog/asset/warningIcon.tsx +21 -0
  60. package/src/layout/connectDialog/idle/assets/banner-placeholder.png +0 -0
  61. package/src/layout/connectDialog/idle/index.tsx +55 -0
  62. package/src/layout/connectDialog/idle/style.scss +52 -0
  63. package/src/layout/connectDialog/index.tsx +432 -0
  64. package/src/layout/connectDialog/loading/index.tsx +13 -0
  65. package/src/layout/connectDialog/loading/style.scss +19 -0
  66. package/src/layout/connectDialog/metaMask/index.tsx +61 -0
  67. package/src/layout/connectDialog/metaMask/style.scss +65 -0
  68. package/src/layout/connectDialog/qr/index.tsx +33 -0
  69. package/src/layout/connectDialog/style.scss +48 -0
  70. package/src/layout/connectDialog/timeout/index.tsx +31 -0
  71. package/src/layout/connectDialog/timeout/style.scss +64 -0
  72. package/src/layout/connectDialog/walletConnect/index.tsx +45 -0
  73. package/src/layout/connectDialog/walletConnect/style.scss +48 -0
  74. package/src/layout/connectDialog/walletQR/index.tsx +37 -0
  75. package/src/layout/detailPanel/index.tsx +175 -0
  76. package/src/layout/detailPanel/style.scss +70 -0
  77. package/src/layout/selectorPanel/index.tsx +100 -0
  78. package/src/layout/selectorPanel/style.scss +113 -0
  79. package/src/style/color.scss +417 -0
  80. package/src/style/font.scss +28 -0
  81. package/src/style/index.scss +5 -0
  82. package/src/style/mixin.scss +217 -0
  83. package/src/style/reset.scss +110 -0
  84. package/src/style/variables.scss +13 -0
  85. package/src/types.ts +32 -8
  86. package/src/utils/platform.ts +5 -3
  87. package/src/wallet-display-override.ts +15 -0
  88. package/tsconfig.json +5 -1
  89. package/tsup.config.ts +32 -2
  90. package/assets/creditwallet.png +0 -0
  91. package/dist/chunk-DDA6FP6U.js +0 -7
  92. package/src/ConnectModal.scss +0 -665
  93. package/src/ConnectModal.tsx +0 -573
  94. package/src/components/QRFrame.tsx +0 -43
  95. package/src/views/CreditWalletView.tsx +0 -58
  96. package/src/views/IdleView.tsx +0 -10
  97. package/src/views/MetaMaskView.tsx +0 -66
  98. package/src/views/SwitchChainView.tsx +0 -72
  99. package/src/views/WalletConnectView.tsx +0 -206
package/src/index.ts CHANGED
@@ -3,9 +3,9 @@ import { getBalance } from './api/balance';
3
3
  import { switchChain, getPublicClient } from './api/chain';
4
4
  import { waitForTransactionReceipt } from './api/transaction';
5
5
  import { getAccount, signMessage, signTypedData } from './api/account';
6
+ import { watchAsset } from './api/asset';
6
7
  import { watchAccount, watchConnections, reconnect, disconnectAll } from './events/account';
7
8
 
8
- export { ConnectModal } from './ConnectModal';
9
9
  export { ConnectKitProvider, useConnectKit } from './ConnectKitProvider';
10
10
  export type { ConnectKitContextValue, ConnectKitProviderProps } from './ConnectKitProvider';
11
11
 
@@ -14,12 +14,14 @@ export { initConfig } from './core/config';
14
14
  export type {
15
15
  ConnectErrorContext,
16
16
  ConnectErrorReason,
17
+ ConnectBannerSiteKey,
17
18
  ConnectModalProps,
18
19
  ConnectKitConfig,
20
+ ConnectKitTheme,
19
21
  Connectors,
22
+ ConnectorKey,
20
23
  ConnectResult,
21
24
  ConnectorId,
22
- CreditWalletStrategy,
23
25
  WCSubView,
24
26
  WCWallet,
25
27
  } from './types';
@@ -35,6 +37,7 @@ export const connectKit = {
35
37
  getAccount,
36
38
  signMessage,
37
39
  signTypedData,
40
+ watchAsset,
38
41
  },
39
42
  events: {
40
43
  watchAccount,
@@ -0,0 +1,52 @@
1
+ import { type FC, useState, useMemo } from 'react';
2
+ import './style.scss';
3
+ import { type WCWallet } from '../../types';
4
+ import { SearchBar } from '../../components/searchBar';
5
+ import { Toggle } from '../../components/toggle';
6
+ import { WalletGrid } from '../../components/walletGrid';
7
+ import wcLogo from '../../../assets/wc-search.png';
8
+
9
+ interface AllWalletsProps {
10
+ /** Credit Wallet 이 최상단에 오도록 정렬된 상태로 전달됨 — useWCState 의 loadWalletList 에서 처리. */
11
+ wallets: WCWallet[];
12
+ isLoading: boolean;
13
+ onSelectWallet: (wallet: WCWallet) => void;
14
+ }
15
+
16
+ export const AllWallets: FC<AllWalletsProps> = ({ wallets, isLoading, onSelectWallet }) => {
17
+ const [search, setSearch] = useState('');
18
+ const [filterInstalled, setFilterInstalled] = useState(false);
19
+
20
+ const filtered = useMemo(() => {
21
+ const q = search.trim().toLowerCase();
22
+ let list = wallets;
23
+ if (filterInstalled) {
24
+ list = list.filter(
25
+ (w) => w.mobileNative || w.mobileUniversal || w.desktopNative || w.desktopUniversal,
26
+ );
27
+ }
28
+ if (q) {
29
+ list = list.filter((w) => w.name.toLowerCase().includes(q));
30
+ }
31
+ return list;
32
+ }, [wallets, search, filterInstalled]);
33
+
34
+ return (
35
+ <div className="ck-all-wallets">
36
+ <div className="ck-all-wallets-controls">
37
+ <SearchBar value={search} onChange={setSearch} onClear={() => setSearch('')} />
38
+ <div className="ck-wc-filter-btn">
39
+ <img className="ck-wc-filter-logo" src={wcLogo} alt="" aria-hidden="true" />
40
+ <Toggle checked={filterInstalled} label="" onChange={setFilterInstalled} />
41
+ </div>
42
+ </div>
43
+ {!isLoading && filtered.length === 0 ? (
44
+ <div className="ck-all-wallets-empty" role="status">
45
+ <p>No Wallet found</p>
46
+ </div>
47
+ ) : (
48
+ <WalletGrid wallets={filtered} isLoading={isLoading} onSelect={onSelectWallet} />
49
+ )}
50
+ </div>
51
+ );
52
+ };
@@ -0,0 +1,57 @@
1
+ @use '../../style/mixin.scss' as *;
2
+
3
+ .ck-all-wallets {
4
+ display: flex;
5
+ flex-direction: column;
6
+ flex: 1;
7
+ min-height: 0;
8
+ gap: 12px;
9
+
10
+ @include tablet {
11
+ min-height: min(420px, 55dvh);
12
+ max-height: calc(100dvh - 60px);
13
+ }
14
+ }
15
+
16
+ .ck-all-wallets-controls {
17
+ display: flex;
18
+ align-items: center;
19
+ gap: 8px;
20
+ flex-shrink: 0;
21
+
22
+ .ck-search {
23
+ min-width: 0;
24
+ }
25
+ }
26
+
27
+ .ck-wc-filter-btn {
28
+ display: inline-flex;
29
+ align-items: center;
30
+ gap: 8px;
31
+ padding: 12px 16px;
32
+ border-radius: 100px;
33
+ background: var(--scale-gray-100);
34
+ flex-shrink: 0;
35
+ }
36
+
37
+ .ck-wc-filter-logo {
38
+ width: 24px;
39
+ height: 24px;
40
+ border-radius: 50%;
41
+ flex-shrink: 0;
42
+ object-fit: cover;
43
+ background: var(--static-white-main);
44
+ }
45
+
46
+ .ck-all-wallets-empty {
47
+ display: flex;
48
+ align-items: center;
49
+ justify-content: center;
50
+ flex: 1;
51
+
52
+ p {
53
+ @include textToken('body4-l2-regular');
54
+ color: var(--scale-gray-600);
55
+ text-align: center;
56
+ }
57
+ }
@@ -0,0 +1,24 @@
1
+ import { type FC, type SVGProps } from 'react';
2
+
3
+ export const BackIcon: FC<SVGProps<SVGSVGElement>> = (props) => {
4
+ return (
5
+ <svg
6
+ width={14}
7
+ height={20}
8
+ viewBox="0 0 14 20"
9
+ fill="none"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ aria-hidden="true"
12
+ focusable="false"
13
+ {...props}
14
+ >
15
+ <path
16
+ d="M10 4L4 10L10 16"
17
+ stroke="currentColor"
18
+ strokeWidth="1.5"
19
+ strokeLinecap="round"
20
+ strokeLinejoin="round"
21
+ />
22
+ </svg>
23
+ );
24
+ };
@@ -0,0 +1,28 @@
1
+ import { type FC, type SVGProps } from 'react';
2
+
3
+ export const CheckIcon: FC<SVGProps<SVGSVGElement>> = (props) => {
4
+ return (
5
+ <svg
6
+ width={24}
7
+ height={24}
8
+ viewBox="0 0 24 24"
9
+ fill="none"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ aria-hidden="true"
12
+ focusable="false"
13
+ {...props}
14
+ >
15
+ <g clipPath="url(#clip0_check)">
16
+ <path
17
+ d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM10.4512 15.6953C10.7879 15.973 11.2866 15.9546 11.6016 15.6396L16.7529 10.4883C17.0877 10.1536 17.0877 9.61013 16.7529 9.27539C16.4182 8.94114 15.8756 8.94091 15.541 9.27539L10.9961 13.8223L8.56836 11.3936C8.23374 11.0591 7.69116 11.0593 7.35645 11.3936C7.02171 11.7283 7.02171 12.2717 7.35645 12.6064L10.3867 15.6367C10.4075 15.6575 10.4289 15.6771 10.4512 15.6953Z"
18
+ fill="currentColor"
19
+ />
20
+ </g>
21
+ <defs>
22
+ <clipPath id="clip0_check">
23
+ <rect width="20" height="20" fill="white" transform="translate(2 2)" />
24
+ </clipPath>
25
+ </defs>
26
+ </svg>
27
+ );
28
+ };
@@ -0,0 +1,21 @@
1
+ import { type FC, type SVGProps } from 'react';
2
+
3
+ export const CloseIcon: FC<SVGProps<SVGSVGElement>> = (props) => {
4
+ return (
5
+ <svg
6
+ width={20}
7
+ height={20}
8
+ viewBox="0 0 20 20"
9
+ fill="none"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ aria-hidden="true"
12
+ focusable="false"
13
+ {...props}
14
+ >
15
+ <path
16
+ d="M15.7785 3.2787C16.0389 3.01835 16.4614 3.01835 16.7217 3.2787C16.9819 3.53899 16.9819 3.96077 16.7217 4.22108L10.9421 9.99989L16.7209 15.7787L16.7673 15.8292C16.9809 16.091 16.9658 16.4778 16.7217 16.7219C16.4776 16.9658 16.0908 16.981 15.829 16.7675L15.7785 16.7211L9.99971 10.9422L4.22172 16.7211L4.17126 16.7675C3.90947 16.981 3.52261 16.9658 3.27852 16.7219C3.03445 16.4778 3.0194 16.091 3.23295 15.8292L3.27934 15.7787L9.05733 9.99989L3.27852 4.22108C3.01842 3.96077 3.01839 3.53899 3.27852 3.2787C3.53887 3.01835 3.96137 3.01835 4.22172 3.2787L9.99971 9.05669L15.7785 3.2787Z"
17
+ fill="currentColor"
18
+ />
19
+ </svg>
20
+ );
21
+ };
@@ -0,0 +1,28 @@
1
+ import { type FC, type SVGProps } from 'react';
2
+
3
+ export const CopyIcon: FC<SVGProps<SVGSVGElement>> = (props) => {
4
+ return (
5
+ <svg
6
+ width={20}
7
+ height={20}
8
+ viewBox="0 0 20 20"
9
+ fill="none"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ aria-hidden="true"
12
+ focusable="false"
13
+ {...props}
14
+ >
15
+ <g clipPath="url(#clip0_copy)">
16
+ <path
17
+ d="M16.2247 6.89437C17.1245 6.89437 17.8539 7.6238 17.854 8.5236V16.2246C17.854 17.1244 17.1245 17.8538 16.2247 17.8538H8.52373C7.62388 17.8538 6.89449 17.1244 6.89449 16.2246V8.5236C6.89454 7.6238 7.62391 6.89437 8.52373 6.89437H16.2247ZM8.52373 8.22738C8.36029 8.22738 8.22755 8.36019 8.2275 8.5236V16.2246C8.2275 16.3881 8.36026 16.5208 8.52373 16.5208H16.2247C16.3882 16.5208 16.521 16.3881 16.521 16.2246V8.5236C16.5209 8.36019 16.3881 8.22738 16.2247 8.22738H8.52373ZM13.0225 2.57064C13.8439 2.65419 14.4848 3.34822 14.4848 4.19173V4.91357C14.4848 5.28173 14.1865 5.58002 13.8183 5.58008C13.4501 5.58008 13.1518 5.28176 13.1518 4.91357V4.19173C13.1518 4.04865 13.05 3.92956 12.915 3.90202L12.8556 3.8955H4.19185C4.02839 3.8955 3.89563 4.02827 3.89563 4.19173V12.8555L3.90214 12.9148C3.92968 13.0498 4.04878 13.1517 4.19185 13.1517H4.91369L4.98206 13.1549C5.31816 13.1892 5.5802 13.4731 5.5802 13.8182C5.58014 14.1633 5.31813 14.4473 4.98206 14.4814L4.91369 14.4847H4.19185C3.34833 14.4847 2.65432 13.8438 2.57076 13.0223L2.56262 12.8555V4.19173C2.56262 3.29189 3.29201 2.5625 4.19185 2.5625H12.8556L13.0225 2.57064Z"
18
+ fill="currentColor"
19
+ />
20
+ </g>
21
+ <defs>
22
+ <clipPath id="clip0_copy">
23
+ <rect width="15.8333" height="15.8333" fill="white" transform="translate(2.5 2.5)" />
24
+ </clipPath>
25
+ </defs>
26
+ </svg>
27
+ );
28
+ };
@@ -0,0 +1,24 @@
1
+ import { type FC, type SVGProps } from 'react';
2
+
3
+ export const LinkIcon: FC<SVGProps<SVGSVGElement>> = (props) => {
4
+ return (
5
+ <svg
6
+ width={16}
7
+ height={16}
8
+ viewBox="0 0 16 16"
9
+ fill="none"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ aria-hidden="true"
12
+ focusable="false"
13
+ {...props}
14
+ >
15
+ <path
16
+ d="M6 3L11 8L6 13"
17
+ stroke="currentColor"
18
+ strokeWidth="1.5"
19
+ strokeLinecap="round"
20
+ strokeLinejoin="round"
21
+ />
22
+ </svg>
23
+ );
24
+ };
@@ -0,0 +1,21 @@
1
+ import { type FC, type SVGProps } from 'react';
2
+
3
+ export const Spinner: FC<SVGProps<SVGSVGElement>> = (props) => {
4
+ return (
5
+ <svg
6
+ width={40}
7
+ height={40}
8
+ viewBox="0 0 40 40"
9
+ fill="none"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ aria-hidden="true"
12
+ focusable="false"
13
+ {...props}
14
+ >
15
+ <path
16
+ d="M19.995 3.34375C20.9155 3.34375 21.6617 4.08995 21.6617 5.01042V10.0104C21.6617 10.9309 20.9155 11.6771 19.995 11.6771C19.0745 11.6771 18.3284 10.9309 18.3284 10.0104V5.01042C18.3284 4.08995 19.0745 3.34375 19.995 3.34375ZM19.995 28.3438C20.9155 28.3438 21.6617 29.0899 21.6617 30.0104V35.0104C21.6617 35.9309 20.9155 36.6771 19.995 36.6771C19.0745 36.6771 18.3284 35.9309 18.3284 35.0104V30.0104C18.3284 29.0899 19.0745 28.3438 19.995 28.3438ZM36.6617 20.0104C36.6617 20.9309 35.9155 21.6771 34.995 21.6771H29.995C29.0745 21.6771 28.3284 20.9309 28.3284 20.0104C28.3284 19.0899 29.0745 18.3438 29.995 18.3438H34.995C35.9155 18.3438 36.6617 19.0899 36.6617 20.0104ZM11.6617 20.0104C11.6617 20.9309 10.9155 21.6771 9.99504 21.6771H4.99504C4.07457 21.6771 3.32837 20.9309 3.32837 20.0104C3.32837 19.0899 4.07457 18.3438 4.99504 18.3438H9.99504C10.9155 18.3438 11.6617 19.0899 11.6617 20.0104ZM31.7802 31.7956C31.1292 32.4464 30.074 32.4464 29.4232 31.7956L25.8875 28.2599C25.2367 27.6091 25.2367 26.5539 25.8875 25.9029C26.5385 25.2521 27.5937 25.2521 28.2445 25.9029L31.7802 29.4386C32.431 30.0894 32.431 31.1446 31.7802 31.7956ZM14.1025 14.1179C13.4516 14.7687 12.3963 14.7687 11.7455 14.1179L8.20992 10.5823C7.55905 9.93145 7.55905 8.87618 8.20992 8.2253C8.8608 7.57443 9.91607 7.57443 10.567 8.2253L14.1025 11.7608C14.7534 12.4117 14.7534 13.467 14.1025 14.1179ZM8.20992 31.7956C7.55905 31.1446 7.55905 30.0894 8.20992 29.4386L11.7455 25.9029C12.3963 25.2521 13.4516 25.2521 14.1025 25.9029C14.7534 26.5539 14.7534 27.6091 14.1025 28.2599L10.567 31.7956C9.91607 32.4464 8.8608 32.4464 8.20992 31.7956ZM25.8875 14.1179C25.2367 13.467 25.2367 12.4117 25.8875 11.7608L29.4232 8.2253C30.074 7.57443 31.1292 7.57443 31.7802 8.2253C32.431 8.87618 32.431 9.93145 31.7802 10.5823L28.2445 14.1179C27.5937 14.7687 26.5385 14.7687 25.8875 14.1179Z"
17
+ fill="currentColor"
18
+ />
19
+ </svg>
20
+ );
21
+ };
@@ -0,0 +1,21 @@
1
+ import { type FC, type SVGProps } from 'react';
2
+
3
+ export const WarningIcon: FC<SVGProps<SVGSVGElement>> = (props) => {
4
+ return (
5
+ <svg
6
+ width={20}
7
+ height={18}
8
+ viewBox="0 0 20 18"
9
+ fill="none"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ aria-hidden="true"
12
+ focusable="false"
13
+ {...props}
14
+ >
15
+ <path
16
+ d="M9.05688 0.833252C9.47596 0.107398 10.5234 0.107541 10.9426 0.833252L19.6663 15.9417C20.0852 16.6675 19.561 17.5744 18.7229 17.5745H1.27759C0.43938 17.5745 -0.0848319 16.6676 0.334229 15.9417L9.05688 0.833252ZM9.26685 13.0491V14.5149H10.7327V13.0491H9.26685ZM9.26685 6.65747V12.1018H10.7327V6.65747H9.26685Z"
17
+ fill="currentColor"
18
+ />
19
+ </svg>
20
+ );
21
+ };
@@ -0,0 +1,55 @@
1
+ import { type FC } from 'react';
2
+ import { LinkIcon } from '../asset/linkIcon';
3
+ import placeholderImage from './assets/banner-placeholder.png';
4
+ import './style.scss';
5
+
6
+ interface IdleProps {
7
+ title?: string;
8
+ description?: string;
9
+ linkText?: string;
10
+ linkUrl?: string;
11
+ imageUrl?: string;
12
+ titleColor?: string;
13
+ descriptionColor?: string;
14
+ linkTextColor?: string;
15
+ }
16
+
17
+ export const Idle: FC<IdleProps> = ({
18
+ title = 'PenguinWallet',
19
+ description = `Your non-custodial gateway to the Creditcoin network.
20
+ Hold tokens, swap, and play ecosystem games in one app.`,
21
+ linkText = 'Download',
22
+ linkUrl = 'https://creditcoin.org/Penguin-Wallet',
23
+ imageUrl = placeholderImage,
24
+ titleColor = '#FFFFFF',
25
+ descriptionColor = '#888A8C',
26
+ linkTextColor = '#3374FF',
27
+ }) => {
28
+ return (
29
+ <div className="ck-idle">
30
+ <img className="ck-idle-bg" src={imageUrl} alt="" />
31
+ {title && (
32
+ <h3 className="ck-idle-title" style={{ color: titleColor }}>
33
+ {title}
34
+ </h3>
35
+ )}
36
+ {description && (
37
+ <p className="ck-idle-desc" style={{ color: descriptionColor }}>
38
+ {description}
39
+ </p>
40
+ )}
41
+ {linkText && linkUrl && (
42
+ <a
43
+ className="ck-idle-link"
44
+ href={linkUrl}
45
+ target="_blank"
46
+ rel="noopener noreferrer"
47
+ style={{ color: linkTextColor }}
48
+ >
49
+ <span>{linkText}</span>
50
+ <LinkIcon />
51
+ </a>
52
+ )}
53
+ </div>
54
+ );
55
+ };
@@ -0,0 +1,52 @@
1
+ @use '../../../style/mixin.scss' as *;
2
+ .ck-root {
3
+ .ck-idle {
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: flex-start;
7
+ gap: 6px;
8
+ position: absolute;
9
+ inset: 0;
10
+ z-index: 0;
11
+ padding: 60px;
12
+ box-sizing: border-box;
13
+ }
14
+
15
+ .ck-idle-bg {
16
+ position: absolute;
17
+ inset: 0;
18
+ width: 100%;
19
+ height: 100%;
20
+ object-fit: cover;
21
+ z-index: -1;
22
+ }
23
+
24
+ .ck-idle-title {
25
+ @include textToken('title1-bold');
26
+ color: var(--scale-gray-900);
27
+ }
28
+
29
+ .ck-idle-desc {
30
+ color: var(--scale-gray-600);
31
+ margin-top: 6px;
32
+ white-space: pre-line;
33
+ @include textToken('body4-l1-regular');
34
+ }
35
+
36
+ .ck-idle-link {
37
+ display: flex;
38
+ align-items: center;
39
+ margin: -2px -8px -8px -8px;
40
+ padding: 8px;
41
+
42
+ span {
43
+ @include textToken('body4-l1-bold');
44
+ color: inherit;
45
+ }
46
+
47
+ svg {
48
+ flex-shrink: 0;
49
+ color: inherit;
50
+ }
51
+ }
52
+ }