@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.
- package/dist/browser/components/BasicHero/BasicHero.d.ts.map +1 -1
- package/dist/browser/components/bigint/InputAdornment.d.ts.map +1 -1
- package/dist/browser/components/bigint/TextField.d.ts.map +1 -1
- package/dist/browser/hooks/payload/types/ValidatedResponse.d.ts +2 -2
- package/dist/browser/hooks/payload/types/ValidatedResponse.d.ts.map +1 -1
- package/dist/browser/hooks/payload/usePayloadValidate.d.ts.map +1 -1
- package/dist/browser/hooks/useShareForwardRef.d.ts.map +1 -1
- package/dist/browser/index.mjs +641 -594
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +88 -40
- package/src/SizeProp.ts +0 -1
- package/src/components/Ampersand.tsx +0 -11
- package/src/components/BasicHero/BasicHero.stories.tsx +0 -54
- package/src/components/BasicHero/BasicHero.tsx +0 -270
- package/src/components/BasicHero/default-desktop.svg +0 -1
- package/src/components/BasicHero/index.ts +0 -1
- package/src/components/Ellipsize.tsx +0 -103
- package/src/components/LabeledTextFieldWrapper.tsx +0 -20
- package/src/components/ListItemButtonEx.tsx +0 -30
- package/src/components/LoadResult.stories.tsx +0 -33
- package/src/components/LoadResult.tsx +0 -27
- package/src/components/NotFound.tsx +0 -16
- package/src/components/Pipe.tsx +0 -11
- package/src/components/ScrollTableOnSm.tsx +0 -13
- package/src/components/SectionSpacingRow/SectionSpacingRow.stories.tsx +0 -32
- package/src/components/SectionSpacingRow/SectionSpacingRow.tsx +0 -26
- package/src/components/SectionSpacingRow/index.ts +0 -1
- package/src/components/StyleGuide/AppBars.example.tsx +0 -29
- package/src/components/StyleGuide/Buttons.example.tsx +0 -46
- package/src/components/StyleGuide/Papers.example.tsx +0 -23
- package/src/components/StyleGuide/StyleGuide.example.tsx +0 -20
- package/src/components/StyleGuide/StyleGuide.stories.tsx +0 -21
- package/src/components/StyleGuide/Texts.example.tsx +0 -34
- package/src/components/StyleGuide/VariantContext.example.tsx +0 -3
- package/src/components/TableCell/AddressTableCell.tsx +0 -24
- package/src/components/TableCell/EllipsisTableCell.tsx +0 -58
- package/src/components/TableCell/EllipsizeTableCell.stories.tsx +0 -105
- package/src/components/TableCell/HashTableCell.tsx +0 -28
- package/src/components/TableCell/findParent.ts +0 -10
- package/src/components/TableCell/getRemainingRowWidth.ts +0 -12
- package/src/components/TableCell/getSmallestParentWidth.ts +0 -13
- package/src/components/TableCell/index.ts +0 -3
- package/src/components/ThemeTokenAvatar/ThemeTokenAvatar.stories.tsx +0 -25
- package/src/components/ThemeTokenAvatar/ThemeTokenAvatar.tsx +0 -8
- package/src/components/ThemeTokenAvatar/index.ts +0 -1
- package/src/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.stories.tsx +0 -38
- package/src/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.tsx +0 -13
- package/src/components/ThemeTokenAvatarGroup/index.ts +0 -1
- package/src/components/TokenBar/TokenBar.stories.tsx +0 -33
- package/src/components/TokenBar/TokenBar.tsx +0 -32
- package/src/components/TokenBar/index.ts +0 -1
- package/src/components/TokenData/TokenData.ts +0 -141
- package/src/components/TokenData/img/ada.png +0 -0
- package/src/components/TokenData/img/btc.png +0 -0
- package/src/components/TokenData/img/busd.png +0 -0
- package/src/components/TokenData/img/dai.png +0 -0
- package/src/components/TokenData/img/dogecoin.png +0 -0
- package/src/components/TokenData/img/dot.png +0 -0
- package/src/components/TokenData/img/ethereum.png +0 -0
- package/src/components/TokenData/img/frax.png +0 -0
- package/src/components/TokenData/img/images.d.ts +0 -5
- package/src/components/TokenData/img/index.ts +0 -16
- package/src/components/TokenData/img/link.png +0 -0
- package/src/components/TokenData/img/sol.png +0 -0
- package/src/components/TokenData/img/tether.png +0 -0
- package/src/components/TokenData/img/usd-coin.png +0 -0
- package/src/components/TokenData/img/weth.png +0 -0
- package/src/components/TokenData/img/wrapped-bitcoin.png +0 -0
- package/src/components/TokenData/img/xl1.png +0 -0
- package/src/components/TokenData/img/xyo.png +0 -0
- package/src/components/TokenData/index.ts +0 -2
- package/src/components/TokenData/useGetTokenData.tsx +0 -16
- package/src/components/TokenSummary/TokenSummary.stories.tsx +0 -37
- package/src/components/TokenSummary/TokenSummary.tsx +0 -32
- package/src/components/TokenSummary/index.ts +0 -1
- package/src/components/TypographyEx.tsx +0 -14
- package/src/components/bigint/FixedPointPopover.tsx +0 -27
- package/src/components/bigint/Input.stories.tsx +0 -79
- package/src/components/bigint/Input.ts +0 -6
- package/src/components/bigint/InputAdornment.tsx +0 -44
- package/src/components/bigint/TextField.tsx +0 -128
- package/src/components/bigint/helpers/formatBigIntInput.ts +0 -11
- package/src/components/bigint/helpers/index.ts +0 -1
- package/src/components/bigint/index.ts +0 -5
- package/src/components/index.ts +0 -19
- package/src/components/pluginValidation/DataMissing.tsx +0 -16
- package/src/components/pluginValidation/index.ts +0 -1
- package/src/contexts/ListMode/Context.ts +0 -5
- package/src/contexts/ListMode/Provider.tsx +0 -29
- package/src/contexts/ListMode/State.ts +0 -9
- package/src/contexts/ListMode/index.ts +0 -4
- package/src/contexts/ListMode/use.ts +0 -7
- package/src/contexts/diviner/Context.ts +0 -4
- package/src/contexts/diviner/Provider.tsx +0 -45
- package/src/contexts/diviner/State.ts +0 -7
- package/src/contexts/diviner/index.ts +0 -3
- package/src/contexts/index.ts +0 -2
- package/src/global.d.ts +0 -1
- package/src/hooks/GradientStyles/GradientStyle.stories.tsx +0 -66
- package/src/hooks/GradientStyles/GradientStyles.tsx +0 -54
- package/src/hooks/GradientStyles/index.ts +0 -1
- package/src/hooks/index.ts +0 -5
- package/src/hooks/payload/index.ts +0 -4
- package/src/hooks/payload/types/ValidatedResponse.ts +0 -3
- package/src/hooks/payload/types/index.ts +0 -1
- package/src/hooks/payload/useBoundWitnessValidate.tsx +0 -29
- package/src/hooks/payload/usePayloadHash.tsx +0 -26
- package/src/hooks/payload/usePayloadValidate.tsx +0 -22
- package/src/hooks/useDataState.ts +0 -18
- package/src/hooks/useMediaQuery.ts +0 -3
- package/src/hooks/useShareForwardRef.ts +0 -23
- package/src/index.ts +0 -6
- package/src/lib/assertDefinedEx.ts +0 -7
- package/src/lib/getActualPaddingX.ts +0 -63
- package/src/lib/index.ts +0 -3
- package/src/lib/networkComponents.tsx +0 -48
- package/src/lib/xyo.tsx +0 -15
- package/src/models/ListMode.ts +0 -1
- package/src/models/index.ts +0 -1
|
@@ -1,54 +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 { BasicHero } from './BasicHero.tsx'
|
|
6
|
-
import BackgroundImage from './default-desktop.svg'
|
|
7
|
-
const StorybookEntry = {
|
|
8
|
-
argTypes: {},
|
|
9
|
-
component: BasicHero,
|
|
10
|
-
parameters: { docs: { page: null } },
|
|
11
|
-
title: 'shared/BasicHero',
|
|
12
|
-
} as Meta<typeof BasicHero>
|
|
13
|
-
|
|
14
|
-
const Template: StoryFn<typeof BasicHero> = args => (
|
|
15
|
-
<BrowserRouter>
|
|
16
|
-
<BasicHero {...args}></BasicHero>
|
|
17
|
-
</BrowserRouter>
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
const Default = Template.bind({})
|
|
21
|
-
Default.args = {
|
|
22
|
-
button1Text: 'Button 1',
|
|
23
|
-
button1To: '',
|
|
24
|
-
button2Text: 'Button 2',
|
|
25
|
-
button2To: '',
|
|
26
|
-
desc: ' Ipsam illo molestiae nisi perferendis a error, eum repellendus voluptatibus, provident, voluptatum qui laborum assumenda minus!',
|
|
27
|
-
gradientTitle: 'dolor',
|
|
28
|
-
subLinkPath: 'https://medium.com/xyonetwork/xyo-2-0-has-arrived-fe160f8b2928',
|
|
29
|
-
subLinkText1: 'We just announced XYO 2.0',
|
|
30
|
-
subLinkText2: 'Read more here.',
|
|
31
|
-
title: 'Lorem ipsum',
|
|
32
|
-
}
|
|
33
|
-
const WithBackgroundImage = Template.bind({})
|
|
34
|
-
WithBackgroundImage.args = {
|
|
35
|
-
backgroundImage: BackgroundImage,
|
|
36
|
-
button1Text: 'Button 1',
|
|
37
|
-
button1To: '',
|
|
38
|
-
button2Text: 'Button 2',
|
|
39
|
-
button2To: '',
|
|
40
|
-
desc: ' Ipsam illo molestiae nisi perferendis a error, eum repellendus voluptatibus, provident, voluptatum qui laborum assumenda minus!',
|
|
41
|
-
gradientTitle: 'dolor',
|
|
42
|
-
subLinkPath: 'https://medium.com/xyonetwork/xyo-2-0-has-arrived-fe160f8b2928',
|
|
43
|
-
subLinkText1: 'We just announced XYO 2.0',
|
|
44
|
-
subLinkText2: 'Read more here.',
|
|
45
|
-
title: 'Lorem ipsum',
|
|
46
|
-
title2: 'adipisicing elit.',
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
50
|
-
// @ts-ignore
|
|
51
|
-
|
|
52
|
-
export { Default, WithBackgroundImage }
|
|
53
|
-
|
|
54
|
-
export default StorybookEntry
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Container, Grid, styled, Typography,
|
|
3
|
-
} from '@mui/material'
|
|
4
|
-
import { ButtonEx } from '@xylabs/react-button'
|
|
5
|
-
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
6
|
-
import { FlexGrowCol, FlexGrowRow } from '@xylabs/react-flexbox'
|
|
7
|
-
import { LinkEx } from '@xylabs/react-link'
|
|
8
|
-
import { useIsSmall } from '@xylabs/react-theme'
|
|
9
|
-
import type { ReactElement } from 'react'
|
|
10
|
-
import React from 'react'
|
|
11
|
-
import type { To } from 'react-router-dom'
|
|
12
|
-
|
|
13
|
-
import { useGradientStyles } from '../../hooks/index.ts'
|
|
14
|
-
|
|
15
|
-
export interface BasicHeroProps extends FlexBoxProps {
|
|
16
|
-
backgroundColor?: string
|
|
17
|
-
backgroundImage?: string
|
|
18
|
-
button1Href?: string
|
|
19
|
-
button1Text?: string
|
|
20
|
-
button1To?: string
|
|
21
|
-
button2Href?: string
|
|
22
|
-
button2Text?: string
|
|
23
|
-
button2To?: string
|
|
24
|
-
desc: string
|
|
25
|
-
gradientTitle?: string
|
|
26
|
-
heroImage?: string
|
|
27
|
-
subLinkIcon?: ReactElement
|
|
28
|
-
subLinkPath?: string
|
|
29
|
-
subLinkText1?: string
|
|
30
|
-
subLinkText2?: string
|
|
31
|
-
sx?: Record<string, string>
|
|
32
|
-
textColor?: string
|
|
33
|
-
title: string
|
|
34
|
-
title2?: string
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface SubLinkSectionProps {
|
|
38
|
-
backgroundImageAlignment?: boolean
|
|
39
|
-
subLinkIcon?: ReactElement
|
|
40
|
-
subLinkPath?: string
|
|
41
|
-
subLinkText1?: string
|
|
42
|
-
subLinkText2?: string
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
interface ButtonSectionBaseProps {
|
|
46
|
-
buttonText?: string
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
interface ButtonSectionHrefProps extends ButtonSectionBaseProps {
|
|
50
|
-
href?: string
|
|
51
|
-
to?: never
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface ButtonSectionToProps extends ButtonSectionBaseProps {
|
|
55
|
-
href?: never
|
|
56
|
-
to?: To
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
interface ButtonSectionClickProps extends ButtonSectionBaseProps {
|
|
60
|
-
href?: never
|
|
61
|
-
to?: never
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
type ButtonSectionProps = ButtonSectionHrefProps | ButtonSectionToProps | ButtonSectionClickProps
|
|
65
|
-
|
|
66
|
-
const SubLinkSection: React.FC<SubLinkSectionProps> = ({
|
|
67
|
-
backgroundImageAlignment, subLinkIcon, subLinkPath, subLinkText1, subLinkText2,
|
|
68
|
-
}) => {
|
|
69
|
-
return (
|
|
70
|
-
<FlexGrowRow
|
|
71
|
-
width="100%"
|
|
72
|
-
sx={{
|
|
73
|
-
flexDirection: { md: 'row', xs: 'column' },
|
|
74
|
-
justifyContent: { md: backgroundImageAlignment ? 'flex-start' : 'center', xs: 'center' },
|
|
75
|
-
}}
|
|
76
|
-
>
|
|
77
|
-
{subLinkIcon
|
|
78
|
-
? (
|
|
79
|
-
<span>
|
|
80
|
-
{subLinkIcon}
|
|
81
|
-
|
|
82
|
-
</span>
|
|
83
|
-
)
|
|
84
|
-
: null}
|
|
85
|
-
<Typography>
|
|
86
|
-
{subLinkText1}
|
|
87
|
-
|
|
88
|
-
</Typography>
|
|
89
|
-
<LinkEx href={subLinkPath} underline="always" target="_blank" color="inherit">
|
|
90
|
-
<Typography>{subLinkText2}</Typography>
|
|
91
|
-
</LinkEx>
|
|
92
|
-
</FlexGrowRow>
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const ButtonSection: React.FC<ButtonSectionProps> = ({
|
|
97
|
-
href, to, buttonText,
|
|
98
|
-
}) => {
|
|
99
|
-
const isMobile = useIsSmall()
|
|
100
|
-
return href
|
|
101
|
-
? (
|
|
102
|
-
<ButtonEx
|
|
103
|
-
fullWidth={true}
|
|
104
|
-
marginTop={1}
|
|
105
|
-
marginBottom={1}
|
|
106
|
-
marginRight={isMobile ? 2 : 1}
|
|
107
|
-
marginLeft={isMobile ? 2 : 0}
|
|
108
|
-
target={href ?? '_blank'}
|
|
109
|
-
href={href}
|
|
110
|
-
color="primary"
|
|
111
|
-
variant="contained"
|
|
112
|
-
paddingX={3}
|
|
113
|
-
sx={{ display: href || to ? 'flex' : 'none' }}
|
|
114
|
-
>
|
|
115
|
-
{buttonText}
|
|
116
|
-
</ButtonEx>
|
|
117
|
-
)
|
|
118
|
-
: to
|
|
119
|
-
? (
|
|
120
|
-
<ButtonEx
|
|
121
|
-
fullWidth={true}
|
|
122
|
-
marginTop={1}
|
|
123
|
-
marginBottom={1}
|
|
124
|
-
marginRight={isMobile ? 2 : 1}
|
|
125
|
-
marginLeft={isMobile ? 2 : 0}
|
|
126
|
-
to={to}
|
|
127
|
-
color="primary"
|
|
128
|
-
variant="contained"
|
|
129
|
-
paddingX={3}
|
|
130
|
-
sx={{ display: href || to ? 'flex' : 'none' }}
|
|
131
|
-
>
|
|
132
|
-
{buttonText}
|
|
133
|
-
</ButtonEx>
|
|
134
|
-
)
|
|
135
|
-
: (
|
|
136
|
-
<ButtonEx
|
|
137
|
-
fullWidth={true}
|
|
138
|
-
marginTop={1}
|
|
139
|
-
marginBottom={1}
|
|
140
|
-
marginRight={isMobile ? 2 : 1}
|
|
141
|
-
marginLeft={isMobile ? 2 : 0}
|
|
142
|
-
color="primary"
|
|
143
|
-
variant="contained"
|
|
144
|
-
paddingX={3}
|
|
145
|
-
sx={{ display: href || to ? 'flex' : 'none' }}
|
|
146
|
-
>
|
|
147
|
-
{buttonText}
|
|
148
|
-
</ButtonEx>
|
|
149
|
-
)
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export const BasicHero: React.FC<BasicHeroProps> = ({
|
|
153
|
-
backgroundImage,
|
|
154
|
-
title,
|
|
155
|
-
gradientTitle,
|
|
156
|
-
backgroundColor,
|
|
157
|
-
textColor,
|
|
158
|
-
desc,
|
|
159
|
-
heroImage,
|
|
160
|
-
title2,
|
|
161
|
-
subLinkText1,
|
|
162
|
-
subLinkText2,
|
|
163
|
-
subLinkPath,
|
|
164
|
-
button1Text,
|
|
165
|
-
button2Text,
|
|
166
|
-
button2To,
|
|
167
|
-
button1To,
|
|
168
|
-
button2Href,
|
|
169
|
-
button1Href,
|
|
170
|
-
subLinkIcon,
|
|
171
|
-
sx,
|
|
172
|
-
...props
|
|
173
|
-
// eslint-disable-next-line complexity
|
|
174
|
-
}) => {
|
|
175
|
-
const isMobile = useIsSmall()
|
|
176
|
-
const styles = useGradientStyles()
|
|
177
|
-
|
|
178
|
-
const StyledSpan = styled('span')({ ...styles.heading })
|
|
179
|
-
|
|
180
|
-
return (
|
|
181
|
-
<FlexGrowCol
|
|
182
|
-
sx={{
|
|
183
|
-
backgroundImage: `url(${backgroundImage})`,
|
|
184
|
-
backgroundPosition: {
|
|
185
|
-
lg: 'bottom', md: 'center left', xs: 'top left',
|
|
186
|
-
},
|
|
187
|
-
minHeight: {
|
|
188
|
-
md: '500px',
|
|
189
|
-
sm: '400px',
|
|
190
|
-
xs: '200px',
|
|
191
|
-
},
|
|
192
|
-
...sx,
|
|
193
|
-
}}
|
|
194
|
-
style={{
|
|
195
|
-
backgroundColor: backgroundColor ?? '',
|
|
196
|
-
backgroundRepeat: 'no-repeat',
|
|
197
|
-
backgroundSize: 'cover',
|
|
198
|
-
color: textColor ?? '',
|
|
199
|
-
}}
|
|
200
|
-
{...props}
|
|
201
|
-
>
|
|
202
|
-
<Container>
|
|
203
|
-
<Grid
|
|
204
|
-
container
|
|
205
|
-
justifyContent="center"
|
|
206
|
-
alignItems="center"
|
|
207
|
-
sx={{
|
|
208
|
-
alignItems: { xs: 'center' },
|
|
209
|
-
justifyContent: { xs: 'center' },
|
|
210
|
-
}}
|
|
211
|
-
>
|
|
212
|
-
<Grid size={{
|
|
213
|
-
xs: 12, sm: 8, md: backgroundImage ? 6 : 8, lg: backgroundImage ? 6 : 8,
|
|
214
|
-
}}
|
|
215
|
-
>
|
|
216
|
-
<FlexGrowCol paddingY={2} sx={{ alignItems: { xs: backgroundImage && !isMobile ? 'flex-start' : 'center' } }}>
|
|
217
|
-
<Typography variant="h1" component="h1" gutterBottom textAlign={backgroundImage && !isMobile ? 'left' : 'center'}>
|
|
218
|
-
{title
|
|
219
|
-
? <span>{`${title} `}</span>
|
|
220
|
-
: null}
|
|
221
|
-
{gradientTitle
|
|
222
|
-
? (
|
|
223
|
-
<StyledSpan>
|
|
224
|
-
{' '}
|
|
225
|
-
{` ${gradientTitle}`}
|
|
226
|
-
</StyledSpan>
|
|
227
|
-
)
|
|
228
|
-
: null}
|
|
229
|
-
{title2
|
|
230
|
-
? <span>{` ${title2}`}</span>
|
|
231
|
-
: null}
|
|
232
|
-
</Typography>
|
|
233
|
-
<Typography variant="body1" component="h2" gutterBottom textAlign={backgroundImage && !isMobile ? 'left' : 'center'}>
|
|
234
|
-
{desc}
|
|
235
|
-
</Typography>
|
|
236
|
-
<FlexGrowRow
|
|
237
|
-
sx={{ flexDirection: { lg: 'row', xs: 'column' } }}
|
|
238
|
-
width="100%"
|
|
239
|
-
marginTop={1}
|
|
240
|
-
>
|
|
241
|
-
{
|
|
242
|
-
button1Href
|
|
243
|
-
? <ButtonSection href={button1Href} buttonText={button1Text} />
|
|
244
|
-
: button1To ? <ButtonSection to={button1To} buttonText={button1Text} /> : <ButtonSection buttonText={button1Text} />
|
|
245
|
-
}
|
|
246
|
-
{
|
|
247
|
-
button2Href
|
|
248
|
-
? <ButtonSection href={button2Href} buttonText={button2Text} />
|
|
249
|
-
: button2To ? <ButtonSection to={button2To} buttonText={button2Text} /> : <ButtonSection buttonText={button2Text} />
|
|
250
|
-
}
|
|
251
|
-
</FlexGrowRow>
|
|
252
|
-
<SubLinkSection
|
|
253
|
-
subLinkIcon={subLinkIcon}
|
|
254
|
-
subLinkText1={subLinkText1}
|
|
255
|
-
subLinkText2={subLinkText2}
|
|
256
|
-
subLinkPath={subLinkPath}
|
|
257
|
-
backgroundImageAlignment={backgroundImage ? true : false}
|
|
258
|
-
/>
|
|
259
|
-
</FlexGrowCol>
|
|
260
|
-
</Grid>
|
|
261
|
-
<Grid size={{ xs: 12, md: 6 }}>
|
|
262
|
-
{heroImage
|
|
263
|
-
? <img src={heroImage} width="100%" />
|
|
264
|
-
: null}
|
|
265
|
-
</Grid>
|
|
266
|
-
</Grid>
|
|
267
|
-
</Container>
|
|
268
|
-
</FlexGrowCol>
|
|
269
|
-
)
|
|
270
|
-
}
|