@xyo-network/react-shared 7.5.8 → 7.5.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.
Files changed (119) hide show
  1. package/dist/browser/components/BasicHero/BasicHero.d.ts.map +1 -1
  2. package/dist/browser/components/bigint/InputAdornment.d.ts.map +1 -1
  3. package/dist/browser/components/bigint/TextField.d.ts.map +1 -1
  4. package/dist/browser/hooks/payload/types/ValidatedResponse.d.ts +2 -2
  5. package/dist/browser/hooks/payload/types/ValidatedResponse.d.ts.map +1 -1
  6. package/dist/browser/hooks/payload/usePayloadValidate.d.ts.map +1 -1
  7. package/dist/browser/hooks/useShareForwardRef.d.ts.map +1 -1
  8. package/dist/browser/index.mjs +641 -594
  9. package/dist/browser/index.mjs.map +1 -1
  10. package/package.json +88 -40
  11. package/src/SizeProp.ts +0 -1
  12. package/src/components/Ampersand.tsx +0 -11
  13. package/src/components/BasicHero/BasicHero.stories.tsx +0 -54
  14. package/src/components/BasicHero/BasicHero.tsx +0 -270
  15. package/src/components/BasicHero/default-desktop.svg +0 -1
  16. package/src/components/BasicHero/index.ts +0 -1
  17. package/src/components/Ellipsize.tsx +0 -103
  18. package/src/components/LabeledTextFieldWrapper.tsx +0 -20
  19. package/src/components/ListItemButtonEx.tsx +0 -30
  20. package/src/components/LoadResult.stories.tsx +0 -33
  21. package/src/components/LoadResult.tsx +0 -27
  22. package/src/components/NotFound.tsx +0 -16
  23. package/src/components/Pipe.tsx +0 -11
  24. package/src/components/ScrollTableOnSm.tsx +0 -13
  25. package/src/components/SectionSpacingRow/SectionSpacingRow.stories.tsx +0 -32
  26. package/src/components/SectionSpacingRow/SectionSpacingRow.tsx +0 -26
  27. package/src/components/SectionSpacingRow/index.ts +0 -1
  28. package/src/components/StyleGuide/AppBars.example.tsx +0 -29
  29. package/src/components/StyleGuide/Buttons.example.tsx +0 -46
  30. package/src/components/StyleGuide/Papers.example.tsx +0 -23
  31. package/src/components/StyleGuide/StyleGuide.example.tsx +0 -20
  32. package/src/components/StyleGuide/StyleGuide.stories.tsx +0 -21
  33. package/src/components/StyleGuide/Texts.example.tsx +0 -34
  34. package/src/components/StyleGuide/VariantContext.example.tsx +0 -3
  35. package/src/components/TableCell/AddressTableCell.tsx +0 -24
  36. package/src/components/TableCell/EllipsisTableCell.tsx +0 -58
  37. package/src/components/TableCell/EllipsizeTableCell.stories.tsx +0 -105
  38. package/src/components/TableCell/HashTableCell.tsx +0 -28
  39. package/src/components/TableCell/findParent.ts +0 -10
  40. package/src/components/TableCell/getRemainingRowWidth.ts +0 -12
  41. package/src/components/TableCell/getSmallestParentWidth.ts +0 -13
  42. package/src/components/TableCell/index.ts +0 -3
  43. package/src/components/ThemeTokenAvatar/ThemeTokenAvatar.stories.tsx +0 -25
  44. package/src/components/ThemeTokenAvatar/ThemeTokenAvatar.tsx +0 -8
  45. package/src/components/ThemeTokenAvatar/index.ts +0 -1
  46. package/src/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.stories.tsx +0 -38
  47. package/src/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.tsx +0 -13
  48. package/src/components/ThemeTokenAvatarGroup/index.ts +0 -1
  49. package/src/components/TokenBar/TokenBar.stories.tsx +0 -33
  50. package/src/components/TokenBar/TokenBar.tsx +0 -32
  51. package/src/components/TokenBar/index.ts +0 -1
  52. package/src/components/TokenData/TokenData.ts +0 -141
  53. package/src/components/TokenData/img/ada.png +0 -0
  54. package/src/components/TokenData/img/btc.png +0 -0
  55. package/src/components/TokenData/img/busd.png +0 -0
  56. package/src/components/TokenData/img/dai.png +0 -0
  57. package/src/components/TokenData/img/dogecoin.png +0 -0
  58. package/src/components/TokenData/img/dot.png +0 -0
  59. package/src/components/TokenData/img/ethereum.png +0 -0
  60. package/src/components/TokenData/img/frax.png +0 -0
  61. package/src/components/TokenData/img/images.d.ts +0 -5
  62. package/src/components/TokenData/img/index.ts +0 -16
  63. package/src/components/TokenData/img/link.png +0 -0
  64. package/src/components/TokenData/img/sol.png +0 -0
  65. package/src/components/TokenData/img/tether.png +0 -0
  66. package/src/components/TokenData/img/usd-coin.png +0 -0
  67. package/src/components/TokenData/img/weth.png +0 -0
  68. package/src/components/TokenData/img/wrapped-bitcoin.png +0 -0
  69. package/src/components/TokenData/img/xl1.png +0 -0
  70. package/src/components/TokenData/img/xyo.png +0 -0
  71. package/src/components/TokenData/index.ts +0 -2
  72. package/src/components/TokenData/useGetTokenData.tsx +0 -16
  73. package/src/components/TokenSummary/TokenSummary.stories.tsx +0 -37
  74. package/src/components/TokenSummary/TokenSummary.tsx +0 -32
  75. package/src/components/TokenSummary/index.ts +0 -1
  76. package/src/components/TypographyEx.tsx +0 -14
  77. package/src/components/bigint/FixedPointPopover.tsx +0 -27
  78. package/src/components/bigint/Input.stories.tsx +0 -79
  79. package/src/components/bigint/Input.ts +0 -6
  80. package/src/components/bigint/InputAdornment.tsx +0 -44
  81. package/src/components/bigint/TextField.tsx +0 -128
  82. package/src/components/bigint/helpers/formatBigIntInput.ts +0 -11
  83. package/src/components/bigint/helpers/index.ts +0 -1
  84. package/src/components/bigint/index.ts +0 -5
  85. package/src/components/index.ts +0 -19
  86. package/src/components/pluginValidation/DataMissing.tsx +0 -16
  87. package/src/components/pluginValidation/index.ts +0 -1
  88. package/src/contexts/ListMode/Context.ts +0 -5
  89. package/src/contexts/ListMode/Provider.tsx +0 -29
  90. package/src/contexts/ListMode/State.ts +0 -9
  91. package/src/contexts/ListMode/index.ts +0 -4
  92. package/src/contexts/ListMode/use.ts +0 -7
  93. package/src/contexts/diviner/Context.ts +0 -4
  94. package/src/contexts/diviner/Provider.tsx +0 -45
  95. package/src/contexts/diviner/State.ts +0 -7
  96. package/src/contexts/diviner/index.ts +0 -3
  97. package/src/contexts/index.ts +0 -2
  98. package/src/global.d.ts +0 -1
  99. package/src/hooks/GradientStyles/GradientStyle.stories.tsx +0 -66
  100. package/src/hooks/GradientStyles/GradientStyles.tsx +0 -54
  101. package/src/hooks/GradientStyles/index.ts +0 -1
  102. package/src/hooks/index.ts +0 -5
  103. package/src/hooks/payload/index.ts +0 -4
  104. package/src/hooks/payload/types/ValidatedResponse.ts +0 -3
  105. package/src/hooks/payload/types/index.ts +0 -1
  106. package/src/hooks/payload/useBoundWitnessValidate.tsx +0 -29
  107. package/src/hooks/payload/usePayloadHash.tsx +0 -26
  108. package/src/hooks/payload/usePayloadValidate.tsx +0 -22
  109. package/src/hooks/useDataState.ts +0 -18
  110. package/src/hooks/useMediaQuery.ts +0 -3
  111. package/src/hooks/useShareForwardRef.ts +0 -23
  112. package/src/index.ts +0 -6
  113. package/src/lib/assertDefinedEx.ts +0 -7
  114. package/src/lib/getActualPaddingX.ts +0 -63
  115. package/src/lib/index.ts +0 -3
  116. package/src/lib/networkComponents.tsx +0 -48
  117. package/src/lib/xyo.tsx +0 -15
  118. package/src/models/ListMode.ts +0 -1
  119. package/src/models/index.ts +0 -1
@@ -1,105 +0,0 @@
1
- import {
2
- Table, TableBody, TableCell, TableHead, TableRow,
3
- } from '@mui/material'
4
- import type {
5
- Decorator, Meta, StoryFn,
6
- } from '@storybook/react-vite'
7
- import React from 'react'
8
- import { BrowserRouter } from 'react-router-dom'
9
-
10
- import { EllipsisTableCell } from './EllipsisTableCell.tsx'
11
-
12
- const TableDecorator: Decorator = (Story, args) => {
13
- return (
14
- <BrowserRouter>
15
- <Table>
16
- <TableHead>
17
- <TableRow>
18
- <TableCell>Heading1</TableCell>
19
- <TableCell>Heading2</TableCell>
20
- <TableCell>Heading3</TableCell>
21
- <TableCell>Heading4</TableCell>
22
- </TableRow>
23
- </TableHead>
24
- <TableBody>
25
- <Story {...args} />
26
- </TableBody>
27
- </Table>
28
- </BrowserRouter>
29
- )
30
- }
31
-
32
- export default {
33
- component: EllipsisTableCell,
34
- decorators: [TableDecorator],
35
- title: 'shared/EllipsisTableCell',
36
- } as Meta
37
-
38
- const Template: StoryFn<typeof EllipsisTableCell> = (props) => {
39
- return (
40
- <TableRow>
41
- <EllipsisTableCell to="/foo" value="As-Link-e0f01ab62384d8d501ff6b2f860b7992c347a6b8ae07bd5fd2fa4a7d47dad915" {...props} />
42
- <TableCell>d2fa4a7d47dad915501ff6b2f860b7992c347</TableCell>
43
- <TableCell>d2fa4a7d47dad915</TableCell>
44
- <TableCell>e0f05</TableCell>
45
- </TableRow>
46
- )
47
- }
48
-
49
- const TemplateWithMultiple: StoryFn<typeof EllipsisTableCell> = (props) => {
50
- return (
51
- <TableRow>
52
- <EllipsisTableCell width="50%" {...props}>
53
- As-children-e0f01ab62384d8d501ff6b2f860b7992c347a6b8ae07bd5fd2fa4a7d47dad915
54
- </EllipsisTableCell>
55
- <EllipsisTableCell width="50%" {...props}>
56
- e0f01ab62384d8d501ff6b2f860b7992c347a6b8ae07bd5fd2fa4a7d47dad915
57
- </EllipsisTableCell>
58
- <TableCell>d2fa4a7d47dad915</TableCell>
59
- <TableCell>e0f05</TableCell>
60
- </TableRow>
61
- )
62
- }
63
-
64
- const TemplateWithMultipleRows: StoryFn<typeof EllipsisTableCell> = (props) => {
65
- return (
66
- <>
67
- <TableRow>
68
- <EllipsisTableCell
69
- width="50%"
70
- href="http://foo.com"
71
- {...props}
72
- value="As-href-e0f01ab62384d8d501ff6b2f860b7992c347a6b8ae07bd5fd2fa4a7d47dad915"
73
- />
74
- <EllipsisTableCell width="50%" {...props}>
75
- e0f01ab62384d8d501ff6b2f860b7992c347a6b8ae07bd5fd2fa4a7d47dad915
76
- </EllipsisTableCell>
77
- <TableCell>d2fa4a7d47dad915</TableCell>
78
- <TableCell>e0f05</TableCell>
79
- </TableRow>
80
- <TableRow>
81
- <TableCell>d2fa4a7d47dad915</TableCell>
82
- <TableCell>e0f05</TableCell>
83
- <EllipsisTableCell width="50%" {...props}>
84
- e0f01ab62384d8d501ff6b2f860b7992c347a6b8ae07bd5fd2fa4a7d47dad915
85
- </EllipsisTableCell>
86
- <EllipsisTableCell width="50%" {...props}>
87
- e0f01ab62384d8d501ff6b2f860b7992c347a6b8ae07bd5fd2fa4a7d47dad915
88
- </EllipsisTableCell>
89
- </TableRow>
90
- </>
91
- )
92
- }
93
-
94
- const Default = Template.bind({})
95
- Default.args = {}
96
-
97
- const WithMultiple = TemplateWithMultiple.bind({})
98
- WithMultiple.args = {}
99
-
100
- const WithMultipleRows = TemplateWithMultipleRows.bind({})
101
- WithMultipleRows.args = {}
102
-
103
- export {
104
- Default, WithMultiple, WithMultipleRows,
105
- }
@@ -1,28 +0,0 @@
1
- import type { Hash } from '@xylabs/sdk-js'
2
- import React from 'react'
3
-
4
- import type { EllipsisTableCellProps } from './EllipsisTableCell.tsx'
5
- import { EllipsisTableCell } from './EllipsisTableCell.tsx'
6
-
7
- export interface HashTableCellProps extends EllipsisTableCellProps {
8
- /** @deprecated - archives are no longer used */
9
- archive?: string
10
- dataType?: 'block' | 'payload'
11
- /** @deprecated - use event listeners instead of link building via props */
12
- exploreDomain?: string
13
- /** @deprecated - use event listeners instead of link building via props */
14
- network?: string
15
- /** @deprecated - onClick instead */
16
- onHashClick?: (value: Hash) => void
17
- }
18
-
19
- export const HashTableCell: React.FC<HashTableCellProps> = ({
20
- ref, value, dataType, ...props
21
- }) => {
22
- return (
23
- <EllipsisTableCell
24
- value={value}
25
- {...props}
26
- />
27
- )
28
- }
@@ -1,10 +0,0 @@
1
- export const findParent = (tagName: string, element: HTMLElement | null = null) => {
2
- let currentElement = element
3
- while (currentElement) {
4
- if (currentElement.tagName.toLowerCase() === tagName.toLowerCase()) {
5
- return currentElement
6
- } else {
7
- currentElement = currentElement.parentElement
8
- }
9
- }
10
- }
@@ -1,12 +0,0 @@
1
- /** @description This is the width of all the cells (except the one passed) in the row combined and the spacing of the main cell */
2
- export const getRemainingRowWidth = (row: HTMLElement, forCell = 0) => {
3
- let width = 0
4
- for (let i = 0; i < (row?.childElementCount ?? 0); i++) {
5
- const item = row?.children.item(i)
6
- if (item && i !== forCell) {
7
- width += item?.clientWidth ?? 0
8
- }
9
- }
10
-
11
- return width
12
- }
@@ -1,13 +0,0 @@
1
- export const getSmallestParentWidth = (element: HTMLElement, maxDepth = 4) => {
2
- let currentElement: HTMLElement | null = element?.parentElement
3
- let width = currentElement?.clientWidth ?? screen.width
4
- let maxDepthCounter = maxDepth
5
- while (currentElement && maxDepthCounter > 0) {
6
- if (width > currentElement.clientWidth) {
7
- width = currentElement.clientWidth
8
- }
9
- currentElement = currentElement.parentElement
10
- maxDepthCounter--
11
- }
12
- return width
13
- }
@@ -1,3 +0,0 @@
1
- export * from './AddressTableCell.tsx'
2
- export * from './EllipsisTableCell.tsx'
3
- export * from './HashTableCell.tsx'
@@ -1,25 +0,0 @@
1
- import type { Meta, StoryFn } from '@storybook/react-vite'
2
- import React from 'react'
3
- import { BrowserRouter } from 'react-router-dom'
4
-
5
- import * as tokenData from '../TokenData/index.ts'
6
- import { ThemeTokenAvatar } from './ThemeTokenAvatar.tsx'
7
- const StorybookEntry = {
8
- argTypes: {},
9
- component: ThemeTokenAvatar,
10
- parameters: { docs: { page: null } },
11
- title: 'shared/ThemeTokenAvatar',
12
- } as Meta<typeof ThemeTokenAvatar>
13
-
14
- const Template: StoryFn<typeof ThemeTokenAvatar> = args => (
15
- <BrowserRouter>
16
- <ThemeTokenAvatar {...args}></ThemeTokenAvatar>
17
- </BrowserRouter>
18
- )
19
-
20
- const WithData = Template.bind({})
21
- WithData.args = { src: tokenData.TokenData[0].icon }
22
-
23
- export { WithData }
24
-
25
- export default StorybookEntry
@@ -1,8 +0,0 @@
1
- import type { AvatarProps } from '@mui/material'
2
- import { Avatar, useTheme } from '@mui/material'
3
- import React from 'react'
4
-
5
- export const ThemeTokenAvatar: React.FC<AvatarProps> = ({ ...props }) => {
6
- const theme = useTheme()
7
- return <Avatar sx={{ background: theme.vars.palette.common.white }} {...props} />
8
- }
@@ -1 +0,0 @@
1
- export * from './ThemeTokenAvatar.tsx'
@@ -1,38 +0,0 @@
1
- import type { Meta, StoryFn } from '@storybook/react-vite'
2
- import React from 'react'
3
- import { BrowserRouter } from 'react-router-dom'
4
-
5
- import * as tokenData from '../TokenData/index.ts'
6
- import { ThemeTokenAvatarGroup } from './ThemeTokenAvatarGroup.tsx'
7
- const StorybookEntry = {
8
- argTypes: {},
9
- component: ThemeTokenAvatarGroup,
10
- parameters: { docs: { page: null } },
11
- title: 'shared/ThemeTokenAvatarGroup',
12
- } as Meta<typeof ThemeTokenAvatarGroup>
13
-
14
- const Template: StoryFn<typeof ThemeTokenAvatarGroup> = args => (
15
- <BrowserRouter>
16
- <ThemeTokenAvatarGroup {...args}></ThemeTokenAvatarGroup>
17
- </BrowserRouter>
18
- )
19
-
20
- const WithData = Template.bind({})
21
- WithData.args = {
22
- images: [
23
- tokenData.TokenData[0].icon,
24
- tokenData.TokenData[1].icon,
25
- tokenData.TokenData[2].icon,
26
- tokenData.TokenData[3].icon,
27
- tokenData.TokenData[4].icon,
28
- tokenData.TokenData[6].icon,
29
- tokenData.TokenData[7].icon,
30
- tokenData.TokenData[8].icon,
31
- tokenData.TokenData[9].icon,
32
- tokenData.TokenData[10].icon,
33
- ],
34
- }
35
-
36
- export { WithData }
37
-
38
- export default StorybookEntry
@@ -1,13 +0,0 @@
1
- import type { AvatarGroupProps } from '@mui/material'
2
- import { AvatarGroup } from '@mui/material'
3
- import React from 'react'
4
-
5
- import { ThemeTokenAvatar } from '../ThemeTokenAvatar/index.ts'
6
-
7
- export interface ThemeTokenAvatarGroupProps extends AvatarGroupProps {
8
- images?: string[]
9
- }
10
-
11
- export const ThemeTokenAvatarGroup: React.FC<ThemeTokenAvatarGroupProps> = ({ images, ...props }) => {
12
- return <AvatarGroup {...props}>{images?.map((image, index) => <ThemeTokenAvatar key={index} src={image} />)}</AvatarGroup>
13
- }
@@ -1 +0,0 @@
1
- export * from './ThemeTokenAvatarGroup.tsx'
@@ -1,33 +0,0 @@
1
- import type { Meta, StoryFn } from '@storybook/react-vite'
2
- import { QuickTipButton } from '@xylabs/react-quick-tip-button'
3
- import React from 'react'
4
- import { BrowserRouter } from 'react-router-dom'
5
-
6
- import { TokenBar } from './TokenBar.tsx'
7
- const StorybookEntry = {
8
- argTypes: {},
9
- component: TokenBar,
10
- parameters: { docs: { page: null } },
11
- title: 'shared/TokenBar',
12
- } as Meta<typeof TokenBar>
13
-
14
- const Template: StoryFn<typeof TokenBar> = args => (
15
- <BrowserRouter>
16
- <TokenBar {...args}></TokenBar>
17
- </BrowserRouter>
18
- )
19
-
20
- const WithData = Template.bind({})
21
- WithData.args = { text1: 'Hello', text2: 'World' }
22
-
23
- const WithSuffixes = Template.bind({})
24
- WithSuffixes.args = {
25
- text1: 'ETH', text2: '0.062342', text2Suffix: <QuickTipButton title="0.06234298345834958" />,
26
- }
27
-
28
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
29
- // @ts-ignore
30
-
31
- export { WithData, WithSuffixes }
32
-
33
- export default StorybookEntry
@@ -1,32 +0,0 @@
1
- import type { PaperProps, TypographyProps } from '@mui/material'
2
- import { Paper, Typography } from '@mui/material'
3
- import { FlexRow } from '@xylabs/react-flexbox'
4
- import type { ReactNode } from 'react'
5
- import React from 'react'
6
- export interface TokenBarProps extends PaperProps {
7
- text1?: ReactNode
8
- text1Props?: TypographyProps
9
- text1Suffix?: ReactNode
10
- text2?: ReactNode
11
- text2Props?: TypographyProps
12
- text2Suffix?: ReactNode
13
- }
14
-
15
- export const TokenBar: React.FC<TokenBarProps> = ({
16
- text1, text1Props, text1Suffix, text2, text2Props, text2Suffix, ...props
17
- }) => {
18
- return (
19
- <Paper elevation={0} className="TokenBar-root" {...props}>
20
- <FlexRow justifyContent="space-between">
21
- <Typography variant="body1" fontWeight={300} margin={1} {...text1Props}>
22
- {text1}
23
- {text1Suffix}
24
- </Typography>
25
- <Typography variant="body1" fontWeight={300} textTransform="uppercase" color="gray" margin={1} {...text2Props}>
26
- {text2}
27
- {text2Suffix}
28
- </Typography>
29
- </FlexRow>
30
- </Paper>
31
- )
32
- }
@@ -1 +0,0 @@
1
- export * from './TokenBar.tsx'
@@ -1,141 +0,0 @@
1
- import * as tokenImages from './img/index.ts'
2
-
3
- export interface TokenData {
4
- coinmarketcapLink: string
5
- etherscanLink: string
6
- icon: string
7
- readableName: string
8
- tokenSymbol: string
9
- uniqueTokenId: string
10
- }
11
-
12
- export const TokenData: TokenData[] = [
13
- {
14
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/multi-collateral-dai/',
15
- etherscanLink: 'https://etherscan.io/token/0x6b175474e89094c44da98b954eedeac495271d0f',
16
- icon: tokenImages.dai,
17
- readableName: 'Dai',
18
- tokenSymbol: 'dai',
19
- uniqueTokenId: 'dai',
20
- },
21
- {
22
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/weth/',
23
- etherscanLink: 'https://etherscan.io/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
24
- icon: tokenImages.weth,
25
- readableName: 'Weth',
26
- tokenSymbol: 'weth',
27
- uniqueTokenId: 'weth',
28
- },
29
- {
30
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/ethereum/',
31
- etherscanLink: 'n/a',
32
- icon: tokenImages.ethereum,
33
- readableName: 'Ethereum',
34
- tokenSymbol: 'eth',
35
- uniqueTokenId: 'ethereum',
36
- },
37
- {
38
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/bitcoin/',
39
- etherscanLink: 'n/a',
40
- icon: tokenImages.btc,
41
- readableName: 'Bitcoin',
42
- tokenSymbol: 'btc',
43
- uniqueTokenId: 'btc',
44
- },
45
- {
46
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/xl1/',
47
- etherscanLink: 'https://etherscan.io/token/0xf72ae3e0da743033abd7a407557d684c1ae66aed',
48
- icon: tokenImages.xl1,
49
- readableName: 'XL1',
50
- tokenSymbol: 'xl1',
51
- uniqueTokenId: 'xl1',
52
- },
53
- {
54
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/xyo/',
55
- etherscanLink: 'https://etherscan.io/token/0x55296f69f40ea6d20e478533c15a6b08b654e758',
56
- icon: tokenImages.xyo,
57
- readableName: 'XYO',
58
- tokenSymbol: 'xyo',
59
- uniqueTokenId: 'xyo',
60
- },
61
- {
62
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/frax/',
63
- etherscanLink: 'https://etherscan.io/token/0x853d955acef822db058eb8505911ed77f175b99e',
64
- icon: tokenImages.frax,
65
- readableName: 'Frax',
66
- tokenSymbol: 'frax',
67
- uniqueTokenId: 'frax',
68
- },
69
- {
70
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/wrapped-bitcoin/',
71
- etherscanLink: 'https://etherscan.io/token/0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
72
- icon: tokenImages.wrappedBtc,
73
- readableName: 'Wrapped BTC',
74
- tokenSymbol: 'wbtc',
75
- uniqueTokenId: 'wbtc',
76
- },
77
- {
78
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/usd-coin/',
79
- etherscanLink: 'https://etherscan.io/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
80
- icon: tokenImages.usdCoin,
81
- readableName: 'USDC',
82
- tokenSymbol: 'usdc',
83
- uniqueTokenId: 'usdc',
84
- },
85
- {
86
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/tether/',
87
- etherscanLink: 'https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7',
88
- icon: tokenImages.tether,
89
- readableName: 'Tether',
90
- tokenSymbol: 'usdt',
91
- uniqueTokenId: 'usdt',
92
- },
93
- {
94
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/cardano/',
95
- etherscanLink: 'https://etherscan.io/token/0xc14777c94229582e5758c5a79b83dde876b9be98',
96
- icon: tokenImages.ada,
97
- readableName: 'Cardano',
98
- tokenSymbol: 'ada',
99
- uniqueTokenId: 'ada',
100
- },
101
- {
102
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/binance-usd/',
103
- etherscanLink: 'https://etherscan.io/token/0x4Fabb145d64652a948d72533023f6E7A623C7C53',
104
- icon: tokenImages.busd,
105
- readableName: 'Binance USD',
106
- tokenSymbol: 'busd',
107
- uniqueTokenId: 'busd',
108
- },
109
- {
110
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/dogecoin/',
111
- etherscanLink: 'https://etherscan.io/token/0x7618b5024a6349f9aef10ddfd33e3428c734551e',
112
- icon: tokenImages.dogecoin,
113
- readableName: 'Dogecoin',
114
- tokenSymbol: 'doge',
115
- uniqueTokenId: 'doge',
116
- },
117
- {
118
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/polkadot-new/',
119
- etherscanLink: 'https://etherscan.io/token/0x2d4fb6dd969992c881d8e534c747cc925d5ba221',
120
- icon: tokenImages.dot,
121
- readableName: 'Polkadot',
122
- tokenSymbol: 'dot',
123
- uniqueTokenId: 'dot',
124
- },
125
- {
126
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/chainlink/',
127
- etherscanLink: 'https://etherscan.io/token/0x514910771af9ca656af840dff83e8264ecf986ca',
128
- icon: tokenImages.link,
129
- readableName: 'ChainLink',
130
- tokenSymbol: 'link',
131
- uniqueTokenId: 'link',
132
- },
133
- {
134
- coinmarketcapLink: 'https://coinmarketcap.com/currencies/solana/',
135
- etherscanLink: 'https://etherscan.io/token/0x1f54638b7737193ffd86c19ec51907a7c41755d8',
136
- icon: tokenImages.sol,
137
- readableName: 'Solana',
138
- tokenSymbol: 'sol',
139
- uniqueTokenId: 'sol',
140
- },
141
- ]
@@ -1,5 +0,0 @@
1
- declare module '*.png'
2
- declare module '*.jpg'
3
- declare module '*.svg'
4
- declare module '*.gif'
5
- declare module '*.webp'
@@ -1,16 +0,0 @@
1
- export { default as ada } from './ada.png'
2
- export { default as btc } from './btc.png'
3
- export { default as busd } from './busd.png'
4
- export { default as dai } from './dai.png'
5
- export { default as dogecoin } from './dogecoin.png'
6
- export { default as dot } from './dot.png'
7
- export { default as ethereum } from './ethereum.png'
8
- export { default as frax } from './frax.png'
9
- export { default as link } from './link.png'
10
- export { default as sol } from './sol.png'
11
- export { default as tether } from './tether.png'
12
- export { default as usdCoin } from './usd-coin.png'
13
- export { default as weth } from './weth.png'
14
- export { default as wrappedBtc } from './wrapped-bitcoin.png'
15
- export { default as xl1 } from './xl1.png'
16
- export { default as xyo } from './xyo.png'
@@ -1,2 +0,0 @@
1
- export * from './TokenData.ts'
2
- export * from './useGetTokenData.tsx'
@@ -1,16 +0,0 @@
1
- import { TokenData } from './TokenData.ts'
2
-
3
- export const getTokenData = (symbols: (string | undefined)[]) => {
4
- return symbols?.map((symbol) => {
5
- const additionalTokenData = TokenData.find(x => x.tokenSymbol.toLowerCase() === symbol?.toLowerCase())
6
- const checkedTokenData = additionalTokenData ?? {
7
- coinmarketcapLink: '',
8
- etherscanLink: '',
9
- icon: '',
10
- readableName: 'Unknown Token',
11
- tokenSymbol: 'unknown',
12
- uniqueTokenId: 'unknown',
13
- }
14
- return checkedTokenData
15
- })
16
- }
@@ -1,37 +0,0 @@
1
- import { Link } from '@mui/material'
2
- import type { Meta, StoryFn } from '@storybook/react-vite'
3
- import React from 'react'
4
- import { BrowserRouter } from 'react-router-dom'
5
-
6
- import * as tokenData from '../TokenData/index.ts'
7
- import { TokenSummary } from './TokenSummary.tsx'
8
- const StorybookEntry = {
9
- argTypes: {},
10
- component: TokenSummary,
11
- parameters: { docs: { page: null } },
12
- title: 'shared/TokenSummary',
13
- } as Meta<typeof TokenSummary>
14
-
15
- const Template: StoryFn<typeof TokenSummary> = args => (
16
- <BrowserRouter>
17
- <TokenSummary {...args}></TokenSummary>
18
- </BrowserRouter>
19
- )
20
-
21
- const WithData = Template.bind({})
22
- WithData.args = { icon: tokenData.TokenData[0].icon, symbol: 'string' }
23
-
24
- const SymbolElement = Template.bind({})
25
- SymbolElement.args = {
26
- icon: tokenData.TokenData[0].icon,
27
- symbol: 'string',
28
- symbolElement: (
29
- <Link underline="hover" href="#">
30
- Linked Title
31
- </Link>
32
- ),
33
- }
34
-
35
- export { SymbolElement, WithData }
36
-
37
- export default StorybookEntry
@@ -1,32 +0,0 @@
1
- import type { AvatarProps, CardHeaderProps } from '@mui/material'
2
- import { CardHeader, Typography } from '@mui/material'
3
- import type { ReactNode } from 'react'
4
- import React from 'react'
5
-
6
- import { ThemeTokenAvatar } from '../ThemeTokenAvatar/index.ts'
7
-
8
- export interface TokenSummaryProps extends CardHeaderProps {
9
- icon?: string
10
- imgBgProps?: AvatarProps
11
- symbol?: string
12
- symbolElement?: ReactNode
13
- }
14
-
15
- export const TokenSummary: React.FC<TokenSummaryProps> = ({
16
- icon, symbol, symbolElement, children, ...props
17
- }) => {
18
- return (
19
- <>
20
- <CardHeader
21
- avatar={<ThemeTokenAvatar src={icon} alt={symbol} />}
22
- title={(
23
- <Typography variant="h6" fontWeight={300} textTransform="uppercase">
24
- {symbolElement ?? symbol}
25
- </Typography>
26
- )}
27
- {...props}
28
- />
29
- {children}
30
- </>
31
- )
32
- }
@@ -1 +0,0 @@
1
- export * from './TokenSummary.tsx'
@@ -1,14 +0,0 @@
1
- import type { TypographyProps } from '@mui/material'
2
- import { Typography } from '@mui/material'
3
- import React from 'react'
4
-
5
- import { useGradientStyles } from '../hooks/index.ts'
6
-
7
- export interface TypographyExProps extends TypographyProps {
8
- gradient?: 'text'
9
- }
10
-
11
- export const TypographyEx: React.FC<TypographyExProps> = ({ gradient, ...props }) => {
12
- const styles = useGradientStyles()
13
- return <Typography style={gradient === 'text' ? styles.heading : undefined} {...props} />
14
- }