@xyo-network/react-address-render 2.60.10 → 2.60.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/RenderRowBox.js +3 -3
- package/dist/cjs/components/RenderRowBox.js.map +1 -1
- package/dist/docs.json +916 -1167
- package/dist/esm/components/RenderRowBox.js +5 -5
- package/dist/esm/components/RenderRowBox.js.map +1 -1
- package/dist/types/components/RenderRowBox.d.ts +2 -4
- package/dist/types/components/RenderRowBox.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/RenderRowBox.tsx +18 -14
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ListItemIcon,
|
|
3
|
-
import {
|
|
2
|
+
import { ListItemIcon, useTheme } from '@mui/material';
|
|
3
|
+
import { FlexRow } from '@xylabs/react-flexbox';
|
|
4
4
|
import { Identicon } from '@xylabs/react-identicon';
|
|
5
5
|
import { useEvent } from '@xyo-network/react-event';
|
|
6
6
|
import { EllipsizeBox, useShareForwardedRef } from '@xyo-network/react-shared';
|
|
7
7
|
import { forwardRef } from 'react';
|
|
8
8
|
import { FavoriteIconButton } from './favorite';
|
|
9
|
-
export const AddressRenderRowBox = forwardRef(({ address, children, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props }, ref) => {
|
|
9
|
+
export const AddressRenderRowBox = forwardRef(({ address, children, disableSharedRef, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props }, ref) => {
|
|
10
10
|
const theme = useTheme();
|
|
11
11
|
const sharedRef = useShareForwardedRef(ref);
|
|
12
12
|
const [elementRef, dispatch] = useEvent(undefined, sharedRef);
|
|
13
|
-
return (_jsxs(
|
|
13
|
+
return (_jsxs(FlexRow, { gap: 2, justifyContent: "flex-start", ref: elementRef, onClick: () => {
|
|
14
14
|
if (address) {
|
|
15
15
|
dispatch('address', 'click', address);
|
|
16
16
|
}
|
|
17
|
-
}, ...props, children: [icons && address ? (_jsx(ListItemIcon, { sx: { minWidth: 0 }, children: _jsx(Identicon, { size: iconSize, value: address }) })) : null, iconOnly ? null : (_jsx(
|
|
17
|
+
}, ...props, children: [icons && address ? (_jsx(ListItemIcon, { sx: { minWidth: 0 }, children: _jsx(Identicon, { size: iconSize, value: address }) })) : null, iconOnly ? null : (_jsx(EllipsizeBox, { disableSharedRef: disableSharedRef, ellipsisPosition: 'end', width: "100%", typographyProps: { fontSize: theme.typography.body1.fontSize }, children: name ?? address })), children, showFavorite && address ? (_jsx(FavoriteIconButton, { name: name, size: 'small', value: address, valueType: 'address', favorite: favoriteProp })) : null] }));
|
|
18
18
|
});
|
|
19
19
|
AddressRenderRowBox.displayName = 'AddressRenderRowBox';
|
|
20
20
|
//# sourceMappingURL=RenderRowBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderRowBox.js","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"RenderRowBox.js","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAgB,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAa/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAC3C,CACE,EAAE,OAAO,EAA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,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,GAAI,CAChH,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
3
|
-
|
|
4
|
-
export interface AddressRenderRowBoxPropsBase {
|
|
3
|
+
export interface AddressRenderRowBoxProps extends FlexBoxProps {
|
|
5
4
|
address?: string | null;
|
|
5
|
+
disableSharedRef?: boolean;
|
|
6
6
|
favorite?: boolean;
|
|
7
7
|
iconOnly?: boolean;
|
|
8
8
|
iconSize?: number;
|
|
@@ -10,7 +10,5 @@ export interface AddressRenderRowBoxPropsBase {
|
|
|
10
10
|
name?: string;
|
|
11
11
|
showFavorite?: boolean;
|
|
12
12
|
}
|
|
13
|
-
export interface AddressRenderRowBoxProps extends WithChildren, AddressRenderRowBoxPropsBase, FlexBoxProps {
|
|
14
|
-
}
|
|
15
13
|
export declare const AddressRenderRowBox: import("react").ForwardRefExoticComponent<AddressRenderRowBoxProps & import("react").RefAttributes<HTMLElement>>;
|
|
16
14
|
//# sourceMappingURL=RenderRowBox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderRowBox.d.ts","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"RenderRowBox.d.ts","sourceRoot":"","sources":["../../../src/components/RenderRowBox.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAQ7D,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,eAAO,MAAM,mBAAmB,kHA4C/B,CAAA"}
|
package/package.json
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"@xylabs/react-flexbox": "~2.17.15",
|
|
14
14
|
"@xylabs/react-identicon": "~2.17.15",
|
|
15
15
|
"@xylabs/react-shared": "~2.17.15",
|
|
16
|
-
"@xyo-network/react-event": "~2.60.
|
|
17
|
-
"@xyo-network/react-shared": "~2.60.
|
|
16
|
+
"@xyo-network/react-event": "~2.60.11",
|
|
17
|
+
"@xyo-network/react-shared": "~2.60.11"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@mui/icons-material": "^5",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@xylabs/ts-scripts-yarn3": "^2.19.3",
|
|
32
32
|
"@xylabs/tsconfig-react": "^2.19.3",
|
|
33
33
|
"@xyo-network/account": "^2.72.7",
|
|
34
|
-
"@xyo-network/react-event": "~2.60.
|
|
34
|
+
"@xyo-network/react-event": "~2.60.11",
|
|
35
35
|
"typescript": "^5.2.2"
|
|
36
36
|
},
|
|
37
37
|
"browser": "dist/esm/index.js",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
},
|
|
77
77
|
"sideEffects": false,
|
|
78
78
|
"types": "dist/types/index.d.ts",
|
|
79
|
-
"version": "2.60.
|
|
79
|
+
"version": "2.60.11"
|
|
80
80
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ListItemIcon,
|
|
2
|
-
import { FlexBoxProps,
|
|
1
|
+
import { ListItemIcon, useTheme } from '@mui/material'
|
|
2
|
+
import { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'
|
|
3
3
|
import { Identicon } from '@xylabs/react-identicon'
|
|
4
|
-
import { WithChildren } from '@xylabs/react-shared'
|
|
5
4
|
import { useEvent } from '@xyo-network/react-event'
|
|
6
5
|
import { EllipsizeBox, useShareForwardedRef } from '@xyo-network/react-shared'
|
|
7
6
|
import { forwardRef } from 'react'
|
|
8
7
|
|
|
9
8
|
import { FavoriteIconButton } from './favorite'
|
|
10
9
|
|
|
11
|
-
export interface
|
|
10
|
+
export interface AddressRenderRowBoxProps extends FlexBoxProps {
|
|
12
11
|
address?: string | null
|
|
12
|
+
disableSharedRef?: boolean
|
|
13
13
|
favorite?: boolean
|
|
14
14
|
iconOnly?: boolean
|
|
15
15
|
iconSize?: number
|
|
@@ -18,17 +18,18 @@ export interface AddressRenderRowBoxPropsBase {
|
|
|
18
18
|
showFavorite?: boolean
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export interface AddressRenderRowBoxProps extends WithChildren, AddressRenderRowBoxPropsBase, FlexBoxProps {}
|
|
22
|
-
|
|
23
21
|
export const AddressRenderRowBox = forwardRef<HTMLElement, AddressRenderRowBoxProps>(
|
|
24
|
-
(
|
|
22
|
+
(
|
|
23
|
+
{ address, children, disableSharedRef, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props },
|
|
24
|
+
ref,
|
|
25
|
+
) => {
|
|
25
26
|
const theme = useTheme()
|
|
26
27
|
|
|
27
28
|
const sharedRef = useShareForwardedRef(ref)
|
|
28
29
|
const [elementRef, dispatch] = useEvent(undefined, sharedRef)
|
|
29
30
|
|
|
30
31
|
return (
|
|
31
|
-
<
|
|
32
|
+
<FlexRow
|
|
32
33
|
gap={2}
|
|
33
34
|
justifyContent="flex-start"
|
|
34
35
|
ref={elementRef}
|
|
@@ -45,17 +46,20 @@ export const AddressRenderRowBox = forwardRef<HTMLElement, AddressRenderRowBoxPr
|
|
|
45
46
|
</ListItemIcon>
|
|
46
47
|
) : null}
|
|
47
48
|
{iconOnly ? null : (
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
<EllipsizeBox
|
|
50
|
+
disableSharedRef={disableSharedRef}
|
|
51
|
+
ellipsisPosition={'end'}
|
|
52
|
+
width="100%"
|
|
53
|
+
typographyProps={{ fontSize: theme.typography.body1.fontSize }}
|
|
54
|
+
>
|
|
55
|
+
{name ?? address}
|
|
56
|
+
</EllipsizeBox>
|
|
53
57
|
)}
|
|
54
58
|
{children}
|
|
55
59
|
{showFavorite && address ? (
|
|
56
60
|
<FavoriteIconButton name={name} size={'small'} value={address} valueType={'address'} favorite={favoriteProp} />
|
|
57
61
|
) : null}
|
|
58
|
-
</
|
|
62
|
+
</FlexRow>
|
|
59
63
|
)
|
|
60
64
|
},
|
|
61
65
|
)
|