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