@fairmint/ui 0.2.13 → 0.2.15
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/ErrorFallback/ErrorFallback.d.ts.map +1 -1
- package/dist/components/FairmintProvider/FairmintProvider.d.ts.map +1 -1
- package/dist/components/form/FormField.d.ts.map +1 -1
- package/dist/components/generic/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/components/generic/ErrorPage/ErrorPage.d.ts +21 -0
- package/dist/components/generic/ErrorPage/ErrorPage.d.ts.map +1 -0
- package/dist/components/generic/ListRow/ListRow.d.ts.map +1 -1
- package/dist/components/generic/StatCard/StatCard.d.ts.map +1 -1
- package/dist/components/layout/PageHeader/PageHeader.d.ts.map +1 -1
- 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 +567 -182
- package/dist/fairmint-ui.cjs.map +1 -1
- package/dist/fairmint-ui.js +567 -182
- package/dist/fairmint-ui.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/theme/index.d.ts +205 -1
- package/dist/theme/index.d.ts.map +1 -1
- 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.cjs
CHANGED
|
@@ -26820,110 +26820,6 @@ const AVATAR_PALETTE = [
|
|
|
26820
26820
|
colors.accent2,
|
|
26821
26821
|
colors.accent3
|
|
26822
26822
|
];
|
|
26823
|
-
const ActionIcon = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(ActionIcon$1, { color: colors.primary, variant: "subtle", ...props, ref }));
|
|
26824
|
-
ActionIcon.displayName = "ActionIcon";
|
|
26825
|
-
function Alert(props) {
|
|
26826
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Alert$1, { ...props });
|
|
26827
|
-
}
|
|
26828
|
-
const Avatar = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Avatar$1, { radius: "md", color: colors.primary, ...props, ref }));
|
|
26829
|
-
Avatar.displayName = "Avatar";
|
|
26830
|
-
const Badge = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "light", ...props, ref }));
|
|
26831
|
-
Badge.displayName = "Badge";
|
|
26832
|
-
const Button = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Button$1, { color: colors.primary, ...props, ref }));
|
|
26833
|
-
Button.displayName = "Button";
|
|
26834
|
-
const Card = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Card$1, { padding: "lg", radius: "xl", withBorder: true, ...props, ref }));
|
|
26835
|
-
Card.displayName = "Card";
|
|
26836
|
-
const Checkbox = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Checkbox$1, { color: colors.primary, ...props, ref }));
|
|
26837
|
-
Checkbox.displayName = "Checkbox";
|
|
26838
|
-
function Drawer(props) {
|
|
26839
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Drawer$1, { position: "right", size: "lg", p: "lg", ...props });
|
|
26840
|
-
}
|
|
26841
|
-
function Loader(props) {
|
|
26842
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Loader$1, { ...props });
|
|
26843
|
-
}
|
|
26844
|
-
function MenuBase(props) {
|
|
26845
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Menu$1, { shadow: "md", ...props });
|
|
26846
|
-
}
|
|
26847
|
-
const Menu = Object.assign(MenuBase, {
|
|
26848
|
-
Target: Menu$1.Target,
|
|
26849
|
-
Dropdown: Menu$1.Dropdown,
|
|
26850
|
-
Item: Menu$1.Item,
|
|
26851
|
-
Label: Menu$1.Label,
|
|
26852
|
-
Divider: Menu$1.Divider
|
|
26853
|
-
});
|
|
26854
|
-
function Modal(props) {
|
|
26855
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Modal$1, { centered: true, radius: "lg", ...props });
|
|
26856
|
-
}
|
|
26857
|
-
const PasswordInput = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(PasswordInput$1, { size: "md", ...props, ref }));
|
|
26858
|
-
PasswordInput.displayName = "PasswordInput";
|
|
26859
|
-
const Select = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Select$1, { size: "md", ...props, ref }));
|
|
26860
|
-
Select.displayName = "Select";
|
|
26861
|
-
function Skeleton(props) {
|
|
26862
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton$1, { ...props });
|
|
26863
|
-
}
|
|
26864
|
-
const Switch = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Switch$1, { color: colors.primary, ...props, ref }));
|
|
26865
|
-
Switch.displayName = "Switch";
|
|
26866
|
-
function TableBase(props) {
|
|
26867
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Table$1, { ...props });
|
|
26868
|
-
}
|
|
26869
|
-
const Table = Object.assign(TableBase, {
|
|
26870
|
-
Thead: Table$1.Thead,
|
|
26871
|
-
Tbody: Table$1.Tbody,
|
|
26872
|
-
Tr: Table$1.Tr,
|
|
26873
|
-
Th: Table$1.Th,
|
|
26874
|
-
Td: Table$1.Td,
|
|
26875
|
-
Tfoot: Table$1.Tfoot,
|
|
26876
|
-
Caption: Table$1.Caption
|
|
26877
|
-
});
|
|
26878
|
-
function TabsBase(props) {
|
|
26879
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tabs$1, { color: colors.primary, ...props });
|
|
26880
|
-
}
|
|
26881
|
-
const Tabs = Object.assign(TabsBase, {
|
|
26882
|
-
List: Tabs$1.List,
|
|
26883
|
-
Tab: Tabs$1.Tab,
|
|
26884
|
-
Panel: Tabs$1.Panel
|
|
26885
|
-
});
|
|
26886
|
-
const TextInput = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(TextInput$1, { size: "md", ...props, ref }));
|
|
26887
|
-
TextInput.displayName = "TextInput";
|
|
26888
|
-
function Tooltip(props) {
|
|
26889
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tooltip$1, { fz: "xs", ...props });
|
|
26890
|
-
}
|
|
26891
|
-
function ErrorFallback({
|
|
26892
|
-
title = "Something went wrong",
|
|
26893
|
-
description = "We've been notified and are working on a fix.",
|
|
26894
|
-
onAction,
|
|
26895
|
-
actionLabel = "Reload Page",
|
|
26896
|
-
error: error2
|
|
26897
|
-
}) {
|
|
26898
|
-
if (error2 !== void 0) {
|
|
26899
|
-
console.error("[ErrorFallback]", error2);
|
|
26900
|
-
}
|
|
26901
|
-
const handleAction = onAction ?? (() => window.location.reload());
|
|
26902
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Container, { size: "sm", py: "xl", children: /* @__PURE__ */ jsxRuntime.jsxs(Stack, { align: "center", gap: "md", children: [
|
|
26903
|
-
/* @__PURE__ */ jsxRuntime.jsx(Title, { order: 2, children: title }),
|
|
26904
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text, { c: "dimmed", children: description }),
|
|
26905
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleAction, children: actionLabel })
|
|
26906
|
-
] }) });
|
|
26907
|
-
}
|
|
26908
|
-
function FairmintLogo({
|
|
26909
|
-
src = "https://imagedelivery.net/Lm6ChJXR4cIKKycsNMvGjA/0367be38-c9d8-4206-aaae-eba5ff830600/public",
|
|
26910
|
-
width = 140,
|
|
26911
|
-
height = 30,
|
|
26912
|
-
className,
|
|
26913
|
-
alt = "Fairmint"
|
|
26914
|
-
}) {
|
|
26915
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
26916
|
-
"img",
|
|
26917
|
-
{
|
|
26918
|
-
src,
|
|
26919
|
-
alt,
|
|
26920
|
-
width,
|
|
26921
|
-
height,
|
|
26922
|
-
className,
|
|
26923
|
-
style: { objectFit: "contain" }
|
|
26924
|
-
}
|
|
26925
|
-
);
|
|
26926
|
-
}
|
|
26927
26823
|
const radii = {
|
|
26928
26824
|
xs: "0.25rem",
|
|
26929
26825
|
sm: "0.375rem",
|
|
@@ -27027,12 +26923,16 @@ const info = [
|
|
|
27027
26923
|
"#155B75",
|
|
27028
26924
|
"#164C63"
|
|
27029
26925
|
];
|
|
26926
|
+
const typography = {
|
|
26927
|
+
fontFamily: '"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
|
|
26928
|
+
headingFontFamily: '"Plus Jakarta Sans", sans-serif'
|
|
26929
|
+
};
|
|
27030
26930
|
const theme = createTheme({
|
|
27031
26931
|
primaryColor: "indigo",
|
|
27032
26932
|
colors: { indigo, gray: neutral, fairmintBlue, fairmintPurple, success, warning, error, info },
|
|
27033
|
-
fontFamily:
|
|
26933
|
+
fontFamily: typography.fontFamily,
|
|
27034
26934
|
headings: {
|
|
27035
|
-
fontFamily:
|
|
26935
|
+
fontFamily: typography.headingFontFamily,
|
|
27036
26936
|
fontWeight: "700"
|
|
27037
26937
|
},
|
|
27038
26938
|
radius: radii,
|
|
@@ -27082,6 +26982,49 @@ const theme = createTheme({
|
|
|
27082
26982
|
}
|
|
27083
26983
|
}
|
|
27084
26984
|
});
|
|
26985
|
+
const fairmintCssVariables = () => ({
|
|
26986
|
+
variables: {
|
|
26987
|
+
"--fairmint-font-headings": typography.headingFontFamily,
|
|
26988
|
+
"--fairmint-font-body": typography.fontFamily
|
|
26989
|
+
},
|
|
26990
|
+
light: {
|
|
26991
|
+
/** Large decorative background text on error/empty pages. */
|
|
26992
|
+
"--fairmint-watermark-color": neutral[1],
|
|
26993
|
+
/** Supporting / muted text (subtitles, secondary labels). Replaces c="dimmed" and neutral.5 */
|
|
26994
|
+
"--fairmint-color-text-secondary": neutral[5],
|
|
26995
|
+
/** Faint metadata text (timestamps, tertiary labels). Replaces neutral.4 */
|
|
26996
|
+
"--fairmint-color-text-tertiary": neutral[4],
|
|
26997
|
+
/** Background tint for selected / active rows. Replaces primary.0 */
|
|
26998
|
+
"--fairmint-color-surface-selected": indigo[0]
|
|
26999
|
+
},
|
|
27000
|
+
dark: {
|
|
27001
|
+
"--fairmint-watermark-color": neutral[7],
|
|
27002
|
+
"--fairmint-color-text-secondary": neutral[4],
|
|
27003
|
+
"--fairmint-color-text-tertiary": neutral[5],
|
|
27004
|
+
"--fairmint-color-surface-selected": indigo[9]
|
|
27005
|
+
}
|
|
27006
|
+
});
|
|
27007
|
+
const fairmintVars = {
|
|
27008
|
+
/** Secondary / muted text — subtitles, supporting labels. Adapts to color scheme. */
|
|
27009
|
+
colorTextSecondary: `var(--fairmint-color-text-secondary, ${neutral[5]})`,
|
|
27010
|
+
/** Tertiary / faint text — timestamps, metadata. Adapts to color scheme. */
|
|
27011
|
+
colorTextTertiary: `var(--fairmint-color-text-tertiary, ${neutral[4]})`,
|
|
27012
|
+
/** Background tint for selected / active rows. Adapts to color scheme. */
|
|
27013
|
+
colorSurfaceSelected: `var(--fairmint-color-surface-selected, ${indigo[0]})`,
|
|
27014
|
+
/** Large decorative watermark on error/empty pages. Adapts to color scheme. */
|
|
27015
|
+
watermarkColor: `var(--fairmint-watermark-color, ${neutral[1]})`,
|
|
27016
|
+
/** Heading font family (Plus Jakarta Sans). */
|
|
27017
|
+
fontHeadings: `var(--fairmint-font-headings, ${typography.headingFontFamily})`,
|
|
27018
|
+
/** Body font family (Inter). */
|
|
27019
|
+
fontBody: `var(--fairmint-font-body, ${typography.fontFamily})`
|
|
27020
|
+
};
|
|
27021
|
+
function createFairmintMantineProviderProps(colorScheme = "light") {
|
|
27022
|
+
return {
|
|
27023
|
+
theme,
|
|
27024
|
+
cssVariablesResolver: fairmintCssVariables,
|
|
27025
|
+
defaultColorScheme: colorScheme
|
|
27026
|
+
};
|
|
27027
|
+
}
|
|
27085
27028
|
const brandColors = {
|
|
27086
27029
|
blue: "#0A4EFB",
|
|
27087
27030
|
purple: "#9E03FF",
|
|
@@ -27106,15 +27049,127 @@ const semanticColors = {
|
|
|
27106
27049
|
error: "#F04438",
|
|
27107
27050
|
info: "#06AED4"
|
|
27108
27051
|
};
|
|
27052
|
+
const ActionIcon = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(ActionIcon$1, { color: colors.primary, variant: "subtle", ...props, ref }));
|
|
27053
|
+
ActionIcon.displayName = "ActionIcon";
|
|
27054
|
+
function Alert(props) {
|
|
27055
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Alert$1, { ...props });
|
|
27056
|
+
}
|
|
27057
|
+
const Avatar = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Avatar$1, { radius: "md", color: colors.primary, ...props, ref }));
|
|
27058
|
+
Avatar.displayName = "Avatar";
|
|
27059
|
+
const Badge = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "light", ...props, ref }));
|
|
27060
|
+
Badge.displayName = "Badge";
|
|
27061
|
+
const Button = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Button$1, { color: colors.primary, ...props, ref }));
|
|
27062
|
+
Button.displayName = "Button";
|
|
27063
|
+
const Card = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Card$1, { padding: "lg", radius: "xl", withBorder: true, ...props, ref }));
|
|
27064
|
+
Card.displayName = "Card";
|
|
27065
|
+
const Checkbox = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Checkbox$1, { color: colors.primary, ...props, ref }));
|
|
27066
|
+
Checkbox.displayName = "Checkbox";
|
|
27067
|
+
function Drawer(props) {
|
|
27068
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Drawer$1, { position: "right", size: "lg", p: "lg", ...props });
|
|
27069
|
+
}
|
|
27070
|
+
function Loader(props) {
|
|
27071
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Loader$1, { ...props });
|
|
27072
|
+
}
|
|
27073
|
+
function MenuBase(props) {
|
|
27074
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Menu$1, { shadow: "md", ...props });
|
|
27075
|
+
}
|
|
27076
|
+
const Menu = Object.assign(MenuBase, {
|
|
27077
|
+
Target: Menu$1.Target,
|
|
27078
|
+
Dropdown: Menu$1.Dropdown,
|
|
27079
|
+
Item: Menu$1.Item,
|
|
27080
|
+
Label: Menu$1.Label,
|
|
27081
|
+
Divider: Menu$1.Divider
|
|
27082
|
+
});
|
|
27083
|
+
function Modal(props) {
|
|
27084
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Modal$1, { centered: true, radius: "lg", ...props });
|
|
27085
|
+
}
|
|
27086
|
+
const PasswordInput = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(PasswordInput$1, { size: "md", ...props, ref }));
|
|
27087
|
+
PasswordInput.displayName = "PasswordInput";
|
|
27088
|
+
const Select = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Select$1, { size: "md", ...props, ref }));
|
|
27089
|
+
Select.displayName = "Select";
|
|
27090
|
+
function Skeleton(props) {
|
|
27091
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton$1, { ...props });
|
|
27092
|
+
}
|
|
27093
|
+
const Switch = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(Switch$1, { color: colors.primary, ...props, ref }));
|
|
27094
|
+
Switch.displayName = "Switch";
|
|
27095
|
+
function TableBase(props) {
|
|
27096
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Table$1, { ...props });
|
|
27097
|
+
}
|
|
27098
|
+
const Table = Object.assign(TableBase, {
|
|
27099
|
+
Thead: Table$1.Thead,
|
|
27100
|
+
Tbody: Table$1.Tbody,
|
|
27101
|
+
Tr: Table$1.Tr,
|
|
27102
|
+
Th: Table$1.Th,
|
|
27103
|
+
Td: Table$1.Td,
|
|
27104
|
+
Tfoot: Table$1.Tfoot,
|
|
27105
|
+
Caption: Table$1.Caption
|
|
27106
|
+
});
|
|
27107
|
+
function TabsBase(props) {
|
|
27108
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tabs$1, { color: colors.primary, ...props });
|
|
27109
|
+
}
|
|
27110
|
+
const Tabs = Object.assign(TabsBase, {
|
|
27111
|
+
List: Tabs$1.List,
|
|
27112
|
+
Tab: Tabs$1.Tab,
|
|
27113
|
+
Panel: Tabs$1.Panel
|
|
27114
|
+
});
|
|
27115
|
+
const TextInput = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(TextInput$1, { size: "md", ...props, ref }));
|
|
27116
|
+
TextInput.displayName = "TextInput";
|
|
27117
|
+
function Tooltip(props) {
|
|
27118
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tooltip$1, { fz: "xs", ...props });
|
|
27119
|
+
}
|
|
27120
|
+
function ErrorFallback({
|
|
27121
|
+
title = "Something went wrong",
|
|
27122
|
+
description = "We've been notified and are working on a fix.",
|
|
27123
|
+
onAction,
|
|
27124
|
+
actionLabel = "Reload Page",
|
|
27125
|
+
error: error2
|
|
27126
|
+
}) {
|
|
27127
|
+
if (error2 !== void 0) {
|
|
27128
|
+
console.error("[ErrorFallback]", error2);
|
|
27129
|
+
}
|
|
27130
|
+
const handleAction = onAction ?? (() => window.location.reload());
|
|
27131
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Container, { size: "sm", py: "xl", children: /* @__PURE__ */ jsxRuntime.jsxs(Stack, { align: "center", gap: "md", children: [
|
|
27132
|
+
/* @__PURE__ */ jsxRuntime.jsx(Title, { order: 2, children: title }),
|
|
27133
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { c: fairmintVars.colorTextSecondary, children: description }),
|
|
27134
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleAction, children: actionLabel })
|
|
27135
|
+
] }) });
|
|
27136
|
+
}
|
|
27137
|
+
function FairmintLogo({
|
|
27138
|
+
src = "https://imagedelivery.net/Lm6ChJXR4cIKKycsNMvGjA/0367be38-c9d8-4206-aaae-eba5ff830600/public",
|
|
27139
|
+
width = 140,
|
|
27140
|
+
height = 30,
|
|
27141
|
+
className,
|
|
27142
|
+
alt = "Fairmint"
|
|
27143
|
+
}) {
|
|
27144
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27145
|
+
"img",
|
|
27146
|
+
{
|
|
27147
|
+
src,
|
|
27148
|
+
alt,
|
|
27149
|
+
width,
|
|
27150
|
+
height,
|
|
27151
|
+
className,
|
|
27152
|
+
style: { objectFit: "contain" }
|
|
27153
|
+
}
|
|
27154
|
+
);
|
|
27155
|
+
}
|
|
27109
27156
|
function FairmintProvider({
|
|
27110
27157
|
children,
|
|
27111
27158
|
colorScheme = "light",
|
|
27112
27159
|
notificationPosition = "top-right"
|
|
27113
27160
|
}) {
|
|
27114
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
27115
|
-
|
|
27116
|
-
|
|
27117
|
-
|
|
27161
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
27162
|
+
MantineProvider,
|
|
27163
|
+
{
|
|
27164
|
+
theme,
|
|
27165
|
+
defaultColorScheme: colorScheme,
|
|
27166
|
+
cssVariablesResolver: fairmintCssVariables,
|
|
27167
|
+
children: [
|
|
27168
|
+
/* @__PURE__ */ jsxRuntime.jsx(Notifications, { position: notificationPosition }),
|
|
27169
|
+
children
|
|
27170
|
+
]
|
|
27171
|
+
}
|
|
27172
|
+
);
|
|
27118
27173
|
}
|
|
27119
27174
|
const emailSchema = stringType().email("Please enter a valid email address");
|
|
27120
27175
|
function EmailField({ error: error2, ...rest }) {
|
|
@@ -28229,7 +28284,7 @@ function FormField({
|
|
|
28229
28284
|
}
|
|
28230
28285
|
),
|
|
28231
28286
|
children && inputProps.error && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c: "error", role: "alert", children: inputProps.error }),
|
|
28232
|
-
children && description && !inputProps.error && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c:
|
|
28287
|
+
children && description && !inputProps.error && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c: fairmintVars.colorTextSecondary, children: description })
|
|
28233
28288
|
] });
|
|
28234
28289
|
}
|
|
28235
28290
|
const passwordSchema = stringType().min(8, "Password must be at least 8 characters");
|
|
@@ -28519,9 +28574,9 @@ function EmptyState({
|
|
|
28519
28574
|
actionColor = colors.primary
|
|
28520
28575
|
}) {
|
|
28521
28576
|
return /* @__PURE__ */ jsxRuntime.jsxs(Stack, { align: "center", gap: "md", py: "xl", role: "status", children: [
|
|
28522
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx(Box, { c:
|
|
28577
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(Box, { c: fairmintVars.colorTextSecondary, fz: "2.5rem", children: icon }),
|
|
28523
28578
|
/* @__PURE__ */ jsxRuntime.jsx(Title, { order: 4, ta: "center", children: title }),
|
|
28524
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(Text, { c:
|
|
28579
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(Text, { c: fairmintVars.colorTextSecondary, size: "sm", ta: "center", maw: 360, children: description }),
|
|
28525
28580
|
actionLabel && onAction && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "light", color: actionColor, onClick: onAction, children: actionLabel })
|
|
28526
28581
|
] });
|
|
28527
28582
|
}
|
|
@@ -28709,6 +28764,102 @@ function EditableSection({
|
|
|
28709
28764
|
] }) : readView
|
|
28710
28765
|
] });
|
|
28711
28766
|
}
|
|
28767
|
+
const ERROR_CONFIGS = {
|
|
28768
|
+
400: {
|
|
28769
|
+
title: "Bad request",
|
|
28770
|
+
description: "Your request could not be understood. Please check your input and try again.",
|
|
28771
|
+
actionLabel: "Go back"
|
|
28772
|
+
},
|
|
28773
|
+
401: {
|
|
28774
|
+
title: "Authentication required",
|
|
28775
|
+
description: "You need to sign in to access this page. If you believe this is a mistake, please contact support.",
|
|
28776
|
+
actionLabel: "Go back"
|
|
28777
|
+
},
|
|
28778
|
+
403: {
|
|
28779
|
+
title: "Access denied",
|
|
28780
|
+
description: "You don't have permission to access this page. Contact support if you believe this is a mistake.",
|
|
28781
|
+
actionLabel: "Go back"
|
|
28782
|
+
},
|
|
28783
|
+
404: {
|
|
28784
|
+
title: "Nothing to see here",
|
|
28785
|
+
description: "The page you are trying to open does not exist. You may have mistyped the address, or the page has been moved to another URL.",
|
|
28786
|
+
actionLabel: "Go back"
|
|
28787
|
+
},
|
|
28788
|
+
429: {
|
|
28789
|
+
title: "Too many requests",
|
|
28790
|
+
description: "You have made too many requests in a short period. Please wait a moment before trying again.",
|
|
28791
|
+
actionLabel: "Try again"
|
|
28792
|
+
},
|
|
28793
|
+
500: {
|
|
28794
|
+
title: "Something went wrong",
|
|
28795
|
+
description: "An unexpected error occurred on our end. We have been notified and are working on a fix.",
|
|
28796
|
+
actionLabel: "Reload page"
|
|
28797
|
+
},
|
|
28798
|
+
503: {
|
|
28799
|
+
title: "Service unavailable",
|
|
28800
|
+
description: "We are temporarily unavailable for scheduled maintenance. Please check back shortly.",
|
|
28801
|
+
actionLabel: "Try again"
|
|
28802
|
+
}
|
|
28803
|
+
};
|
|
28804
|
+
function defaultAction(errorCode) {
|
|
28805
|
+
if (errorCode >= 500 || errorCode === 429) return () => window.location.reload();
|
|
28806
|
+
return () => {
|
|
28807
|
+
if (window.history.length > 1) window.history.back();
|
|
28808
|
+
else window.location.assign(window.location.origin);
|
|
28809
|
+
};
|
|
28810
|
+
}
|
|
28811
|
+
function ErrorPage({
|
|
28812
|
+
errorCode = 404,
|
|
28813
|
+
title,
|
|
28814
|
+
description,
|
|
28815
|
+
onAction,
|
|
28816
|
+
actionLabel
|
|
28817
|
+
}) {
|
|
28818
|
+
const config2 = ERROR_CONFIGS[errorCode] ?? ERROR_CONFIGS[500];
|
|
28819
|
+
const resolvedTitle = title ?? config2.title;
|
|
28820
|
+
const resolvedDescription = description ?? config2.description;
|
|
28821
|
+
const resolvedActionLabel = actionLabel ?? config2.actionLabel;
|
|
28822
|
+
const handleAction = onAction ?? defaultAction(errorCode);
|
|
28823
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28824
|
+
Flex,
|
|
28825
|
+
{
|
|
28826
|
+
pos: "relative",
|
|
28827
|
+
align: "center",
|
|
28828
|
+
justify: "center",
|
|
28829
|
+
style: { minHeight: "100dvh", overflow: "hidden" },
|
|
28830
|
+
children: [
|
|
28831
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
28832
|
+
Box,
|
|
28833
|
+
{
|
|
28834
|
+
pos: "absolute",
|
|
28835
|
+
"aria-hidden": true,
|
|
28836
|
+
fw: 900,
|
|
28837
|
+
lh: 1,
|
|
28838
|
+
w: "100%",
|
|
28839
|
+
ta: "center",
|
|
28840
|
+
c: fairmintVars.watermarkColor,
|
|
28841
|
+
ff: fairmintVars.fontHeadings,
|
|
28842
|
+
style: {
|
|
28843
|
+
fontSize: "clamp(200px, 30vw, 380px)",
|
|
28844
|
+
userSelect: "none",
|
|
28845
|
+
letterSpacing: "-0.04em",
|
|
28846
|
+
top: "50%",
|
|
28847
|
+
left: "50%",
|
|
28848
|
+
transform: "translate(-50%, -50%)",
|
|
28849
|
+
pointerEvents: "none"
|
|
28850
|
+
},
|
|
28851
|
+
children: errorCode
|
|
28852
|
+
}
|
|
28853
|
+
),
|
|
28854
|
+
/* @__PURE__ */ jsxRuntime.jsx(Container, { size: "sm", pos: "relative", style: { zIndex: 1 }, children: /* @__PURE__ */ jsxRuntime.jsxs(Stack, { align: "center", gap: "lg", children: [
|
|
28855
|
+
/* @__PURE__ */ jsxRuntime.jsx(Title, { order: 2, ta: "center", children: resolvedTitle }),
|
|
28856
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { c: fairmintVars.colorTextSecondary, ta: "center", maw: 500, size: "lg", children: resolvedDescription }),
|
|
28857
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { color: colors.primary, onClick: handleAction, children: resolvedActionLabel })
|
|
28858
|
+
] }) })
|
|
28859
|
+
]
|
|
28860
|
+
}
|
|
28861
|
+
);
|
|
28862
|
+
}
|
|
28712
28863
|
const DefaultChevronIcon = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
28713
28864
|
"svg",
|
|
28714
28865
|
{
|
|
@@ -28747,14 +28898,22 @@ function ListRow({
|
|
|
28747
28898
|
/* @__PURE__ */ jsxRuntime.jsx(Avatar, { src: avatarSrc, alt: title, radius: "md", size: 40, color: avatarColor, children: avatarFallback ?? title.charAt(0).toUpperCase() }),
|
|
28748
28899
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { flex: 1, miw: 0, children: [
|
|
28749
28900
|
/* @__PURE__ */ jsxRuntime.jsx(Text, { fw: 500, size: "sm", truncate: true, children: title }),
|
|
28750
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c:
|
|
28901
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c: fairmintVars.colorTextSecondary, lh: 1.3, children: subtitle })
|
|
28751
28902
|
] }),
|
|
28752
28903
|
/* @__PURE__ */ jsxRuntime.jsxs(Group, { gap: 6, wrap: "nowrap", children: [
|
|
28753
28904
|
rightSection ?? (value !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs(Stack, { gap: 2, align: "flex-end", children: [
|
|
28754
28905
|
/* @__PURE__ */ jsxRuntime.jsx(Text, { fw: 500, size: "sm", style: { whiteSpace: "nowrap" }, children: value }),
|
|
28755
|
-
valueSubtitle && /* @__PURE__ */ jsxRuntime.jsx(
|
|
28906
|
+
valueSubtitle && /* @__PURE__ */ jsxRuntime.jsx(
|
|
28907
|
+
Text,
|
|
28908
|
+
{
|
|
28909
|
+
size: "xs",
|
|
28910
|
+
c: fairmintVars.colorTextSecondary,
|
|
28911
|
+
style: { whiteSpace: "nowrap" },
|
|
28912
|
+
children: valueSubtitle
|
|
28913
|
+
}
|
|
28914
|
+
)
|
|
28756
28915
|
] })),
|
|
28757
|
-
displayChevron && (chevronIcon ?? /* @__PURE__ */ jsxRuntime.jsx(Box, { c:
|
|
28916
|
+
displayChevron && (chevronIcon ?? /* @__PURE__ */ jsxRuntime.jsx(Box, { c: fairmintVars.colorTextTertiary, style: { flexShrink: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(DefaultChevronIcon, {}) }))
|
|
28758
28917
|
] })
|
|
28759
28918
|
] });
|
|
28760
28919
|
const animationStyle = animate ? {
|
|
@@ -28766,7 +28925,7 @@ function ListRow({
|
|
|
28766
28925
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
28767
28926
|
Box,
|
|
28768
28927
|
{
|
|
28769
|
-
bg: isSelected ?
|
|
28928
|
+
bg: isSelected ? fairmintVars.colorSurfaceSelected : void 0,
|
|
28770
28929
|
py: "sm",
|
|
28771
28930
|
px: "md",
|
|
28772
28931
|
style: animationStyle,
|
|
@@ -28777,7 +28936,7 @@ function ListRow({
|
|
|
28777
28936
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
28778
28937
|
UnstyledButton,
|
|
28779
28938
|
{
|
|
28780
|
-
bg: isSelected ?
|
|
28939
|
+
bg: isSelected ? fairmintVars.colorSurfaceSelected : void 0,
|
|
28781
28940
|
onClick,
|
|
28782
28941
|
w: "100%",
|
|
28783
28942
|
py: "sm",
|
|
@@ -30047,9 +30206,9 @@ function PhotoCropModal({
|
|
|
30047
30206
|
)
|
|
30048
30207
|
}
|
|
30049
30208
|
),
|
|
30050
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c:
|
|
30209
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c: fairmintVars.colorTextSecondary, ta: "center", children: "Drag to reposition · Scroll or pinch to zoom" }),
|
|
30051
30210
|
/* @__PURE__ */ jsxRuntime.jsxs(Group, { justify: "flex-end", gap: "xs", children: [
|
|
30052
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "subtle", color:
|
|
30211
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "subtle", color: colors.neutral, onClick: onClose, disabled: isConfirming, children: "Cancel" }),
|
|
30053
30212
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: handleConfirm, loading: isConfirming, disabled: !croppedAreaPixels, children: "Apply" })
|
|
30054
30213
|
] })
|
|
30055
30214
|
] }) });
|
|
@@ -30148,7 +30307,7 @@ function StatCard({
|
|
|
30148
30307
|
}
|
|
30149
30308
|
),
|
|
30150
30309
|
/* @__PURE__ */ jsxRuntime.jsx(Text, { fw: 700, size: "xl", lh: 1, children: value }),
|
|
30151
|
-
trend && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c:
|
|
30310
|
+
trend && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c: fairmintVars.colorTextSecondary, children: trend })
|
|
30152
30311
|
] }),
|
|
30153
30312
|
icon && /* @__PURE__ */ jsxRuntime.jsx(Box, { c: `${color}.5`, fz: "1.5rem", children: icon })
|
|
30154
30313
|
] }) });
|
|
@@ -30243,7 +30402,7 @@ function PageHeader({ title, subtitle, action }) {
|
|
|
30243
30402
|
return /* @__PURE__ */ jsxRuntime.jsxs(Group, { justify: "space-between", align: "flex-start", mb: "lg", children: [
|
|
30244
30403
|
/* @__PURE__ */ jsxRuntime.jsxs(Stack, { gap: 4, children: [
|
|
30245
30404
|
/* @__PURE__ */ jsxRuntime.jsx(Title, { order: 2, children: title }),
|
|
30246
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx(Text, { c:
|
|
30405
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx(Text, { c: fairmintVars.colorTextSecondary, size: "sm", children: subtitle })
|
|
30247
30406
|
] }),
|
|
30248
30407
|
action
|
|
30249
30408
|
] });
|
|
@@ -30539,46 +30698,92 @@ function InvestorProfileCard({
|
|
|
30539
30698
|
}
|
|
30540
30699
|
) }) : /* @__PURE__ */ jsxRuntime.jsx(ActionIcon, { variant: "subtle", size: "sm", onClick: onEditName, "aria-label": "Edit name", children: editNameIcon ?? /* @__PURE__ */ jsxRuntime.jsx(DefaultPencilIcon, {}) }))
|
|
30541
30700
|
] }),
|
|
30542
|
-
email && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "sm", c:
|
|
30543
|
-
memberSinceText && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c:
|
|
30544
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c:
|
|
30701
|
+
email && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "sm", c: fairmintVars.colorTextSecondary, children: email }),
|
|
30702
|
+
memberSinceText && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c: fairmintVars.colorTextTertiary, children: memberSinceText }),
|
|
30703
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c: fairmintVars.colorTextSecondary, children: subtitle })
|
|
30545
30704
|
] })
|
|
30546
30705
|
] }),
|
|
30547
30706
|
children
|
|
30548
30707
|
] });
|
|
30549
30708
|
}
|
|
30550
|
-
const
|
|
30709
|
+
const SYSTEM_TYPES = /* @__PURE__ */ new Set(["fairmint", "privy"]);
|
|
30710
|
+
const TYPE_LABELS = {
|
|
30551
30711
|
fairmint: "Fairmint Wallet",
|
|
30552
30712
|
privy: "Fairmint Wallet",
|
|
30553
30713
|
manual: "Manual"
|
|
30554
30714
|
};
|
|
30555
|
-
function
|
|
30556
|
-
|
|
30557
|
-
|
|
30715
|
+
function normalizeWalletType(type) {
|
|
30716
|
+
return String(type ?? "").trim().toLowerCase();
|
|
30717
|
+
}
|
|
30718
|
+
function getWalletLabel(type, custom2) {
|
|
30719
|
+
const key = normalizeWalletType(type);
|
|
30720
|
+
const rawType = typeof type === "string" ? type : String(type ?? "");
|
|
30721
|
+
if (custom2?.[key]) return custom2[key];
|
|
30722
|
+
if (custom2?.[rawType]) return custom2[rawType];
|
|
30723
|
+
return TYPE_LABELS[key] ?? rawType;
|
|
30724
|
+
}
|
|
30725
|
+
function getWalletDisplayName(wallet, customLabels) {
|
|
30726
|
+
const label = wallet.label?.trim();
|
|
30727
|
+
if (label) return label;
|
|
30728
|
+
return getWalletLabel(wallet.type, customLabels);
|
|
30729
|
+
}
|
|
30730
|
+
function isSystemWalletType(type) {
|
|
30731
|
+
return SYSTEM_TYPES.has(normalizeWalletType(type));
|
|
30732
|
+
}
|
|
30733
|
+
function isRemovableWalletType(type) {
|
|
30734
|
+
return !isSystemWalletType(type);
|
|
30735
|
+
}
|
|
30736
|
+
function walletKey(w) {
|
|
30737
|
+
return `${normalizeWalletType(w.type)}:${w.address.toLowerCase()}`;
|
|
30558
30738
|
}
|
|
30559
30739
|
function WalletList({
|
|
30560
30740
|
wallets,
|
|
30561
30741
|
onAdd,
|
|
30562
30742
|
onRemove,
|
|
30743
|
+
onSetDefault,
|
|
30744
|
+
onLabel,
|
|
30745
|
+
onConnect,
|
|
30746
|
+
getExplorerUrl,
|
|
30563
30747
|
readOnly = false,
|
|
30564
30748
|
addLoading = false,
|
|
30565
30749
|
removeLoading = false,
|
|
30750
|
+
setDefaultLoading = false,
|
|
30751
|
+
setDefaultAddress,
|
|
30752
|
+
labelLoading = false,
|
|
30753
|
+
labelAddress,
|
|
30754
|
+
connectLoading = false,
|
|
30566
30755
|
emptyIcon,
|
|
30567
30756
|
copyIcon,
|
|
30568
30757
|
copiedIcon,
|
|
30569
30758
|
removeIcon,
|
|
30570
30759
|
addIcon,
|
|
30760
|
+
defaultIcon,
|
|
30761
|
+
renameIcon,
|
|
30762
|
+
explorerIcon,
|
|
30763
|
+
connectIcon,
|
|
30571
30764
|
typeLabels,
|
|
30572
|
-
removableTypes
|
|
30765
|
+
removableTypes,
|
|
30766
|
+
children
|
|
30573
30767
|
}) {
|
|
30768
|
+
const normalizeWalletAddress = React.useCallback(
|
|
30769
|
+
(address) => address?.trim().toLowerCase() ?? "",
|
|
30770
|
+
[]
|
|
30771
|
+
);
|
|
30574
30772
|
const [newAddress, setNewAddress] = React.useState("");
|
|
30575
30773
|
const [addressError, setAddressError] = React.useState(null);
|
|
30576
30774
|
const [showAddForm, setShowAddForm] = React.useState(false);
|
|
30577
30775
|
const [walletToRemove, setWalletToRemove] = React.useState(null);
|
|
30578
30776
|
const [copiedAddress, setCopiedAddress] = React.useState(null);
|
|
30777
|
+
const [renamingAddress, setRenamingAddress] = React.useState(null);
|
|
30778
|
+
const [renameValue, setRenameValue] = React.useState("");
|
|
30779
|
+
const [labelError, setLabelError] = React.useState(null);
|
|
30780
|
+
const [setDefaultError, setSetDefaultError] = React.useState(null);
|
|
30579
30781
|
const copyTimeoutRef = React.useRef(void 0);
|
|
30580
30782
|
React.useEffect(() => () => clearTimeout(copyTimeoutRef.current), []);
|
|
30581
|
-
|
|
30783
|
+
React.useEffect(() => {
|
|
30784
|
+
if (readOnly) setRenamingAddress(null);
|
|
30785
|
+
}, [readOnly]);
|
|
30786
|
+
const copyAddress = React.useCallback(async (address) => {
|
|
30582
30787
|
try {
|
|
30583
30788
|
await navigator.clipboard.writeText(address);
|
|
30584
30789
|
clearTimeout(copyTimeoutRef.current);
|
|
@@ -30586,9 +30791,27 @@ function WalletList({
|
|
|
30586
30791
|
copyTimeoutRef.current = setTimeout(() => setCopiedAddress(null), 2e3);
|
|
30587
30792
|
} catch {
|
|
30588
30793
|
}
|
|
30589
|
-
};
|
|
30794
|
+
}, []);
|
|
30590
30795
|
const canAdd = !readOnly && !!onAdd;
|
|
30591
30796
|
const canRemove = !readOnly && !!onRemove;
|
|
30797
|
+
const canSetDefault = !readOnly && !!onSetDefault;
|
|
30798
|
+
const canLabel = !readOnly && !!onLabel;
|
|
30799
|
+
const canConnect = !readOnly && !!onConnect;
|
|
30800
|
+
const getSafeExplorerUrl = React.useCallback(
|
|
30801
|
+
(address) => {
|
|
30802
|
+
if (!getExplorerUrl) return null;
|
|
30803
|
+
try {
|
|
30804
|
+
const url = getExplorerUrl(address);
|
|
30805
|
+
if (!url) return null;
|
|
30806
|
+
const parsed = new URL(url);
|
|
30807
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
|
|
30808
|
+
return parsed.toString();
|
|
30809
|
+
} catch {
|
|
30810
|
+
return null;
|
|
30811
|
+
}
|
|
30812
|
+
},
|
|
30813
|
+
[getExplorerUrl]
|
|
30814
|
+
);
|
|
30592
30815
|
const handleAdd = async () => {
|
|
30593
30816
|
const trimmed = newAddress.trim();
|
|
30594
30817
|
const error2 = validateEthereumAddress(trimmed);
|
|
@@ -30616,8 +30839,191 @@ function WalletList({
|
|
|
30616
30839
|
setRemoveError("Failed to remove wallet. Please try again.");
|
|
30617
30840
|
}
|
|
30618
30841
|
};
|
|
30619
|
-
|
|
30620
|
-
|
|
30842
|
+
const handleSetDefault = async (address) => {
|
|
30843
|
+
setSetDefaultError(null);
|
|
30844
|
+
try {
|
|
30845
|
+
await onSetDefault?.(address);
|
|
30846
|
+
} catch {
|
|
30847
|
+
setSetDefaultError("Failed to set default wallet. Please try again.");
|
|
30848
|
+
}
|
|
30849
|
+
};
|
|
30850
|
+
const handleLabelSave = async (address) => {
|
|
30851
|
+
setLabelError(null);
|
|
30852
|
+
try {
|
|
30853
|
+
await onLabel?.(address, renameValue.trim() || null);
|
|
30854
|
+
setRenamingAddress((current) => current === address ? null : current);
|
|
30855
|
+
} catch {
|
|
30856
|
+
setLabelError("Failed to update label. Please try again.");
|
|
30857
|
+
}
|
|
30858
|
+
};
|
|
30859
|
+
const hasWallets = wallets.length > 0;
|
|
30860
|
+
if (!hasWallets && !showAddForm && !canConnect) {
|
|
30861
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Stack, { gap: "sm", children: [
|
|
30862
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30863
|
+
EmptyState,
|
|
30864
|
+
{
|
|
30865
|
+
icon: emptyIcon,
|
|
30866
|
+
title: "No wallets connected",
|
|
30867
|
+
description: "Add a wallet address to receive equity on-chain.",
|
|
30868
|
+
actionLabel: canAdd ? "Add Wallet" : void 0,
|
|
30869
|
+
onAction: canAdd ? () => setShowAddForm(true) : void 0
|
|
30870
|
+
}
|
|
30871
|
+
),
|
|
30872
|
+
children
|
|
30873
|
+
] });
|
|
30874
|
+
}
|
|
30875
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Stack, { gap: "sm", children: [
|
|
30876
|
+
wallets.map((w) => {
|
|
30877
|
+
const normalizedWalletAddress = normalizeWalletAddress(w.address);
|
|
30878
|
+
const setDefaultActionLoading = setDefaultLoading && (!setDefaultAddress || normalizeWalletAddress(setDefaultAddress) === normalizedWalletAddress);
|
|
30879
|
+
const labelActionLoading = labelLoading && (!labelAddress || normalizeWalletAddress(labelAddress) === normalizedWalletAddress);
|
|
30880
|
+
const explorerUrl = getSafeExplorerUrl(w.address);
|
|
30881
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Stack, { gap: 0, children: [
|
|
30882
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
30883
|
+
Group,
|
|
30884
|
+
{
|
|
30885
|
+
justify: "space-between",
|
|
30886
|
+
p: "xs",
|
|
30887
|
+
style: {
|
|
30888
|
+
borderRadius: radii.sm,
|
|
30889
|
+
border: `1px solid ${neutralColors[200]}`
|
|
30890
|
+
},
|
|
30891
|
+
children: [
|
|
30892
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Group, { gap: "xs", children: [
|
|
30893
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { size: "xs", variant: "light", children: getWalletLabel(w.type, typeLabels) }),
|
|
30894
|
+
w.label && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c: fairmintVars.colorTextSecondary, children: w.label }),
|
|
30895
|
+
w.defaultRecipient && /* @__PURE__ */ jsxRuntime.jsx(Badge, { size: "xs", color: colors.success, variant: "light", children: "Default" }),
|
|
30896
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: "sm", ff: "monospace", children: truncateAddress(w.address) })
|
|
30897
|
+
] }),
|
|
30898
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Group, { gap: 4, children: [
|
|
30899
|
+
copyIcon && /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { label: copiedAddress === w.address ? "Copied!" : "Copy address", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30900
|
+
ActionIcon,
|
|
30901
|
+
{
|
|
30902
|
+
variant: "subtle",
|
|
30903
|
+
size: "sm",
|
|
30904
|
+
onClick: () => copyAddress(w.address),
|
|
30905
|
+
"aria-label": "Copy wallet address",
|
|
30906
|
+
children: copiedAddress === w.address ? copiedIcon ?? copyIcon : copyIcon
|
|
30907
|
+
}
|
|
30908
|
+
) }),
|
|
30909
|
+
canSetDefault && defaultIcon && !w.defaultRecipient && /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { label: "Set as default recipient", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30910
|
+
ActionIcon,
|
|
30911
|
+
{
|
|
30912
|
+
variant: "subtle",
|
|
30913
|
+
size: "sm",
|
|
30914
|
+
onClick: () => handleSetDefault(w.address),
|
|
30915
|
+
loading: setDefaultActionLoading,
|
|
30916
|
+
disabled: setDefaultActionLoading,
|
|
30917
|
+
"aria-label": "Set as default wallet",
|
|
30918
|
+
children: defaultIcon
|
|
30919
|
+
}
|
|
30920
|
+
) }),
|
|
30921
|
+
canLabel && renameIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
30922
|
+
Tooltip,
|
|
30923
|
+
{
|
|
30924
|
+
label: renamingAddress === w.address ? "Cancel rename" : "Rename wallet",
|
|
30925
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30926
|
+
ActionIcon,
|
|
30927
|
+
{
|
|
30928
|
+
variant: "subtle",
|
|
30929
|
+
size: "sm",
|
|
30930
|
+
onClick: () => {
|
|
30931
|
+
setLabelError(null);
|
|
30932
|
+
if (renamingAddress === w.address) {
|
|
30933
|
+
setRenamingAddress(null);
|
|
30934
|
+
} else {
|
|
30935
|
+
setRenamingAddress(w.address);
|
|
30936
|
+
setRenameValue(w.label ?? "");
|
|
30937
|
+
}
|
|
30938
|
+
},
|
|
30939
|
+
"aria-label": "Rename wallet",
|
|
30940
|
+
children: renameIcon
|
|
30941
|
+
}
|
|
30942
|
+
)
|
|
30943
|
+
}
|
|
30944
|
+
),
|
|
30945
|
+
explorerUrl && explorerIcon && /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { label: "View on block explorer", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30946
|
+
Anchor,
|
|
30947
|
+
{
|
|
30948
|
+
href: explorerUrl,
|
|
30949
|
+
target: "_blank",
|
|
30950
|
+
rel: "noopener noreferrer",
|
|
30951
|
+
"aria-label": "View on block explorer",
|
|
30952
|
+
c: colors.primary,
|
|
30953
|
+
style: {
|
|
30954
|
+
display: "inline-flex",
|
|
30955
|
+
alignItems: "center",
|
|
30956
|
+
justifyContent: "center",
|
|
30957
|
+
width: "1.625rem",
|
|
30958
|
+
height: "1.625rem",
|
|
30959
|
+
borderRadius: radii.sm
|
|
30960
|
+
},
|
|
30961
|
+
children: explorerIcon
|
|
30962
|
+
}
|
|
30963
|
+
) }),
|
|
30964
|
+
canRemove && removeIcon && (removableTypes ? removableTypes.some(
|
|
30965
|
+
(t) => normalizeWalletType(t) === normalizeWalletType(w.type)
|
|
30966
|
+
) : isRemovableWalletType(w.type)) && /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { label: "Remove wallet", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30967
|
+
ActionIcon,
|
|
30968
|
+
{
|
|
30969
|
+
variant: "subtle",
|
|
30970
|
+
size: "sm",
|
|
30971
|
+
color: colors.error,
|
|
30972
|
+
onClick: () => setWalletToRemove(w.address),
|
|
30973
|
+
disabled: removeLoading,
|
|
30974
|
+
"aria-label": "Remove wallet",
|
|
30975
|
+
children: removeIcon
|
|
30976
|
+
}
|
|
30977
|
+
) })
|
|
30978
|
+
] })
|
|
30979
|
+
]
|
|
30980
|
+
}
|
|
30981
|
+
),
|
|
30982
|
+
renamingAddress === w.address && /* @__PURE__ */ jsxRuntime.jsxs(Group, { gap: "xs", mt: "xs", align: "flex-start", children: [
|
|
30983
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30984
|
+
TextInput,
|
|
30985
|
+
{
|
|
30986
|
+
value: renameValue,
|
|
30987
|
+
onChange: (e) => {
|
|
30988
|
+
setRenameValue(e.currentTarget.value);
|
|
30989
|
+
setLabelError(null);
|
|
30990
|
+
},
|
|
30991
|
+
placeholder: getWalletLabel(w.type, typeLabels),
|
|
30992
|
+
size: "xs",
|
|
30993
|
+
style: { flex: 1 },
|
|
30994
|
+
"aria-label": "Wallet label",
|
|
30995
|
+
maxLength: 50,
|
|
30996
|
+
error: labelError
|
|
30997
|
+
}
|
|
30998
|
+
),
|
|
30999
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31000
|
+
Button,
|
|
31001
|
+
{
|
|
31002
|
+
size: "xs",
|
|
31003
|
+
loading: labelActionLoading,
|
|
31004
|
+
disabled: labelActionLoading,
|
|
31005
|
+
onClick: () => handleLabelSave(w.address),
|
|
31006
|
+
children: "Save"
|
|
31007
|
+
}
|
|
31008
|
+
),
|
|
31009
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31010
|
+
Button,
|
|
31011
|
+
{
|
|
31012
|
+
size: "xs",
|
|
31013
|
+
variant: "subtle",
|
|
31014
|
+
color: colors.neutral,
|
|
31015
|
+
onClick: () => {
|
|
31016
|
+
setRenamingAddress(null);
|
|
31017
|
+
setLabelError(null);
|
|
31018
|
+
},
|
|
31019
|
+
children: "Cancel"
|
|
31020
|
+
}
|
|
31021
|
+
)
|
|
31022
|
+
] })
|
|
31023
|
+
] }, walletKey(w));
|
|
31024
|
+
}),
|
|
31025
|
+
setDefaultError && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "sm", c: colors.error, children: setDefaultError }),
|
|
31026
|
+
!hasWallets && !showAddForm && /* @__PURE__ */ jsxRuntime.jsx(
|
|
30621
31027
|
EmptyState,
|
|
30622
31028
|
{
|
|
30623
31029
|
icon: emptyIcon,
|
|
@@ -30626,52 +31032,19 @@ function WalletList({
|
|
|
30626
31032
|
actionLabel: canAdd ? "Add Wallet" : void 0,
|
|
30627
31033
|
onAction: canAdd ? () => setShowAddForm(true) : void 0
|
|
30628
31034
|
}
|
|
30629
|
-
)
|
|
30630
|
-
|
|
30631
|
-
|
|
30632
|
-
wallets.map((w) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30633
|
-
Group,
|
|
31035
|
+
),
|
|
31036
|
+
canConnect && /* @__PURE__ */ jsxRuntime.jsx(
|
|
31037
|
+
Button,
|
|
30634
31038
|
{
|
|
30635
|
-
|
|
30636
|
-
|
|
30637
|
-
|
|
30638
|
-
|
|
30639
|
-
|
|
30640
|
-
|
|
30641
|
-
children:
|
|
30642
|
-
|
|
30643
|
-
|
|
30644
|
-
w.label && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", c: `${colors.neutral}.5`, children: w.label }),
|
|
30645
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: "sm", ff: "monospace", children: truncateAddress(w.address) })
|
|
30646
|
-
] }),
|
|
30647
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Group, { gap: 4, children: [
|
|
30648
|
-
copyIcon && /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { label: copiedAddress === w.address ? "Copied!" : "Copy address", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30649
|
-
ActionIcon,
|
|
30650
|
-
{
|
|
30651
|
-
variant: "subtle",
|
|
30652
|
-
size: "sm",
|
|
30653
|
-
onClick: () => copyAddress(w.address),
|
|
30654
|
-
"aria-label": "Copy wallet address",
|
|
30655
|
-
children: copiedAddress === w.address ? copiedIcon ?? copyIcon : copyIcon
|
|
30656
|
-
}
|
|
30657
|
-
) }),
|
|
30658
|
-
canRemove && removeIcon && removableTypes.includes(w.type) && /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { label: "Remove wallet", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30659
|
-
ActionIcon,
|
|
30660
|
-
{
|
|
30661
|
-
variant: "subtle",
|
|
30662
|
-
size: "sm",
|
|
30663
|
-
color: colors.error,
|
|
30664
|
-
onClick: () => setWalletToRemove(w.address),
|
|
30665
|
-
disabled: removeLoading,
|
|
30666
|
-
"aria-label": "Remove wallet",
|
|
30667
|
-
children: removeIcon
|
|
30668
|
-
}
|
|
30669
|
-
) })
|
|
30670
|
-
] })
|
|
30671
|
-
]
|
|
30672
|
-
},
|
|
30673
|
-
w.address
|
|
30674
|
-
)),
|
|
31039
|
+
variant: "light",
|
|
31040
|
+
size: "xs",
|
|
31041
|
+
leftSection: connectIcon,
|
|
31042
|
+
onClick: onConnect,
|
|
31043
|
+
loading: connectLoading,
|
|
31044
|
+
mt: "xs",
|
|
31045
|
+
children: "Connect Wallet"
|
|
31046
|
+
}
|
|
31047
|
+
),
|
|
30675
31048
|
canAdd && (showAddForm ? /* @__PURE__ */ jsxRuntime.jsxs(Group, { gap: "xs", mt: "xs", children: [
|
|
30676
31049
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30677
31050
|
TextInput,
|
|
@@ -30702,7 +31075,7 @@ function WalletList({
|
|
|
30702
31075
|
children: "Cancel"
|
|
30703
31076
|
}
|
|
30704
31077
|
)
|
|
30705
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
31078
|
+
] }) : hasWallets ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
30706
31079
|
Button,
|
|
30707
31080
|
{
|
|
30708
31081
|
variant: "light",
|
|
@@ -30712,14 +31085,15 @@ function WalletList({
|
|
|
30712
31085
|
mt: "xs",
|
|
30713
31086
|
children: "Add Wallet"
|
|
30714
31087
|
}
|
|
30715
|
-
)),
|
|
31088
|
+
) : null),
|
|
31089
|
+
children,
|
|
30716
31090
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30717
31091
|
ConfirmDialog,
|
|
30718
31092
|
{
|
|
30719
31093
|
title: "Remove Wallet",
|
|
30720
31094
|
message: /* @__PURE__ */ jsxRuntime.jsxs(Stack, { gap: "sm", children: [
|
|
30721
31095
|
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: "sm", children: "Are you sure you want to remove this wallet address? This action cannot be undone." }),
|
|
30722
|
-
walletToRemove && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "sm", ff: "monospace", c:
|
|
31096
|
+
walletToRemove && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "sm", ff: "monospace", c: fairmintVars.colorTextSecondary, children: walletToRemove }),
|
|
30723
31097
|
removeError && /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "sm", c: colors.error, children: removeError })
|
|
30724
31098
|
] }),
|
|
30725
31099
|
opened: walletToRemove !== null,
|
|
@@ -30797,6 +31171,7 @@ exports.EmailField = EmailField;
|
|
|
30797
31171
|
exports.EmptyState = EmptyState;
|
|
30798
31172
|
exports.EquityGrantCard = EquityGrantCard;
|
|
30799
31173
|
exports.ErrorFallback = ErrorFallback;
|
|
31174
|
+
exports.ErrorPage = ErrorPage;
|
|
30800
31175
|
exports.EthereumAddressField = EthereumAddressField;
|
|
30801
31176
|
exports.FairmintLogo = FairmintLogo;
|
|
30802
31177
|
exports.FairmintProvider = FairmintProvider;
|
|
@@ -30855,9 +31230,12 @@ exports.ZERO_ETHEREUM_ADDRESS = ZERO_ETHEREUM_ADDRESS;
|
|
|
30855
31230
|
exports.ZipField = ZipField;
|
|
30856
31231
|
exports.brandColors = brandColors;
|
|
30857
31232
|
exports.colors = colors;
|
|
31233
|
+
exports.createFairmintMantineProviderProps = createFairmintMantineProviderProps;
|
|
30858
31234
|
exports.createZipSchema = createZipSchema;
|
|
30859
31235
|
exports.emailSchema = emailSchema;
|
|
30860
31236
|
exports.ethereumAddressSchema = ethereumAddressSchema;
|
|
31237
|
+
exports.fairmintCssVariables = fairmintCssVariables;
|
|
31238
|
+
exports.fairmintVars = fairmintVars;
|
|
30861
31239
|
exports.formatCurrency = formatCurrency;
|
|
30862
31240
|
exports.formatCurrencyPrecise = formatCurrencyPrecise;
|
|
30863
31241
|
exports.formatDate = formatDate;
|
|
@@ -30867,9 +31245,14 @@ exports.formatPhone = formatPhone;
|
|
|
30867
31245
|
exports.formatPhoneDisplay = formatPhoneDisplay;
|
|
30868
31246
|
exports.formatPreciseWithCurrency = formatPreciseWithCurrency;
|
|
30869
31247
|
exports.getAvatarColor = getAvatarColor;
|
|
31248
|
+
exports.getWalletDisplayName = getWalletDisplayName;
|
|
31249
|
+
exports.getWalletLabel = getWalletLabel;
|
|
30870
31250
|
exports.isEthereumAddress = isEthereumAddress;
|
|
31251
|
+
exports.isRemovableWalletType = isRemovableWalletType;
|
|
31252
|
+
exports.isSystemWalletType = isSystemWalletType;
|
|
30871
31253
|
exports.neutralColors = neutralColors;
|
|
30872
31254
|
exports.normalizePhone = normalizePhone;
|
|
31255
|
+
exports.normalizeWalletType = normalizeWalletType;
|
|
30873
31256
|
exports.notify = notify;
|
|
30874
31257
|
exports.passwordSchema = passwordSchema;
|
|
30875
31258
|
exports.phoneSchema = phoneSchema;
|
|
@@ -30877,6 +31260,7 @@ exports.radii = radii;
|
|
|
30877
31260
|
exports.semanticColors = semanticColors;
|
|
30878
31261
|
exports.theme = theme;
|
|
30879
31262
|
exports.truncateAddress = truncateAddress;
|
|
31263
|
+
exports.typography = typography;
|
|
30880
31264
|
exports.useClickOutside = useClickOutside;
|
|
30881
31265
|
exports.useClipboard = useClipboard;
|
|
30882
31266
|
exports.useDebouncedCallback = useDebouncedCallback;
|
|
@@ -30891,6 +31275,7 @@ exports.useMediaQuery = useMediaQuery;
|
|
|
30891
31275
|
exports.useScrollIntoView = useScrollIntoView;
|
|
30892
31276
|
exports.useViewportSize = useViewportSize;
|
|
30893
31277
|
exports.validateEthereumAddress = validateEthereumAddress;
|
|
31278
|
+
exports.walletKey = walletKey;
|
|
30894
31279
|
exports.z = z;
|
|
30895
31280
|
exports.zipSchema = zipSchema;
|
|
30896
31281
|
//# sourceMappingURL=fairmint-ui.cjs.map
|