@xylabs/sdk-react 2.9.33 → 2.9.36

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.
Files changed (57) hide show
  1. package/dist/cjs5/components/EthAccount/EthAccount.stories.d.ts +3 -1
  2. package/dist/cjs5/components/EthAccount/EthAccountProps.d.ts +1 -0
  3. package/dist/cjs5/components/LinkEx/LinkToEx.d.ts +4 -2
  4. package/dist/cjs5/components/LinkEx/index.d.ts +1 -2
  5. package/dist/cjs5/index.js +12 -4
  6. package/dist/cjs5/index.js.map +1 -1
  7. package/dist/components/BasePage/BasePage.stories.js +2 -1
  8. package/dist/components/BasePage/BasePage.stories.js.map +1 -1
  9. package/dist/components/EthAccount/EthAccount.js +2 -2
  10. package/dist/components/EthAccount/EthAccount.js.map +1 -1
  11. package/dist/components/EthAccount/EthAccount.stories.d.ts +3 -1
  12. package/dist/components/EthAccount/EthAccount.stories.js +18 -1
  13. package/dist/components/EthAccount/EthAccount.stories.js.map +1 -1
  14. package/dist/components/EthAccount/EthAccountProps.d.ts +1 -0
  15. package/dist/components/LinkEx/LinkToEx.d.ts +4 -2
  16. package/dist/components/LinkEx/LinkToEx.js +10 -3
  17. package/dist/components/LinkEx/LinkToEx.js.map +1 -1
  18. package/dist/components/LinkEx/index.d.ts +1 -2
  19. package/dist/components/LinkEx/index.js +1 -2
  20. package/dist/components/LinkEx/index.js.map +1 -1
  21. package/dist/esm2015/components/EthAccount/EthAccount.stories.d.ts +3 -1
  22. package/dist/esm2015/components/EthAccount/EthAccountProps.d.ts +1 -0
  23. package/dist/esm2015/components/LinkEx/LinkToEx.d.ts +4 -2
  24. package/dist/esm2015/components/LinkEx/index.d.ts +1 -2
  25. package/dist/esm2015/index.js +12 -5
  26. package/dist/esm2015/index.js.map +1 -1
  27. package/dist/esm2017/components/EthAccount/EthAccount.stories.d.ts +3 -1
  28. package/dist/esm2017/components/EthAccount/EthAccountProps.d.ts +1 -0
  29. package/dist/esm2017/components/LinkEx/LinkToEx.d.ts +4 -2
  30. package/dist/esm2017/components/LinkEx/index.d.ts +1 -2
  31. package/dist/esm2017/index.js +12 -5
  32. package/dist/esm2017/index.js.map +1 -1
  33. package/dist/esm5/components/EthAccount/EthAccount.stories.d.ts +3 -1
  34. package/dist/esm5/components/EthAccount/EthAccountProps.d.ts +1 -0
  35. package/dist/esm5/components/LinkEx/LinkToEx.d.ts +4 -2
  36. package/dist/esm5/components/LinkEx/index.d.ts +1 -2
  37. package/dist/esm5/index.js +12 -5
  38. package/dist/esm5/index.js.map +1 -1
  39. package/dist/node/components/EthAccount/EthAccount.stories.d.ts +3 -1
  40. package/dist/node/components/EthAccount/EthAccountProps.d.ts +1 -0
  41. package/dist/node/components/LinkEx/LinkToEx.d.ts +4 -2
  42. package/dist/node/components/LinkEx/index.d.ts +1 -2
  43. package/dist/node/index.js +12 -4
  44. package/dist/node/index.js.map +1 -1
  45. package/dist/node-esm/components/EthAccount/EthAccount.stories.d.ts +3 -1
  46. package/dist/node-esm/components/EthAccount/EthAccountProps.d.ts +1 -0
  47. package/dist/node-esm/components/LinkEx/LinkToEx.d.ts +4 -2
  48. package/dist/node-esm/components/LinkEx/index.d.ts +1 -2
  49. package/dist/node-esm/index.js +12 -5
  50. package/dist/node-esm/index.js.map +1 -1
  51. package/package.json +15 -12
  52. package/src/components/BasePage/BasePage.stories.tsx +6 -1
  53. package/src/components/EthAccount/EthAccount.stories.tsx +20 -1
  54. package/src/components/EthAccount/EthAccount.tsx +2 -1
  55. package/src/components/EthAccount/EthAccountProps.tsx +1 -0
  56. package/src/components/LinkEx/LinkToEx.tsx +11 -4
  57. package/src/components/LinkEx/index.ts +1 -3
@@ -14,6 +14,7 @@ const EthAccount: React.FC<EthAccountProps> = ({
14
14
  icon = false,
15
15
  iconSize = 16,
16
16
  iconOnly = false,
17
+ shortenedLength,
17
18
  addressLength = 'auto',
18
19
  fontFamily = '"Source Code Pro",monospace',
19
20
  toEtherScan,
@@ -40,7 +41,7 @@ const EthAccount: React.FC<EthAccountProps> = ({
40
41
  addressLength === 'long'
41
42
  ? addressToDisplay.toString()
42
43
  : addressLength === 'short'
43
- ? addressToDisplay.toShortString()
44
+ ? addressToDisplay.toShortString(shortenedLength)
44
45
  : large
45
46
  ? addressToDisplay.toString()
46
47
  : addressToDisplay.toShortString()
@@ -6,6 +6,7 @@ import { ButtonExProps } from '../ButtonEx'
6
6
  interface EthAccountProps extends ButtonExProps {
7
7
  address?: EthAddress | null
8
8
  addressLength?: 'auto' | 'short' | 'long'
9
+ shortenedLength?: number
9
10
  full?: boolean
10
11
  icon?: boolean
11
12
  iconSize?: number
@@ -3,11 +3,18 @@ import React from 'react'
3
3
  import { Link as RouterLink, To } from 'react-router-dom'
4
4
 
5
5
  interface Props extends LinkProps {
6
- to: To
6
+ to?: To
7
7
  }
8
8
 
9
- const LinkToEx: React.FC<Props> = ({ to, ...props }) => {
10
- return <Link component={RouterLink} to={to} {...props} />
9
+ const LinkEx: React.FC<Props> = ({ to, ...props }) => {
10
+ if (to) {
11
+ return <Link component={RouterLink} to={to} {...props} />
12
+ } else {
13
+ return <Link {...props} />
14
+ }
11
15
  }
12
16
 
13
- export { LinkToEx }
17
+ /** @deprecated use LinkEx instead */
18
+ const LinkToEx = LinkEx
19
+
20
+ export { LinkEx, LinkToEx }
@@ -1,3 +1 @@
1
- import { LinkToEx } from './LinkToEx'
2
-
3
- export { LinkToEx }
1
+ export * from './LinkToEx'