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