@xyo-network/react-address-render 2.60.10 → 2.60.12

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.
@@ -1,20 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ListItemIcon, ListItemText, useTheme } from '@mui/material';
3
- import { FlexGrowRow } from '@xylabs/react-flexbox';
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(FlexGrowRow, { gap: 2, justifyContent: "flex-start", ref: elementRef, onClick: () => {
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(ListItemText, { sx: { my: 0 }, children: _jsx(EllipsizeBox, { 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] }));
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,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAgB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,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;AAc/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAC3C,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,GAAG,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACnI,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IAExB,MAAM,SAAS,GAAG,oBAAoB,CAAC,GAA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AE,CAAC,EAAE,YAC/B,KAAC,SAAS,IAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAI,GAChC,CAChB,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACjB,KAAC,YAAY,IACX,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,KAAK,EACvB,KAAK,EAAC,MAAM,EACZ,eAAe,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,EAAE,YAE7D,IAAI,IAAI,OAAO,GACH,CAChB,EACA,QAAQ,EACR,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,CACzB,KAAC,kBAAkB,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,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
- import { WithChildren } from '@xylabs/react-shared';
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,EAAe,MAAM,uBAAuB,CAAA;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAOnD,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,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,MAAM,WAAW,wBAAyB,SAAQ,YAAY,EAAE,4BAA4B,EAAE,YAAY;CAAG;AAE7G,eAAO,MAAM,mBAAmB,kHAsC/B,CAAA"}
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.10",
17
- "@xyo-network/react-shared": "~2.60.10"
16
+ "@xyo-network/react-event": "~2.60.12",
17
+ "@xyo-network/react-shared": "~2.60.12"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@mui/icons-material": "^5",
@@ -28,10 +28,10 @@
28
28
  "description": "Common React library for all XYO projects that use React",
29
29
  "devDependencies": {
30
30
  "@storybook/react": "^7.4.0",
31
- "@xylabs/ts-scripts-yarn3": "^2.19.3",
32
- "@xylabs/tsconfig-react": "^2.19.3",
33
- "@xyo-network/account": "^2.72.7",
34
- "@xyo-network/react-event": "~2.60.10",
31
+ "@xylabs/ts-scripts-yarn3": "^2.19.4",
32
+ "@xylabs/tsconfig-react": "^2.19.4",
33
+ "@xyo-network/account": "^2.72.9",
34
+ "@xyo-network/react-event": "~2.60.12",
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.10"
79
+ "version": "2.60.12"
80
80
  }
@@ -1,15 +1,15 @@
1
- import { ListItemIcon, ListItemText, useTheme } from '@mui/material'
2
- import { FlexBoxProps, FlexGrowRow } from '@xylabs/react-flexbox'
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 AddressRenderRowBoxPropsBase {
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
- ({ address, children, favorite: favoriteProp = false, iconOnly, iconSize = 24, icons, name, showFavorite = false, ...props }, ref) => {
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
- <FlexGrowRow
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
- <ListItemText sx={{ my: 0 }}>
49
- <EllipsizeBox ellipsisPosition={'end'} width="100%" typographyProps={{ fontSize: theme.typography.body1.fontSize }}>
50
- {name ?? address}
51
- </EllipsizeBox>
52
- </ListItemText>
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
- </FlexGrowRow>
62
+ </FlexRow>
59
63
  )
60
64
  },
61
65
  )