@xyo-network/react-shared 7.5.8 → 7.5.11
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/browser/components/BasicHero/BasicHero.d.ts.map +1 -1
- package/dist/browser/components/bigint/InputAdornment.d.ts.map +1 -1
- package/dist/browser/components/bigint/TextField.d.ts.map +1 -1
- package/dist/browser/hooks/payload/types/ValidatedResponse.d.ts +2 -2
- package/dist/browser/hooks/payload/types/ValidatedResponse.d.ts.map +1 -1
- package/dist/browser/hooks/payload/usePayloadValidate.d.ts.map +1 -1
- package/dist/browser/hooks/useShareForwardRef.d.ts.map +1 -1
- package/dist/browser/index.mjs +641 -594
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +88 -40
- package/src/SizeProp.ts +0 -1
- package/src/components/Ampersand.tsx +0 -11
- package/src/components/BasicHero/BasicHero.stories.tsx +0 -54
- package/src/components/BasicHero/BasicHero.tsx +0 -270
- package/src/components/BasicHero/default-desktop.svg +0 -1
- package/src/components/BasicHero/index.ts +0 -1
- package/src/components/Ellipsize.tsx +0 -103
- package/src/components/LabeledTextFieldWrapper.tsx +0 -20
- package/src/components/ListItemButtonEx.tsx +0 -30
- package/src/components/LoadResult.stories.tsx +0 -33
- package/src/components/LoadResult.tsx +0 -27
- package/src/components/NotFound.tsx +0 -16
- package/src/components/Pipe.tsx +0 -11
- package/src/components/ScrollTableOnSm.tsx +0 -13
- package/src/components/SectionSpacingRow/SectionSpacingRow.stories.tsx +0 -32
- package/src/components/SectionSpacingRow/SectionSpacingRow.tsx +0 -26
- package/src/components/SectionSpacingRow/index.ts +0 -1
- package/src/components/StyleGuide/AppBars.example.tsx +0 -29
- package/src/components/StyleGuide/Buttons.example.tsx +0 -46
- package/src/components/StyleGuide/Papers.example.tsx +0 -23
- package/src/components/StyleGuide/StyleGuide.example.tsx +0 -20
- package/src/components/StyleGuide/StyleGuide.stories.tsx +0 -21
- package/src/components/StyleGuide/Texts.example.tsx +0 -34
- package/src/components/StyleGuide/VariantContext.example.tsx +0 -3
- package/src/components/TableCell/AddressTableCell.tsx +0 -24
- package/src/components/TableCell/EllipsisTableCell.tsx +0 -58
- package/src/components/TableCell/EllipsizeTableCell.stories.tsx +0 -105
- package/src/components/TableCell/HashTableCell.tsx +0 -28
- package/src/components/TableCell/findParent.ts +0 -10
- package/src/components/TableCell/getRemainingRowWidth.ts +0 -12
- package/src/components/TableCell/getSmallestParentWidth.ts +0 -13
- package/src/components/TableCell/index.ts +0 -3
- package/src/components/ThemeTokenAvatar/ThemeTokenAvatar.stories.tsx +0 -25
- package/src/components/ThemeTokenAvatar/ThemeTokenAvatar.tsx +0 -8
- package/src/components/ThemeTokenAvatar/index.ts +0 -1
- package/src/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.stories.tsx +0 -38
- package/src/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.tsx +0 -13
- package/src/components/ThemeTokenAvatarGroup/index.ts +0 -1
- package/src/components/TokenBar/TokenBar.stories.tsx +0 -33
- package/src/components/TokenBar/TokenBar.tsx +0 -32
- package/src/components/TokenBar/index.ts +0 -1
- package/src/components/TokenData/TokenData.ts +0 -141
- package/src/components/TokenData/img/ada.png +0 -0
- package/src/components/TokenData/img/btc.png +0 -0
- package/src/components/TokenData/img/busd.png +0 -0
- package/src/components/TokenData/img/dai.png +0 -0
- package/src/components/TokenData/img/dogecoin.png +0 -0
- package/src/components/TokenData/img/dot.png +0 -0
- package/src/components/TokenData/img/ethereum.png +0 -0
- package/src/components/TokenData/img/frax.png +0 -0
- package/src/components/TokenData/img/images.d.ts +0 -5
- package/src/components/TokenData/img/index.ts +0 -16
- package/src/components/TokenData/img/link.png +0 -0
- package/src/components/TokenData/img/sol.png +0 -0
- package/src/components/TokenData/img/tether.png +0 -0
- package/src/components/TokenData/img/usd-coin.png +0 -0
- package/src/components/TokenData/img/weth.png +0 -0
- package/src/components/TokenData/img/wrapped-bitcoin.png +0 -0
- package/src/components/TokenData/img/xl1.png +0 -0
- package/src/components/TokenData/img/xyo.png +0 -0
- package/src/components/TokenData/index.ts +0 -2
- package/src/components/TokenData/useGetTokenData.tsx +0 -16
- package/src/components/TokenSummary/TokenSummary.stories.tsx +0 -37
- package/src/components/TokenSummary/TokenSummary.tsx +0 -32
- package/src/components/TokenSummary/index.ts +0 -1
- package/src/components/TypographyEx.tsx +0 -14
- package/src/components/bigint/FixedPointPopover.tsx +0 -27
- package/src/components/bigint/Input.stories.tsx +0 -79
- package/src/components/bigint/Input.ts +0 -6
- package/src/components/bigint/InputAdornment.tsx +0 -44
- package/src/components/bigint/TextField.tsx +0 -128
- package/src/components/bigint/helpers/formatBigIntInput.ts +0 -11
- package/src/components/bigint/helpers/index.ts +0 -1
- package/src/components/bigint/index.ts +0 -5
- package/src/components/index.ts +0 -19
- package/src/components/pluginValidation/DataMissing.tsx +0 -16
- package/src/components/pluginValidation/index.ts +0 -1
- package/src/contexts/ListMode/Context.ts +0 -5
- package/src/contexts/ListMode/Provider.tsx +0 -29
- package/src/contexts/ListMode/State.ts +0 -9
- package/src/contexts/ListMode/index.ts +0 -4
- package/src/contexts/ListMode/use.ts +0 -7
- package/src/contexts/diviner/Context.ts +0 -4
- package/src/contexts/diviner/Provider.tsx +0 -45
- package/src/contexts/diviner/State.ts +0 -7
- package/src/contexts/diviner/index.ts +0 -3
- package/src/contexts/index.ts +0 -2
- package/src/global.d.ts +0 -1
- package/src/hooks/GradientStyles/GradientStyle.stories.tsx +0 -66
- package/src/hooks/GradientStyles/GradientStyles.tsx +0 -54
- package/src/hooks/GradientStyles/index.ts +0 -1
- package/src/hooks/index.ts +0 -5
- package/src/hooks/payload/index.ts +0 -4
- package/src/hooks/payload/types/ValidatedResponse.ts +0 -3
- package/src/hooks/payload/types/index.ts +0 -1
- package/src/hooks/payload/useBoundWitnessValidate.tsx +0 -29
- package/src/hooks/payload/usePayloadHash.tsx +0 -26
- package/src/hooks/payload/usePayloadValidate.tsx +0 -22
- package/src/hooks/useDataState.ts +0 -18
- package/src/hooks/useMediaQuery.ts +0 -3
- package/src/hooks/useShareForwardRef.ts +0 -23
- package/src/index.ts +0 -6
- package/src/lib/assertDefinedEx.ts +0 -7
- package/src/lib/getActualPaddingX.ts +0 -63
- package/src/lib/index.ts +0 -3
- package/src/lib/networkComponents.tsx +0 -48
- package/src/lib/xyo.tsx +0 -15
- package/src/models/ListMode.ts +0 -1
- package/src/models/index.ts +0 -1
package/dist/browser/index.mjs
CHANGED
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// src/components/Ampersand.tsx
|
|
5
2
|
import { Typography } from "@mui/material";
|
|
6
|
-
import
|
|
7
|
-
var Ampersand =
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
|
|
10
|
-
component: "span",
|
|
11
|
-
...props
|
|
12
|
-
}, "&");
|
|
13
|
-
}, "Ampersand");
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var Ampersand = (props) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(Typography, { marginX: 1, component: "span", ...props, children: "&" });
|
|
6
|
+
};
|
|
14
7
|
|
|
15
8
|
// src/components/BasicHero/BasicHero.tsx
|
|
16
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
Container,
|
|
11
|
+
Grid,
|
|
12
|
+
styled,
|
|
13
|
+
Typography as Typography2
|
|
14
|
+
} from "@mui/material";
|
|
17
15
|
import { ButtonEx } from "@xylabs/react-button";
|
|
18
16
|
import { FlexGrowCol, FlexGrowRow } from "@xylabs/react-flexbox";
|
|
19
17
|
import { LinkEx } from "@xylabs/react-link";
|
|
20
18
|
import { useIsSmall } from "@xylabs/react-theme";
|
|
21
|
-
import
|
|
19
|
+
import { useMemo as useMemo2 } from "react";
|
|
22
20
|
|
|
23
21
|
// src/hooks/GradientStyles/GradientStyles.tsx
|
|
24
22
|
import { useIsDark } from "@xylabs/react-theme";
|
|
25
|
-
var colorfulGradientLightMode =
|
|
23
|
+
var colorfulGradientLightMode = () => {
|
|
26
24
|
return {
|
|
27
|
-
background: {
|
|
28
|
-
backgroundImage: "-webkit-linear-gradient(232deg, #e17751, #d84e7a, #5898dd, #8c8ee5)"
|
|
29
|
-
},
|
|
25
|
+
background: { backgroundImage: "-webkit-linear-gradient(232deg, #e17751, #d84e7a, #5898dd, #8c8ee5)" },
|
|
30
26
|
border: {
|
|
31
27
|
borderImage: "-webkit-linear-gradient(232deg, #e17751, #d84e7a, #5898dd, #8c8ee5)",
|
|
32
28
|
borderImageSlice: 1,
|
|
@@ -42,12 +38,10 @@ var colorfulGradientLightMode = /* @__PURE__ */ __name(() => {
|
|
|
42
38
|
display: "inline-block"
|
|
43
39
|
}
|
|
44
40
|
};
|
|
45
|
-
}
|
|
46
|
-
var colorfulGradientDarkMode =
|
|
41
|
+
};
|
|
42
|
+
var colorfulGradientDarkMode = () => {
|
|
47
43
|
return {
|
|
48
|
-
background: {
|
|
49
|
-
backgroundImage: "-webkit-linear-gradient(232deg, #F17938, #FF5BDC, #5898dd, #B2FFFD)"
|
|
50
|
-
},
|
|
44
|
+
background: { backgroundImage: "-webkit-linear-gradient(232deg, #F17938, #FF5BDC, #5898dd, #B2FFFD)" },
|
|
51
45
|
border: {
|
|
52
46
|
borderImage: "-webkit-linear-gradient(232deg, #F17938, #FF5BDC, #5898dd, #B2FFFD)",
|
|
53
47
|
borderImageSlice: 1,
|
|
@@ -63,19 +57,19 @@ var colorfulGradientDarkMode = /* @__PURE__ */ __name(() => {
|
|
|
63
57
|
display: "inline-block"
|
|
64
58
|
}
|
|
65
59
|
};
|
|
66
|
-
}
|
|
67
|
-
var useGradientStyles =
|
|
60
|
+
};
|
|
61
|
+
var useGradientStyles = () => {
|
|
68
62
|
const dark = useIsDark();
|
|
69
63
|
const styles = dark ? colorfulGradientDarkMode() : colorfulGradientLightMode();
|
|
70
64
|
return styles;
|
|
71
|
-
}
|
|
65
|
+
};
|
|
72
66
|
|
|
73
67
|
// src/hooks/payload/useBoundWitnessValidate.tsx
|
|
74
68
|
import { usePromise } from "@xylabs/react-promise";
|
|
75
69
|
import { assertEx } from "@xylabs/sdk-js";
|
|
76
70
|
import { BoundWitnessValidator } from "@xyo-network/boundwitness-validator";
|
|
77
71
|
import { isAnyPayload } from "@xyo-network/payload-model";
|
|
78
|
-
var useValidateBoundWitness =
|
|
72
|
+
var useValidateBoundWitness = (input) => {
|
|
79
73
|
const [output, validationError] = usePromise(async () => {
|
|
80
74
|
if (!input) return;
|
|
81
75
|
const object = JSON.parse(input);
|
|
@@ -85,79 +79,58 @@ var useValidateBoundWitness = /* @__PURE__ */ __name((input) => {
|
|
|
85
79
|
payload: validPayload,
|
|
86
80
|
errors: errors2
|
|
87
81
|
};
|
|
88
|
-
}, [
|
|
89
|
-
input
|
|
90
|
-
]);
|
|
82
|
+
}, [input]);
|
|
91
83
|
const { payload, errors } = output ?? {};
|
|
92
84
|
return {
|
|
93
85
|
payload,
|
|
94
|
-
errors: [
|
|
95
|
-
validationError,
|
|
96
|
-
...errors ?? []
|
|
97
|
-
].filter((error) => !!error)
|
|
86
|
+
errors: [validationError, ...errors ?? []].filter((error) => !!error)
|
|
98
87
|
};
|
|
99
|
-
}
|
|
88
|
+
};
|
|
100
89
|
|
|
101
90
|
// src/hooks/payload/usePayloadHash.tsx
|
|
102
91
|
import { usePromise as usePromise2 } from "@xylabs/react-promise";
|
|
103
92
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
104
|
-
var usePayloadHash =
|
|
93
|
+
var usePayloadHash = (payload) => {
|
|
105
94
|
return usePayloadRootHash(payload);
|
|
106
|
-
}
|
|
107
|
-
var usePayloadDataHash =
|
|
108
|
-
return usePromise2(async () => payload ? await PayloadBuilder.dataHash(payload) : void 0, [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
payload,
|
|
120
|
-
await PayloadBuilder.dataHash(payload)
|
|
121
|
-
])) : void 0, [
|
|
122
|
-
payloads
|
|
123
|
-
])[0];
|
|
124
|
-
}, "usePayloadHashes");
|
|
95
|
+
};
|
|
96
|
+
var usePayloadDataHash = (payload) => {
|
|
97
|
+
return usePromise2(async () => payload ? await PayloadBuilder.dataHash(payload) : void 0, [payload])[0];
|
|
98
|
+
};
|
|
99
|
+
var usePayloadRootHash = (payload) => {
|
|
100
|
+
return usePromise2(async () => payload ? await PayloadBuilder.hash(payload) : void 0, [payload])[0];
|
|
101
|
+
};
|
|
102
|
+
var usePayloadHashes = (payloads) => {
|
|
103
|
+
return usePromise2(
|
|
104
|
+
async () => payloads ? await Promise.all(payloads.map(async (payload) => [payload, await PayloadBuilder.dataHash(payload)])) : void 0,
|
|
105
|
+
[payloads]
|
|
106
|
+
)[0];
|
|
107
|
+
};
|
|
125
108
|
|
|
126
109
|
// src/hooks/payload/usePayloadValidate.tsx
|
|
127
110
|
import { assertEx as assertEx2 } from "@xylabs/sdk-js";
|
|
128
111
|
import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
|
|
129
112
|
import { isAnyPayload as isAnyPayload2 } from "@xyo-network/payload-model";
|
|
130
113
|
import { useMemo } from "react";
|
|
131
|
-
var usePayloadValidate =
|
|
114
|
+
var usePayloadValidate = (input) => {
|
|
132
115
|
return useMemo(() => {
|
|
133
116
|
if (!input) return {};
|
|
134
117
|
try {
|
|
135
118
|
const object = JSON.parse(input);
|
|
136
119
|
const validPayload = assertEx2(isAnyPayload2(object) ? object : null, () => "Invalid payload");
|
|
137
120
|
const { schema, ...fields } = validPayload;
|
|
138
|
-
const payload = new PayloadBuilder2({
|
|
139
|
-
|
|
140
|
-
}).fields(fields).build();
|
|
141
|
-
return {
|
|
142
|
-
payload
|
|
143
|
-
};
|
|
121
|
+
const payload = new PayloadBuilder2({ schema }).fields(fields).build();
|
|
122
|
+
return { payload };
|
|
144
123
|
} catch (error) {
|
|
145
|
-
return {
|
|
146
|
-
errors: [
|
|
147
|
-
error
|
|
148
|
-
]
|
|
149
|
-
};
|
|
124
|
+
return { errors: [error] };
|
|
150
125
|
}
|
|
151
|
-
}, [
|
|
152
|
-
|
|
153
|
-
]);
|
|
154
|
-
}, "usePayloadValidate");
|
|
126
|
+
}, [input]);
|
|
127
|
+
};
|
|
155
128
|
|
|
156
129
|
// src/hooks/useDataState.ts
|
|
157
130
|
import { useState } from "react";
|
|
158
|
-
var useDataState =
|
|
131
|
+
var useDataState = (defaultValue) => {
|
|
159
132
|
const [state, setState] = useState(defaultValue);
|
|
160
|
-
const setDataState =
|
|
133
|
+
const setDataState = (value) => {
|
|
161
134
|
try {
|
|
162
135
|
if (JSON.stringify(value) !== JSON.stringify(state)) {
|
|
163
136
|
setState(value);
|
|
@@ -165,19 +138,16 @@ var useDataState = /* @__PURE__ */ __name((defaultValue) => {
|
|
|
165
138
|
} catch {
|
|
166
139
|
console.error("setDataState failed! Make sure data type is stringifiable!");
|
|
167
140
|
}
|
|
168
|
-
}
|
|
169
|
-
return [
|
|
170
|
-
|
|
171
|
-
setDataState
|
|
172
|
-
];
|
|
173
|
-
}, "useDataState");
|
|
141
|
+
};
|
|
142
|
+
return [state, setDataState];
|
|
143
|
+
};
|
|
174
144
|
|
|
175
145
|
// src/hooks/useMediaQuery.ts
|
|
176
146
|
import { useMediaQuery } from "@mui/material";
|
|
177
147
|
|
|
178
148
|
// src/hooks/useShareForwardRef.ts
|
|
179
149
|
import { useEffect, useRef } from "react";
|
|
180
|
-
var useShareForwardedRef =
|
|
150
|
+
var useShareForwardedRef = (forwardedRef, refresh = 0) => {
|
|
181
151
|
const innerRef = useRef(null);
|
|
182
152
|
useEffect(() => {
|
|
183
153
|
if (!forwardedRef) {
|
|
@@ -188,257 +158,315 @@ var useShareForwardedRef = /* @__PURE__ */ __name((forwardedRef, refresh = 0) =>
|
|
|
188
158
|
} else {
|
|
189
159
|
forwardedRef.current = innerRef.current;
|
|
190
160
|
}
|
|
191
|
-
}, [
|
|
192
|
-
forwardedRef,
|
|
193
|
-
refresh
|
|
194
|
-
]);
|
|
161
|
+
}, [forwardedRef, refresh]);
|
|
195
162
|
return innerRef;
|
|
196
|
-
}
|
|
163
|
+
};
|
|
197
164
|
|
|
198
165
|
// src/components/BasicHero/BasicHero.tsx
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
166
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
167
|
+
var SubLinkSection = ({
|
|
168
|
+
backgroundImageAlignment,
|
|
169
|
+
subLinkIcon,
|
|
170
|
+
subLinkPath,
|
|
171
|
+
subLinkText1,
|
|
172
|
+
subLinkText2
|
|
173
|
+
}) => {
|
|
174
|
+
return /* @__PURE__ */ jsxs(
|
|
175
|
+
FlexGrowRow,
|
|
176
|
+
{
|
|
177
|
+
width: "100%",
|
|
178
|
+
sx: {
|
|
179
|
+
flexDirection: { md: "row", xs: "column" },
|
|
180
|
+
justifyContent: { md: backgroundImageAlignment ? "flex-start" : "center", xs: "center" }
|
|
206
181
|
},
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
182
|
+
children: [
|
|
183
|
+
subLinkIcon ? /* @__PURE__ */ jsxs("span", { children: [
|
|
184
|
+
subLinkIcon,
|
|
185
|
+
"\xA0"
|
|
186
|
+
] }) : null,
|
|
187
|
+
/* @__PURE__ */ jsxs(Typography2, { children: [
|
|
188
|
+
subLinkText1,
|
|
189
|
+
"\xA0"
|
|
190
|
+
] }),
|
|
191
|
+
/* @__PURE__ */ jsx2(LinkEx, { href: subLinkPath, underline: "always", target: "_blank", color: "inherit", children: /* @__PURE__ */ jsx2(Typography2, { children: subLinkText2 }) })
|
|
192
|
+
]
|
|
211
193
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
var ButtonSection = /* @__PURE__ */ __name(({ href, to, buttonText }) => {
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
var ButtonSection = ({
|
|
197
|
+
href,
|
|
198
|
+
to,
|
|
199
|
+
buttonText
|
|
200
|
+
}) => {
|
|
220
201
|
const isMobile = useIsSmall();
|
|
221
|
-
return href ? /* @__PURE__ */
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
202
|
+
return href ? /* @__PURE__ */ jsx2(
|
|
203
|
+
ButtonEx,
|
|
204
|
+
{
|
|
205
|
+
fullWidth: true,
|
|
206
|
+
marginTop: 1,
|
|
207
|
+
marginBottom: 1,
|
|
208
|
+
marginRight: isMobile ? 2 : 1,
|
|
209
|
+
marginLeft: isMobile ? 2 : 0,
|
|
210
|
+
target: href ?? "_blank",
|
|
211
|
+
href,
|
|
212
|
+
color: "primary",
|
|
213
|
+
variant: "contained",
|
|
214
|
+
paddingX: 3,
|
|
215
|
+
sx: { display: href || to ? "flex" : "none" },
|
|
216
|
+
children: buttonText
|
|
234
217
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
218
|
+
) : to ? /* @__PURE__ */ jsx2(
|
|
219
|
+
ButtonEx,
|
|
220
|
+
{
|
|
221
|
+
fullWidth: true,
|
|
222
|
+
marginTop: 1,
|
|
223
|
+
marginBottom: 1,
|
|
224
|
+
marginRight: isMobile ? 2 : 1,
|
|
225
|
+
marginLeft: isMobile ? 2 : 0,
|
|
226
|
+
to,
|
|
227
|
+
color: "primary",
|
|
228
|
+
variant: "contained",
|
|
229
|
+
paddingX: 3,
|
|
230
|
+
sx: { display: href || to ? "flex" : "none" },
|
|
231
|
+
children: buttonText
|
|
247
232
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
233
|
+
) : /* @__PURE__ */ jsx2(
|
|
234
|
+
ButtonEx,
|
|
235
|
+
{
|
|
236
|
+
fullWidth: true,
|
|
237
|
+
marginTop: 1,
|
|
238
|
+
marginBottom: 1,
|
|
239
|
+
marginRight: isMobile ? 2 : 1,
|
|
240
|
+
marginLeft: isMobile ? 2 : 0,
|
|
241
|
+
color: "primary",
|
|
242
|
+
variant: "contained",
|
|
243
|
+
paddingX: 3,
|
|
244
|
+
sx: { display: href || to ? "flex" : "none" },
|
|
245
|
+
children: buttonText
|
|
259
246
|
}
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
var BasicHero =
|
|
247
|
+
);
|
|
248
|
+
};
|
|
249
|
+
var BasicHero = ({
|
|
250
|
+
backgroundImage,
|
|
251
|
+
title,
|
|
252
|
+
gradientTitle,
|
|
253
|
+
backgroundColor,
|
|
254
|
+
textColor,
|
|
255
|
+
desc,
|
|
256
|
+
heroImage,
|
|
257
|
+
title2,
|
|
258
|
+
subLinkText1,
|
|
259
|
+
subLinkText2,
|
|
260
|
+
subLinkPath,
|
|
261
|
+
button1Text,
|
|
262
|
+
button2Text,
|
|
263
|
+
button2To,
|
|
264
|
+
button1To,
|
|
265
|
+
button2Href,
|
|
266
|
+
button1Href,
|
|
267
|
+
subLinkIcon,
|
|
268
|
+
sx,
|
|
269
|
+
...props
|
|
270
|
+
// eslint-disable-next-line complexity
|
|
271
|
+
}) => {
|
|
263
272
|
const isMobile = useIsSmall();
|
|
264
273
|
const styles = useGradientStyles();
|
|
265
|
-
const StyledSpan = styled("span")({
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
274
|
+
const StyledSpan = useMemo2(() => styled("span")({ ...styles.heading }), [styles.heading]);
|
|
275
|
+
return /* @__PURE__ */ jsx2(
|
|
276
|
+
FlexGrowCol,
|
|
277
|
+
{
|
|
278
|
+
sx: {
|
|
279
|
+
backgroundImage: `url(${backgroundImage})`,
|
|
280
|
+
backgroundPosition: {
|
|
281
|
+
lg: "bottom",
|
|
282
|
+
md: "center left",
|
|
283
|
+
xs: "top left"
|
|
284
|
+
},
|
|
285
|
+
minHeight: {
|
|
286
|
+
md: "500px",
|
|
287
|
+
sm: "400px",
|
|
288
|
+
xs: "200px"
|
|
289
|
+
},
|
|
290
|
+
...sx
|
|
275
291
|
},
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
292
|
+
style: {
|
|
293
|
+
backgroundColor: backgroundColor ?? "",
|
|
294
|
+
backgroundRepeat: "no-repeat",
|
|
295
|
+
backgroundSize: "cover",
|
|
296
|
+
color: textColor ?? ""
|
|
280
297
|
},
|
|
281
|
-
...
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}) : /* @__PURE__ */ React2.createElement(ButtonSection, {
|
|
342
|
-
buttonText: button1Text
|
|
343
|
-
}), button2Href ? /* @__PURE__ */ React2.createElement(ButtonSection, {
|
|
344
|
-
href: button2Href,
|
|
345
|
-
buttonText: button2Text
|
|
346
|
-
}) : button2To ? /* @__PURE__ */ React2.createElement(ButtonSection, {
|
|
347
|
-
to: button2To,
|
|
348
|
-
buttonText: button2Text
|
|
349
|
-
}) : /* @__PURE__ */ React2.createElement(ButtonSection, {
|
|
350
|
-
buttonText: button2Text
|
|
351
|
-
})), /* @__PURE__ */ React2.createElement(SubLinkSection, {
|
|
352
|
-
subLinkIcon,
|
|
353
|
-
subLinkText1,
|
|
354
|
-
subLinkText2,
|
|
355
|
-
subLinkPath,
|
|
356
|
-
backgroundImageAlignment: backgroundImage ? true : false
|
|
357
|
-
}))), /* @__PURE__ */ React2.createElement(Grid, {
|
|
358
|
-
size: {
|
|
359
|
-
xs: 12,
|
|
360
|
-
md: 6
|
|
298
|
+
...props,
|
|
299
|
+
children: /* @__PURE__ */ jsx2(Container, { children: /* @__PURE__ */ jsxs(
|
|
300
|
+
Grid,
|
|
301
|
+
{
|
|
302
|
+
container: true,
|
|
303
|
+
justifyContent: "center",
|
|
304
|
+
alignItems: "center",
|
|
305
|
+
sx: {
|
|
306
|
+
alignItems: { xs: "center" },
|
|
307
|
+
justifyContent: { xs: "center" }
|
|
308
|
+
},
|
|
309
|
+
children: [
|
|
310
|
+
/* @__PURE__ */ jsx2(
|
|
311
|
+
Grid,
|
|
312
|
+
{
|
|
313
|
+
size: {
|
|
314
|
+
xs: 12,
|
|
315
|
+
sm: 8,
|
|
316
|
+
md: backgroundImage ? 6 : 8,
|
|
317
|
+
lg: backgroundImage ? 6 : 8
|
|
318
|
+
},
|
|
319
|
+
children: /* @__PURE__ */ jsxs(FlexGrowCol, { paddingY: 2, sx: { alignItems: { xs: backgroundImage && !isMobile ? "flex-start" : "center" } }, children: [
|
|
320
|
+
/* @__PURE__ */ jsxs(Typography2, { variant: "h1", component: "h1", gutterBottom: true, textAlign: backgroundImage && !isMobile ? "left" : "center", children: [
|
|
321
|
+
title ? /* @__PURE__ */ jsx2("span", { children: `${title} ` }) : null,
|
|
322
|
+
gradientTitle ? /* @__PURE__ */ jsxs(StyledSpan, { children: [
|
|
323
|
+
" ",
|
|
324
|
+
` ${gradientTitle}`
|
|
325
|
+
] }) : null,
|
|
326
|
+
title2 ? /* @__PURE__ */ jsx2("span", { children: ` ${title2}` }) : null
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ jsx2(Typography2, { variant: "body1", component: "h2", gutterBottom: true, textAlign: backgroundImage && !isMobile ? "left" : "center", children: desc }),
|
|
329
|
+
/* @__PURE__ */ jsxs(
|
|
330
|
+
FlexGrowRow,
|
|
331
|
+
{
|
|
332
|
+
sx: { flexDirection: { lg: "row", xs: "column" } },
|
|
333
|
+
width: "100%",
|
|
334
|
+
marginTop: 1,
|
|
335
|
+
children: [
|
|
336
|
+
button1Href ? /* @__PURE__ */ jsx2(ButtonSection, { href: button1Href, buttonText: button1Text }) : button1To ? /* @__PURE__ */ jsx2(ButtonSection, { to: button1To, buttonText: button1Text }) : /* @__PURE__ */ jsx2(ButtonSection, { buttonText: button1Text }),
|
|
337
|
+
button2Href ? /* @__PURE__ */ jsx2(ButtonSection, { href: button2Href, buttonText: button2Text }) : button2To ? /* @__PURE__ */ jsx2(ButtonSection, { to: button2To, buttonText: button2Text }) : /* @__PURE__ */ jsx2(ButtonSection, { buttonText: button2Text })
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
),
|
|
341
|
+
/* @__PURE__ */ jsx2(
|
|
342
|
+
SubLinkSection,
|
|
343
|
+
{
|
|
344
|
+
subLinkIcon,
|
|
345
|
+
subLinkText1,
|
|
346
|
+
subLinkText2,
|
|
347
|
+
subLinkPath,
|
|
348
|
+
backgroundImageAlignment: backgroundImage ? true : false
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
] })
|
|
352
|
+
}
|
|
353
|
+
),
|
|
354
|
+
/* @__PURE__ */ jsx2(Grid, { size: { xs: 12, md: 6 }, children: heroImage ? /* @__PURE__ */ jsx2("img", { src: heroImage, width: "100%" }) : null })
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
) })
|
|
361
358
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
width: "100%"
|
|
365
|
-
}) : null))));
|
|
366
|
-
}, "BasicHero");
|
|
359
|
+
);
|
|
360
|
+
};
|
|
367
361
|
|
|
368
362
|
// src/components/bigint/FixedPointPopover.tsx
|
|
369
|
-
import {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
363
|
+
import {
|
|
364
|
+
FormHelperText,
|
|
365
|
+
Popover,
|
|
366
|
+
TextField
|
|
367
|
+
} from "@mui/material";
|
|
368
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
369
|
+
var FixedPointPopover = ({
|
|
370
|
+
fixedPoint,
|
|
371
|
+
minFixedPoint: minimumPoint,
|
|
372
|
+
onFixedPointChange,
|
|
373
|
+
...props
|
|
374
|
+
}) => {
|
|
375
|
+
const handleChange = (event) => {
|
|
373
376
|
const fixedPointInteger = Number.parseInt(event.target.value, 10);
|
|
374
377
|
if (Number.isNaN(fixedPointInteger)) return;
|
|
375
378
|
onFixedPointChange?.(fixedPointInteger);
|
|
376
|
-
}
|
|
377
|
-
return /* @__PURE__ */
|
|
378
|
-
slotProps: {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
...props
|
|
386
|
-
}, /* @__PURE__ */ React3.createElement(TextField, {
|
|
387
|
-
slotProps: {
|
|
388
|
-
htmlInput: {
|
|
389
|
-
min: minimumPoint
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
value: fixedPoint,
|
|
393
|
-
onChange: handleChange,
|
|
394
|
-
type: "number"
|
|
395
|
-
}), /* @__PURE__ */ React3.createElement(FormHelperText, null, "Set the Fixed Point"));
|
|
396
|
-
}, "FixedPointPopover");
|
|
379
|
+
};
|
|
380
|
+
return /* @__PURE__ */ jsxs2(Popover, { slotProps: { paper: { sx: { p: 2 } } }, ...props, children: [
|
|
381
|
+
/* @__PURE__ */ jsx3(TextField, { slotProps: { htmlInput: { min: minimumPoint } }, value: fixedPoint, onChange: handleChange, type: "number" }),
|
|
382
|
+
/* @__PURE__ */ jsx3(FormHelperText, { children: "Set the Fixed Point" })
|
|
383
|
+
] });
|
|
384
|
+
};
|
|
397
385
|
|
|
398
386
|
// src/components/bigint/helpers/formatBigIntInput.ts
|
|
399
|
-
var formatBigIntInput =
|
|
387
|
+
var formatBigIntInput = (rawValue) => {
|
|
400
388
|
const filteredValue = rawValue.replaceAll(/[^\d.]/g, "");
|
|
401
389
|
if (filteredValue.split(".").length > 2) return;
|
|
402
390
|
return filteredValue;
|
|
403
|
-
}
|
|
391
|
+
};
|
|
404
392
|
|
|
405
393
|
// src/components/bigint/TextField.tsx
|
|
406
|
-
import {
|
|
394
|
+
import {
|
|
395
|
+
FormControl,
|
|
396
|
+
FormHelperText as FormHelperText2,
|
|
397
|
+
TextField as TextField2
|
|
398
|
+
} from "@mui/material";
|
|
407
399
|
import { isDefined, toFixedPoint } from "@xylabs/sdk-js";
|
|
408
|
-
import
|
|
400
|
+
import {
|
|
401
|
+
useEffect as useEffect3,
|
|
402
|
+
useMemo as useMemo3,
|
|
403
|
+
useState as useState3
|
|
404
|
+
} from "react";
|
|
409
405
|
|
|
410
406
|
// src/components/bigint/InputAdornment.tsx
|
|
411
|
-
import {
|
|
412
|
-
|
|
413
|
-
|
|
407
|
+
import {
|
|
408
|
+
Avatar,
|
|
409
|
+
IconButton,
|
|
410
|
+
InputAdornment
|
|
411
|
+
} from "@mui/material";
|
|
412
|
+
import {
|
|
413
|
+
useEffect as useEffect2,
|
|
414
|
+
useRef as useRef2,
|
|
415
|
+
useState as useState2
|
|
416
|
+
} from "react";
|
|
417
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
418
|
+
var FixedPointInputAdornment = ({
|
|
419
|
+
fixedPoint,
|
|
420
|
+
minFixedPoint,
|
|
421
|
+
onFixedPointChange,
|
|
422
|
+
...props
|
|
423
|
+
}) => {
|
|
414
424
|
const ref = useRef2(null);
|
|
415
425
|
const [open, setOpen] = useState2(false);
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
426
|
+
const [anchorEl, setAnchorEl] = useState2(null);
|
|
427
|
+
useEffect2(() => {
|
|
428
|
+
setAnchorEl(ref.current);
|
|
429
|
+
}, []);
|
|
430
|
+
return /* @__PURE__ */ jsxs3(InputAdornment, { ...props, children: [
|
|
431
|
+
/* @__PURE__ */ jsx4(
|
|
432
|
+
FixedPointPopover,
|
|
433
|
+
{
|
|
434
|
+
anchorEl,
|
|
435
|
+
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
436
|
+
fixedPoint,
|
|
437
|
+
minFixedPoint,
|
|
438
|
+
onClose: () => setOpen(false),
|
|
439
|
+
onFixedPointChange,
|
|
440
|
+
open
|
|
441
|
+
}
|
|
442
|
+
),
|
|
443
|
+
/* @__PURE__ */ jsx4(IconButton, { size: "small", ref, onClick: () => setOpen(!open), children: /* @__PURE__ */ jsx4(
|
|
444
|
+
Avatar,
|
|
445
|
+
{
|
|
446
|
+
sx: {
|
|
447
|
+
fontSize: ".75rem",
|
|
448
|
+
height: "20px",
|
|
449
|
+
width: "20px"
|
|
450
|
+
},
|
|
451
|
+
children: fixedPoint
|
|
452
|
+
}
|
|
453
|
+
) })
|
|
454
|
+
] });
|
|
455
|
+
};
|
|
439
456
|
|
|
440
457
|
// src/components/bigint/TextField.tsx
|
|
441
|
-
|
|
458
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
459
|
+
var BigIntTextField = ({
|
|
460
|
+
defaultFixedPoint = 18,
|
|
461
|
+
defaultRawValue,
|
|
462
|
+
helperText,
|
|
463
|
+
hideAdornment,
|
|
464
|
+
onChangeFixedPoint,
|
|
465
|
+
onChangeFormatted,
|
|
466
|
+
onChange,
|
|
467
|
+
resetValue,
|
|
468
|
+
...props
|
|
469
|
+
}) => {
|
|
442
470
|
const [rawValue, setRawValue] = useState3("");
|
|
443
471
|
const [fixedPoint, setFixedPoint] = useState3(defaultFixedPoint);
|
|
444
472
|
const [error, setError] = useState3();
|
|
@@ -455,17 +483,17 @@ var BigIntTextField = /* @__PURE__ */ __name(({ defaultFixedPoint = 18, defaultR
|
|
|
455
483
|
if (formattedValue) setRawValue(formattedValue);
|
|
456
484
|
}
|
|
457
485
|
}
|
|
458
|
-
const handleChange =
|
|
486
|
+
const handleChange = (event) => {
|
|
459
487
|
onChange?.(event);
|
|
460
488
|
const formattedValue = formatBigIntInput(event.target.value);
|
|
461
489
|
if (isDefined(formattedValue)) {
|
|
462
490
|
setRawValue(formattedValue);
|
|
463
491
|
onChangeFormatted?.(formattedValue);
|
|
464
492
|
}
|
|
465
|
-
}
|
|
466
|
-
const onFixedPointChange =
|
|
467
|
-
|
|
468
|
-
const bigIntValue =
|
|
493
|
+
};
|
|
494
|
+
const onFixedPointChange = (fixedPoint2) => setFixedPoint(fixedPoint2);
|
|
495
|
+
useEffect3(() => {
|
|
496
|
+
const bigIntValue = () => {
|
|
469
497
|
if (rawValue) {
|
|
470
498
|
const fixedValue = toFixedPoint(rawValue, fixedPoint);
|
|
471
499
|
setError(void 0);
|
|
@@ -479,43 +507,43 @@ var BigIntTextField = /* @__PURE__ */ __name(({ defaultFixedPoint = 18, defaultR
|
|
|
479
507
|
} else {
|
|
480
508
|
return;
|
|
481
509
|
}
|
|
482
|
-
}
|
|
510
|
+
};
|
|
483
511
|
onChangeFixedPoint?.(bigIntValue());
|
|
484
|
-
}, [
|
|
485
|
-
fixedPoint,
|
|
486
|
-
onChangeFixedPoint,
|
|
487
|
-
rawValue
|
|
488
|
-
]);
|
|
512
|
+
}, [fixedPoint, onChangeFixedPoint, rawValue]);
|
|
489
513
|
const minFixedPoint = rawValue.split(".")[1]?.length;
|
|
490
|
-
const resolvedHelperText =
|
|
514
|
+
const resolvedHelperText = useMemo3(() => {
|
|
491
515
|
if (error) return "Cannot convert to BigInt";
|
|
492
516
|
return helperText ?? "Enter a number";
|
|
493
|
-
}, [
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
517
|
+
}, [helperText, error]);
|
|
518
|
+
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
519
|
+
/* @__PURE__ */ jsx5(
|
|
520
|
+
TextField2,
|
|
521
|
+
{
|
|
522
|
+
onChange: handleChange,
|
|
523
|
+
type: "string",
|
|
524
|
+
error: Boolean(error),
|
|
525
|
+
slotProps: {
|
|
526
|
+
htmlInput: { pattern: "[0-9]*[.]?[0-9]*" },
|
|
527
|
+
input: {
|
|
528
|
+
startAdornment: hideAdornment ? null : /* @__PURE__ */ jsx5(
|
|
529
|
+
FixedPointInputAdornment,
|
|
530
|
+
{
|
|
531
|
+
position: "start",
|
|
532
|
+
fixedPoint,
|
|
533
|
+
minFixedPoint,
|
|
534
|
+
onFixedPointChange
|
|
535
|
+
}
|
|
536
|
+
)
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
value: rawValue,
|
|
540
|
+
...props
|
|
512
541
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
},
|
|
518
|
-
var WithFormControl = /* @__PURE__ */ __name(({ textFieldProps, ...props }) => /* @__PURE__ */ React5.createElement(FormControl, props, /* @__PURE__ */ React5.createElement(BigIntTextField, textFieldProps)), "WithFormControl");
|
|
542
|
+
),
|
|
543
|
+
/* @__PURE__ */ jsx5(FormHelperText2, { children: resolvedHelperText })
|
|
544
|
+
] });
|
|
545
|
+
};
|
|
546
|
+
var WithFormControl = ({ textFieldProps, ...props }) => /* @__PURE__ */ jsx5(FormControl, { ...props, children: /* @__PURE__ */ jsx5(BigIntTextField, { ...textFieldProps }) });
|
|
519
547
|
|
|
520
548
|
// src/components/bigint/Input.ts
|
|
521
549
|
var BigIntInput = {
|
|
@@ -524,12 +552,16 @@ var BigIntInput = {
|
|
|
524
552
|
};
|
|
525
553
|
|
|
526
554
|
// src/components/Ellipsize.tsx
|
|
527
|
-
import {
|
|
528
|
-
|
|
555
|
+
import {
|
|
556
|
+
Box,
|
|
557
|
+
styled as styled2,
|
|
558
|
+
Typography as Typography3
|
|
559
|
+
} from "@mui/material";
|
|
560
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
529
561
|
var ComponentName = "Ellipsize";
|
|
530
562
|
var EllipsizeRoot = styled2(Box, {
|
|
531
563
|
name: ComponentName,
|
|
532
|
-
shouldForwardProp:
|
|
564
|
+
shouldForwardProp: (prop) => prop !== "beforeLineHeight",
|
|
533
565
|
slot: "Root"
|
|
534
566
|
})(({ beforeLineHeight = 0 }) => ({
|
|
535
567
|
"&": {
|
|
@@ -548,14 +580,16 @@ var EllipsizeRoot = styled2(Box, {
|
|
|
548
580
|
var EllipsizeInnerWrap = styled2(Box, {
|
|
549
581
|
name: ComponentName,
|
|
550
582
|
slot: "innerWrap"
|
|
551
|
-
})(() => ({
|
|
552
|
-
position: "relative"
|
|
553
|
-
}));
|
|
583
|
+
})(() => ({ position: "relative" }));
|
|
554
584
|
var EllipsizeContentWrap = styled2(Typography3, {
|
|
555
585
|
name: ComponentName,
|
|
556
|
-
shouldForwardProp:
|
|
586
|
+
shouldForwardProp: (prop) => prop !== "ellipsisPosition",
|
|
557
587
|
slot: "contentWrap"
|
|
558
|
-
})(({
|
|
588
|
+
})(({
|
|
589
|
+
theme,
|
|
590
|
+
ellipsisPosition,
|
|
591
|
+
fontFamily
|
|
592
|
+
}) => {
|
|
559
593
|
return theme.unstable_sx({
|
|
560
594
|
fontFamily: fontFamily ?? "monospace",
|
|
561
595
|
left: 0,
|
|
@@ -570,275 +604,268 @@ var EllipsizeContentWrap = styled2(Typography3, {
|
|
|
570
604
|
} : {}
|
|
571
605
|
});
|
|
572
606
|
});
|
|
573
|
-
var EllipsizeBox =
|
|
607
|
+
var EllipsizeBox = ({
|
|
608
|
+
ref,
|
|
609
|
+
innerWrapProps,
|
|
610
|
+
children,
|
|
611
|
+
ellipsisPosition = "start",
|
|
612
|
+
disableSharedRef,
|
|
613
|
+
typographyProps,
|
|
614
|
+
...props
|
|
615
|
+
}) => {
|
|
574
616
|
const sharedRef = useShareForwardedRef(ref);
|
|
575
617
|
const { sx: innerWrapSx, ...remainingInnerWrapProps } = innerWrapProps ?? {};
|
|
576
|
-
return /* @__PURE__ */
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
618
|
+
return /* @__PURE__ */ jsx6(EllipsizeRoot, { ref: sharedRef, ...props, children: /* @__PURE__ */ jsx6(
|
|
619
|
+
EllipsizeInnerWrap,
|
|
620
|
+
{
|
|
621
|
+
...remainingInnerWrapProps,
|
|
622
|
+
sx: {
|
|
623
|
+
alignItems: "center",
|
|
624
|
+
display: "flex",
|
|
625
|
+
...innerWrapSx
|
|
626
|
+
},
|
|
627
|
+
children: /* @__PURE__ */ jsx6(EllipsizeContentWrap, { component: "span", ellipsisPosition, variant: "body2", ...typographyProps, children })
|
|
585
628
|
}
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
ellipsisPosition,
|
|
589
|
-
variant: "body2",
|
|
590
|
-
...typographyProps
|
|
591
|
-
}, children)));
|
|
592
|
-
}, "EllipsizeBox");
|
|
629
|
+
) });
|
|
630
|
+
};
|
|
593
631
|
EllipsizeBox.displayName = "EllipsizeBox";
|
|
594
632
|
|
|
595
633
|
// src/components/LabeledTextFieldWrapper.tsx
|
|
596
634
|
import { Stack, Typography as Typography4 } from "@mui/material";
|
|
597
|
-
import
|
|
598
|
-
var LabeledTextFieldWrapper =
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
variant: "caption"
|
|
605
|
-
|
|
606
|
-
}
|
|
635
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
636
|
+
var LabeledTextFieldWrapper = ({
|
|
637
|
+
children,
|
|
638
|
+
label,
|
|
639
|
+
...props
|
|
640
|
+
}) => {
|
|
641
|
+
return /* @__PURE__ */ jsxs5(Stack, { flexDirection: "column", ...props, children: [
|
|
642
|
+
/* @__PURE__ */ jsx7(Typography4, { gutterBottom: true, variant: "caption", children: label }),
|
|
643
|
+
children
|
|
644
|
+
] });
|
|
645
|
+
};
|
|
607
646
|
|
|
608
647
|
// src/components/ListItemButtonEx.tsx
|
|
609
648
|
import { ListItemButton } from "@mui/material";
|
|
610
|
-
import React8 from "react";
|
|
611
649
|
import { useNavigate } from "react-router-dom";
|
|
612
|
-
|
|
650
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
651
|
+
var ListItemButtonExTo = ({
|
|
652
|
+
to,
|
|
653
|
+
toOptions,
|
|
654
|
+
onClick,
|
|
655
|
+
...props
|
|
656
|
+
}) => {
|
|
613
657
|
const navigate = useNavigate();
|
|
614
|
-
const localOnClick =
|
|
658
|
+
const localOnClick = (event) => {
|
|
615
659
|
onClick?.(event);
|
|
616
660
|
if (to) {
|
|
617
661
|
void navigate(to, toOptions);
|
|
618
662
|
}
|
|
619
|
-
}
|
|
620
|
-
return /* @__PURE__ */
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
var ListItemButtonEx = /* @__PURE__ */ __name(({ to, ...props }) => {
|
|
626
|
-
return to ? /* @__PURE__ */ React8.createElement(ListItemButtonExTo, {
|
|
627
|
-
to,
|
|
628
|
-
...props
|
|
629
|
-
}) : /* @__PURE__ */ React8.createElement(ListItemButton, props);
|
|
630
|
-
}, "ListItemButtonEx");
|
|
663
|
+
};
|
|
664
|
+
return /* @__PURE__ */ jsx8(ListItemButton, { onClick: localOnClick, ...props });
|
|
665
|
+
};
|
|
666
|
+
var ListItemButtonEx = ({ to, ...props }) => {
|
|
667
|
+
return to ? /* @__PURE__ */ jsx8(ListItemButtonExTo, { to, ...props }) : /* @__PURE__ */ jsx8(ListItemButton, { ...props });
|
|
668
|
+
};
|
|
631
669
|
|
|
632
670
|
// src/components/LoadResult.tsx
|
|
633
671
|
import { FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
|
|
634
|
-
import React10 from "react";
|
|
635
672
|
|
|
636
673
|
// src/components/NotFound.tsx
|
|
637
674
|
import { Typography as Typography5 } from "@mui/material";
|
|
638
675
|
import { FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
|
|
639
|
-
import
|
|
640
|
-
var NotFound =
|
|
641
|
-
return /* @__PURE__ */
|
|
642
|
-
variant: "h2"
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
}, "Can't find anything here"));
|
|
647
|
-
}, "NotFound");
|
|
676
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
677
|
+
var NotFound = (props) => {
|
|
678
|
+
return /* @__PURE__ */ jsxs6(FlexGrowCol2, { ...props, children: [
|
|
679
|
+
/* @__PURE__ */ jsx9(Typography5, { variant: "h2", children: "Sorry!" }),
|
|
680
|
+
/* @__PURE__ */ jsx9(Typography5, { marginY: 3, variant: "body2", children: "Can't find anything here" })
|
|
681
|
+
] });
|
|
682
|
+
};
|
|
648
683
|
|
|
649
684
|
// src/components/LoadResult.tsx
|
|
685
|
+
import { Fragment as Fragment2, jsx as jsx10 } from "react/jsx-runtime";
|
|
650
686
|
function LoadResult(props) {
|
|
651
|
-
const {
|
|
687
|
+
const {
|
|
688
|
+
notFound,
|
|
689
|
+
error,
|
|
690
|
+
searchResult,
|
|
691
|
+
children
|
|
692
|
+
} = props;
|
|
652
693
|
if (notFound) {
|
|
653
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ jsx10(NotFound, {});
|
|
654
695
|
}
|
|
655
696
|
if (error) {
|
|
656
|
-
return /* @__PURE__ */
|
|
697
|
+
return /* @__PURE__ */ jsx10(Fragment2, { children });
|
|
657
698
|
}
|
|
658
|
-
return searchResult === void 0 ? /* @__PURE__ */
|
|
659
|
-
busy: true,
|
|
660
|
-
minHeight: "50px"
|
|
661
|
-
}) : /* @__PURE__ */ React10.createElement(React10.Fragment, null, children);
|
|
699
|
+
return searchResult === void 0 ? /* @__PURE__ */ jsx10(FlexGrowRow2, { busy: true, minHeight: "50px" }) : /* @__PURE__ */ jsx10(Fragment2, { children });
|
|
662
700
|
}
|
|
663
|
-
__name(LoadResult, "LoadResult");
|
|
664
701
|
|
|
665
702
|
// src/components/Pipe.tsx
|
|
666
703
|
import { Typography as Typography6 } from "@mui/material";
|
|
667
|
-
import
|
|
668
|
-
var Pipe =
|
|
669
|
-
return /* @__PURE__ */
|
|
670
|
-
|
|
671
|
-
component: "span",
|
|
672
|
-
...props
|
|
673
|
-
}, "|");
|
|
674
|
-
}, "Pipe");
|
|
704
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
705
|
+
var Pipe = (props) => {
|
|
706
|
+
return /* @__PURE__ */ jsx11(Typography6, { marginX: 1, component: "span", ...props, children: "|" });
|
|
707
|
+
};
|
|
675
708
|
|
|
676
709
|
// src/components/pluginValidation/DataMissing.tsx
|
|
677
710
|
import { Alert, AlertTitle } from "@mui/material";
|
|
678
|
-
import
|
|
679
|
-
var PayloadDataMissing =
|
|
680
|
-
return /* @__PURE__ */
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
}
|
|
684
|
-
}
|
|
711
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
712
|
+
var PayloadDataMissing = ({ alertBody, ...props }) => {
|
|
713
|
+
return /* @__PURE__ */ jsxs7(Alert, { severity: "warning", ...props, children: [
|
|
714
|
+
/* @__PURE__ */ jsx12(AlertTitle, { children: "Missing Data" }),
|
|
715
|
+
alertBody ?? "Payload is missing required data to render correctly"
|
|
716
|
+
] });
|
|
717
|
+
};
|
|
685
718
|
|
|
686
719
|
// src/components/ScrollTableOnSm.tsx
|
|
687
720
|
import { styled as styled3 } from "@mui/material";
|
|
688
|
-
import
|
|
721
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
689
722
|
var StyledScrollTableOnSm = styled3("div")(({ theme }) => ({
|
|
690
|
-
[theme.breakpoints.down("md")]: {
|
|
691
|
-
overflowX: "scroll"
|
|
692
|
-
},
|
|
723
|
+
[theme.breakpoints.down("md")]: { overflowX: "scroll" },
|
|
693
724
|
display: "flex",
|
|
694
725
|
flexGrow: 1
|
|
695
726
|
}));
|
|
696
|
-
var ScrollTableOnSm =
|
|
727
|
+
var ScrollTableOnSm = ({ children }) => /* @__PURE__ */ jsx13(StyledScrollTableOnSm, { children });
|
|
697
728
|
|
|
698
729
|
// src/components/SectionSpacingRow/SectionSpacingRow.tsx
|
|
699
730
|
import { useTheme } from "@mui/material";
|
|
700
731
|
import { FlexGrowRow as FlexGrowRow3 } from "@xylabs/react-flexbox";
|
|
701
|
-
import
|
|
702
|
-
var SectionSpacingRow =
|
|
732
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
733
|
+
var SectionSpacingRow = ({
|
|
734
|
+
ref,
|
|
735
|
+
children,
|
|
736
|
+
sx,
|
|
737
|
+
...props
|
|
738
|
+
}) => {
|
|
703
739
|
const theme = useTheme();
|
|
704
|
-
return /* @__PURE__ */
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
xs: theme.spacing(5)
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
md: theme.spacing(5),
|
|
712
|
-
xs: theme.spacing(5)
|
|
740
|
+
return /* @__PURE__ */ jsx14(
|
|
741
|
+
FlexGrowRow3,
|
|
742
|
+
{
|
|
743
|
+
sx: {
|
|
744
|
+
paddingBottom: { md: theme.spacing(5), xs: theme.spacing(5) },
|
|
745
|
+
paddingTop: { md: theme.spacing(5), xs: theme.spacing(5) },
|
|
746
|
+
...sx
|
|
713
747
|
},
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}
|
|
748
|
+
width: "100%",
|
|
749
|
+
ref,
|
|
750
|
+
...props,
|
|
751
|
+
children
|
|
752
|
+
}
|
|
753
|
+
);
|
|
754
|
+
};
|
|
721
755
|
SectionSpacingRow.displayName = "SectionSpacingRow";
|
|
722
756
|
|
|
723
|
-
// src/components/TableCell/AddressTableCell.tsx
|
|
724
|
-
import React16 from "react";
|
|
725
|
-
|
|
726
757
|
// src/components/TableCell/EllipsisTableCell.tsx
|
|
727
758
|
import { styled as styled4, TableCell } from "@mui/material";
|
|
728
759
|
import { asLinkHrefOrToProps, LinkEx as LinkEx2 } from "@xylabs/react-link";
|
|
729
|
-
import
|
|
760
|
+
import { useMemo as useMemo4 } from "react";
|
|
761
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
730
762
|
var EllipsisTableCellRoot = styled4(TableCell, {
|
|
731
763
|
name: "EllipsisTableCell",
|
|
732
|
-
shouldForwardProp:
|
|
764
|
+
shouldForwardProp: (prop) => prop !== "width",
|
|
733
765
|
slot: "Root"
|
|
734
|
-
})(({ width = "100%" }) => ({
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
766
|
+
})(({ width = "100%" }) => ({ width }));
|
|
767
|
+
var EllipsisTableCellWithRef = ({
|
|
768
|
+
ref,
|
|
769
|
+
children,
|
|
770
|
+
href,
|
|
771
|
+
link = false,
|
|
772
|
+
to,
|
|
773
|
+
value,
|
|
774
|
+
...props
|
|
775
|
+
}) => {
|
|
776
|
+
const data = useMemo4(() => {
|
|
739
777
|
if (children) {
|
|
740
778
|
return children;
|
|
741
779
|
}
|
|
742
780
|
if (href || link || to) {
|
|
743
|
-
return /* @__PURE__ */
|
|
744
|
-
title: value,
|
|
745
|
-
...asLinkHrefOrToProps({
|
|
746
|
-
to,
|
|
747
|
-
href
|
|
748
|
-
}),
|
|
749
|
-
target: href ? "_blank" : void 0
|
|
750
|
-
}, value);
|
|
781
|
+
return /* @__PURE__ */ jsx15(LinkEx2, { title: value, ...asLinkHrefOrToProps({ to, href }), target: href ? "_blank" : void 0, children: value });
|
|
751
782
|
}
|
|
752
783
|
return value;
|
|
753
|
-
}, [
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
return /* @__PURE__ */ React15.createElement(EllipsisTableCellRoot, props, /* @__PURE__ */ React15.createElement(EllipsizeBox, {
|
|
761
|
-
ref,
|
|
762
|
-
sx: {
|
|
763
|
-
cursor: link || to || href ? "pointer" : "inherit"
|
|
784
|
+
}, [children, href, link, to, value]);
|
|
785
|
+
return /* @__PURE__ */ jsx15(EllipsisTableCellRoot, { ...props, children: /* @__PURE__ */ jsx15(
|
|
786
|
+
EllipsizeBox,
|
|
787
|
+
{
|
|
788
|
+
ref,
|
|
789
|
+
sx: { cursor: link || to || href ? "pointer" : "inherit" },
|
|
790
|
+
children: data
|
|
764
791
|
}
|
|
765
|
-
}
|
|
766
|
-
}
|
|
792
|
+
) });
|
|
793
|
+
};
|
|
767
794
|
EllipsisTableCellWithRef.displayName = "EllipsisTableCell";
|
|
768
795
|
var EllipsisTableCell = EllipsisTableCellWithRef;
|
|
769
796
|
|
|
770
797
|
// src/components/TableCell/AddressTableCell.tsx
|
|
771
|
-
|
|
798
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
799
|
+
var AddressTableCell = ({
|
|
800
|
+
ref,
|
|
801
|
+
value,
|
|
802
|
+
archive,
|
|
803
|
+
exploreDomain,
|
|
804
|
+
link,
|
|
805
|
+
...props
|
|
806
|
+
}) => {
|
|
772
807
|
const href = exploreDomain && archive ? `${exploreDomain}/archive/${archive}/address/${value}` : void 0;
|
|
773
808
|
const to = exploreDomain === void 0 && archive ? `/archive/${archive}/address/${value}` : void 0;
|
|
774
|
-
return /* @__PURE__ */
|
|
775
|
-
|
|
776
|
-
href,
|
|
777
|
-
to,
|
|
778
|
-
ref,
|
|
779
|
-
link,
|
|
780
|
-
...props
|
|
781
|
-
});
|
|
782
|
-
}, "AddressTableCell");
|
|
809
|
+
return /* @__PURE__ */ jsx16(EllipsisTableCell, { value, href, to, ref, link, ...props });
|
|
810
|
+
};
|
|
783
811
|
AddressTableCell.displayName = "AddressTableCell";
|
|
784
812
|
|
|
785
813
|
// src/components/TableCell/HashTableCell.tsx
|
|
786
|
-
import
|
|
787
|
-
var HashTableCell =
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
}
|
|
814
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
815
|
+
var HashTableCell = ({
|
|
816
|
+
ref,
|
|
817
|
+
value,
|
|
818
|
+
dataType,
|
|
819
|
+
...props
|
|
820
|
+
}) => {
|
|
821
|
+
return /* @__PURE__ */ jsx17(
|
|
822
|
+
EllipsisTableCell,
|
|
823
|
+
{
|
|
824
|
+
value,
|
|
825
|
+
...props
|
|
826
|
+
}
|
|
827
|
+
);
|
|
828
|
+
};
|
|
793
829
|
|
|
794
830
|
// src/components/ThemeTokenAvatar/ThemeTokenAvatar.tsx
|
|
795
831
|
import { Avatar as Avatar2, useTheme as useTheme2 } from "@mui/material";
|
|
796
|
-
import
|
|
797
|
-
var ThemeTokenAvatar =
|
|
832
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
833
|
+
var ThemeTokenAvatar = ({ ...props }) => {
|
|
798
834
|
const theme = useTheme2();
|
|
799
|
-
return /* @__PURE__ */
|
|
800
|
-
|
|
801
|
-
background: theme.vars.palette.common.white
|
|
802
|
-
},
|
|
803
|
-
...props
|
|
804
|
-
});
|
|
805
|
-
}, "ThemeTokenAvatar");
|
|
835
|
+
return /* @__PURE__ */ jsx18(Avatar2, { sx: { background: theme.vars.palette.common.white }, ...props });
|
|
836
|
+
};
|
|
806
837
|
|
|
807
838
|
// src/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.tsx
|
|
808
839
|
import { AvatarGroup } from "@mui/material";
|
|
809
|
-
import
|
|
810
|
-
var ThemeTokenAvatarGroup =
|
|
811
|
-
return /* @__PURE__ */
|
|
812
|
-
|
|
813
|
-
src: image
|
|
814
|
-
})));
|
|
815
|
-
}, "ThemeTokenAvatarGroup");
|
|
840
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
841
|
+
var ThemeTokenAvatarGroup = ({ images, ...props }) => {
|
|
842
|
+
return /* @__PURE__ */ jsx19(AvatarGroup, { ...props, children: images?.map((image) => /* @__PURE__ */ jsx19(ThemeTokenAvatar, { src: image }, image)) });
|
|
843
|
+
};
|
|
816
844
|
|
|
817
845
|
// src/components/TokenBar/TokenBar.tsx
|
|
818
846
|
import { Paper, Typography as Typography7 } from "@mui/material";
|
|
819
847
|
import { FlexRow } from "@xylabs/react-flexbox";
|
|
820
|
-
import
|
|
821
|
-
var TokenBar =
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
margin: 1,
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
fontWeight: 300,
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
}, "TokenBar");
|
|
848
|
+
import { jsx as jsx20, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
849
|
+
var TokenBar = ({
|
|
850
|
+
text1,
|
|
851
|
+
text1Props,
|
|
852
|
+
text1Suffix,
|
|
853
|
+
text2,
|
|
854
|
+
text2Props,
|
|
855
|
+
text2Suffix,
|
|
856
|
+
...props
|
|
857
|
+
}) => {
|
|
858
|
+
return /* @__PURE__ */ jsx20(Paper, { elevation: 0, className: "TokenBar-root", ...props, children: /* @__PURE__ */ jsxs8(FlexRow, { justifyContent: "space-between", children: [
|
|
859
|
+
/* @__PURE__ */ jsxs8(Typography7, { variant: "body1", fontWeight: 300, margin: 1, ...text1Props, children: [
|
|
860
|
+
text1,
|
|
861
|
+
text1Suffix
|
|
862
|
+
] }),
|
|
863
|
+
/* @__PURE__ */ jsxs8(Typography7, { variant: "body1", fontWeight: 300, textTransform: "uppercase", color: "gray", margin: 1, ...text2Props, children: [
|
|
864
|
+
text2,
|
|
865
|
+
text2Suffix
|
|
866
|
+
] })
|
|
867
|
+
] }) });
|
|
868
|
+
};
|
|
842
869
|
|
|
843
870
|
// src/components/TokenData/img/index.ts
|
|
844
871
|
import { default as default2 } from "./ada-JCPSRXND.png";
|
|
@@ -991,7 +1018,7 @@ var TokenData = [
|
|
|
991
1018
|
];
|
|
992
1019
|
|
|
993
1020
|
// src/components/TokenData/useGetTokenData.tsx
|
|
994
|
-
var getTokenData =
|
|
1021
|
+
var getTokenData = (symbols) => {
|
|
995
1022
|
return symbols?.map((symbol) => {
|
|
996
1023
|
const additionalTokenData = TokenData.find((x) => x.tokenSymbol.toLowerCase() === symbol?.toLowerCase());
|
|
997
1024
|
const checkedTokenData = additionalTokenData ?? {
|
|
@@ -1004,78 +1031,87 @@ var getTokenData = /* @__PURE__ */ __name((symbols) => {
|
|
|
1004
1031
|
};
|
|
1005
1032
|
return checkedTokenData;
|
|
1006
1033
|
});
|
|
1007
|
-
}
|
|
1034
|
+
};
|
|
1008
1035
|
|
|
1009
1036
|
// src/components/TokenSummary/TokenSummary.tsx
|
|
1010
1037
|
import { CardHeader, Typography as Typography8 } from "@mui/material";
|
|
1011
|
-
import
|
|
1012
|
-
var TokenSummary =
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1038
|
+
import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1039
|
+
var TokenSummary = ({
|
|
1040
|
+
icon,
|
|
1041
|
+
symbol,
|
|
1042
|
+
symbolElement,
|
|
1043
|
+
children,
|
|
1044
|
+
...props
|
|
1045
|
+
}) => {
|
|
1046
|
+
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
1047
|
+
/* @__PURE__ */ jsx21(
|
|
1048
|
+
CardHeader,
|
|
1049
|
+
{
|
|
1050
|
+
avatar: /* @__PURE__ */ jsx21(ThemeTokenAvatar, { src: icon, alt: symbol }),
|
|
1051
|
+
title: /* @__PURE__ */ jsx21(Typography8, { variant: "h6", fontWeight: 300, textTransform: "uppercase", children: symbolElement ?? symbol }),
|
|
1052
|
+
...props
|
|
1053
|
+
}
|
|
1054
|
+
),
|
|
1055
|
+
children
|
|
1056
|
+
] });
|
|
1057
|
+
};
|
|
1026
1058
|
|
|
1027
1059
|
// src/components/TypographyEx.tsx
|
|
1028
1060
|
import { Typography as Typography9 } from "@mui/material";
|
|
1029
|
-
import
|
|
1030
|
-
var TypographyEx =
|
|
1061
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1062
|
+
var TypographyEx = ({ gradient, ...props }) => {
|
|
1031
1063
|
const styles = useGradientStyles();
|
|
1032
|
-
return /* @__PURE__ */
|
|
1033
|
-
|
|
1034
|
-
...props
|
|
1035
|
-
});
|
|
1036
|
-
}, "TypographyEx");
|
|
1064
|
+
return /* @__PURE__ */ jsx22(Typography9, { style: gradient === "text" ? styles.heading : void 0, ...props });
|
|
1065
|
+
};
|
|
1037
1066
|
|
|
1038
1067
|
// src/contexts/diviner/Context.ts
|
|
1039
1068
|
import { createContextEx } from "@xylabs/react-shared";
|
|
1040
|
-
var ResolvedDivinerContext =
|
|
1069
|
+
var ResolvedDivinerContext = () => createContextEx();
|
|
1041
1070
|
|
|
1042
1071
|
// src/contexts/diviner/Provider.tsx
|
|
1043
1072
|
import { useResetState } from "@xylabs/react-hooks";
|
|
1044
|
-
import
|
|
1045
|
-
|
|
1073
|
+
import { useMemo as useMemo5 } from "react";
|
|
1074
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1075
|
+
var ResolvedDivinerProvider = ({
|
|
1076
|
+
diviner: divinerProp,
|
|
1077
|
+
required = false,
|
|
1078
|
+
children,
|
|
1079
|
+
context: Context
|
|
1080
|
+
}) => {
|
|
1046
1081
|
const [diviner, setDiviner] = useResetState(divinerProp);
|
|
1047
|
-
const value =
|
|
1048
|
-
const resolveDiviner =
|
|
1082
|
+
const value = useMemo5(() => {
|
|
1083
|
+
const resolveDiviner = () => {
|
|
1049
1084
|
if (divinerProp) {
|
|
1050
1085
|
return diviner === divinerProp ? diviner : void 0;
|
|
1051
1086
|
} else {
|
|
1052
1087
|
return diviner;
|
|
1053
1088
|
}
|
|
1054
|
-
}
|
|
1089
|
+
};
|
|
1055
1090
|
return {
|
|
1056
1091
|
diviner: resolveDiviner(),
|
|
1057
1092
|
provided: true,
|
|
1058
1093
|
setDiviner
|
|
1059
1094
|
};
|
|
1060
|
-
}, [
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
}
|
|
1095
|
+
}, [setDiviner, divinerProp, diviner]);
|
|
1096
|
+
return /* @__PURE__ */ jsx23(
|
|
1097
|
+
Context,
|
|
1098
|
+
{
|
|
1099
|
+
value,
|
|
1100
|
+
children: diviner ? children : required ? null : children
|
|
1101
|
+
}
|
|
1102
|
+
);
|
|
1103
|
+
};
|
|
1069
1104
|
|
|
1070
1105
|
// src/contexts/ListMode/Context.ts
|
|
1071
1106
|
import { createContextEx as createContextEx2 } from "@xylabs/react-shared";
|
|
1072
1107
|
var ListModeContext = createContextEx2();
|
|
1073
1108
|
|
|
1074
1109
|
// src/contexts/ListMode/Provider.tsx
|
|
1075
|
-
import
|
|
1076
|
-
|
|
1110
|
+
import { useMemo as useMemo6, useState as useState4 } from "react";
|
|
1111
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1112
|
+
var ListModeProvider = ({ children, defaultListMode }) => {
|
|
1077
1113
|
const [listMode, setListMode] = useState4(defaultListMode ?? "default");
|
|
1078
|
-
const value =
|
|
1114
|
+
const value = useMemo6(() => ({
|
|
1079
1115
|
listMode,
|
|
1080
1116
|
provided: true,
|
|
1081
1117
|
setListMode
|
|
@@ -1083,25 +1119,29 @@ var ListModeProvider = /* @__PURE__ */ __name(({ children, defaultListMode }) =>
|
|
|
1083
1119
|
listMode,
|
|
1084
1120
|
setListMode
|
|
1085
1121
|
]);
|
|
1086
|
-
return /* @__PURE__ */
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1122
|
+
return /* @__PURE__ */ jsx24(
|
|
1123
|
+
ListModeContext,
|
|
1124
|
+
{
|
|
1125
|
+
value,
|
|
1126
|
+
children
|
|
1127
|
+
}
|
|
1128
|
+
);
|
|
1129
|
+
};
|
|
1090
1130
|
|
|
1091
1131
|
// src/contexts/ListMode/use.ts
|
|
1092
1132
|
import { useContextEx } from "@xylabs/react-shared";
|
|
1093
|
-
var useListMode =
|
|
1133
|
+
var useListMode = (required = false) => {
|
|
1094
1134
|
return useContextEx(ListModeContext, "ListMode", required);
|
|
1095
|
-
}
|
|
1135
|
+
};
|
|
1096
1136
|
|
|
1097
1137
|
// src/lib/assertDefinedEx.ts
|
|
1098
|
-
var assertDefinedEx =
|
|
1138
|
+
var assertDefinedEx = (expr, message) => {
|
|
1099
1139
|
if (expr !== null && expr !== void 0) return expr;
|
|
1100
1140
|
throw new Error(message);
|
|
1101
|
-
}
|
|
1141
|
+
};
|
|
1102
1142
|
|
|
1103
1143
|
// src/lib/getActualPaddingX.ts
|
|
1104
|
-
var parseMeausureString =
|
|
1144
|
+
var parseMeausureString = (measure, absolute) => {
|
|
1105
1145
|
if (measure !== void 0 && measure !== null && measure.length > 0) {
|
|
1106
1146
|
if (measure.endsWith("px")) {
|
|
1107
1147
|
return Number.parseFloat(measure.slice(0, Math.max(0, measure.length - 2)));
|
|
@@ -1117,8 +1157,8 @@ var parseMeausureString = /* @__PURE__ */ __name((measure, absolute) => {
|
|
|
1117
1157
|
}
|
|
1118
1158
|
throw new Error(`Error Parsing Measure [${measure}]`);
|
|
1119
1159
|
}
|
|
1120
|
-
}
|
|
1121
|
-
var parsePadding =
|
|
1160
|
+
};
|
|
1161
|
+
var parsePadding = (padding) => {
|
|
1122
1162
|
const parts = padding.split(" ");
|
|
1123
1163
|
switch (parts.length) {
|
|
1124
1164
|
case 4: {
|
|
@@ -1153,55 +1193,62 @@ var parsePadding = /* @__PURE__ */ __name((padding) => {
|
|
|
1153
1193
|
};
|
|
1154
1194
|
}
|
|
1155
1195
|
}
|
|
1156
|
-
}
|
|
1157
|
-
var getActualPaddingX =
|
|
1196
|
+
};
|
|
1197
|
+
var getActualPaddingX = (element) => {
|
|
1158
1198
|
const padding = parsePadding(globalThis.getComputedStyle(element, null).getPropertyValue("padding"));
|
|
1159
1199
|
const paddingLeft = parseMeausureString(globalThis.getComputedStyle(element, null).getPropertyValue("padding-left") ?? padding?.left, element.clientWidth) ?? 0;
|
|
1160
1200
|
const paddingRight = parseMeausureString(globalThis.getComputedStyle(element, null).getPropertyValue("padding-right") ?? padding?.right, element.clientWidth) ?? 0;
|
|
1161
1201
|
return paddingLeft + paddingRight;
|
|
1162
|
-
}
|
|
1202
|
+
};
|
|
1163
1203
|
|
|
1164
1204
|
// src/lib/networkComponents.tsx
|
|
1165
|
-
import {
|
|
1166
|
-
|
|
1205
|
+
import {
|
|
1206
|
+
BubbleChartRounded as BubbleChartRoundedIcon,
|
|
1207
|
+
HubRounded as HubRoundedIcon,
|
|
1208
|
+
InsertLinkRounded as InsertLinkRoundedIcon,
|
|
1209
|
+
Inventory2Rounded as Inventory2RoundedIcon,
|
|
1210
|
+
TimerRounded as TimerRoundedIcon,
|
|
1211
|
+
VisibilityRounded as VisibilityRoundedIcon
|
|
1212
|
+
} from "@mui/icons-material";
|
|
1213
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1167
1214
|
var networkComponents = [
|
|
1168
1215
|
{
|
|
1169
|
-
icon:
|
|
1216
|
+
icon: (props) => /* @__PURE__ */ jsx25(HubRoundedIcon, { ...props }),
|
|
1170
1217
|
name: "Node",
|
|
1171
1218
|
slug: "node"
|
|
1172
1219
|
},
|
|
1173
1220
|
{
|
|
1174
|
-
icon:
|
|
1221
|
+
icon: (props) => /* @__PURE__ */ jsx25(TimerRoundedIcon, { ...props }),
|
|
1175
1222
|
name: "Sentinel",
|
|
1176
1223
|
slug: "sentinel"
|
|
1177
1224
|
},
|
|
1178
1225
|
{
|
|
1179
|
-
icon:
|
|
1226
|
+
icon: (props) => /* @__PURE__ */ jsx25(InsertLinkRoundedIcon, { ...props }),
|
|
1180
1227
|
name: "Bridge",
|
|
1181
1228
|
slug: "bridge"
|
|
1182
1229
|
},
|
|
1183
1230
|
{
|
|
1184
|
-
icon:
|
|
1231
|
+
icon: (props) => /* @__PURE__ */ jsx25(Inventory2RoundedIcon, { ...props }),
|
|
1185
1232
|
name: "Archivist",
|
|
1186
1233
|
slug: "archivist"
|
|
1187
1234
|
},
|
|
1188
1235
|
{
|
|
1189
|
-
icon:
|
|
1236
|
+
icon: (props) => /* @__PURE__ */ jsx25(BubbleChartRoundedIcon, { ...props }),
|
|
1190
1237
|
name: "Diviner",
|
|
1191
1238
|
slug: "diviner"
|
|
1192
1239
|
},
|
|
1193
1240
|
{
|
|
1194
|
-
icon:
|
|
1241
|
+
icon: (props) => /* @__PURE__ */ jsx25(VisibilityRoundedIcon, { ...props }),
|
|
1195
1242
|
name: "Witness",
|
|
1196
1243
|
slug: "witness"
|
|
1197
1244
|
}
|
|
1198
1245
|
];
|
|
1199
|
-
var findNetworkComponentIndex =
|
|
1246
|
+
var findNetworkComponentIndex = (slug) => {
|
|
1200
1247
|
return networkComponents.findIndex((info) => info.slug === slug);
|
|
1201
|
-
}
|
|
1202
|
-
var findNetworkComponent =
|
|
1248
|
+
};
|
|
1249
|
+
var findNetworkComponent = (slug) => {
|
|
1203
1250
|
return networkComponents.find((info) => info.slug === slug);
|
|
1204
|
-
}
|
|
1251
|
+
};
|
|
1205
1252
|
export {
|
|
1206
1253
|
AddressTableCell,
|
|
1207
1254
|
Ampersand,
|