@hfunlabs/hypurr-connect 0.1.19 → 0.1.20
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/index.js +40 -69
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/WalletSelectorDropdown.tsx +15 -49
package/dist/index.js
CHANGED
|
@@ -4997,27 +4997,6 @@ var formatCompactAddress = (addr) => {
|
|
|
4997
4997
|
if (!addr) return "";
|
|
4998
4998
|
return `${addr.slice(0, 4)}...${addr.slice(-2)}`;
|
|
4999
4999
|
};
|
|
5000
|
-
function getWalletTypeMeta2(wallet) {
|
|
5001
|
-
if (wallet.isAgent) {
|
|
5002
|
-
return {
|
|
5003
|
-
label: "Agent wallet",
|
|
5004
|
-
color: "#38bdf8",
|
|
5005
|
-
icon: /* @__PURE__ */ jsx12(Bot, { size: 12 })
|
|
5006
|
-
};
|
|
5007
|
-
}
|
|
5008
|
-
if (wallet.isReadOnly) {
|
|
5009
|
-
return {
|
|
5010
|
-
label: "Read-only wallet",
|
|
5011
|
-
color: "#a78bfa",
|
|
5012
|
-
icon: /* @__PURE__ */ jsx12(Eye, { size: 12 })
|
|
5013
|
-
};
|
|
5014
|
-
}
|
|
5015
|
-
return {
|
|
5016
|
-
label: "Private-key wallet",
|
|
5017
|
-
color: "#34d399",
|
|
5018
|
-
icon: /* @__PURE__ */ jsx12(KeyRound, { size: 12 })
|
|
5019
|
-
};
|
|
5020
|
-
}
|
|
5021
5000
|
var rootStyle = {
|
|
5022
5001
|
position: "absolute",
|
|
5023
5002
|
right: 0,
|
|
@@ -5030,6 +5009,13 @@ var rootStyle = {
|
|
|
5030
5009
|
transformOrigin: "top right",
|
|
5031
5010
|
overflow: "hidden"
|
|
5032
5011
|
};
|
|
5012
|
+
var SCROLLBAR_CLASS = "hpc-wallet-scroll";
|
|
5013
|
+
var scrollbarCss = `
|
|
5014
|
+
.${SCROLLBAR_CLASS}::-webkit-scrollbar { width: 6px; height: 6px; }
|
|
5015
|
+
.${SCROLLBAR_CLASS}::-webkit-scrollbar-track { background: #0b0e11; }
|
|
5016
|
+
.${SCROLLBAR_CLASS}::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
|
|
5017
|
+
.${SCROLLBAR_CLASS}::-webkit-scrollbar-thumb:hover { background: #4b5563; }
|
|
5018
|
+
`;
|
|
5033
5019
|
var sectionBorder = "1px solid rgb(var(--line))";
|
|
5034
5020
|
var sectionHeaderStyle = {
|
|
5035
5021
|
padding: "8px 16px",
|
|
@@ -5116,7 +5102,6 @@ function WalletSelectorDropdown({
|
|
|
5116
5102
|
depth,
|
|
5117
5103
|
isSelected,
|
|
5118
5104
|
label,
|
|
5119
|
-
walletType: getWalletTypeMeta2(wallet),
|
|
5120
5105
|
compactAddress,
|
|
5121
5106
|
onSelect: () => {
|
|
5122
5107
|
selectWallet(wallet.id);
|
|
@@ -5147,6 +5132,7 @@ function WalletSelectorDropdown({
|
|
|
5147
5132
|
exit: { opacity: 0, scale: 0.95 },
|
|
5148
5133
|
transition: { duration: 0.15, ease: "easeOut" },
|
|
5149
5134
|
children: [
|
|
5135
|
+
/* @__PURE__ */ jsx12("style", { children: scrollbarCss }),
|
|
5150
5136
|
/* @__PURE__ */ jsxs11(
|
|
5151
5137
|
"button",
|
|
5152
5138
|
{
|
|
@@ -5306,10 +5292,13 @@ function WalletSelectorDropdown({
|
|
|
5306
5292
|
/* @__PURE__ */ jsx12(
|
|
5307
5293
|
"div",
|
|
5308
5294
|
{
|
|
5295
|
+
className: SCROLLBAR_CLASS,
|
|
5309
5296
|
style: {
|
|
5310
5297
|
maxHeight: 256,
|
|
5311
5298
|
overflowY: "auto",
|
|
5312
|
-
paddingBottom: 4
|
|
5299
|
+
paddingBottom: 4,
|
|
5300
|
+
scrollbarWidth: "thin",
|
|
5301
|
+
scrollbarColor: "#374151 #0b0e11"
|
|
5313
5302
|
},
|
|
5314
5303
|
children: walletListEntries.map((entry) => {
|
|
5315
5304
|
if (entry.type === "wallet") {
|
|
@@ -5483,7 +5472,6 @@ function WalletRow2({
|
|
|
5483
5472
|
depth,
|
|
5484
5473
|
isSelected,
|
|
5485
5474
|
label,
|
|
5486
|
-
walletType,
|
|
5487
5475
|
compactAddress,
|
|
5488
5476
|
onSelect,
|
|
5489
5477
|
onShowPortfolio,
|
|
@@ -5525,7 +5513,7 @@ function WalletRow2({
|
|
|
5525
5513
|
if (actions) actions.style.opacity = "0";
|
|
5526
5514
|
},
|
|
5527
5515
|
children: [
|
|
5528
|
-
/* @__PURE__ */
|
|
5516
|
+
/* @__PURE__ */ jsx12(
|
|
5529
5517
|
"button",
|
|
5530
5518
|
{
|
|
5531
5519
|
onClick: onSelect,
|
|
@@ -5542,64 +5530,47 @@ function WalletRow2({
|
|
|
5542
5530
|
cursor: "pointer",
|
|
5543
5531
|
padding: 0
|
|
5544
5532
|
},
|
|
5545
|
-
children: [
|
|
5533
|
+
children: label ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
5546
5534
|
/* @__PURE__ */ jsx12(
|
|
5547
5535
|
"span",
|
|
5548
5536
|
{
|
|
5549
|
-
title: walletType.label,
|
|
5550
|
-
"aria-label": walletType.label,
|
|
5551
5537
|
style: {
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5538
|
+
overflow: "hidden",
|
|
5539
|
+
textOverflow: "ellipsis",
|
|
5540
|
+
whiteSpace: "nowrap",
|
|
5541
|
+
color: isAgentExpired ? walletTextColor : isSelected ? "rgb(var(--content))" : void 0,
|
|
5542
|
+
fontWeight: isSelected ? 500 : void 0
|
|
5557
5543
|
},
|
|
5558
|
-
children:
|
|
5544
|
+
children: label
|
|
5559
5545
|
}
|
|
5560
5546
|
),
|
|
5561
|
-
|
|
5562
|
-
/* @__PURE__ */ jsx12(
|
|
5563
|
-
"span",
|
|
5564
|
-
{
|
|
5565
|
-
style: {
|
|
5566
|
-
overflow: "hidden",
|
|
5567
|
-
textOverflow: "ellipsis",
|
|
5568
|
-
whiteSpace: "nowrap",
|
|
5569
|
-
color: isAgentExpired ? walletTextColor : isSelected ? "rgb(var(--content))" : void 0,
|
|
5570
|
-
fontWeight: isSelected ? 500 : void 0
|
|
5571
|
-
},
|
|
5572
|
-
children: label
|
|
5573
|
-
}
|
|
5574
|
-
),
|
|
5575
|
-
/* @__PURE__ */ jsxs11(
|
|
5576
|
-
"span",
|
|
5577
|
-
{
|
|
5578
|
-
style: {
|
|
5579
|
-
fontSize: 12,
|
|
5580
|
-
fontWeight: 400,
|
|
5581
|
-
flexShrink: 0,
|
|
5582
|
-
color: mutedTextColor
|
|
5583
|
-
},
|
|
5584
|
-
children: [
|
|
5585
|
-
"(",
|
|
5586
|
-
compactAddress,
|
|
5587
|
-
")"
|
|
5588
|
-
]
|
|
5589
|
-
}
|
|
5590
|
-
)
|
|
5591
|
-
] }) : /* @__PURE__ */ jsx12(
|
|
5547
|
+
/* @__PURE__ */ jsxs11(
|
|
5592
5548
|
"span",
|
|
5593
5549
|
{
|
|
5594
5550
|
style: {
|
|
5595
5551
|
fontSize: 12,
|
|
5596
|
-
|
|
5597
|
-
|
|
5552
|
+
fontWeight: 400,
|
|
5553
|
+
flexShrink: 0,
|
|
5554
|
+
color: mutedTextColor
|
|
5598
5555
|
},
|
|
5599
|
-
children:
|
|
5556
|
+
children: [
|
|
5557
|
+
"(",
|
|
5558
|
+
compactAddress,
|
|
5559
|
+
")"
|
|
5560
|
+
]
|
|
5600
5561
|
}
|
|
5601
5562
|
)
|
|
5602
|
-
]
|
|
5563
|
+
] }) : /* @__PURE__ */ jsx12(
|
|
5564
|
+
"span",
|
|
5565
|
+
{
|
|
5566
|
+
style: {
|
|
5567
|
+
fontSize: 12,
|
|
5568
|
+
color: isAgentExpired ? walletTextColor : isSelected ? "rgb(var(--content))" : "rgb(var(--content-muted))",
|
|
5569
|
+
fontWeight: isSelected ? 500 : void 0
|
|
5570
|
+
},
|
|
5571
|
+
children: compactAddress
|
|
5572
|
+
}
|
|
5573
|
+
)
|
|
5603
5574
|
}
|
|
5604
5575
|
),
|
|
5605
5576
|
agentExpiryTitle && /* @__PURE__ */ jsx12(
|