@babylonlabs-io/core-ui 1.28.0 → 1.29.1
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/Card/Card.stories.d.ts +2 -0
- package/dist/components/Card/Card.stories.js +21 -2
- package/dist/components/Icons/common/BugReportIcon.d.ts +2 -0
- package/dist/components/Icons/common/BugReportIcon.js +7 -0
- package/dist/components/Icons/common/ChevronLeftIcon.d.ts +2 -0
- package/dist/components/Icons/common/ChevronLeftIcon.js +7 -0
- package/dist/components/Icons/index.d.ts +2 -0
- package/dist/components/Icons/index.js +2 -0
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/MenuDrawer.js +3 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Portal/Portal.d.ts +5 -1
- package/dist/components/Portal/Portal.js +27 -28
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useCopy.js +22 -27
- package/dist/hooks/useDrawerAnimation.d.ts +18 -0
- package/dist/hooks/useDrawerAnimation.js +42 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1364 -1251
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/providers/CoreUIProvider.d.ts +11 -0
- package/dist/providers/CoreUIProvider.js +9 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.d.ts +8 -9
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.js +2 -3
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.stories.d.ts +2 -0
- package/dist/widgets/sections/RewardsPreviewModal/RewardsPreviewModal.stories.js +147 -17
- package/dist/widgets/sections/SettingMenu/SettingMenu.js +2 -1
- package/dist/widgets/sections/WalletMenu/WalletMenu.d.ts +7 -0
- package/dist/widgets/sections/WalletMenu/WalletMenu.js +6 -3
- package/dist/widgets/sections/WalletMenu/components/WalletInfoCard.js +1 -1
- package/dist/widgets/sections/WalletMenu/components/WalletInfoSection.js +1 -1
- package/dist/widgets/sections/WalletMenu/components/WalletSettingItem.js +1 -1
- package/package.json +1 -1
- package/tailwind.config.js +86 -3
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from "react";
|
|
2
|
-
interface
|
|
3
|
-
icon
|
|
2
|
+
interface TokenReward {
|
|
3
|
+
icon?: ReactNode;
|
|
4
4
|
name: string;
|
|
5
|
+
amount?: {
|
|
6
|
+
token: string;
|
|
7
|
+
usd: string;
|
|
8
|
+
};
|
|
5
9
|
}
|
|
6
10
|
interface PreviewModalProps {
|
|
7
11
|
open: boolean;
|
|
@@ -9,16 +13,11 @@ interface PreviewModalProps {
|
|
|
9
13
|
title: string;
|
|
10
14
|
onClose: () => void;
|
|
11
15
|
onProceed: () => void;
|
|
12
|
-
|
|
13
|
-
bsns: Info[];
|
|
14
|
-
amount: {
|
|
15
|
-
token: string;
|
|
16
|
-
usd: string;
|
|
17
|
-
};
|
|
16
|
+
tokens: TokenReward[];
|
|
18
17
|
transactionFees: {
|
|
19
18
|
token: string;
|
|
20
19
|
usd: string;
|
|
21
20
|
};
|
|
22
21
|
}
|
|
23
|
-
export declare const RewardsPreviewModal: ({ open, processing, title, onClose, onProceed,
|
|
22
|
+
export declare const RewardsPreviewModal: ({ open, processing, title, onClose, onProceed, tokens, transactionFees, }: PropsWithChildren<PreviewModalProps>) => import("react/jsx-runtime").JSX.Element;
|
|
24
23
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from "@/components/Button";
|
|
3
|
-
import { Warning } from "@/components/Warning";
|
|
4
3
|
import { WINDOW_BREAKPOINT } from "../../../utils/constants";
|
|
5
4
|
import { Dialog, MobileDialog, DialogBody, DialogFooter, DialogHeader } from "@/components/Dialog";
|
|
6
5
|
import { useIsMobile } from "@/hooks/useIsMobile";
|
|
@@ -11,6 +10,6 @@ function ResponsiveDialog({ className, ...restProps }) {
|
|
|
11
10
|
const DialogComponent = isMobileView ? MobileDialog : Dialog;
|
|
12
11
|
return _jsx(DialogComponent, { ...restProps, className: twMerge("w-[41.25rem] max-w-full", className) });
|
|
13
12
|
}
|
|
14
|
-
export const RewardsPreviewModal = ({ open, processing = false, title, onClose, onProceed,
|
|
15
|
-
return (_jsxs(ResponsiveDialog, { open: open, onClose: onClose, children: [_jsx(DialogHeader, { title: title, className: "text-accent-primary" }),
|
|
13
|
+
export const RewardsPreviewModal = ({ open, processing = false, title, onClose, onProceed, tokens, transactionFees, }) => {
|
|
14
|
+
return (_jsxs(ResponsiveDialog, { open: open, onClose: onClose, children: [_jsx(DialogHeader, { title: title, className: "text-accent-primary" }), _jsx(DialogBody, { className: "no-scrollbar mb-[40px] mt-8 flex max-h-[calc(100vh-12rem)] flex-col overflow-y-auto text-accent-primary", children: _jsxs("div", { className: "flex flex-col", children: [_jsx("div", { className: "max-h-[300px] overflow-y-auto", children: tokens.map((token, index) => (_jsxs("div", { children: [_jsx(FeeItem, { title: token.name, hint: token.amount?.usd, children: _jsxs("div", { className: "flex items-center gap-2", children: [token.icon, token.amount?.token] }) }), index < tokens.length - 1 && _jsx("div", { className: "h-4" })] }, `token-${index}`))) }), _jsx("div", { className: "pt-6 pb-6", children: _jsx("div", { className: "border-divider w-full border-t" }) }), _jsx(FeeItem, { title: "Transaction Fees", hint: transactionFees.usd, children: transactionFees.token })] }) }), _jsxs(DialogFooter, { className: "flex flex-col gap-4 pt-0 sm:flex-row", children: [_jsx(Button, { variant: "contained", color: "primary", onClick: onProceed, className: "w-full sm:flex-1 sm:order-2", disabled: processing, children: processing ? "Processing..." : "Proceed" }), _jsx(Button, { variant: "outlined", color: "primary", onClick: onClose, className: "w-full sm:flex-1 sm:order-1", children: "Cancel" })] })] }));
|
|
16
15
|
};
|
|
@@ -12,26 +12,36 @@ export const Default = {
|
|
|
12
12
|
processing: false,
|
|
13
13
|
onClose: () => { },
|
|
14
14
|
onProceed: () => { },
|
|
15
|
-
|
|
15
|
+
tokens: [
|
|
16
16
|
{
|
|
17
17
|
icon: _jsx(PlaceholderIcon, { text: "B1", bgColor: "bg-black" }),
|
|
18
|
-
name: "
|
|
18
|
+
name: "Babylon Genesis",
|
|
19
|
+
amount: {
|
|
20
|
+
token: "1000 BABY",
|
|
21
|
+
usd: "~ $5,677.39 USD",
|
|
22
|
+
},
|
|
19
23
|
},
|
|
20
24
|
{
|
|
21
|
-
icon: _jsx(PlaceholderIcon, { text: "
|
|
22
|
-
name: "
|
|
25
|
+
icon: _jsx(PlaceholderIcon, { text: "C", bgColor: "bg-blue-500" }),
|
|
26
|
+
name: "Cosmos",
|
|
27
|
+
amount: {
|
|
28
|
+
token: "500 ATOM",
|
|
29
|
+
usd: "~ $2,621.78 USD",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "Sui",
|
|
34
|
+
amount: {
|
|
35
|
+
token: "100 SUI",
|
|
36
|
+
usd: "~ $399.79 USD",
|
|
37
|
+
},
|
|
23
38
|
},
|
|
24
39
|
],
|
|
25
|
-
amount: {
|
|
26
|
-
token: "100.000 BABY",
|
|
27
|
-
usd: "$6,677.15 USD",
|
|
28
|
-
},
|
|
29
40
|
transactionFees: {
|
|
30
41
|
token: "10 BABY",
|
|
31
42
|
usd: "$0.56 USD",
|
|
32
43
|
},
|
|
33
|
-
|
|
34
|
-
title: "Claim BABY Rewards",
|
|
44
|
+
title: "Claim Rewards",
|
|
35
45
|
},
|
|
36
46
|
};
|
|
37
47
|
export const OneReceivingToken = {
|
|
@@ -40,21 +50,141 @@ export const OneReceivingToken = {
|
|
|
40
50
|
processing: false,
|
|
41
51
|
onClose: () => { },
|
|
42
52
|
onProceed: () => { },
|
|
43
|
-
|
|
53
|
+
tokens: [
|
|
44
54
|
{
|
|
45
55
|
icon: _jsx(PlaceholderIcon, { text: "B1", bgColor: "bg-black" }),
|
|
46
|
-
name: "
|
|
56
|
+
name: "Babylon Genesis",
|
|
57
|
+
amount: {
|
|
58
|
+
token: "1000 BABY",
|
|
59
|
+
usd: "~ $5,677.39 USD",
|
|
60
|
+
},
|
|
47
61
|
},
|
|
48
62
|
],
|
|
49
|
-
amount: {
|
|
50
|
-
token: "100.000 BABY",
|
|
51
|
-
usd: "$6,677.15 USD",
|
|
52
|
-
},
|
|
53
63
|
transactionFees: {
|
|
54
64
|
token: "10 BABY",
|
|
55
65
|
usd: "$0.56 USD",
|
|
56
66
|
},
|
|
57
|
-
warning: "Processing your claim will take approximately 2 blocks to complete. BABY is a test token without any real world value.",
|
|
58
67
|
title: "Claim BABY Rewards",
|
|
59
68
|
},
|
|
60
69
|
};
|
|
70
|
+
export const TokensWithoutIcons = {
|
|
71
|
+
args: {
|
|
72
|
+
open: true,
|
|
73
|
+
processing: false,
|
|
74
|
+
onClose: () => { },
|
|
75
|
+
onProceed: () => { },
|
|
76
|
+
tokens: [
|
|
77
|
+
{
|
|
78
|
+
name: "Babylon Genesis",
|
|
79
|
+
amount: {
|
|
80
|
+
token: "1000 BABY",
|
|
81
|
+
usd: "~ $5,677.39 USD",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "Cosmos",
|
|
86
|
+
amount: {
|
|
87
|
+
token: "500 ATOM",
|
|
88
|
+
usd: "~ $2,621.78 USD",
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
transactionFees: {
|
|
93
|
+
token: "10 BABY",
|
|
94
|
+
usd: "$0.56 USD",
|
|
95
|
+
},
|
|
96
|
+
title: "Claim Rewards - No Icons",
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
export const LongTokenList = {
|
|
100
|
+
args: {
|
|
101
|
+
open: true,
|
|
102
|
+
processing: false,
|
|
103
|
+
onClose: () => { },
|
|
104
|
+
onProceed: () => { },
|
|
105
|
+
tokens: [
|
|
106
|
+
{
|
|
107
|
+
icon: _jsx(PlaceholderIcon, { text: "B", bgColor: "bg-black" }),
|
|
108
|
+
name: "Babylon Genesis",
|
|
109
|
+
amount: {
|
|
110
|
+
token: "1000 BABY",
|
|
111
|
+
usd: "~ $5,677.39 USD",
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
icon: _jsx(PlaceholderIcon, { text: "C", bgColor: "bg-blue-500" }),
|
|
116
|
+
name: "Cosmos",
|
|
117
|
+
amount: {
|
|
118
|
+
token: "500 ATOM",
|
|
119
|
+
usd: "~ $2,621.78 USD",
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
icon: _jsx(PlaceholderIcon, { text: "S", bgColor: "bg-green-500" }),
|
|
124
|
+
name: "Sui",
|
|
125
|
+
amount: {
|
|
126
|
+
token: "100 SUI",
|
|
127
|
+
usd: "~ $399.79 USD",
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
icon: _jsx(PlaceholderIcon, { text: "E", bgColor: "bg-purple-500" }),
|
|
132
|
+
name: "Ethereum",
|
|
133
|
+
amount: {
|
|
134
|
+
token: "2.5 ETH",
|
|
135
|
+
usd: "~ $8,250.00 USD",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
icon: _jsx(PlaceholderIcon, { text: "B", bgColor: "bg-orange-500" }),
|
|
140
|
+
name: "Bitcoin",
|
|
141
|
+
amount: {
|
|
142
|
+
token: "0.15 BTC",
|
|
143
|
+
usd: "~ $6,450.00 USD",
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "Polygon",
|
|
148
|
+
amount: {
|
|
149
|
+
token: "2000 MATIC",
|
|
150
|
+
usd: "~ $1,800.00 USD",
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
icon: _jsx(PlaceholderIcon, { text: "A", bgColor: "bg-red-500" }),
|
|
155
|
+
name: "Avalanche",
|
|
156
|
+
amount: {
|
|
157
|
+
token: "150 AVAX",
|
|
158
|
+
usd: "~ $5,250.00 USD",
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "Solana",
|
|
163
|
+
amount: {
|
|
164
|
+
token: "25 SOL",
|
|
165
|
+
usd: "~ $2,750.00 USD",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
icon: _jsx(PlaceholderIcon, { text: "D", bgColor: "bg-yellow-500" }),
|
|
170
|
+
name: "Dogecoin",
|
|
171
|
+
amount: {
|
|
172
|
+
token: "10000 DOGE",
|
|
173
|
+
usd: "~ $800.00 USD",
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "Cardano",
|
|
178
|
+
amount: {
|
|
179
|
+
token: "5000 ADA",
|
|
180
|
+
usd: "~ $2,000.00 USD",
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
transactionFees: {
|
|
185
|
+
token: "15 BABY",
|
|
186
|
+
usd: "$0.84 USD",
|
|
187
|
+
},
|
|
188
|
+
title: "Claim Large Rewards - Scrollable List",
|
|
189
|
+
},
|
|
190
|
+
};
|
|
@@ -3,9 +3,10 @@ import { Menu } from "@/components/Menu";
|
|
|
3
3
|
import { Spacer } from "@/components/Spacer";
|
|
4
4
|
import { SettingsIcon } from "@/elements/Icons";
|
|
5
5
|
import { SettingMenuTitle, SettingMenuGroup, SettingMenuItem, SettingMenuSubMenu, SettingMenuDescription, SettingMenuCustomContent, } from "./components";
|
|
6
|
+
import { twJoin } from "tailwind-merge";
|
|
6
7
|
const SettingMenuBase = ({ trigger, open, onOpenChange, placement = "bottom-end", className, offset = [0, 8], children, }) => {
|
|
7
8
|
const defaultTrigger = (_jsx("button", { className: "flex h-10 w-10 items-center justify-center rounded-lg transition-colors hover:bg-accent-primary/10", "aria-label": "Settings menu", children: _jsx(SettingsIcon, {}) }));
|
|
8
|
-
return (_jsx(Menu, { trigger: trigger || defaultTrigger, open: open, onOpenChange: onOpenChange, placement: placement, className: className, offset: offset, children: children }));
|
|
9
|
+
return (_jsx(Menu, { trigger: trigger || defaultTrigger, open: open, onOpenChange: onOpenChange, placement: placement, className: twJoin("relative", className), offset: offset, mobileMode: "drawer", children: children }));
|
|
9
10
|
};
|
|
10
11
|
export const SettingMenu = SettingMenuBase;
|
|
11
12
|
SettingMenu.Title = SettingMenuTitle;
|
|
@@ -16,5 +16,12 @@ export interface WalletMenuProps {
|
|
|
16
16
|
onDisconnect: () => void;
|
|
17
17
|
forceOpen?: boolean;
|
|
18
18
|
onOpenChange?: (isOpen: boolean) => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
mobileMode?: "drawer" | "dialog";
|
|
21
|
+
copy?: {
|
|
22
|
+
isCopied?: (key: "btc" | "bbn" | "publicKey") => boolean;
|
|
23
|
+
copyToClipboard?: (key: "btc" | "bbn" | "publicKey", value: string) => void;
|
|
24
|
+
timeout?: number;
|
|
25
|
+
};
|
|
19
26
|
}
|
|
20
27
|
export declare const WalletMenu: React.FC<WalletMenuProps>;
|
|
@@ -7,8 +7,11 @@ import { WalletSettingItem } from "./components/WalletSettingItem";
|
|
|
7
7
|
import { WalletInfoSection } from "./components/WalletInfoSection";
|
|
8
8
|
import { UsingInscriptionIcon, LinkWalletIcon, BitcoinPublicKeyIcon } from "../../../components/Icons";
|
|
9
9
|
import { useCopy } from "../../../hooks/useCopy";
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import { twJoin } from "tailwind-merge";
|
|
11
|
+
export const WalletMenu = ({ trigger, btcAddress, bbnAddress, selectedWallets, ordinalsExcluded, linkedDelegationsVisibility, onIncludeOrdinals, onExcludeOrdinals, onDisplayLinkedDelegations, publicKeyNoCoord, onDisconnect, forceOpen = false, onOpenChange, className, mobileMode = "dialog", copy, }) => {
|
|
12
|
+
const { copyToClipboard: internalCopy, isCopied: internalIsCopied } = useCopy({ timeout: copy?.timeout });
|
|
13
|
+
const isCopied = copy?.isCopied ?? internalIsCopied;
|
|
14
|
+
const copyToClipboard = copy?.copyToClipboard ?? internalCopy;
|
|
12
15
|
const [isOpen, setIsOpen] = useState(forceOpen);
|
|
13
16
|
const handleOpenChange = useCallback((open) => {
|
|
14
17
|
setIsOpen(open);
|
|
@@ -18,5 +21,5 @@ export const WalletMenu = ({ trigger, btcAddress, bbnAddress, selectedWallets, o
|
|
|
18
21
|
setIsOpen(false);
|
|
19
22
|
onDisconnect();
|
|
20
23
|
}, [onDisconnect]);
|
|
21
|
-
return (_jsx(Menu, { trigger: trigger, open: isOpen, onOpenChange: handleOpenChange, mobileMode:
|
|
24
|
+
return (_jsx(Menu, { trigger: trigger, open: isOpen, onOpenChange: handleOpenChange, mobileMode: mobileMode, className: twJoin("shadow-lg border border-[#38708533] bg-[#FFFFFF] dark:bg-[#252525] dark:border-[#404040] rounded-lg", className), children: _jsxs("div", { className: "p-4 space-y-6 w-full text-primary-main", children: [_jsxs("div", { className: "flex flex-row gap-2 w-full md:flex-col overflow-x-auto", children: [_jsx(WalletInfoCard, { walletType: "Bitcoin", walletName: selectedWallets["BTC"]?.name, walletIcon: selectedWallets["BTC"]?.icon, address: btcAddress, isCopied: isCopied("btc"), onCopy: () => copyToClipboard("btc", btcAddress) }), _jsx(WalletInfoCard, { walletType: "Babylon", walletName: selectedWallets["BBN"]?.name, walletIcon: selectedWallets["BBN"]?.icon, address: bbnAddress, isCopied: isCopied("bbn"), onCopy: () => copyToClipboard("bbn", bbnAddress) })] }), _jsxs("div", { className: "flex flex-col w-full bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-lg md:bg-transparent md:dark:bg-transparent md:border-none md:gap-8", children: [_jsx(WalletSettingItem, { icon: _jsx(UsingInscriptionIcon, {}), title: "Using Inscriptions", status: ordinalsExcluded ? "Off" : "On", value: !ordinalsExcluded, onChange: (value) => value ? onIncludeOrdinals() : onExcludeOrdinals() }), _jsx(WalletSettingItem, { icon: _jsx(LinkWalletIcon, {}), title: "Linked Wallet Stakes", status: linkedDelegationsVisibility ? "On" : "Off", value: linkedDelegationsVisibility, onChange: onDisplayLinkedDelegations }), _jsx(WalletInfoSection, { title: "Bitcoin Public Key", value: publicKeyNoCoord, isCopied: isCopied("publicKey"), onCopy: () => copyToClipboard("publicKey", publicKeyNoCoord), icon: _jsx(BitcoinPublicKeyIcon, {}), className: "rounded-b-lg rounded-t-none md:rounded-none" })] }), _jsx("div", { className: "pt-2", children: _jsx(WalletDisconnectButton, { onClick: handleDisconnect, fluid: true, children: "Disconnect Wallets" }) })] }) }));
|
|
22
25
|
};
|
|
@@ -5,5 +5,5 @@ import { DisplayHash } from '../../../../components/DisplayHash';
|
|
|
5
5
|
import { CopyIcon } from '../../../../components/Icons';
|
|
6
6
|
import { twJoin } from 'tailwind-merge';
|
|
7
7
|
export const WalletInfoCard = ({ walletType, walletName, walletIcon, address, isCopied, onCopy, className, }) => {
|
|
8
|
-
return (_jsx("div", { className: twJoin("bg-
|
|
8
|
+
return (_jsx("div", { className: twJoin("bg-[#F9F9F9] dark:bg-[#2F2F2F] rounded-[4px] p-3 flex-1 md:p-4", className), children: _jsxs("div", { className: "flex flex-col w-full", children: [_jsx("div", { className: "flex justify-start mb-2 md:mb-3", children: _jsx(Avatar, { alt: walletName || walletType, url: walletIcon || '', size: "large", className: "w-8 h-8 md:w-10 md:h-10" }) }), _jsx("div", { className: "flex justify-start mb-[1px]", children: _jsxs(Text, { variant: "body1", className: "text-accent-secondary font-medium !text-xs", children: [walletType, " Wallet"] }) }), _jsxs("div", { className: "flex items-center justify-between w-full", children: [_jsx("div", { className: "flex-1 min-w-0", children: isCopied ? (_jsx(Text, { className: "text-accent-primary !text-sm truncate whitespace-nowrap", children: "Copied \u2713" })) : (_jsx(DisplayHash, { className: "text-accent-primary !text-sm", value: address, symbols: 6 })) }), _jsx("button", { onClick: onCopy, className: "flex-shrink-0 ml-3 p-1 rounded hover:bg-[#d7e1e7] dark:hover:bg-[#252525] transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80", children: _jsx(CopyIcon, { size: 14, className: "md:w-4 md:h-4" }) })] })] }) }));
|
|
9
9
|
};
|
|
@@ -4,5 +4,5 @@ import { DisplayHash } from '../../../../components/DisplayHash';
|
|
|
4
4
|
import { CopyIcon } from '../../../../components/Icons';
|
|
5
5
|
import { twJoin } from 'tailwind-merge';
|
|
6
6
|
export const WalletInfoSection = ({ title, value, isCopied, onCopy, className, icon, }) => {
|
|
7
|
-
return (_jsx("div", { className: twJoin("flex items-center justify-between w-full
|
|
7
|
+
return (_jsx("div", { className: twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0", className), children: _jsx("div", { className: "flex flex-col w-full", children: _jsxs("div", { className: "flex items-center gap-4", children: [icon && (_jsx("div", { className: "flex-shrink-0", children: icon })), _jsxs("div", { className: "flex w-full", children: [_jsxs("div", { className: "flex flex-col w-full", children: [_jsx(Text, { variant: "body2", className: "text-accent-primary font-medium text-xs", children: title }), _jsx("div", { className: "flex items-center justify-between w-full", children: _jsx("div", { className: "flex-1 min-w-0", children: isCopied ? (_jsx(Text, { className: "text-accent-secondary !text-xs truncate whitespace-nowrap", children: "Copied \u2713" })) : (_jsx(DisplayHash, { className: "text-accent-secondary !text-xs", value: value, symbols: 6 })) }) })] }), _jsx("button", { onClick: onCopy, className: "flex-shrink-0 ml-3 p-1 rounded hover:bg-surface-tertiary transition-colors h-6 w-6 flex items-center justify-center hover:opacity-80 self-center", children: _jsx(CopyIcon, { size: 16 }) })] })] }) }) }));
|
|
8
8
|
};
|
|
@@ -3,5 +3,5 @@ import { Text } from '../../../../components/Text';
|
|
|
3
3
|
import { WalletToggle } from './WalletToggle';
|
|
4
4
|
import { twJoin } from 'tailwind-merge';
|
|
5
5
|
export const WalletSettingItem = ({ icon, title, status, value, onChange, className, }) => {
|
|
6
|
-
return (_jsxs("div", { className: twJoin("flex items-center justify-between w-full
|
|
6
|
+
return (_jsxs("div", { className: twJoin("flex items-center justify-between w-full p-3 md:p-0 md:mb-0", className), children: [_jsxs("div", { className: "flex items-center gap-4", children: [icon, _jsxs("div", { className: "flex flex-col", children: [_jsx(Text, { variant: "body2", className: "text-accent-primary font-medium", children: title }), _jsx(Text, { className: "text-accent-secondary !text-xs", children: status })] })] }), _jsx(WalletToggle, { value: value, onChange: onChange })] }));
|
|
7
7
|
};
|
package/package.json
CHANGED
package/tailwind.config.js
CHANGED
|
@@ -3,8 +3,93 @@ import { createThemes } from "tw-colors";
|
|
|
3
3
|
|
|
4
4
|
/** @type {import('tailwindcss').Config} */
|
|
5
5
|
export default {
|
|
6
|
-
content: [
|
|
6
|
+
content: [
|
|
7
|
+
"./src/**/*.{js,ts,jsx,tsx,css}",
|
|
8
|
+
"./dist/**/*.{js,ts,jsx,tsx}"
|
|
9
|
+
],
|
|
7
10
|
darkMode: ["class", '[data-mode="dark"]'],
|
|
11
|
+
safelist: [
|
|
12
|
+
// Include theme color classes with proper pattern syntax
|
|
13
|
+
{
|
|
14
|
+
pattern: /(bg|text|border)-(primary|secondary|accent|surface|error|warning|info|success|neutral)-(main|light|dark|contrast|highlight|strokeLight|strokeDark|100|200)/,
|
|
15
|
+
variants: ['dark', 'hover', 'focus', 'disabled'],
|
|
16
|
+
},
|
|
17
|
+
// Animation patterns
|
|
18
|
+
{
|
|
19
|
+
pattern: /animate-(modal|mobile-modal|backdrop)-(in|out)/,
|
|
20
|
+
},
|
|
21
|
+
// Common opacity values used
|
|
22
|
+
{
|
|
23
|
+
pattern: /opacity-(0|30|100)/,
|
|
24
|
+
variants: ['dark', 'hover'],
|
|
25
|
+
},
|
|
26
|
+
// Transform patterns used in dialogs/drawers
|
|
27
|
+
{
|
|
28
|
+
pattern: /-?translate-(x|y)-(0|full|1\/2|1\/4)/,
|
|
29
|
+
},
|
|
30
|
+
// Critical dark mode and color classes
|
|
31
|
+
'dark',
|
|
32
|
+
'bg-[#FFFFFF]',
|
|
33
|
+
'dark:bg-[#252525]',
|
|
34
|
+
'dark:bg-[#404040]',
|
|
35
|
+
'border-[#38708533]',
|
|
36
|
+
'dark:border-[#404040]',
|
|
37
|
+
'bg-black/50',
|
|
38
|
+
// Essential layout classes
|
|
39
|
+
'fixed',
|
|
40
|
+
'absolute',
|
|
41
|
+
'relative',
|
|
42
|
+
'z-40',
|
|
43
|
+
'z-50',
|
|
44
|
+
'z-[9999]',
|
|
45
|
+
'inset-0',
|
|
46
|
+
'inset-x-0',
|
|
47
|
+
'inset-y-0',
|
|
48
|
+
'top-0',
|
|
49
|
+
'right-0',
|
|
50
|
+
'bottom-0',
|
|
51
|
+
'left-0',
|
|
52
|
+
// Essential display/flex
|
|
53
|
+
'hidden',
|
|
54
|
+
'block',
|
|
55
|
+
'flex',
|
|
56
|
+
'inline-block',
|
|
57
|
+
'inline-flex',
|
|
58
|
+
'contents',
|
|
59
|
+
'items-center',
|
|
60
|
+
'justify-center',
|
|
61
|
+
'justify-between',
|
|
62
|
+
// Essential sizing
|
|
63
|
+
'w-full',
|
|
64
|
+
'h-full',
|
|
65
|
+
'min-w-[294px]',
|
|
66
|
+
'max-w-sm',
|
|
67
|
+
'max-h-full',
|
|
68
|
+
// Essential spacing
|
|
69
|
+
'p-4',
|
|
70
|
+
'px-4',
|
|
71
|
+
'pb-4',
|
|
72
|
+
'pt-12',
|
|
73
|
+
'mt-4',
|
|
74
|
+
// Essential borders/rounds
|
|
75
|
+
'border',
|
|
76
|
+
'rounded',
|
|
77
|
+
'rounded-lg',
|
|
78
|
+
'rounded-t-3xl',
|
|
79
|
+
'rounded-full',
|
|
80
|
+
// Essential transitions
|
|
81
|
+
'transition-opacity',
|
|
82
|
+
'transition-transform',
|
|
83
|
+
'transition-colors',
|
|
84
|
+
'duration-300',
|
|
85
|
+
'duration-500',
|
|
86
|
+
// Essential utilities
|
|
87
|
+
'shadow-lg',
|
|
88
|
+
'pointer-events-none',
|
|
89
|
+
'pointer-events-auto',
|
|
90
|
+
'overflow-hidden',
|
|
91
|
+
'overflow-y-auto',
|
|
92
|
+
],
|
|
8
93
|
theme: {
|
|
9
94
|
fontFamily: {
|
|
10
95
|
sans: ["Px Grotesk", ...defaultTheme.fontFamily.sans],
|
|
@@ -104,7 +189,6 @@ export default {
|
|
|
104
189
|
plugins: [
|
|
105
190
|
createThemes({
|
|
106
191
|
light: {
|
|
107
|
-
current: "currentColor",
|
|
108
192
|
transparent: "transparent",
|
|
109
193
|
surface: "#ffffff",
|
|
110
194
|
accent: {
|
|
@@ -152,7 +236,6 @@ export default {
|
|
|
152
236
|
},
|
|
153
237
|
},
|
|
154
238
|
dark: {
|
|
155
|
-
current: "currentColor",
|
|
156
239
|
transparent: "transparent",
|
|
157
240
|
surface: "#202020",
|
|
158
241
|
accent: {
|