@xyo-network/react-shared 4.4.5 → 4.4.7
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/index.d.ts +32 -2
- package/dist/browser/index.mjs +207 -67
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +14 -14
- package/src/components/bigint/FixedPointPopover.tsx +27 -0
- package/src/components/bigint/Input.stories.tsx +44 -0
- package/src/components/bigint/Input.ts +6 -0
- package/src/components/bigint/InputAdornment.tsx +44 -0
- package/src/components/bigint/TextField.tsx +108 -0
- package/src/components/bigint/index.ts +4 -0
- package/src/components/index.ts +1 -0
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TypographyProps, BoxProps, TypographyTypeMap, StackProps, ListItemButtonProps, AlertProps, TableCellProps, AvatarProps, AvatarGroupProps, PaperProps, CardHeaderProps, SvgIconProps } from '@mui/material';
|
|
1
|
+
import { TypographyProps, PopoverProps, StandardTextFieldProps, FormControlProps, InputAdornmentProps, BoxProps, TypographyTypeMap, StackProps, ListItemButtonProps, AlertProps, TableCellProps, AvatarProps, AvatarGroupProps, PaperProps, CardHeaderProps, SvgIconProps } from '@mui/material';
|
|
2
2
|
export { useMediaQuery } from '@mui/material';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { ReactElement, PropsWithChildren, ReactNode, Context, Dispatch, SetStateAction, CSSProperties, ForwardedRef } from 'react';
|
|
@@ -36,6 +36,36 @@ interface BasicHeroProps extends FlexBoxProps {
|
|
|
36
36
|
}
|
|
37
37
|
declare const BasicHero: React__default.FC<BasicHeroProps>;
|
|
38
38
|
|
|
39
|
+
interface FixedPointPopoverProps extends PopoverProps {
|
|
40
|
+
fixedPoint?: number;
|
|
41
|
+
minFixedPoint?: number;
|
|
42
|
+
onFixedPointChange?: (value: number) => void;
|
|
43
|
+
}
|
|
44
|
+
declare const FixedPointPopover: React__default.FC<FixedPointPopoverProps>;
|
|
45
|
+
|
|
46
|
+
interface BigIntTextFieldProps extends StandardTextFieldProps {
|
|
47
|
+
defaultFixedPoint?: number;
|
|
48
|
+
hideAdornment?: boolean;
|
|
49
|
+
onChangeFixedPoint?: (value: bigint) => void;
|
|
50
|
+
}
|
|
51
|
+
declare const BigIntTextField: React__default.FC<BigIntTextFieldProps>;
|
|
52
|
+
interface InputWithFormControlProps extends FormControlProps {
|
|
53
|
+
textFieldProps?: BigIntTextFieldProps;
|
|
54
|
+
}
|
|
55
|
+
declare const WithFormControl: React__default.FC<InputWithFormControlProps>;
|
|
56
|
+
|
|
57
|
+
declare const BigIntInput: {
|
|
58
|
+
TextField: React.FC<BigIntTextFieldProps>;
|
|
59
|
+
WithFormControl: React.FC<InputWithFormControlProps>;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
interface FixedPointInputAdornmentProps extends InputAdornmentProps {
|
|
63
|
+
fixedPoint?: number;
|
|
64
|
+
minFixedPoint?: number;
|
|
65
|
+
onFixedPointChange?: (value: number) => void;
|
|
66
|
+
}
|
|
67
|
+
declare const FixedPointInputAdornment: React__default.FC<FixedPointInputAdornmentProps>;
|
|
68
|
+
|
|
39
69
|
interface EllipsizeRootProps extends BoxProps {
|
|
40
70
|
beforeLineHeight?: string | number;
|
|
41
71
|
}
|
|
@@ -308,4 +338,4 @@ declare const findNetworkComponent: (slug: string) => NetworkComponentDetails |
|
|
|
308
338
|
|
|
309
339
|
type SizeProp = 'small' | 'medium' | 'large';
|
|
310
340
|
|
|
311
|
-
export { AddressTableCell, type AddressTableCellProps, Ampersand, BasicHero, type BasicHeroProps, type ContextExProviderProps, type ContextExState, type DivinerProviderProps, EllipsisTableCell, type EllipsisTableCellProps, EllipsisTableCellWithRef, EllipsizeBox, type EllipsizeBoxProps, type EllipsizeRootProps, type EmptyObject, type GradientStyles, HashTableCell, type HashTableCellProps, LabeledTextFieldWrapper, type LabeledTextFieldWrapperProps, ListItemButtonEx, type ListItemButtonExProps, ListItemButtonExTo, type ListMode, ListModeContext, type ListModeContextState, ListModeProvider, type ListModeProviderProps, LoadResult, type LoadResultProps, type NetworkComponentDetails, type NetworkComponentSlug, NotFound, PayloadDataMissing, type PayloadDataMissingProps, Pipe, ResolvedDivinerContext, ResolvedDivinerProvider, type ResolvedDivinerState, ScrollTableOnSm, SectionSpacingRow, type SizeProp, ThemeTokenAvatar, ThemeTokenAvatarGroup, type ThemeTokenAvatarGroupProps, TokenBar, type TokenBarProps, TokenData, TokenSummary, type TokenSummaryProps, TypographyEx, type TypographyExProps, type TypographyWithComponentProps, type ValidatedResponse, assertDefinedEx, colorfulGradientDarkMode, colorfulGradientLightMode, createContextEx, findNetworkComponent, findNetworkComponentIndex, getActualPaddingX, networkComponents, parseMeausureString, parsePadding, useContextEx, useDataState, useGetTokenData, useGradientStyles, useIsMobile, useIsSmall, useListMode, usePayloadHash, usePayloadHashes, usePayloadRootHash, usePayloadValidate, useProvided, useShareForwardedRef, useValidateBoundWitness };
|
|
341
|
+
export { AddressTableCell, type AddressTableCellProps, Ampersand, BasicHero, type BasicHeroProps, BigIntInput, BigIntTextField, type BigIntTextFieldProps, type ContextExProviderProps, type ContextExState, type DivinerProviderProps, EllipsisTableCell, type EllipsisTableCellProps, EllipsisTableCellWithRef, EllipsizeBox, type EllipsizeBoxProps, type EllipsizeRootProps, type EmptyObject, FixedPointInputAdornment, type FixedPointInputAdornmentProps, FixedPointPopover, type FixedPointPopoverProps, type GradientStyles, HashTableCell, type HashTableCellProps, type InputWithFormControlProps, LabeledTextFieldWrapper, type LabeledTextFieldWrapperProps, ListItemButtonEx, type ListItemButtonExProps, ListItemButtonExTo, type ListMode, ListModeContext, type ListModeContextState, ListModeProvider, type ListModeProviderProps, LoadResult, type LoadResultProps, type NetworkComponentDetails, type NetworkComponentSlug, NotFound, PayloadDataMissing, type PayloadDataMissingProps, Pipe, ResolvedDivinerContext, ResolvedDivinerProvider, type ResolvedDivinerState, ScrollTableOnSm, SectionSpacingRow, type SizeProp, ThemeTokenAvatar, ThemeTokenAvatarGroup, type ThemeTokenAvatarGroupProps, TokenBar, type TokenBarProps, TokenData, TokenSummary, type TokenSummaryProps, TypographyEx, type TypographyExProps, type TypographyWithComponentProps, type ValidatedResponse, WithFormControl, assertDefinedEx, colorfulGradientDarkMode, colorfulGradientLightMode, createContextEx, findNetworkComponent, findNetworkComponentIndex, getActualPaddingX, networkComponents, parseMeausureString, parsePadding, useContextEx, useDataState, useGetTokenData, useGradientStyles, useIsMobile, useIsSmall, useListMode, usePayloadHash, usePayloadHashes, usePayloadRootHash, usePayloadValidate, useProvided, useShareForwardedRef, useValidateBoundWitness };
|
package/dist/browser/index.mjs
CHANGED
|
@@ -376,9 +376,144 @@ var BasicHero = /* @__PURE__ */ __name(({ backgroundImage, title, gradientTitle,
|
|
|
376
376
|
}) : null))));
|
|
377
377
|
}, "BasicHero");
|
|
378
378
|
|
|
379
|
+
// src/components/bigint/FixedPointPopover.tsx
|
|
380
|
+
import { FormHelperText, Popover, TextField } from "@mui/material";
|
|
381
|
+
import React3 from "react";
|
|
382
|
+
var FixedPointPopover = /* @__PURE__ */ __name(({ fixedPoint, minFixedPoint: minimumPoint, onFixedPointChange, ...props }) => {
|
|
383
|
+
const handleChange = /* @__PURE__ */ __name((event) => {
|
|
384
|
+
const fixedPointInteger = Number.parseInt(event.target.value, 10);
|
|
385
|
+
if (Number.isNaN(fixedPointInteger)) return;
|
|
386
|
+
onFixedPointChange?.(fixedPointInteger);
|
|
387
|
+
}, "handleChange");
|
|
388
|
+
return /* @__PURE__ */ React3.createElement(Popover, {
|
|
389
|
+
slotProps: {
|
|
390
|
+
paper: {
|
|
391
|
+
sx: {
|
|
392
|
+
p: 2
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
...props
|
|
397
|
+
}, /* @__PURE__ */ React3.createElement(TextField, {
|
|
398
|
+
slotProps: {
|
|
399
|
+
htmlInput: {
|
|
400
|
+
min: minimumPoint
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
value: fixedPoint,
|
|
404
|
+
onChange: handleChange,
|
|
405
|
+
type: "number"
|
|
406
|
+
}), /* @__PURE__ */ React3.createElement(FormHelperText, null, "Set the Fixed Point"));
|
|
407
|
+
}, "FixedPointPopover");
|
|
408
|
+
|
|
409
|
+
// src/components/bigint/TextField.tsx
|
|
410
|
+
import { FormControl, FormHelperText as FormHelperText2, TextField as TextField2 } from "@mui/material";
|
|
411
|
+
import React5, { useEffect as useEffect2, useMemo as useMemo2, useState as useState3 } from "react";
|
|
412
|
+
|
|
413
|
+
// src/components/bigint/InputAdornment.tsx
|
|
414
|
+
import { Avatar, IconButton, InputAdornment } from "@mui/material";
|
|
415
|
+
import React4, { useRef as useRef2, useState as useState2 } from "react";
|
|
416
|
+
var FixedPointInputAdornment = /* @__PURE__ */ __name(({ fixedPoint, minFixedPoint, onFixedPointChange, ...props }) => {
|
|
417
|
+
const ref = useRef2(null);
|
|
418
|
+
const [open, setOpen] = useState2(false);
|
|
419
|
+
return /* @__PURE__ */ React4.createElement(InputAdornment, props, /* @__PURE__ */ React4.createElement(FixedPointPopover, {
|
|
420
|
+
anchorEl: ref.current,
|
|
421
|
+
anchorOrigin: {
|
|
422
|
+
vertical: "bottom",
|
|
423
|
+
horizontal: "left"
|
|
424
|
+
},
|
|
425
|
+
fixedPoint,
|
|
426
|
+
minFixedPoint,
|
|
427
|
+
onClose: /* @__PURE__ */ __name(() => setOpen(false), "onClose"),
|
|
428
|
+
onFixedPointChange,
|
|
429
|
+
open
|
|
430
|
+
}), /* @__PURE__ */ React4.createElement(IconButton, {
|
|
431
|
+
size: "small",
|
|
432
|
+
ref,
|
|
433
|
+
onClick: /* @__PURE__ */ __name(() => setOpen(!open), "onClick")
|
|
434
|
+
}, /* @__PURE__ */ React4.createElement(Avatar, {
|
|
435
|
+
sx: {
|
|
436
|
+
fontSize: ".75rem",
|
|
437
|
+
height: "20px",
|
|
438
|
+
width: "20px"
|
|
439
|
+
}
|
|
440
|
+
}, fixedPoint)));
|
|
441
|
+
}, "FixedPointInputAdornment");
|
|
442
|
+
|
|
443
|
+
// src/components/bigint/TextField.tsx
|
|
444
|
+
var BigIntTextField = /* @__PURE__ */ __name(({ defaultFixedPoint = 18, helperText, hideAdornment, onChangeFixedPoint, onChange, ...props }) => {
|
|
445
|
+
const [value, setValue] = useState3(0);
|
|
446
|
+
const [rawValue, setRawValue] = useState3("");
|
|
447
|
+
const [fixedPoint, setFixedPoint] = useState3(defaultFixedPoint);
|
|
448
|
+
const [error, setError] = useState3();
|
|
449
|
+
const handleChange = /* @__PURE__ */ __name((event) => {
|
|
450
|
+
onChange?.(event);
|
|
451
|
+
const filteredValue = event.target.value.replaceAll(/[^\d.]/g, "");
|
|
452
|
+
if (filteredValue.split(".").length > 2) return;
|
|
453
|
+
setRawValue(filteredValue);
|
|
454
|
+
const value2 = Number.parseFloat(filteredValue || "0");
|
|
455
|
+
if (Number.isNaN(value2)) setValue(0);
|
|
456
|
+
setValue(value2);
|
|
457
|
+
}, "handleChange");
|
|
458
|
+
const onFixedPointChange = /* @__PURE__ */ __name((fixedPoint2) => setFixedPoint(fixedPoint2), "onFixedPointChange");
|
|
459
|
+
const bigIntValue = useMemo2(() => {
|
|
460
|
+
const fixedValue = value * 10 ** fixedPoint;
|
|
461
|
+
setError(void 0);
|
|
462
|
+
try {
|
|
463
|
+
return BigInt(fixedValue);
|
|
464
|
+
} catch (e) {
|
|
465
|
+
console.error(e);
|
|
466
|
+
setError(e);
|
|
467
|
+
}
|
|
468
|
+
}, [
|
|
469
|
+
value,
|
|
470
|
+
fixedPoint
|
|
471
|
+
]);
|
|
472
|
+
useEffect2(() => {
|
|
473
|
+
if (bigIntValue) onChangeFixedPoint?.(bigIntValue);
|
|
474
|
+
}, [
|
|
475
|
+
bigIntValue
|
|
476
|
+
]);
|
|
477
|
+
const minFixedPoint = rawValue.split(".")[1]?.length;
|
|
478
|
+
const resolvedHelperText = useMemo2(() => {
|
|
479
|
+
if (error) return "Cannot convert to BigInt";
|
|
480
|
+
return helperText ?? "Enter a number";
|
|
481
|
+
}, [
|
|
482
|
+
helperText,
|
|
483
|
+
error
|
|
484
|
+
]);
|
|
485
|
+
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(TextField2, {
|
|
486
|
+
onChange: handleChange,
|
|
487
|
+
type: "string",
|
|
488
|
+
error: Boolean(error),
|
|
489
|
+
slotProps: {
|
|
490
|
+
htmlInput: {
|
|
491
|
+
pattern: "[0-9]*[.]?[0-9]*"
|
|
492
|
+
},
|
|
493
|
+
input: {
|
|
494
|
+
startAdornment: hideAdornment ? null : /* @__PURE__ */ React5.createElement(FixedPointInputAdornment, {
|
|
495
|
+
position: "start",
|
|
496
|
+
fixedPoint,
|
|
497
|
+
minFixedPoint,
|
|
498
|
+
onFixedPointChange
|
|
499
|
+
})
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
value: rawValue,
|
|
503
|
+
...props
|
|
504
|
+
}), /* @__PURE__ */ React5.createElement(FormHelperText2, null, resolvedHelperText));
|
|
505
|
+
}, "BigIntTextField");
|
|
506
|
+
var WithFormControl = /* @__PURE__ */ __name(({ textFieldProps, ...props }) => /* @__PURE__ */ React5.createElement(FormControl, props, /* @__PURE__ */ React5.createElement(BigIntTextField, textFieldProps)), "WithFormControl");
|
|
507
|
+
|
|
508
|
+
// src/components/bigint/Input.ts
|
|
509
|
+
var BigIntInput = {
|
|
510
|
+
TextField: BigIntTextField,
|
|
511
|
+
WithFormControl
|
|
512
|
+
};
|
|
513
|
+
|
|
379
514
|
// src/components/Ellipsize.tsx
|
|
380
515
|
import { Box, styled, Typography as Typography3 } from "@mui/material";
|
|
381
|
-
import
|
|
516
|
+
import React6, { forwardRef, useCallback, useState as useState4 } from "react";
|
|
382
517
|
var ComponentName = "Ellipsize";
|
|
383
518
|
var EllipsizeRoot = styled(Box, {
|
|
384
519
|
name: ComponentName,
|
|
@@ -427,7 +562,7 @@ var EllipsizeContentWrap = styled(Typography3, {
|
|
|
427
562
|
});
|
|
428
563
|
});
|
|
429
564
|
var useClientHeight = /* @__PURE__ */ __name(() => {
|
|
430
|
-
const [contentWrapHeight, setContentWrapHeight] =
|
|
565
|
+
const [contentWrapHeight, setContentWrapHeight] = useState4();
|
|
431
566
|
const contentWrapRef = useCallback((node) => {
|
|
432
567
|
if (node !== null) {
|
|
433
568
|
setContentWrapHeight(node.clientHeight + "px");
|
|
@@ -441,11 +576,11 @@ var useClientHeight = /* @__PURE__ */ __name(() => {
|
|
|
441
576
|
var EllipsizeBox = /* @__PURE__ */ forwardRef(({ children, ellipsisPosition = "start", disableSharedRef, typographyProps, ...props }, ref) => {
|
|
442
577
|
const { contentWrapRef, contentWrapHeight } = useClientHeight();
|
|
443
578
|
const sharedRef = useShareForwardedRef(ref);
|
|
444
|
-
return /* @__PURE__ */
|
|
579
|
+
return /* @__PURE__ */ React6.createElement(EllipsizeRoot, {
|
|
445
580
|
beforeLineHeight: !!sharedRef && !disableSharedRef ? contentWrapHeight : void 0,
|
|
446
581
|
...props,
|
|
447
582
|
ref: sharedRef
|
|
448
|
-
}, /* @__PURE__ */
|
|
583
|
+
}, /* @__PURE__ */ React6.createElement(EllipsizeInnerWrap, null, /* @__PURE__ */ React6.createElement(EllipsizeContentWrap, {
|
|
449
584
|
ref: contentWrapRef,
|
|
450
585
|
component: "span",
|
|
451
586
|
ellipsisPosition,
|
|
@@ -457,12 +592,12 @@ EllipsizeBox.displayName = "EllipsizeBox";
|
|
|
457
592
|
|
|
458
593
|
// src/components/LabeledTextFieldWrapper.tsx
|
|
459
594
|
import { Stack, Typography as Typography4 } from "@mui/material";
|
|
460
|
-
import
|
|
595
|
+
import React7 from "react";
|
|
461
596
|
var LabeledTextFieldWrapper = /* @__PURE__ */ __name(({ children, label, ...props }) => {
|
|
462
|
-
return /* @__PURE__ */
|
|
597
|
+
return /* @__PURE__ */ React7.createElement(Stack, {
|
|
463
598
|
flexDirection: "column",
|
|
464
599
|
...props
|
|
465
|
-
}, /* @__PURE__ */
|
|
600
|
+
}, /* @__PURE__ */ React7.createElement(Typography4, {
|
|
466
601
|
gutterBottom: true,
|
|
467
602
|
variant: "caption"
|
|
468
603
|
}, label), children);
|
|
@@ -470,7 +605,7 @@ var LabeledTextFieldWrapper = /* @__PURE__ */ __name(({ children, label, ...prop
|
|
|
470
605
|
|
|
471
606
|
// src/components/ListItemButtonEx.tsx
|
|
472
607
|
import { ListItemButton } from "@mui/material";
|
|
473
|
-
import
|
|
608
|
+
import React8 from "react";
|
|
474
609
|
import { useNavigate } from "react-router-dom";
|
|
475
610
|
var ListItemButtonExTo = /* @__PURE__ */ __name(({ to, toOptions, onClick, ...props }) => {
|
|
476
611
|
const navigate = useNavigate();
|
|
@@ -480,30 +615,30 @@ var ListItemButtonExTo = /* @__PURE__ */ __name(({ to, toOptions, onClick, ...pr
|
|
|
480
615
|
void navigate(to, toOptions);
|
|
481
616
|
}
|
|
482
617
|
}, "localOnClick");
|
|
483
|
-
return /* @__PURE__ */
|
|
618
|
+
return /* @__PURE__ */ React8.createElement(ListItemButton, {
|
|
484
619
|
onClick: localOnClick,
|
|
485
620
|
...props
|
|
486
621
|
});
|
|
487
622
|
}, "ListItemButtonExTo");
|
|
488
623
|
var ListItemButtonEx = /* @__PURE__ */ __name(({ to, ...props }) => {
|
|
489
|
-
return to ? /* @__PURE__ */
|
|
624
|
+
return to ? /* @__PURE__ */ React8.createElement(ListItemButtonExTo, {
|
|
490
625
|
to,
|
|
491
626
|
...props
|
|
492
|
-
}) : /* @__PURE__ */
|
|
627
|
+
}) : /* @__PURE__ */ React8.createElement(ListItemButton, props);
|
|
493
628
|
}, "ListItemButtonEx");
|
|
494
629
|
|
|
495
630
|
// src/components/LoadResult.tsx
|
|
496
631
|
import { FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
|
|
497
|
-
import
|
|
632
|
+
import React10 from "react";
|
|
498
633
|
|
|
499
634
|
// src/components/NotFound.tsx
|
|
500
635
|
import { Typography as Typography5 } from "@mui/material";
|
|
501
636
|
import { FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
|
|
502
|
-
import
|
|
637
|
+
import React9 from "react";
|
|
503
638
|
var NotFound = /* @__PURE__ */ __name((props) => {
|
|
504
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ React9.createElement(FlexGrowCol2, props, /* @__PURE__ */ React9.createElement(Typography5, {
|
|
505
640
|
variant: "h2"
|
|
506
|
-
}, "Sorry!"), /* @__PURE__ */
|
|
641
|
+
}, "Sorry!"), /* @__PURE__ */ React9.createElement(Typography5, {
|
|
507
642
|
marginY: 3,
|
|
508
643
|
variant: "body2"
|
|
509
644
|
}, "Can't find anything here"));
|
|
@@ -513,23 +648,23 @@ var NotFound = /* @__PURE__ */ __name((props) => {
|
|
|
513
648
|
function LoadResult(props) {
|
|
514
649
|
const { notFound, error, searchResult, children } = props;
|
|
515
650
|
if (notFound) {
|
|
516
|
-
return /* @__PURE__ */
|
|
651
|
+
return /* @__PURE__ */ React10.createElement(NotFound, null);
|
|
517
652
|
}
|
|
518
653
|
if (error) {
|
|
519
|
-
return /* @__PURE__ */
|
|
654
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, children);
|
|
520
655
|
}
|
|
521
|
-
return searchResult === void 0 ? /* @__PURE__ */
|
|
656
|
+
return searchResult === void 0 ? /* @__PURE__ */ React10.createElement(FlexGrowRow2, {
|
|
522
657
|
busy: true,
|
|
523
658
|
minHeight: "50px"
|
|
524
|
-
}) : /* @__PURE__ */
|
|
659
|
+
}) : /* @__PURE__ */ React10.createElement(React10.Fragment, null, children);
|
|
525
660
|
}
|
|
526
661
|
__name(LoadResult, "LoadResult");
|
|
527
662
|
|
|
528
663
|
// src/components/Pipe.tsx
|
|
529
664
|
import { Typography as Typography6 } from "@mui/material";
|
|
530
|
-
import
|
|
665
|
+
import React11 from "react";
|
|
531
666
|
var Pipe = /* @__PURE__ */ __name((props) => {
|
|
532
|
-
return /* @__PURE__ */
|
|
667
|
+
return /* @__PURE__ */ React11.createElement(Typography6, {
|
|
533
668
|
marginX: 1,
|
|
534
669
|
component: "span",
|
|
535
670
|
...props
|
|
@@ -538,17 +673,17 @@ var Pipe = /* @__PURE__ */ __name((props) => {
|
|
|
538
673
|
|
|
539
674
|
// src/components/pluginValidation/DataMissing.tsx
|
|
540
675
|
import { Alert, AlertTitle } from "@mui/material";
|
|
541
|
-
import
|
|
676
|
+
import React12 from "react";
|
|
542
677
|
var PayloadDataMissing = /* @__PURE__ */ __name(({ alertBody, ...props }) => {
|
|
543
|
-
return /* @__PURE__ */
|
|
678
|
+
return /* @__PURE__ */ React12.createElement(Alert, {
|
|
544
679
|
severity: "warning",
|
|
545
680
|
...props
|
|
546
|
-
}, /* @__PURE__ */
|
|
681
|
+
}, /* @__PURE__ */ React12.createElement(AlertTitle, null, "Missing Data"), alertBody ?? "Payload is missing required data to render correctly");
|
|
547
682
|
}, "PayloadDataMissing");
|
|
548
683
|
|
|
549
684
|
// src/components/ScrollTableOnSm.tsx
|
|
550
685
|
import { styled as styled2 } from "@mui/material";
|
|
551
|
-
import
|
|
686
|
+
import React13 from "react";
|
|
552
687
|
var StyledScrollTableOnSm = styled2("div")(({ theme }) => ({
|
|
553
688
|
[theme.breakpoints.down("md")]: {
|
|
554
689
|
overflowX: "scroll"
|
|
@@ -556,15 +691,15 @@ var StyledScrollTableOnSm = styled2("div")(({ theme }) => ({
|
|
|
556
691
|
display: "flex",
|
|
557
692
|
flexGrow: 1
|
|
558
693
|
}));
|
|
559
|
-
var ScrollTableOnSm = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */
|
|
694
|
+
var ScrollTableOnSm = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ React13.createElement(StyledScrollTableOnSm, null, children), "ScrollTableOnSm");
|
|
560
695
|
|
|
561
696
|
// src/components/SectionSpacingRow/SectionSpacingRow.tsx
|
|
562
697
|
import { useTheme as useTheme3 } from "@mui/material";
|
|
563
698
|
import { FlexGrowRow as FlexGrowRow3 } from "@xylabs/react-flexbox";
|
|
564
|
-
import
|
|
699
|
+
import React14, { forwardRef as forwardRef2 } from "react";
|
|
565
700
|
var SectionSpacingRow = /* @__PURE__ */ forwardRef2(({ children, sx, ...props }, ref) => {
|
|
566
701
|
const theme = useTheme3();
|
|
567
|
-
return /* @__PURE__ */
|
|
702
|
+
return /* @__PURE__ */ React14.createElement(FlexGrowRow3, {
|
|
568
703
|
sx: {
|
|
569
704
|
paddingBottom: {
|
|
570
705
|
md: theme.spacing(5),
|
|
@@ -584,12 +719,12 @@ var SectionSpacingRow = /* @__PURE__ */ forwardRef2(({ children, sx, ...props },
|
|
|
584
719
|
SectionSpacingRow.displayName = "SectionSpacingRow";
|
|
585
720
|
|
|
586
721
|
// src/components/TableCell/AddressTableCell.tsx
|
|
587
|
-
import
|
|
722
|
+
import React16, { forwardRef as forwardRef4 } from "react";
|
|
588
723
|
|
|
589
724
|
// src/components/TableCell/EllipsisTableCell.tsx
|
|
590
725
|
import { styled as styled3, TableCell } from "@mui/material";
|
|
591
726
|
import { asLinkHrefOrToProps, LinkEx as LinkEx2 } from "@xylabs/react-link";
|
|
592
|
-
import
|
|
727
|
+
import React15, { forwardRef as forwardRef3, useMemo as useMemo3 } from "react";
|
|
593
728
|
var EllipsisTableCellRoot = styled3(TableCell, {
|
|
594
729
|
name: "EllipsisTableCell",
|
|
595
730
|
shouldForwardProp: /* @__PURE__ */ __name((prop) => prop !== "width", "shouldForwardProp"),
|
|
@@ -598,12 +733,12 @@ var EllipsisTableCellRoot = styled3(TableCell, {
|
|
|
598
733
|
width
|
|
599
734
|
}));
|
|
600
735
|
var EllipsisTableCellWithRef = /* @__PURE__ */ forwardRef3(({ children, href, link = false, to, value, ...props }, ref) => {
|
|
601
|
-
const data =
|
|
736
|
+
const data = useMemo3(() => {
|
|
602
737
|
if (children) {
|
|
603
738
|
return children;
|
|
604
739
|
}
|
|
605
740
|
if (href || link || to) {
|
|
606
|
-
return /* @__PURE__ */
|
|
741
|
+
return /* @__PURE__ */ React15.createElement(LinkEx2, {
|
|
607
742
|
title: value,
|
|
608
743
|
...asLinkHrefOrToProps({
|
|
609
744
|
to,
|
|
@@ -620,7 +755,7 @@ var EllipsisTableCellWithRef = /* @__PURE__ */ forwardRef3(({ children, href, li
|
|
|
620
755
|
to,
|
|
621
756
|
value
|
|
622
757
|
]);
|
|
623
|
-
return /* @__PURE__ */
|
|
758
|
+
return /* @__PURE__ */ React15.createElement(EllipsisTableCellRoot, props, /* @__PURE__ */ React15.createElement(EllipsizeBox, {
|
|
624
759
|
ref,
|
|
625
760
|
sx: {
|
|
626
761
|
cursor: link || to || href ? "pointer" : "inherit"
|
|
@@ -634,7 +769,7 @@ var EllipsisTableCell = EllipsisTableCellWithRef;
|
|
|
634
769
|
var AddressTableCell = /* @__PURE__ */ forwardRef4(({ value, archive, exploreDomain, link, ...props }, ref) => {
|
|
635
770
|
const href = exploreDomain && archive ? `${exploreDomain}/archive/${archive}/address/${value}` : void 0;
|
|
636
771
|
const to = exploreDomain === void 0 && archive ? `/archive/${archive}/address/${value}` : void 0;
|
|
637
|
-
return /* @__PURE__ */
|
|
772
|
+
return /* @__PURE__ */ React16.createElement(EllipsisTableCell, {
|
|
638
773
|
value,
|
|
639
774
|
href,
|
|
640
775
|
to,
|
|
@@ -647,9 +782,9 @@ AddressTableCell.displayName = "AddressTableCell";
|
|
|
647
782
|
|
|
648
783
|
// src/components/TableCell/HashTableCell.tsx
|
|
649
784
|
import { useEvent } from "@xyo-network/react-event";
|
|
650
|
-
import
|
|
785
|
+
import React17, { useRef as useRef3 } from "react";
|
|
651
786
|
var HashTableCell = /* @__PURE__ */ __name(({ value, archive, dataType, network, exploreDomain, onHashClick, ...props }) => {
|
|
652
|
-
const ref =
|
|
787
|
+
const ref = useRef3(null);
|
|
653
788
|
const [tableCellRef, dispatch] = useEvent(void 0, ref);
|
|
654
789
|
const hashPath = `/${dataType}/hash/${value}?network=${network ?? "main"}`;
|
|
655
790
|
const explorePath = archive ? `/archive/${archive}${hashPath}` : hashPath;
|
|
@@ -660,7 +795,7 @@ var HashTableCell = /* @__PURE__ */ __name(({ value, archive, dataType, network,
|
|
|
660
795
|
dispatch?.("hash", "click", value);
|
|
661
796
|
}
|
|
662
797
|
}, "handleCellClick");
|
|
663
|
-
return /* @__PURE__ */
|
|
798
|
+
return /* @__PURE__ */ React17.createElement(EllipsisTableCell, {
|
|
664
799
|
onClick: handleCellClick,
|
|
665
800
|
ref: tableCellRef,
|
|
666
801
|
value,
|
|
@@ -671,11 +806,11 @@ var HashTableCell = /* @__PURE__ */ __name(({ value, archive, dataType, network,
|
|
|
671
806
|
}, "HashTableCell");
|
|
672
807
|
|
|
673
808
|
// src/components/ThemeTokenAvatar/ThemeTokenAvatar.tsx
|
|
674
|
-
import { Avatar, useTheme as useTheme4 } from "@mui/material";
|
|
675
|
-
import
|
|
809
|
+
import { Avatar as Avatar2, useTheme as useTheme4 } from "@mui/material";
|
|
810
|
+
import React18 from "react";
|
|
676
811
|
var ThemeTokenAvatar = /* @__PURE__ */ __name(({ ...props }) => {
|
|
677
812
|
const theme = useTheme4();
|
|
678
|
-
return /* @__PURE__ */
|
|
813
|
+
return /* @__PURE__ */ React18.createElement(Avatar2, {
|
|
679
814
|
sx: {
|
|
680
815
|
background: theme.palette.common.white
|
|
681
816
|
},
|
|
@@ -685,9 +820,9 @@ var ThemeTokenAvatar = /* @__PURE__ */ __name(({ ...props }) => {
|
|
|
685
820
|
|
|
686
821
|
// src/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.tsx
|
|
687
822
|
import { AvatarGroup } from "@mui/material";
|
|
688
|
-
import
|
|
823
|
+
import React19 from "react";
|
|
689
824
|
var ThemeTokenAvatarGroup = /* @__PURE__ */ __name(({ images, ...props }) => {
|
|
690
|
-
return /* @__PURE__ */
|
|
825
|
+
return /* @__PURE__ */ React19.createElement(AvatarGroup, props, images?.map((image, index) => /* @__PURE__ */ React19.createElement(ThemeTokenAvatar, {
|
|
691
826
|
key: index,
|
|
692
827
|
src: image
|
|
693
828
|
})));
|
|
@@ -696,20 +831,20 @@ var ThemeTokenAvatarGroup = /* @__PURE__ */ __name(({ images, ...props }) => {
|
|
|
696
831
|
// src/components/TokenBar/TokenBar.tsx
|
|
697
832
|
import { Paper, Typography as Typography7 } from "@mui/material";
|
|
698
833
|
import { FlexRow } from "@xylabs/react-flexbox";
|
|
699
|
-
import
|
|
834
|
+
import React20 from "react";
|
|
700
835
|
var TokenBar = /* @__PURE__ */ __name(({ text1, text1Props, text1Suffix, text2, text2Props, text2Suffix, ...props }) => {
|
|
701
|
-
return /* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ React20.createElement(Paper, {
|
|
702
837
|
elevation: 0,
|
|
703
838
|
className: "TokenBar-root",
|
|
704
839
|
...props
|
|
705
|
-
}, /* @__PURE__ */
|
|
840
|
+
}, /* @__PURE__ */ React20.createElement(FlexRow, {
|
|
706
841
|
justifyContent: "space-between"
|
|
707
|
-
}, /* @__PURE__ */
|
|
842
|
+
}, /* @__PURE__ */ React20.createElement(Typography7, {
|
|
708
843
|
variant: "body1",
|
|
709
844
|
fontWeight: 300,
|
|
710
845
|
margin: 1,
|
|
711
846
|
...text1Props
|
|
712
|
-
}, text1, text1Suffix), /* @__PURE__ */
|
|
847
|
+
}, text1, text1Suffix), /* @__PURE__ */ React20.createElement(Typography7, {
|
|
713
848
|
variant: "body1",
|
|
714
849
|
fontWeight: 300,
|
|
715
850
|
textTransform: "uppercase",
|
|
@@ -871,14 +1006,14 @@ var useGetTokenData = /* @__PURE__ */ __name((symbols) => {
|
|
|
871
1006
|
|
|
872
1007
|
// src/components/TokenSummary/TokenSummary.tsx
|
|
873
1008
|
import { CardHeader, Typography as Typography8 } from "@mui/material";
|
|
874
|
-
import
|
|
1009
|
+
import React21 from "react";
|
|
875
1010
|
var TokenSummary = /* @__PURE__ */ __name(({ icon, symbol, symbolElement, children, ...props }) => {
|
|
876
|
-
return /* @__PURE__ */
|
|
877
|
-
avatar: /* @__PURE__ */
|
|
1011
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(CardHeader, {
|
|
1012
|
+
avatar: /* @__PURE__ */ React21.createElement(ThemeTokenAvatar, {
|
|
878
1013
|
src: icon,
|
|
879
1014
|
alt: symbol
|
|
880
1015
|
}),
|
|
881
|
-
title: /* @__PURE__ */
|
|
1016
|
+
title: /* @__PURE__ */ React21.createElement(Typography8, {
|
|
882
1017
|
variant: "h6",
|
|
883
1018
|
fontWeight: 300,
|
|
884
1019
|
textTransform: "uppercase"
|
|
@@ -889,10 +1024,10 @@ var TokenSummary = /* @__PURE__ */ __name(({ icon, symbol, symbolElement, childr
|
|
|
889
1024
|
|
|
890
1025
|
// src/components/TypographyEx.tsx
|
|
891
1026
|
import { Typography as Typography9 } from "@mui/material";
|
|
892
|
-
import
|
|
1027
|
+
import React22 from "react";
|
|
893
1028
|
var TypographyEx = /* @__PURE__ */ __name(({ gradient, ...props }) => {
|
|
894
1029
|
const { classes } = useGradientStyles();
|
|
895
|
-
return /* @__PURE__ */
|
|
1030
|
+
return /* @__PURE__ */ React22.createElement(Typography9, {
|
|
896
1031
|
className: gradient === "text" ? classes().heading : void 0,
|
|
897
1032
|
...props
|
|
898
1033
|
});
|
|
@@ -923,10 +1058,10 @@ var ResolvedDivinerContext = /* @__PURE__ */ __name(() => createContextEx(), "Re
|
|
|
923
1058
|
|
|
924
1059
|
// src/contexts/diviner/Provider.tsx
|
|
925
1060
|
import { useResetState } from "@xylabs/react-hooks";
|
|
926
|
-
import
|
|
1061
|
+
import React23, { useMemo as useMemo4 } from "react";
|
|
927
1062
|
var ResolvedDivinerProvider = /* @__PURE__ */ __name(({ diviner: divinerProp, required = false, children, context }) => {
|
|
928
1063
|
const [diviner, setDiviner] = useResetState(divinerProp);
|
|
929
|
-
const value =
|
|
1064
|
+
const value = useMemo4(() => {
|
|
930
1065
|
const resolveDiviner = /* @__PURE__ */ __name(() => {
|
|
931
1066
|
if (divinerProp) {
|
|
932
1067
|
return diviner === divinerProp ? diviner : void 0;
|
|
@@ -943,7 +1078,7 @@ var ResolvedDivinerProvider = /* @__PURE__ */ __name(({ diviner: divinerProp, re
|
|
|
943
1078
|
setDiviner,
|
|
944
1079
|
divinerProp
|
|
945
1080
|
]);
|
|
946
|
-
return /* @__PURE__ */
|
|
1081
|
+
return /* @__PURE__ */ React23.createElement(context.Provider, {
|
|
947
1082
|
value
|
|
948
1083
|
}, diviner ? children : required ? null : children);
|
|
949
1084
|
}, "ResolvedDivinerProvider");
|
|
@@ -952,10 +1087,10 @@ var ResolvedDivinerProvider = /* @__PURE__ */ __name(({ diviner: divinerProp, re
|
|
|
952
1087
|
var ListModeContext = createContextEx();
|
|
953
1088
|
|
|
954
1089
|
// src/contexts/ListMode/Provider.tsx
|
|
955
|
-
import
|
|
1090
|
+
import React24, { useMemo as useMemo5, useState as useState5 } from "react";
|
|
956
1091
|
var ListModeProvider = /* @__PURE__ */ __name(({ children, defaultListMode }) => {
|
|
957
|
-
const [listMode, setListMode] =
|
|
958
|
-
const value =
|
|
1092
|
+
const [listMode, setListMode] = useState5(defaultListMode ?? "default");
|
|
1093
|
+
const value = useMemo5(() => ({
|
|
959
1094
|
listMode,
|
|
960
1095
|
provided: true,
|
|
961
1096
|
setListMode
|
|
@@ -963,7 +1098,7 @@ var ListModeProvider = /* @__PURE__ */ __name(({ children, defaultListMode }) =>
|
|
|
963
1098
|
listMode,
|
|
964
1099
|
setListMode
|
|
965
1100
|
]);
|
|
966
|
-
return /* @__PURE__ */
|
|
1101
|
+
return /* @__PURE__ */ React24.createElement(ListModeContext.Provider, {
|
|
967
1102
|
value
|
|
968
1103
|
}, children);
|
|
969
1104
|
}, "ListModeProvider");
|
|
@@ -1042,35 +1177,35 @@ var getActualPaddingX = /* @__PURE__ */ __name((element) => {
|
|
|
1042
1177
|
|
|
1043
1178
|
// src/lib/networkComponents.tsx
|
|
1044
1179
|
import { BubbleChartRounded as BubbleChartRoundedIcon, HubRounded as HubRoundedIcon, InsertLinkRounded as InsertLinkRoundedIcon, Inventory2Rounded as Inventory2RoundedIcon, TimerRounded as TimerRoundedIcon, VisibilityRounded as VisibilityRoundedIcon } from "@mui/icons-material";
|
|
1045
|
-
import
|
|
1180
|
+
import React25 from "react";
|
|
1046
1181
|
var networkComponents = [
|
|
1047
1182
|
{
|
|
1048
|
-
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */
|
|
1183
|
+
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement(HubRoundedIcon, props), "icon"),
|
|
1049
1184
|
name: "Node",
|
|
1050
1185
|
slug: "node"
|
|
1051
1186
|
},
|
|
1052
1187
|
{
|
|
1053
|
-
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */
|
|
1188
|
+
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement(TimerRoundedIcon, props), "icon"),
|
|
1054
1189
|
name: "Sentinel",
|
|
1055
1190
|
slug: "sentinel"
|
|
1056
1191
|
},
|
|
1057
1192
|
{
|
|
1058
|
-
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */
|
|
1193
|
+
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement(InsertLinkRoundedIcon, props), "icon"),
|
|
1059
1194
|
name: "Bridge",
|
|
1060
1195
|
slug: "bridge"
|
|
1061
1196
|
},
|
|
1062
1197
|
{
|
|
1063
|
-
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */
|
|
1198
|
+
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement(Inventory2RoundedIcon, props), "icon"),
|
|
1064
1199
|
name: "Archivist",
|
|
1065
1200
|
slug: "archivist"
|
|
1066
1201
|
},
|
|
1067
1202
|
{
|
|
1068
|
-
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */
|
|
1203
|
+
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement(BubbleChartRoundedIcon, props), "icon"),
|
|
1069
1204
|
name: "Diviner",
|
|
1070
1205
|
slug: "diviner"
|
|
1071
1206
|
},
|
|
1072
1207
|
{
|
|
1073
|
-
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */
|
|
1208
|
+
icon: /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement(VisibilityRoundedIcon, props), "icon"),
|
|
1074
1209
|
name: "Witness",
|
|
1075
1210
|
slug: "witness"
|
|
1076
1211
|
}
|
|
@@ -1085,9 +1220,13 @@ export {
|
|
|
1085
1220
|
AddressTableCell,
|
|
1086
1221
|
Ampersand,
|
|
1087
1222
|
BasicHero,
|
|
1223
|
+
BigIntInput,
|
|
1224
|
+
BigIntTextField,
|
|
1088
1225
|
EllipsisTableCell,
|
|
1089
1226
|
EllipsisTableCellWithRef,
|
|
1090
1227
|
EllipsizeBox,
|
|
1228
|
+
FixedPointInputAdornment,
|
|
1229
|
+
FixedPointPopover,
|
|
1091
1230
|
HashTableCell,
|
|
1092
1231
|
LabeledTextFieldWrapper,
|
|
1093
1232
|
ListItemButtonEx,
|
|
@@ -1108,6 +1247,7 @@ export {
|
|
|
1108
1247
|
TokenData,
|
|
1109
1248
|
TokenSummary,
|
|
1110
1249
|
TypographyEx,
|
|
1250
|
+
WithFormControl,
|
|
1111
1251
|
assertDefinedEx,
|
|
1112
1252
|
colorfulGradientDarkMode,
|
|
1113
1253
|
colorfulGradientLightMode,
|