@fairmint/ui 0.2.14 → 0.2.16
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/specific/WalletList/WalletList.d.ts +35 -5
- package/dist/components/specific/WalletList/WalletList.d.ts.map +1 -1
- package/dist/fairmint-ui.cjs +303 -73
- package/dist/fairmint-ui.cjs.map +1 -1
- package/dist/fairmint-ui.js +303 -73
- package/dist/fairmint-ui.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/spacing.d.ts +14 -0
- package/dist/theme/spacing.d.ts.map +1 -0
- package/dist/utils/wallets.d.ts +19 -0
- package/dist/utils/wallets.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/fairmint-ui.js
CHANGED
|
@@ -15839,14 +15839,14 @@ function useAvatarGroupContext() {
|
|
|
15839
15839
|
const ctx = useContext(AvatarGroupContext);
|
|
15840
15840
|
return { withinGroup: !!ctx };
|
|
15841
15841
|
}
|
|
15842
|
-
const varsResolver$v = createVarsResolver((_, { spacing }) => ({
|
|
15842
|
+
const varsResolver$v = createVarsResolver((_, { spacing: spacing2 }) => ({
|
|
15843
15843
|
group: {
|
|
15844
|
-
"--ag-spacing": getSpacing(
|
|
15844
|
+
"--ag-spacing": getSpacing(spacing2)
|
|
15845
15845
|
}
|
|
15846
15846
|
}));
|
|
15847
15847
|
const AvatarGroup = factory((_props, ref) => {
|
|
15848
15848
|
const props = useProps("AvatarGroup", null, _props);
|
|
15849
|
-
const { classNames: classNames2, className, style, styles, unstyled, vars, spacing, attributes, ...others } = props;
|
|
15849
|
+
const { classNames: classNames2, className, style, styles, unstyled, vars, spacing: spacing2, attributes, ...others } = props;
|
|
15850
15850
|
const getStyles2 = useStyles({
|
|
15851
15851
|
name: "AvatarGroup",
|
|
15852
15852
|
classes: classes$t,
|
|
@@ -21383,15 +21383,15 @@ Select$1.classes = { ...InputBase.classes, ...Combobox.classes };
|
|
|
21383
21383
|
Select$1.displayName = "@mantine/core/Select";
|
|
21384
21384
|
var classes$8 = { "container": "m_925c2d2c", "root": "m_2415a157" };
|
|
21385
21385
|
function SimpleGridMediaVariables({
|
|
21386
|
-
spacing,
|
|
21386
|
+
spacing: spacing2,
|
|
21387
21387
|
verticalSpacing,
|
|
21388
21388
|
cols,
|
|
21389
21389
|
selector
|
|
21390
21390
|
}) {
|
|
21391
21391
|
const theme2 = useMantineTheme();
|
|
21392
|
-
const _verticalSpacing = verticalSpacing === void 0 ?
|
|
21392
|
+
const _verticalSpacing = verticalSpacing === void 0 ? spacing2 : verticalSpacing;
|
|
21393
21393
|
const baseStyles = filterProps({
|
|
21394
|
-
"--sg-spacing-x": getSpacing(getBaseValue$1(
|
|
21394
|
+
"--sg-spacing-x": getSpacing(getBaseValue$1(spacing2)),
|
|
21395
21395
|
"--sg-spacing-y": getSpacing(getBaseValue$1(_verticalSpacing)),
|
|
21396
21396
|
"--sg-cols": getBaseValue$1(cols)?.toString()
|
|
21397
21397
|
});
|
|
@@ -21400,8 +21400,8 @@ function SimpleGridMediaVariables({
|
|
|
21400
21400
|
if (!acc[breakpoint]) {
|
|
21401
21401
|
acc[breakpoint] = {};
|
|
21402
21402
|
}
|
|
21403
|
-
if (typeof
|
|
21404
|
-
acc[breakpoint]["--sg-spacing-x"] = getSpacing(
|
|
21403
|
+
if (typeof spacing2 === "object" && spacing2[breakpoint] !== void 0) {
|
|
21404
|
+
acc[breakpoint]["--sg-spacing-x"] = getSpacing(spacing2[breakpoint]);
|
|
21405
21405
|
}
|
|
21406
21406
|
if (typeof _verticalSpacing === "object" && _verticalSpacing[breakpoint] !== void 0) {
|
|
21407
21407
|
acc[breakpoint]["--sg-spacing-y"] = getSpacing(_verticalSpacing[breakpoint]);
|
|
@@ -21432,13 +21432,13 @@ function sortBreakpoints(breakpoints) {
|
|
|
21432
21432
|
return breakpoints.sort((a, b) => px(a) - px(b));
|
|
21433
21433
|
}
|
|
21434
21434
|
function getUniqueBreakpoints({
|
|
21435
|
-
spacing,
|
|
21435
|
+
spacing: spacing2,
|
|
21436
21436
|
verticalSpacing,
|
|
21437
21437
|
cols
|
|
21438
21438
|
}) {
|
|
21439
21439
|
const breakpoints = Array.from(
|
|
21440
21440
|
/* @__PURE__ */ new Set([
|
|
21441
|
-
...getBreakpoints(
|
|
21441
|
+
...getBreakpoints(spacing2),
|
|
21442
21442
|
...getBreakpoints(verticalSpacing),
|
|
21443
21443
|
...getBreakpoints(cols)
|
|
21444
21444
|
])
|
|
@@ -21446,25 +21446,25 @@ function getUniqueBreakpoints({
|
|
|
21446
21446
|
return sortBreakpoints(breakpoints);
|
|
21447
21447
|
}
|
|
21448
21448
|
function SimpleGridContainerVariables({
|
|
21449
|
-
spacing,
|
|
21449
|
+
spacing: spacing2,
|
|
21450
21450
|
verticalSpacing,
|
|
21451
21451
|
cols,
|
|
21452
21452
|
selector
|
|
21453
21453
|
}) {
|
|
21454
|
-
const _verticalSpacing = verticalSpacing === void 0 ?
|
|
21454
|
+
const _verticalSpacing = verticalSpacing === void 0 ? spacing2 : verticalSpacing;
|
|
21455
21455
|
const baseStyles = filterProps({
|
|
21456
|
-
"--sg-spacing-x": getSpacing(getBaseValue$1(
|
|
21456
|
+
"--sg-spacing-x": getSpacing(getBaseValue$1(spacing2)),
|
|
21457
21457
|
"--sg-spacing-y": getSpacing(getBaseValue$1(_verticalSpacing)),
|
|
21458
21458
|
"--sg-cols": getBaseValue$1(cols)?.toString()
|
|
21459
21459
|
});
|
|
21460
|
-
const uniqueBreakpoints = getUniqueBreakpoints({ spacing, verticalSpacing, cols });
|
|
21460
|
+
const uniqueBreakpoints = getUniqueBreakpoints({ spacing: spacing2, verticalSpacing, cols });
|
|
21461
21461
|
const queries = uniqueBreakpoints.reduce(
|
|
21462
21462
|
(acc, breakpoint) => {
|
|
21463
21463
|
if (!acc[breakpoint]) {
|
|
21464
21464
|
acc[breakpoint] = {};
|
|
21465
21465
|
}
|
|
21466
|
-
if (typeof
|
|
21467
|
-
acc[breakpoint]["--sg-spacing-x"] = getSpacing(
|
|
21466
|
+
if (typeof spacing2 === "object" && spacing2[breakpoint] !== void 0) {
|
|
21467
|
+
acc[breakpoint]["--sg-spacing-x"] = getSpacing(spacing2[breakpoint]);
|
|
21468
21468
|
}
|
|
21469
21469
|
if (typeof _verticalSpacing === "object" && _verticalSpacing[breakpoint] !== void 0) {
|
|
21470
21470
|
acc[breakpoint]["--sg-spacing-y"] = getSpacing(_verticalSpacing[breakpoint]);
|
|
@@ -21498,7 +21498,7 @@ const SimpleGrid = factory((_props, ref) => {
|
|
|
21498
21498
|
vars,
|
|
21499
21499
|
cols,
|
|
21500
21500
|
verticalSpacing,
|
|
21501
|
-
spacing,
|
|
21501
|
+
spacing: spacing2,
|
|
21502
21502
|
type,
|
|
21503
21503
|
attributes,
|
|
21504
21504
|
...others
|
|
@@ -26768,6 +26768,13 @@ const z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
26768
26768
|
},
|
|
26769
26769
|
void: voidType
|
|
26770
26770
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
26771
|
+
const spacing = {
|
|
26772
|
+
xs: "0.625rem",
|
|
26773
|
+
sm: "0.75rem",
|
|
26774
|
+
md: "1rem",
|
|
26775
|
+
lg: "1.25rem",
|
|
26776
|
+
xl: "2rem"
|
|
26777
|
+
};
|
|
26771
26778
|
const colors = {
|
|
26772
26779
|
/** Primary UI color — buttons, links, active states. */
|
|
26773
26780
|
primary: "indigo",
|
|
@@ -26919,6 +26926,7 @@ const theme = createTheme({
|
|
|
26919
26926
|
},
|
|
26920
26927
|
radius: radii,
|
|
26921
26928
|
defaultRadius: "md",
|
|
26929
|
+
spacing,
|
|
26922
26930
|
breakpoints: {
|
|
26923
26931
|
xs: "30em",
|
|
26924
26932
|
sm: "48em",
|
|
@@ -30688,38 +30696,84 @@ function InvestorProfileCard({
|
|
|
30688
30696
|
children
|
|
30689
30697
|
] });
|
|
30690
30698
|
}
|
|
30691
|
-
const
|
|
30699
|
+
const SYSTEM_TYPES = /* @__PURE__ */ new Set(["fairmint", "privy"]);
|
|
30700
|
+
const TYPE_LABELS = {
|
|
30692
30701
|
fairmint: "Fairmint Wallet",
|
|
30693
30702
|
privy: "Fairmint Wallet",
|
|
30694
30703
|
manual: "Manual"
|
|
30695
30704
|
};
|
|
30696
|
-
function
|
|
30697
|
-
|
|
30698
|
-
|
|
30705
|
+
function normalizeWalletType(type) {
|
|
30706
|
+
return String(type ?? "").trim().toLowerCase();
|
|
30707
|
+
}
|
|
30708
|
+
function getWalletLabel(type, custom2) {
|
|
30709
|
+
const key = normalizeWalletType(type);
|
|
30710
|
+
const rawType = typeof type === "string" ? type : String(type ?? "");
|
|
30711
|
+
if (custom2?.[key]) return custom2[key];
|
|
30712
|
+
if (custom2?.[rawType]) return custom2[rawType];
|
|
30713
|
+
return TYPE_LABELS[key] ?? rawType;
|
|
30714
|
+
}
|
|
30715
|
+
function getWalletDisplayName(wallet, customLabels) {
|
|
30716
|
+
const label = wallet.label?.trim();
|
|
30717
|
+
if (label) return label;
|
|
30718
|
+
return getWalletLabel(wallet.type, customLabels);
|
|
30719
|
+
}
|
|
30720
|
+
function isSystemWalletType(type) {
|
|
30721
|
+
return SYSTEM_TYPES.has(normalizeWalletType(type));
|
|
30722
|
+
}
|
|
30723
|
+
function isRemovableWalletType(type) {
|
|
30724
|
+
return !isSystemWalletType(type);
|
|
30725
|
+
}
|
|
30726
|
+
function walletKey(w) {
|
|
30727
|
+
return `${normalizeWalletType(w.type)}:${w.address.toLowerCase()}`;
|
|
30699
30728
|
}
|
|
30700
30729
|
function WalletList({
|
|
30701
30730
|
wallets,
|
|
30702
30731
|
onAdd,
|
|
30703
30732
|
onRemove,
|
|
30733
|
+
onSetDefault,
|
|
30734
|
+
onLabel,
|
|
30735
|
+
onConnect,
|
|
30736
|
+
getExplorerUrl,
|
|
30704
30737
|
readOnly = false,
|
|
30705
30738
|
addLoading = false,
|
|
30706
30739
|
removeLoading = false,
|
|
30740
|
+
setDefaultLoading = false,
|
|
30741
|
+
setDefaultAddress,
|
|
30742
|
+
labelLoading = false,
|
|
30743
|
+
labelAddress,
|
|
30744
|
+
connectLoading = false,
|
|
30707
30745
|
emptyIcon,
|
|
30708
30746
|
copyIcon,
|
|
30709
30747
|
copiedIcon,
|
|
30710
30748
|
removeIcon,
|
|
30711
30749
|
addIcon,
|
|
30750
|
+
defaultIcon,
|
|
30751
|
+
renameIcon,
|
|
30752
|
+
explorerIcon,
|
|
30753
|
+
connectIcon,
|
|
30712
30754
|
typeLabels,
|
|
30713
|
-
removableTypes
|
|
30755
|
+
removableTypes,
|
|
30756
|
+
children
|
|
30714
30757
|
}) {
|
|
30758
|
+
const normalizeWalletAddress = useCallback(
|
|
30759
|
+
(address) => address?.trim().toLowerCase() ?? "",
|
|
30760
|
+
[]
|
|
30761
|
+
);
|
|
30715
30762
|
const [newAddress, setNewAddress] = useState("");
|
|
30716
30763
|
const [addressError, setAddressError] = useState(null);
|
|
30717
30764
|
const [showAddForm, setShowAddForm] = useState(false);
|
|
30718
30765
|
const [walletToRemove, setWalletToRemove] = useState(null);
|
|
30719
30766
|
const [copiedAddress, setCopiedAddress] = useState(null);
|
|
30767
|
+
const [renamingAddress, setRenamingAddress] = useState(null);
|
|
30768
|
+
const [renameValue, setRenameValue] = useState("");
|
|
30769
|
+
const [labelError, setLabelError] = useState(null);
|
|
30770
|
+
const [setDefaultError, setSetDefaultError] = useState(null);
|
|
30720
30771
|
const copyTimeoutRef = useRef(void 0);
|
|
30721
30772
|
useEffect(() => () => clearTimeout(copyTimeoutRef.current), []);
|
|
30722
|
-
|
|
30773
|
+
useEffect(() => {
|
|
30774
|
+
if (readOnly) setRenamingAddress(null);
|
|
30775
|
+
}, [readOnly]);
|
|
30776
|
+
const copyAddress = useCallback(async (address) => {
|
|
30723
30777
|
try {
|
|
30724
30778
|
await navigator.clipboard.writeText(address);
|
|
30725
30779
|
clearTimeout(copyTimeoutRef.current);
|
|
@@ -30727,9 +30781,27 @@ function WalletList({
|
|
|
30727
30781
|
copyTimeoutRef.current = setTimeout(() => setCopiedAddress(null), 2e3);
|
|
30728
30782
|
} catch {
|
|
30729
30783
|
}
|
|
30730
|
-
};
|
|
30784
|
+
}, []);
|
|
30731
30785
|
const canAdd = !readOnly && !!onAdd;
|
|
30732
30786
|
const canRemove = !readOnly && !!onRemove;
|
|
30787
|
+
const canSetDefault = !readOnly && !!onSetDefault;
|
|
30788
|
+
const canLabel = !readOnly && !!onLabel;
|
|
30789
|
+
const canConnect = !readOnly && !!onConnect;
|
|
30790
|
+
const getSafeExplorerUrl = useCallback(
|
|
30791
|
+
(address) => {
|
|
30792
|
+
if (!getExplorerUrl) return null;
|
|
30793
|
+
try {
|
|
30794
|
+
const url = getExplorerUrl(address);
|
|
30795
|
+
if (!url) return null;
|
|
30796
|
+
const parsed = new URL(url);
|
|
30797
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
|
|
30798
|
+
return parsed.toString();
|
|
30799
|
+
} catch {
|
|
30800
|
+
return null;
|
|
30801
|
+
}
|
|
30802
|
+
},
|
|
30803
|
+
[getExplorerUrl]
|
|
30804
|
+
);
|
|
30733
30805
|
const handleAdd = async () => {
|
|
30734
30806
|
const trimmed = newAddress.trim();
|
|
30735
30807
|
const error2 = validateEthereumAddress(trimmed);
|
|
@@ -30757,8 +30829,191 @@ function WalletList({
|
|
|
30757
30829
|
setRemoveError("Failed to remove wallet. Please try again.");
|
|
30758
30830
|
}
|
|
30759
30831
|
};
|
|
30760
|
-
|
|
30761
|
-
|
|
30832
|
+
const handleSetDefault = async (address) => {
|
|
30833
|
+
setSetDefaultError(null);
|
|
30834
|
+
try {
|
|
30835
|
+
await onSetDefault?.(address);
|
|
30836
|
+
} catch {
|
|
30837
|
+
setSetDefaultError("Failed to set default wallet. Please try again.");
|
|
30838
|
+
}
|
|
30839
|
+
};
|
|
30840
|
+
const handleLabelSave = async (address) => {
|
|
30841
|
+
setLabelError(null);
|
|
30842
|
+
try {
|
|
30843
|
+
await onLabel?.(address, renameValue.trim() || null);
|
|
30844
|
+
setRenamingAddress((current) => current === address ? null : current);
|
|
30845
|
+
} catch {
|
|
30846
|
+
setLabelError("Failed to update label. Please try again.");
|
|
30847
|
+
}
|
|
30848
|
+
};
|
|
30849
|
+
const hasWallets = wallets.length > 0;
|
|
30850
|
+
if (!hasWallets && !showAddForm && !canConnect) {
|
|
30851
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
30852
|
+
/* @__PURE__ */ jsx(
|
|
30853
|
+
EmptyState,
|
|
30854
|
+
{
|
|
30855
|
+
icon: emptyIcon,
|
|
30856
|
+
title: "No wallets connected",
|
|
30857
|
+
description: "Add a wallet address to receive equity on-chain.",
|
|
30858
|
+
actionLabel: canAdd ? "Add Wallet" : void 0,
|
|
30859
|
+
onAction: canAdd ? () => setShowAddForm(true) : void 0
|
|
30860
|
+
}
|
|
30861
|
+
),
|
|
30862
|
+
children
|
|
30863
|
+
] });
|
|
30864
|
+
}
|
|
30865
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
30866
|
+
wallets.map((w) => {
|
|
30867
|
+
const normalizedWalletAddress = normalizeWalletAddress(w.address);
|
|
30868
|
+
const setDefaultActionLoading = setDefaultLoading && (!setDefaultAddress || normalizeWalletAddress(setDefaultAddress) === normalizedWalletAddress);
|
|
30869
|
+
const labelActionLoading = labelLoading && (!labelAddress || normalizeWalletAddress(labelAddress) === normalizedWalletAddress);
|
|
30870
|
+
const explorerUrl = getSafeExplorerUrl(w.address);
|
|
30871
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: 0, children: [
|
|
30872
|
+
/* @__PURE__ */ jsxs(
|
|
30873
|
+
Group,
|
|
30874
|
+
{
|
|
30875
|
+
justify: "space-between",
|
|
30876
|
+
p: "xs",
|
|
30877
|
+
style: {
|
|
30878
|
+
borderRadius: radii.sm,
|
|
30879
|
+
border: `1px solid ${neutralColors[200]}`
|
|
30880
|
+
},
|
|
30881
|
+
children: [
|
|
30882
|
+
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
30883
|
+
/* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", children: getWalletLabel(w.type, typeLabels) }),
|
|
30884
|
+
w.label && /* @__PURE__ */ jsx(Text, { size: "xs", c: fairmintVars.colorTextSecondary, children: w.label }),
|
|
30885
|
+
w.defaultRecipient && /* @__PURE__ */ jsx(Badge, { size: "xs", color: colors.success, variant: "light", children: "Default" }),
|
|
30886
|
+
/* @__PURE__ */ jsx(Text, { size: "sm", ff: "monospace", children: truncateAddress(w.address) })
|
|
30887
|
+
] }),
|
|
30888
|
+
/* @__PURE__ */ jsxs(Group, { gap: 4, children: [
|
|
30889
|
+
copyIcon && /* @__PURE__ */ jsx(Tooltip, { label: copiedAddress === w.address ? "Copied!" : "Copy address", children: /* @__PURE__ */ jsx(
|
|
30890
|
+
ActionIcon,
|
|
30891
|
+
{
|
|
30892
|
+
variant: "subtle",
|
|
30893
|
+
size: "sm",
|
|
30894
|
+
onClick: () => copyAddress(w.address),
|
|
30895
|
+
"aria-label": "Copy wallet address",
|
|
30896
|
+
children: copiedAddress === w.address ? copiedIcon ?? copyIcon : copyIcon
|
|
30897
|
+
}
|
|
30898
|
+
) }),
|
|
30899
|
+
canSetDefault && defaultIcon && !w.defaultRecipient && /* @__PURE__ */ jsx(Tooltip, { label: "Set as default recipient", children: /* @__PURE__ */ jsx(
|
|
30900
|
+
ActionIcon,
|
|
30901
|
+
{
|
|
30902
|
+
variant: "subtle",
|
|
30903
|
+
size: "sm",
|
|
30904
|
+
onClick: () => handleSetDefault(w.address),
|
|
30905
|
+
loading: setDefaultActionLoading,
|
|
30906
|
+
disabled: setDefaultActionLoading,
|
|
30907
|
+
"aria-label": "Set as default wallet",
|
|
30908
|
+
children: defaultIcon
|
|
30909
|
+
}
|
|
30910
|
+
) }),
|
|
30911
|
+
canLabel && renameIcon && /* @__PURE__ */ jsx(
|
|
30912
|
+
Tooltip,
|
|
30913
|
+
{
|
|
30914
|
+
label: renamingAddress === w.address ? "Cancel rename" : "Rename wallet",
|
|
30915
|
+
children: /* @__PURE__ */ jsx(
|
|
30916
|
+
ActionIcon,
|
|
30917
|
+
{
|
|
30918
|
+
variant: "subtle",
|
|
30919
|
+
size: "sm",
|
|
30920
|
+
onClick: () => {
|
|
30921
|
+
setLabelError(null);
|
|
30922
|
+
if (renamingAddress === w.address) {
|
|
30923
|
+
setRenamingAddress(null);
|
|
30924
|
+
} else {
|
|
30925
|
+
setRenamingAddress(w.address);
|
|
30926
|
+
setRenameValue(w.label ?? "");
|
|
30927
|
+
}
|
|
30928
|
+
},
|
|
30929
|
+
"aria-label": "Rename wallet",
|
|
30930
|
+
children: renameIcon
|
|
30931
|
+
}
|
|
30932
|
+
)
|
|
30933
|
+
}
|
|
30934
|
+
),
|
|
30935
|
+
explorerUrl && explorerIcon && /* @__PURE__ */ jsx(Tooltip, { label: "View on block explorer", children: /* @__PURE__ */ jsx(
|
|
30936
|
+
Anchor,
|
|
30937
|
+
{
|
|
30938
|
+
href: explorerUrl,
|
|
30939
|
+
target: "_blank",
|
|
30940
|
+
rel: "noopener noreferrer",
|
|
30941
|
+
"aria-label": "View on block explorer",
|
|
30942
|
+
c: colors.primary,
|
|
30943
|
+
style: {
|
|
30944
|
+
display: "inline-flex",
|
|
30945
|
+
alignItems: "center",
|
|
30946
|
+
justifyContent: "center",
|
|
30947
|
+
width: "1.625rem",
|
|
30948
|
+
height: "1.625rem",
|
|
30949
|
+
borderRadius: radii.sm
|
|
30950
|
+
},
|
|
30951
|
+
children: explorerIcon
|
|
30952
|
+
}
|
|
30953
|
+
) }),
|
|
30954
|
+
canRemove && removeIcon && (removableTypes ? removableTypes.some(
|
|
30955
|
+
(t) => normalizeWalletType(t) === normalizeWalletType(w.type)
|
|
30956
|
+
) : isRemovableWalletType(w.type)) && /* @__PURE__ */ jsx(Tooltip, { label: "Remove wallet", children: /* @__PURE__ */ jsx(
|
|
30957
|
+
ActionIcon,
|
|
30958
|
+
{
|
|
30959
|
+
variant: "subtle",
|
|
30960
|
+
size: "sm",
|
|
30961
|
+
color: colors.error,
|
|
30962
|
+
onClick: () => setWalletToRemove(w.address),
|
|
30963
|
+
disabled: removeLoading,
|
|
30964
|
+
"aria-label": "Remove wallet",
|
|
30965
|
+
children: removeIcon
|
|
30966
|
+
}
|
|
30967
|
+
) })
|
|
30968
|
+
] })
|
|
30969
|
+
]
|
|
30970
|
+
}
|
|
30971
|
+
),
|
|
30972
|
+
renamingAddress === w.address && /* @__PURE__ */ jsxs(Group, { gap: "xs", mt: "xs", align: "flex-start", children: [
|
|
30973
|
+
/* @__PURE__ */ jsx(
|
|
30974
|
+
TextInput,
|
|
30975
|
+
{
|
|
30976
|
+
value: renameValue,
|
|
30977
|
+
onChange: (e) => {
|
|
30978
|
+
setRenameValue(e.currentTarget.value);
|
|
30979
|
+
setLabelError(null);
|
|
30980
|
+
},
|
|
30981
|
+
placeholder: getWalletLabel(w.type, typeLabels),
|
|
30982
|
+
size: "xs",
|
|
30983
|
+
style: { flex: 1 },
|
|
30984
|
+
"aria-label": "Wallet label",
|
|
30985
|
+
maxLength: 50,
|
|
30986
|
+
error: labelError
|
|
30987
|
+
}
|
|
30988
|
+
),
|
|
30989
|
+
/* @__PURE__ */ jsx(
|
|
30990
|
+
Button,
|
|
30991
|
+
{
|
|
30992
|
+
size: "xs",
|
|
30993
|
+
loading: labelActionLoading,
|
|
30994
|
+
disabled: labelActionLoading,
|
|
30995
|
+
onClick: () => handleLabelSave(w.address),
|
|
30996
|
+
children: "Save"
|
|
30997
|
+
}
|
|
30998
|
+
),
|
|
30999
|
+
/* @__PURE__ */ jsx(
|
|
31000
|
+
Button,
|
|
31001
|
+
{
|
|
31002
|
+
size: "xs",
|
|
31003
|
+
variant: "subtle",
|
|
31004
|
+
color: colors.neutral,
|
|
31005
|
+
onClick: () => {
|
|
31006
|
+
setRenamingAddress(null);
|
|
31007
|
+
setLabelError(null);
|
|
31008
|
+
},
|
|
31009
|
+
children: "Cancel"
|
|
31010
|
+
}
|
|
31011
|
+
)
|
|
31012
|
+
] })
|
|
31013
|
+
] }, walletKey(w));
|
|
31014
|
+
}),
|
|
31015
|
+
setDefaultError && /* @__PURE__ */ jsx(Text, { size: "sm", c: colors.error, children: setDefaultError }),
|
|
31016
|
+
!hasWallets && !showAddForm && /* @__PURE__ */ jsx(
|
|
30762
31017
|
EmptyState,
|
|
30763
31018
|
{
|
|
30764
31019
|
icon: emptyIcon,
|
|
@@ -30767,52 +31022,19 @@ function WalletList({
|
|
|
30767
31022
|
actionLabel: canAdd ? "Add Wallet" : void 0,
|
|
30768
31023
|
onAction: canAdd ? () => setShowAddForm(true) : void 0
|
|
30769
31024
|
}
|
|
30770
|
-
)
|
|
30771
|
-
|
|
30772
|
-
|
|
30773
|
-
wallets.map((w) => /* @__PURE__ */ jsxs(
|
|
30774
|
-
Group,
|
|
31025
|
+
),
|
|
31026
|
+
canConnect && /* @__PURE__ */ jsx(
|
|
31027
|
+
Button,
|
|
30775
31028
|
{
|
|
30776
|
-
|
|
30777
|
-
|
|
30778
|
-
|
|
30779
|
-
|
|
30780
|
-
|
|
30781
|
-
|
|
30782
|
-
children:
|
|
30783
|
-
|
|
30784
|
-
|
|
30785
|
-
w.label && /* @__PURE__ */ jsx(Text, { size: "xs", c: fairmintVars.colorTextSecondary, children: w.label }),
|
|
30786
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", ff: "monospace", children: truncateAddress(w.address) })
|
|
30787
|
-
] }),
|
|
30788
|
-
/* @__PURE__ */ jsxs(Group, { gap: 4, children: [
|
|
30789
|
-
copyIcon && /* @__PURE__ */ jsx(Tooltip, { label: copiedAddress === w.address ? "Copied!" : "Copy address", children: /* @__PURE__ */ jsx(
|
|
30790
|
-
ActionIcon,
|
|
30791
|
-
{
|
|
30792
|
-
variant: "subtle",
|
|
30793
|
-
size: "sm",
|
|
30794
|
-
onClick: () => copyAddress(w.address),
|
|
30795
|
-
"aria-label": "Copy wallet address",
|
|
30796
|
-
children: copiedAddress === w.address ? copiedIcon ?? copyIcon : copyIcon
|
|
30797
|
-
}
|
|
30798
|
-
) }),
|
|
30799
|
-
canRemove && removeIcon && removableTypes.includes(w.type) && /* @__PURE__ */ jsx(Tooltip, { label: "Remove wallet", children: /* @__PURE__ */ jsx(
|
|
30800
|
-
ActionIcon,
|
|
30801
|
-
{
|
|
30802
|
-
variant: "subtle",
|
|
30803
|
-
size: "sm",
|
|
30804
|
-
color: colors.error,
|
|
30805
|
-
onClick: () => setWalletToRemove(w.address),
|
|
30806
|
-
disabled: removeLoading,
|
|
30807
|
-
"aria-label": "Remove wallet",
|
|
30808
|
-
children: removeIcon
|
|
30809
|
-
}
|
|
30810
|
-
) })
|
|
30811
|
-
] })
|
|
30812
|
-
]
|
|
30813
|
-
},
|
|
30814
|
-
w.address
|
|
30815
|
-
)),
|
|
31029
|
+
variant: "light",
|
|
31030
|
+
size: "xs",
|
|
31031
|
+
leftSection: connectIcon,
|
|
31032
|
+
onClick: onConnect,
|
|
31033
|
+
loading: connectLoading,
|
|
31034
|
+
mt: "xs",
|
|
31035
|
+
children: "Connect Wallet"
|
|
31036
|
+
}
|
|
31037
|
+
),
|
|
30816
31038
|
canAdd && (showAddForm ? /* @__PURE__ */ jsxs(Group, { gap: "xs", mt: "xs", children: [
|
|
30817
31039
|
/* @__PURE__ */ jsx(
|
|
30818
31040
|
TextInput,
|
|
@@ -30843,7 +31065,7 @@ function WalletList({
|
|
|
30843
31065
|
children: "Cancel"
|
|
30844
31066
|
}
|
|
30845
31067
|
)
|
|
30846
|
-
] }) : /* @__PURE__ */ jsx(
|
|
31068
|
+
] }) : hasWallets ? /* @__PURE__ */ jsx(
|
|
30847
31069
|
Button,
|
|
30848
31070
|
{
|
|
30849
31071
|
variant: "light",
|
|
@@ -30853,7 +31075,8 @@ function WalletList({
|
|
|
30853
31075
|
mt: "xs",
|
|
30854
31076
|
children: "Add Wallet"
|
|
30855
31077
|
}
|
|
30856
|
-
)),
|
|
31078
|
+
) : null),
|
|
31079
|
+
children,
|
|
30857
31080
|
/* @__PURE__ */ jsx(
|
|
30858
31081
|
ConfirmDialog,
|
|
30859
31082
|
{
|
|
@@ -31013,14 +31236,20 @@ export {
|
|
|
31013
31236
|
formatPhoneDisplay,
|
|
31014
31237
|
formatPreciseWithCurrency,
|
|
31015
31238
|
getAvatarColor,
|
|
31239
|
+
getWalletDisplayName,
|
|
31240
|
+
getWalletLabel,
|
|
31016
31241
|
isEthereumAddress,
|
|
31242
|
+
isRemovableWalletType,
|
|
31243
|
+
isSystemWalletType,
|
|
31017
31244
|
neutralColors,
|
|
31018
31245
|
normalizePhone,
|
|
31246
|
+
normalizeWalletType,
|
|
31019
31247
|
notify,
|
|
31020
31248
|
passwordSchema,
|
|
31021
31249
|
phoneSchema,
|
|
31022
31250
|
radii,
|
|
31023
31251
|
semanticColors,
|
|
31252
|
+
spacing,
|
|
31024
31253
|
theme,
|
|
31025
31254
|
truncateAddress,
|
|
31026
31255
|
typography,
|
|
@@ -31038,6 +31267,7 @@ export {
|
|
|
31038
31267
|
useScrollIntoView,
|
|
31039
31268
|
useViewportSize,
|
|
31040
31269
|
validateEthereumAddress,
|
|
31270
|
+
walletKey,
|
|
31041
31271
|
z,
|
|
31042
31272
|
zipSchema
|
|
31043
31273
|
};
|