@xyo-network/react-shared 4.4.10 → 5.0.0-rc.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/index.mjs +23 -29
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/SizeProp.d.ts +2 -0
- package/dist/types/SizeProp.d.ts.map +1 -0
- package/dist/types/components/Ampersand.d.ts +4 -0
- package/dist/types/components/Ampersand.d.ts.map +1 -0
- package/dist/types/components/BasicHero/BasicHero.d.ts +26 -0
- package/dist/types/components/BasicHero/BasicHero.d.ts.map +1 -0
- package/dist/types/components/BasicHero/index.d.ts +2 -0
- package/dist/types/components/BasicHero/index.d.ts.map +1 -0
- package/dist/types/components/Ellipsize.d.ts +21 -0
- package/dist/types/components/Ellipsize.d.ts.map +1 -0
- package/dist/types/components/LabeledTextFieldWrapper.d.ts +7 -0
- package/dist/types/components/LabeledTextFieldWrapper.d.ts.map +1 -0
- package/dist/types/components/ListItemButtonEx.d.ts +11 -0
- package/dist/types/components/ListItemButtonEx.d.ts.map +1 -0
- package/dist/types/components/LoadResult.d.ts +11 -0
- package/dist/types/components/LoadResult.d.ts.map +1 -0
- package/dist/types/components/NotFound.d.ts +5 -0
- package/dist/types/components/NotFound.d.ts.map +1 -0
- package/dist/types/components/Pipe.d.ts +4 -0
- package/dist/types/components/Pipe.d.ts.map +1 -0
- package/dist/types/components/ScrollTableOnSm.d.ts +5 -0
- package/dist/types/components/ScrollTableOnSm.d.ts.map +1 -0
- package/dist/types/components/SectionSpacingRow/SectionSpacingRow.d.ts +9 -0
- package/dist/types/components/SectionSpacingRow/SectionSpacingRow.d.ts.map +1 -0
- package/dist/types/components/SectionSpacingRow/index.d.ts +2 -0
- package/dist/types/components/SectionSpacingRow/index.d.ts.map +1 -0
- package/dist/types/components/StyleGuide/AppBars.example.d.ts +2 -0
- package/dist/types/components/StyleGuide/AppBars.example.d.ts.map +1 -0
- package/dist/types/components/StyleGuide/Buttons.example.d.ts +3 -0
- package/dist/types/components/StyleGuide/Buttons.example.d.ts.map +1 -0
- package/dist/types/components/StyleGuide/Papers.example.d.ts +3 -0
- package/dist/types/components/StyleGuide/Papers.example.d.ts.map +1 -0
- package/dist/types/components/StyleGuide/StyleGuide.example.d.ts +3 -0
- package/dist/types/components/StyleGuide/StyleGuide.example.d.ts.map +1 -0
- package/dist/types/components/StyleGuide/Texts.example.d.ts +2 -0
- package/dist/types/components/StyleGuide/Texts.example.d.ts.map +1 -0
- package/dist/types/components/StyleGuide/VariantContext.example.d.ts +2 -0
- package/dist/types/components/StyleGuide/VariantContext.example.d.ts.map +1 -0
- package/dist/types/components/TableCell/AddressTableCell.d.ts +17 -0
- package/dist/types/components/TableCell/AddressTableCell.d.ts.map +1 -0
- package/dist/types/components/TableCell/EllipsisTableCell.d.ts +29 -0
- package/dist/types/components/TableCell/EllipsisTableCell.d.ts.map +1 -0
- package/dist/types/components/TableCell/HashTableCell.d.ts +12 -0
- package/dist/types/components/TableCell/HashTableCell.d.ts.map +1 -0
- package/dist/types/components/TableCell/findParent.d.ts +2 -0
- package/dist/types/components/TableCell/findParent.d.ts.map +1 -0
- package/dist/types/components/TableCell/getRemainingRowWidth.d.ts +3 -0
- package/dist/types/components/TableCell/getRemainingRowWidth.d.ts.map +1 -0
- package/dist/types/components/TableCell/getSmallestParentWidth.d.ts +2 -0
- package/dist/types/components/TableCell/getSmallestParentWidth.d.ts.map +1 -0
- package/dist/types/components/TableCell/index.d.ts +4 -0
- package/dist/types/components/TableCell/index.d.ts.map +1 -0
- package/dist/types/components/ThemeTokenAvatar/ThemeTokenAvatar.d.ts +4 -0
- package/dist/types/components/ThemeTokenAvatar/ThemeTokenAvatar.d.ts.map +1 -0
- package/dist/types/components/ThemeTokenAvatar/index.d.ts +2 -0
- package/dist/types/components/ThemeTokenAvatar/index.d.ts.map +1 -0
- package/dist/types/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.d.ts +7 -0
- package/dist/types/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.d.ts.map +1 -0
- package/dist/types/components/ThemeTokenAvatarGroup/index.d.ts +2 -0
- package/dist/types/components/ThemeTokenAvatarGroup/index.d.ts.map +1 -0
- package/dist/types/components/TokenBar/TokenBar.d.ts +13 -0
- package/dist/types/components/TokenBar/TokenBar.d.ts.map +1 -0
- package/dist/types/components/TokenBar/index.d.ts +2 -0
- package/dist/types/components/TokenBar/index.d.ts.map +1 -0
- package/dist/types/components/TokenData/TokenData.d.ts +10 -0
- package/dist/types/components/TokenData/TokenData.d.ts.map +1 -0
- package/dist/types/components/TokenData/img/index.d.ts +16 -0
- package/dist/types/components/TokenData/img/index.d.ts.map +1 -0
- package/dist/types/components/TokenData/index.d.ts +3 -0
- package/dist/types/components/TokenData/index.d.ts.map +1 -0
- package/dist/types/components/TokenData/useGetTokenData.d.ts +3 -0
- package/dist/types/components/TokenData/useGetTokenData.d.ts.map +1 -0
- package/dist/types/components/TokenSummary/TokenSummary.d.ts +11 -0
- package/dist/types/components/TokenSummary/TokenSummary.d.ts.map +1 -0
- package/dist/types/components/TokenSummary/index.d.ts +2 -0
- package/dist/types/components/TokenSummary/index.d.ts.map +1 -0
- package/dist/types/components/TypographyEx.d.ts +7 -0
- package/dist/types/components/TypographyEx.d.ts.map +1 -0
- package/dist/types/components/bigint/FixedPointPopover.d.ts +9 -0
- package/dist/types/components/bigint/FixedPointPopover.d.ts.map +1 -0
- package/dist/types/components/bigint/Input.d.ts +5 -0
- package/dist/types/components/bigint/Input.d.ts.map +1 -0
- package/dist/types/components/bigint/InputAdornment.d.ts +9 -0
- package/dist/types/components/bigint/InputAdornment.d.ts.map +1 -0
- package/dist/types/components/bigint/TextField.d.ts +15 -0
- package/dist/types/components/bigint/TextField.d.ts.map +1 -0
- package/dist/types/components/bigint/index.d.ts +5 -0
- package/dist/types/components/bigint/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +20 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/pluginValidation/DataMissing.d.ts +7 -0
- package/dist/types/components/pluginValidation/DataMissing.d.ts.map +1 -0
- package/dist/types/components/pluginValidation/index.d.ts +2 -0
- package/dist/types/components/pluginValidation/index.d.ts.map +1 -0
- package/dist/types/contexts/ListMode/Context.d.ts +3 -0
- package/dist/types/contexts/ListMode/Context.d.ts.map +1 -0
- package/dist/types/contexts/ListMode/Provider.d.ts +8 -0
- package/dist/types/contexts/ListMode/Provider.d.ts.map +1 -0
- package/dist/types/contexts/ListMode/State.d.ts +8 -0
- package/dist/types/contexts/ListMode/State.d.ts.map +1 -0
- package/dist/types/contexts/ListMode/index.d.ts +5 -0
- package/dist/types/contexts/ListMode/index.d.ts.map +1 -0
- package/dist/types/contexts/ListMode/use.d.ts +2 -0
- package/dist/types/contexts/ListMode/use.d.ts.map +1 -0
- package/dist/types/contexts/contextEx/ContextExProviderProps.d.ts +6 -0
- package/dist/types/contexts/contextEx/ContextExProviderProps.d.ts.map +1 -0
- package/dist/types/contexts/contextEx/State.d.ts +4 -0
- package/dist/types/contexts/contextEx/State.d.ts.map +1 -0
- package/dist/types/contexts/contextEx/create.d.ts +3 -0
- package/dist/types/contexts/contextEx/create.d.ts.map +1 -0
- package/dist/types/contexts/contextEx/index.d.ts +5 -0
- package/dist/types/contexts/contextEx/index.d.ts.map +1 -0
- package/dist/types/contexts/contextEx/use.d.ts +5 -0
- package/dist/types/contexts/contextEx/use.d.ts.map +1 -0
- package/dist/types/contexts/diviner/Context.d.ts +2 -0
- package/dist/types/contexts/diviner/Context.d.ts.map +1 -0
- package/dist/types/contexts/diviner/Provider.d.ts +10 -0
- package/dist/types/contexts/diviner/Provider.d.ts.map +1 -0
- package/dist/types/contexts/diviner/State.d.ts +7 -0
- package/dist/types/contexts/diviner/State.d.ts.map +1 -0
- package/dist/types/contexts/diviner/index.d.ts +4 -0
- package/dist/types/contexts/diviner/index.d.ts.map +1 -0
- package/dist/types/contexts/index.d.ts +4 -0
- package/dist/types/contexts/index.d.ts.map +1 -0
- package/dist/types/hooks/GradientStyles/GradientStyles.d.ts +67 -0
- package/dist/types/hooks/GradientStyles/GradientStyles.d.ts.map +1 -0
- package/dist/types/hooks/GradientStyles/index.d.ts +2 -0
- package/dist/types/hooks/GradientStyles/index.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +7 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/payload/index.d.ts +5 -0
- package/dist/types/hooks/payload/index.d.ts.map +1 -0
- package/dist/types/hooks/payload/types/ValidatedResponse.d.ts +6 -0
- package/dist/types/hooks/payload/types/ValidatedResponse.d.ts.map +1 -0
- package/dist/types/hooks/payload/types/index.d.ts +2 -0
- package/dist/types/hooks/payload/types/index.d.ts.map +1 -0
- package/dist/types/hooks/payload/useBoundWitnessValidate.d.ts +4 -0
- package/dist/types/hooks/payload/useBoundWitnessValidate.d.ts.map +1 -0
- package/dist/types/hooks/payload/usePayloadHash.d.ts +5 -0
- package/dist/types/hooks/payload/usePayloadHash.d.ts.map +1 -0
- package/dist/types/hooks/payload/usePayloadValidate.d.ts +4 -0
- package/dist/types/hooks/payload/usePayloadValidate.d.ts.map +1 -0
- package/dist/types/hooks/useDataState.d.ts +3 -0
- package/dist/types/hooks/useDataState.d.ts.map +1 -0
- package/dist/types/hooks/useIsMobile.d.ts +4 -0
- package/dist/types/hooks/useIsMobile.d.ts.map +1 -0
- package/dist/types/hooks/useMediaQuery.d.ts +2 -0
- package/dist/types/hooks/useMediaQuery.d.ts.map +1 -0
- package/dist/types/hooks/useShareForwardRef.d.ts +3 -0
- package/dist/types/hooks/useShareForwardRef.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/assertDefinedEx.d.ts +5 -0
- package/dist/types/lib/assertDefinedEx.d.ts.map +1 -0
- package/dist/types/lib/getActualPaddingX.d.ts +14 -0
- package/dist/types/lib/getActualPaddingX.d.ts.map +1 -0
- package/dist/types/lib/index.d.ts +4 -0
- package/dist/types/lib/index.d.ts.map +1 -0
- package/dist/types/lib/networkComponents.d.ts +12 -0
- package/dist/types/lib/networkComponents.d.ts.map +1 -0
- package/dist/types/lib/xyo.d.ts +4 -0
- package/dist/types/lib/xyo.d.ts.map +1 -0
- package/dist/types/models/ListMode.d.ts +2 -0
- package/dist/types/models/ListMode.d.ts.map +1 -0
- package/dist/types/models/index.d.ts +2 -0
- package/dist/types/models/index.d.ts.map +1 -0
- package/package.json +34 -31
- package/src/components/Ellipsize.tsx +17 -21
- package/src/components/SectionSpacingRow/SectionSpacingRow.tsx +5 -5
- package/src/components/TableCell/AddressTableCell.tsx +5 -5
- package/src/components/TableCell/EllipsisTableCell.tsx +23 -25
- package/src/components/bigint/TextField.tsx +5 -14
- package/src/contexts/ListMode/Provider.tsx +2 -2
- package/src/contexts/contextEx/use.ts +3 -3
- package/src/contexts/diviner/Provider.tsx +3 -3
- package/src/hooks/useShareForwardRef.ts +1 -1
- package/dist/browser/index.d.ts +0 -343
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TableCellProps } from '@mui/material'
|
|
2
2
|
import { styled, TableCell } from '@mui/material'
|
|
3
3
|
import { asLinkHrefOrToProps, LinkEx } from '@xylabs/react-link'
|
|
4
|
-
import React, {
|
|
4
|
+
import React, { useMemo } from 'react'
|
|
5
5
|
import type { To } from 'react-router-dom'
|
|
6
6
|
|
|
7
7
|
import { EllipsizeBox } from '../Ellipsize.tsx'
|
|
@@ -26,30 +26,28 @@ export interface EllipsisTableCellProps extends Omit<TableCellProps, 'ref'> {
|
|
|
26
26
|
width?: string | number
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export const EllipsisTableCellWithRef =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
)
|
|
29
|
+
export const EllipsisTableCellWithRef = ({
|
|
30
|
+
ref, children, href, link = false, to, value, ...props
|
|
31
|
+
}: EllipsisTableCellProps & { ref?: React.RefObject<HTMLDivElement | null> }) => {
|
|
32
|
+
const data = useMemo(() => {
|
|
33
|
+
if (children) {
|
|
34
|
+
return children
|
|
35
|
+
}
|
|
36
|
+
if (href || link || to) {
|
|
37
|
+
return (
|
|
38
|
+
<LinkEx title={value} {...asLinkHrefOrToProps({ to, href })} target={href ? '_blank' : undefined}>
|
|
39
|
+
{value}
|
|
40
|
+
</LinkEx>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
return value
|
|
44
|
+
}, [children, href, link, to, value])
|
|
45
|
+
return (
|
|
46
|
+
<EllipsisTableCellRoot {...props}>
|
|
47
|
+
<EllipsizeBox ref={ref} sx={{ cursor: link || to || href ? 'pointer' : 'inherit' }}>{data}</EllipsizeBox>
|
|
48
|
+
</EllipsisTableCellRoot>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
53
51
|
|
|
54
52
|
EllipsisTableCellWithRef.displayName = 'EllipsisTableCell'
|
|
55
53
|
export const EllipsisTableCell = EllipsisTableCellWithRef
|
|
@@ -2,6 +2,7 @@ import type { FormControlProps, StandardTextFieldProps } from '@mui/material'
|
|
|
2
2
|
import {
|
|
3
3
|
FormControl, FormHelperText, TextField,
|
|
4
4
|
} from '@mui/material'
|
|
5
|
+
import { toFixedPoint } from '@xylabs/decimal-precision'
|
|
5
6
|
import type { FocusEventHandler } from 'react'
|
|
6
7
|
import React, {
|
|
7
8
|
useEffect, useMemo, useState,
|
|
@@ -20,14 +21,12 @@ export interface BigIntTextFieldProps extends StandardTextFieldProps {
|
|
|
20
21
|
export const BigIntTextField: React.FC<BigIntTextFieldProps> = ({
|
|
21
22
|
defaultFixedPoint = 18, defaultRawValue, helperText, hideAdornment, onChangeFixedPoint, onChange, resetValue, ...props
|
|
22
23
|
}) => {
|
|
23
|
-
const [value, setValue] = useState<number | undefined>()
|
|
24
24
|
const [rawValue, setRawValue] = useState<string>('')
|
|
25
25
|
const [fixedPoint, setFixedPoint] = useState(defaultFixedPoint)
|
|
26
26
|
const [error, setError] = useState<Error>()
|
|
27
27
|
|
|
28
28
|
useMemo(() => {
|
|
29
29
|
setRawValue('')
|
|
30
|
-
setValue(undefined)
|
|
31
30
|
}, [resetValue])
|
|
32
31
|
|
|
33
32
|
const handleRawValueChange = (rawValue: string) => {
|
|
@@ -36,19 +35,11 @@ export const BigIntTextField: React.FC<BigIntTextFieldProps> = ({
|
|
|
36
35
|
// only allow one decimal point
|
|
37
36
|
if (filteredValue.split('.').length > 2) return
|
|
38
37
|
setRawValue(filteredValue)
|
|
39
|
-
|
|
40
|
-
// parse the raw filtered raw value
|
|
41
|
-
const value = Number.parseFloat(filteredValue)
|
|
42
|
-
// if the value is NaN set it to 0
|
|
43
|
-
if (Number.isNaN(value)) setValue(undefined)
|
|
44
|
-
setValue(value)
|
|
45
38
|
}
|
|
46
39
|
|
|
47
40
|
useMemo(() => {
|
|
48
41
|
if (defaultRawValue) {
|
|
49
42
|
handleRawValueChange(defaultRawValue)
|
|
50
|
-
} else {
|
|
51
|
-
setValue(undefined)
|
|
52
43
|
}
|
|
53
44
|
}, [defaultRawValue])
|
|
54
45
|
|
|
@@ -62,11 +53,11 @@ export const BigIntTextField: React.FC<BigIntTextFieldProps> = ({
|
|
|
62
53
|
|
|
63
54
|
// on value or point changes, run the bigInt callback
|
|
64
55
|
const bigIntValue = useMemo(() => {
|
|
65
|
-
if (
|
|
66
|
-
const fixedValue =
|
|
56
|
+
if (rawValue) {
|
|
57
|
+
const fixedValue = toFixedPoint(rawValue)
|
|
67
58
|
setError(undefined)
|
|
68
59
|
try {
|
|
69
|
-
return
|
|
60
|
+
return fixedValue
|
|
70
61
|
} catch (e) {
|
|
71
62
|
console.error(e)
|
|
72
63
|
setError(e as Error)
|
|
@@ -76,7 +67,7 @@ export const BigIntTextField: React.FC<BigIntTextFieldProps> = ({
|
|
|
76
67
|
return
|
|
77
68
|
}
|
|
78
69
|
// run bigInt callback
|
|
79
|
-
}, [
|
|
70
|
+
}, [rawValue, fixedPoint])
|
|
80
71
|
|
|
81
72
|
useEffect(() => {
|
|
82
73
|
onChangeFixedPoint?.(bigIntValue)
|
|
@@ -19,10 +19,10 @@ export const ListModeProvider: React.FC<PropsWithChildren<ListModeProviderProps>
|
|
|
19
19
|
setListMode])
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
|
-
<ListModeContext
|
|
22
|
+
<ListModeContext
|
|
23
23
|
value={value}
|
|
24
24
|
>
|
|
25
25
|
{children}
|
|
26
|
-
</ListModeContext
|
|
26
|
+
</ListModeContext>
|
|
27
27
|
)
|
|
28
28
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Context } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { use } from 'react'
|
|
3
3
|
|
|
4
4
|
import type { ContextExState } from './State.ts'
|
|
5
5
|
|
|
6
6
|
export const useContextEx = <T extends ContextExState>(context: Context<T>, contextName: string, required = true) => {
|
|
7
|
-
const { provided, ...props } =
|
|
7
|
+
const { provided, ...props } = use(context)
|
|
8
8
|
if (!provided && required) {
|
|
9
9
|
throw new Error(`use${contextName} can not be used outside of a ${contextName}Context when required=true`)
|
|
10
10
|
}
|
|
@@ -12,6 +12,6 @@ export const useContextEx = <T extends ContextExState>(context: Context<T>, cont
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const useProvided = <T extends ContextExState>(context: Context<T>) => {
|
|
15
|
-
const { provided } =
|
|
15
|
+
const { provided } = use(context)
|
|
16
16
|
return provided
|
|
17
17
|
}
|
|
@@ -12,7 +12,7 @@ export interface DivinerProviderProps<D> extends ContextExProviderProps, PropsWi
|
|
|
12
12
|
|
|
13
13
|
/** Exposes a resolved diviner */
|
|
14
14
|
export const ResolvedDivinerProvider = <D,>({
|
|
15
|
-
diviner: divinerProp, required = false, children, context,
|
|
15
|
+
diviner: divinerProp, required = false, children, context: Context,
|
|
16
16
|
}: DivinerProviderProps<D>) => {
|
|
17
17
|
const [diviner, setDiviner] = useResetState<D | undefined>(divinerProp)
|
|
18
18
|
|
|
@@ -33,7 +33,7 @@ export const ResolvedDivinerProvider = <D,>({
|
|
|
33
33
|
setDiviner, divinerProp])
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
|
-
<
|
|
36
|
+
<Context
|
|
37
37
|
value={value}
|
|
38
38
|
>
|
|
39
39
|
{diviner
|
|
@@ -41,6 +41,6 @@ export const ResolvedDivinerProvider = <D,>({
|
|
|
41
41
|
: required
|
|
42
42
|
? null
|
|
43
43
|
: children}
|
|
44
|
-
</
|
|
44
|
+
</Context>
|
|
45
45
|
)
|
|
46
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ForwardedRef } from 'react'
|
|
2
2
|
import { useEffect, useRef } from 'react'
|
|
3
3
|
|
|
4
|
-
export const useShareForwardedRef = <T>(forwardedRef: ForwardedRef<T
|
|
4
|
+
export const useShareForwardedRef = <T>(forwardedRef: ForwardedRef<T> | null | undefined, refresh = 0) => {
|
|
5
5
|
// final ref that will share value with forward ref. this is the one to be attached to components
|
|
6
6
|
const innerRef = useRef<T>(null)
|
|
7
7
|
|
package/dist/browser/index.d.ts
DELETED
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
import { TypographyProps, PopoverProps, StandardTextFieldProps, FormControlProps, InputAdornmentProps, BoxProps, TypographyTypeMap, StackProps, ListItemButtonProps, AlertProps, TableCellProps, AvatarProps, AvatarGroupProps, PaperProps, CardHeaderProps, SvgIconProps } from '@mui/material';
|
|
2
|
-
export { useMediaQuery } from '@mui/material';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import React__default, { ReactElement, PropsWithChildren, ReactNode, Context, Dispatch, SetStateAction, CSSProperties, ForwardedRef } from 'react';
|
|
5
|
-
import * as _xylabs_react_flexbox from '@xylabs/react-flexbox';
|
|
6
|
-
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
7
|
-
import { To, NavigateOptions } from 'react-router-dom';
|
|
8
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
|
-
import { Hash } from '@xylabs/hex';
|
|
10
|
-
import * as _mui_styles from '@mui/styles';
|
|
11
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
12
|
-
import { BoundWitness } from '@xyo-network/boundwitness-model';
|
|
13
|
-
|
|
14
|
-
declare const Ampersand: React__default.FC<TypographyProps>;
|
|
15
|
-
|
|
16
|
-
interface BasicHeroProps extends FlexBoxProps {
|
|
17
|
-
backgroundColor?: string;
|
|
18
|
-
backgroundImage?: string;
|
|
19
|
-
button1Href?: string;
|
|
20
|
-
button1Text?: string;
|
|
21
|
-
button1To?: string;
|
|
22
|
-
button2Href?: string;
|
|
23
|
-
button2Text?: string;
|
|
24
|
-
button2To?: string;
|
|
25
|
-
desc: string;
|
|
26
|
-
gradientTitle?: string;
|
|
27
|
-
heroImage?: string;
|
|
28
|
-
subLinkIcon?: ReactElement;
|
|
29
|
-
subLinkPath?: string;
|
|
30
|
-
subLinkText1?: string;
|
|
31
|
-
subLinkText2?: string;
|
|
32
|
-
sx?: Record<string, string>;
|
|
33
|
-
textColor?: string;
|
|
34
|
-
title: string;
|
|
35
|
-
title2?: string;
|
|
36
|
-
}
|
|
37
|
-
declare const BasicHero: React__default.FC<BasicHeroProps>;
|
|
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
|
-
defaultRawValue?: string;
|
|
49
|
-
hideAdornment?: boolean;
|
|
50
|
-
onChangeFixedPoint?: (value?: bigint) => void;
|
|
51
|
-
resetValue?: number;
|
|
52
|
-
}
|
|
53
|
-
declare const BigIntTextField: React__default.FC<BigIntTextFieldProps>;
|
|
54
|
-
interface InputWithFormControlProps extends FormControlProps {
|
|
55
|
-
textFieldProps?: BigIntTextFieldProps;
|
|
56
|
-
}
|
|
57
|
-
declare const WithFormControl: React__default.FC<InputWithFormControlProps>;
|
|
58
|
-
|
|
59
|
-
declare const BigIntInput: {
|
|
60
|
-
TextField: React.FC<BigIntTextFieldProps>;
|
|
61
|
-
WithFormControl: React.FC<InputWithFormControlProps>;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
interface FixedPointInputAdornmentProps extends InputAdornmentProps {
|
|
65
|
-
fixedPoint?: number;
|
|
66
|
-
minFixedPoint?: number;
|
|
67
|
-
onFixedPointChange?: (value: number) => void;
|
|
68
|
-
}
|
|
69
|
-
declare const FixedPointInputAdornment: React__default.FC<FixedPointInputAdornmentProps>;
|
|
70
|
-
|
|
71
|
-
interface EllipsizeRootProps extends BoxProps {
|
|
72
|
-
beforeLineHeight?: string | number;
|
|
73
|
-
}
|
|
74
|
-
type TypographyWithComponentProps<D extends React__default.ElementType = TypographyTypeMap['defaultComponent'], P = {}> = TypographyProps<D, P> & {
|
|
75
|
-
ellipsisPosition?: 'start' | 'end';
|
|
76
|
-
};
|
|
77
|
-
interface EllipsizeBoxProps extends BoxProps {
|
|
78
|
-
disableSharedRef?: boolean;
|
|
79
|
-
ellipsisPosition?: 'start' | 'end';
|
|
80
|
-
typographyProps?: TypographyWithComponentProps;
|
|
81
|
-
}
|
|
82
|
-
declare const EllipsizeBox: React__default.ForwardRefExoticComponent<Omit<PropsWithChildren<EllipsizeBoxProps>, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
83
|
-
|
|
84
|
-
interface LabeledTextFieldWrapperProps extends StackProps {
|
|
85
|
-
label: string;
|
|
86
|
-
}
|
|
87
|
-
declare const LabeledTextFieldWrapper: React__default.FC<LabeledTextFieldWrapperProps>;
|
|
88
|
-
|
|
89
|
-
interface ListItemButtonExProps extends ListItemButtonProps {
|
|
90
|
-
target?: string;
|
|
91
|
-
to?: To;
|
|
92
|
-
toOptions?: NavigateOptions;
|
|
93
|
-
}
|
|
94
|
-
declare const ListItemButtonExTo: React__default.FC<ListItemButtonExProps>;
|
|
95
|
-
declare const ListItemButtonEx: React__default.FC<ListItemButtonExProps>;
|
|
96
|
-
|
|
97
|
-
interface LoadResultProps<T> {
|
|
98
|
-
apiError?: Error;
|
|
99
|
-
error?: boolean;
|
|
100
|
-
notFound: boolean;
|
|
101
|
-
searchResult: T | undefined;
|
|
102
|
-
}
|
|
103
|
-
declare function LoadResult<T>(props: PropsWithChildren<LoadResultProps<T>>): react_jsx_runtime.JSX.Element;
|
|
104
|
-
|
|
105
|
-
declare const NotFound: React__default.FC<FlexBoxProps>;
|
|
106
|
-
|
|
107
|
-
declare const Pipe: React__default.FC<TypographyProps>;
|
|
108
|
-
|
|
109
|
-
interface PayloadDataMissingProps extends AlertProps {
|
|
110
|
-
alertBody?: string;
|
|
111
|
-
}
|
|
112
|
-
declare const PayloadDataMissing: React__default.FC<PayloadDataMissingProps>;
|
|
113
|
-
|
|
114
|
-
declare const ScrollTableOnSm: React__default.FC<PropsWithChildren>;
|
|
115
|
-
|
|
116
|
-
declare const SectionSpacingRow: React__default.ForwardRefExoticComponent<_xylabs_react_flexbox.BusyBoxProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
117
|
-
|
|
118
|
-
interface EllipsisTableCellProps extends Omit<TableCellProps, 'ref'> {
|
|
119
|
-
href?: string;
|
|
120
|
-
link?: boolean;
|
|
121
|
-
to?: To;
|
|
122
|
-
value?: string;
|
|
123
|
-
width?: string | number;
|
|
124
|
-
}
|
|
125
|
-
declare const EllipsisTableCellWithRef: React__default.ForwardRefExoticComponent<EllipsisTableCellProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
126
|
-
declare const EllipsisTableCell: React__default.ForwardRefExoticComponent<EllipsisTableCellProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
127
|
-
|
|
128
|
-
interface AddressTableCellProps extends Omit<EllipsisTableCellProps, 'ref'> {
|
|
129
|
-
archive?: string;
|
|
130
|
-
exploreDomain?: string;
|
|
131
|
-
link?: boolean;
|
|
132
|
-
}
|
|
133
|
-
declare const AddressTableCell: React__default.ForwardRefExoticComponent<AddressTableCellProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
134
|
-
|
|
135
|
-
interface HashTableCellProps extends EllipsisTableCellProps {
|
|
136
|
-
archive?: string;
|
|
137
|
-
dataType?: 'block' | 'payload';
|
|
138
|
-
exploreDomain?: string;
|
|
139
|
-
network?: string;
|
|
140
|
-
onHashClick?: (value: Hash) => void;
|
|
141
|
-
}
|
|
142
|
-
declare const HashTableCell: React__default.FC<HashTableCellProps>;
|
|
143
|
-
|
|
144
|
-
declare const ThemeTokenAvatar: React__default.FC<AvatarProps>;
|
|
145
|
-
|
|
146
|
-
interface ThemeTokenAvatarGroupProps extends AvatarGroupProps {
|
|
147
|
-
images?: string[];
|
|
148
|
-
}
|
|
149
|
-
declare const ThemeTokenAvatarGroup: React__default.FC<ThemeTokenAvatarGroupProps>;
|
|
150
|
-
|
|
151
|
-
interface TokenBarProps extends PaperProps {
|
|
152
|
-
text1?: ReactNode;
|
|
153
|
-
text1Props?: TypographyProps;
|
|
154
|
-
text1Suffix?: ReactNode;
|
|
155
|
-
text2?: ReactNode;
|
|
156
|
-
text2Props?: TypographyProps;
|
|
157
|
-
text2Suffix?: ReactNode;
|
|
158
|
-
}
|
|
159
|
-
declare const TokenBar: React__default.FC<TokenBarProps>;
|
|
160
|
-
|
|
161
|
-
interface TokenData {
|
|
162
|
-
coinmarketcapLink: string;
|
|
163
|
-
etherscanLink: string;
|
|
164
|
-
icon: string;
|
|
165
|
-
readableName: string;
|
|
166
|
-
tokenSymbol: string;
|
|
167
|
-
uniqueTokenId: string;
|
|
168
|
-
}
|
|
169
|
-
declare const TokenData: TokenData[];
|
|
170
|
-
|
|
171
|
-
declare const useGetTokenData: (symbols: (string | undefined)[]) => TokenData[];
|
|
172
|
-
|
|
173
|
-
interface TokenSummaryProps extends CardHeaderProps {
|
|
174
|
-
icon?: string;
|
|
175
|
-
imgBgProps?: AvatarProps;
|
|
176
|
-
symbol?: string;
|
|
177
|
-
symbolElement?: ReactNode;
|
|
178
|
-
}
|
|
179
|
-
declare const TokenSummary: React__default.FC<TokenSummaryProps>;
|
|
180
|
-
|
|
181
|
-
interface TypographyExProps extends TypographyProps {
|
|
182
|
-
gradient?: 'text';
|
|
183
|
-
}
|
|
184
|
-
declare const TypographyEx: React__default.FC<TypographyExProps>;
|
|
185
|
-
|
|
186
|
-
type EmptyObject = {};
|
|
187
|
-
type ContextExProviderProps<T extends EmptyObject = EmptyObject> = PropsWithChildren<{
|
|
188
|
-
required?: boolean;
|
|
189
|
-
} & T>;
|
|
190
|
-
|
|
191
|
-
interface ContextExState {
|
|
192
|
-
provided: boolean;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
declare const createContextEx: <T>() => React.Context<T & ContextExState>;
|
|
196
|
-
|
|
197
|
-
declare const useContextEx: <T extends ContextExState>(context: Context<T>, contextName: string, required?: boolean) => Omit<T, "provided">;
|
|
198
|
-
declare const useProvided: <T extends ContextExState>(context: Context<T>) => boolean;
|
|
199
|
-
|
|
200
|
-
declare const ResolvedDivinerContext: <T>() => React.Context<T & ContextExState>;
|
|
201
|
-
|
|
202
|
-
interface ResolvedDivinerState<T> extends ContextExState {
|
|
203
|
-
diviner?: T;
|
|
204
|
-
setDiviner?: Dispatch<SetStateAction<T | undefined>>;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
interface DivinerProviderProps<D> extends ContextExProviderProps, PropsWithChildren {
|
|
208
|
-
context: Context<ResolvedDivinerState<D>>;
|
|
209
|
-
diviner?: D;
|
|
210
|
-
}
|
|
211
|
-
declare const ResolvedDivinerProvider: <D>({ diviner: divinerProp, required, children, context, }: DivinerProviderProps<D>) => react_jsx_runtime.JSX.Element;
|
|
212
|
-
|
|
213
|
-
type ListMode = 'table' | 'grid' | 'default';
|
|
214
|
-
|
|
215
|
-
interface ListModeContextState extends ContextExState {
|
|
216
|
-
listMode: ListMode;
|
|
217
|
-
setListMode?: Dispatch<ListMode>;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
declare const ListModeContext: React.Context<ListModeContextState & ContextExState>;
|
|
221
|
-
|
|
222
|
-
interface ListModeProviderProps {
|
|
223
|
-
defaultListMode?: ListMode;
|
|
224
|
-
}
|
|
225
|
-
declare const ListModeProvider: React__default.FC<PropsWithChildren<ListModeProviderProps>>;
|
|
226
|
-
|
|
227
|
-
declare const useListMode: (required?: boolean) => Omit<ListModeContextState & ContextExState, "provided">;
|
|
228
|
-
|
|
229
|
-
interface GradientStyles {
|
|
230
|
-
background: CSSProperties;
|
|
231
|
-
border: CSSProperties;
|
|
232
|
-
heading: CSSProperties;
|
|
233
|
-
}
|
|
234
|
-
declare const colorfulGradientLightMode: () => {
|
|
235
|
-
background: {
|
|
236
|
-
backgroundImage: string;
|
|
237
|
-
};
|
|
238
|
-
border: {
|
|
239
|
-
borderImage: string;
|
|
240
|
-
borderImageSlice: number;
|
|
241
|
-
borderImageSource: string;
|
|
242
|
-
borderRadius: number;
|
|
243
|
-
borderStyle: string;
|
|
244
|
-
borderWidth: string;
|
|
245
|
-
};
|
|
246
|
-
heading: {
|
|
247
|
-
WebkitBackgroundClip: string;
|
|
248
|
-
WebkitTextFillColor: string;
|
|
249
|
-
background: string;
|
|
250
|
-
display: string;
|
|
251
|
-
};
|
|
252
|
-
};
|
|
253
|
-
declare const colorfulGradientDarkMode: () => {
|
|
254
|
-
background: {
|
|
255
|
-
backgroundImage: string;
|
|
256
|
-
};
|
|
257
|
-
border: {
|
|
258
|
-
borderImage: string;
|
|
259
|
-
borderImageSlice: number;
|
|
260
|
-
borderImageSource: string;
|
|
261
|
-
borderRadius: number;
|
|
262
|
-
borderStyle: string;
|
|
263
|
-
borderWidth: string;
|
|
264
|
-
};
|
|
265
|
-
heading: {
|
|
266
|
-
WebkitBackgroundClip: string;
|
|
267
|
-
WebkitTextFillColor: string;
|
|
268
|
-
background: string;
|
|
269
|
-
display: string;
|
|
270
|
-
};
|
|
271
|
-
};
|
|
272
|
-
declare const useGradientStyles: () => {
|
|
273
|
-
classes: (props?: any) => _mui_styles.ClassNameMap<"border" | "background" | "heading">;
|
|
274
|
-
styles: {
|
|
275
|
-
background: {
|
|
276
|
-
backgroundImage: string;
|
|
277
|
-
};
|
|
278
|
-
border: {
|
|
279
|
-
borderImage: string;
|
|
280
|
-
borderImageSlice: number;
|
|
281
|
-
borderImageSource: string;
|
|
282
|
-
borderRadius: number;
|
|
283
|
-
borderStyle: string;
|
|
284
|
-
borderWidth: string;
|
|
285
|
-
};
|
|
286
|
-
heading: {
|
|
287
|
-
WebkitBackgroundClip: string;
|
|
288
|
-
WebkitTextFillColor: string;
|
|
289
|
-
background: string;
|
|
290
|
-
display: string;
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
type ValidatedResponse<T extends Payload = Payload> = {
|
|
296
|
-
errors?: Error[];
|
|
297
|
-
payload?: T;
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
declare const useValidateBoundWitness: (input?: string) => ValidatedResponse<BoundWitness>;
|
|
301
|
-
|
|
302
|
-
declare const usePayloadHash: <TPayload extends Payload>(payload: TPayload | undefined | null) => Lowercase<string> | undefined;
|
|
303
|
-
declare const usePayloadRootHash: <TPayload extends Payload>(payload: TPayload | undefined | null) => Lowercase<string> | undefined;
|
|
304
|
-
declare const usePayloadHashes: <TPayload extends Payload>(payloads: TPayload[] | undefined | null) => [TPayload, Lowercase<string>][] | undefined;
|
|
305
|
-
|
|
306
|
-
declare const usePayloadValidate: <TPayload extends Payload>(input?: string) => ValidatedResponse;
|
|
307
|
-
|
|
308
|
-
declare const useDataState: <T>(defaultValue: T | undefined) => [T | undefined, Dispatch<SetStateAction<T | undefined>>];
|
|
309
|
-
|
|
310
|
-
declare const useIsMobile: () => boolean;
|
|
311
|
-
declare const useIsSmall: () => boolean;
|
|
312
|
-
|
|
313
|
-
declare const useShareForwardedRef: <T>(forwardedRef: ForwardedRef<T>, refresh?: number) => React.RefObject<T>;
|
|
314
|
-
|
|
315
|
-
declare const assertDefinedEx: <T>(expr?: T | null, message?: string) => T;
|
|
316
|
-
|
|
317
|
-
declare const parseMeausureString: (measure?: string, absolute?: number) => number | undefined;
|
|
318
|
-
declare const parsePadding: (padding: string) => {
|
|
319
|
-
bottom: string;
|
|
320
|
-
left: string;
|
|
321
|
-
right: string;
|
|
322
|
-
top: string;
|
|
323
|
-
} | {
|
|
324
|
-
bottom: string;
|
|
325
|
-
right: string;
|
|
326
|
-
top: string;
|
|
327
|
-
left?: undefined;
|
|
328
|
-
} | undefined;
|
|
329
|
-
declare const getActualPaddingX: (element: HTMLElement) => number;
|
|
330
|
-
|
|
331
|
-
type NetworkComponentSlug = 'sentinel' | 'bridge' | 'archivist' | 'diviner' | 'node' | 'witness';
|
|
332
|
-
interface NetworkComponentDetails {
|
|
333
|
-
icon: (props?: SvgIconProps) => ReactElement;
|
|
334
|
-
name: string;
|
|
335
|
-
slug: NetworkComponentSlug;
|
|
336
|
-
}
|
|
337
|
-
declare const networkComponents: NetworkComponentDetails[];
|
|
338
|
-
declare const findNetworkComponentIndex: (slug: string) => number;
|
|
339
|
-
declare const findNetworkComponent: (slug: string) => NetworkComponentDetails | undefined;
|
|
340
|
-
|
|
341
|
-
type SizeProp = 'small' | 'medium' | 'large';
|
|
342
|
-
|
|
343
|
-
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 };
|