@xyo-network/react-shared 3.0.2 → 3.0.4
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/SizeProp.d.ts +2 -0
- package/dist/browser/SizeProp.d.ts.map +1 -0
- package/dist/browser/components/Ampersand.d.ts +4 -0
- package/dist/browser/components/Ampersand.d.ts.map +1 -0
- package/dist/browser/components/BasicHero/BasicHero.d.ts +26 -0
- package/dist/browser/components/BasicHero/BasicHero.d.ts.map +1 -0
- package/dist/browser/components/BasicHero/index.d.ts +2 -0
- package/dist/browser/components/BasicHero/index.d.ts.map +1 -0
- package/dist/browser/components/Ellipsize.d.ts +16 -0
- package/dist/browser/components/Ellipsize.d.ts.map +1 -0
- package/dist/browser/components/ErrorBoundary.d.ts +20 -0
- package/dist/browser/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/browser/components/LabeledTextFieldWrapper.d.ts +7 -0
- package/dist/browser/components/LabeledTextFieldWrapper.d.ts.map +1 -0
- package/dist/browser/components/ListItemButtonEx.d.ts +11 -0
- package/dist/browser/components/ListItemButtonEx.d.ts.map +1 -0
- package/dist/browser/components/LoadResult.d.ts +9 -0
- package/dist/browser/components/LoadResult.d.ts.map +1 -0
- package/dist/browser/components/NotFound.d.ts +5 -0
- package/dist/browser/components/NotFound.d.ts.map +1 -0
- package/dist/browser/components/Pipe.d.ts +4 -0
- package/dist/browser/components/Pipe.d.ts.map +1 -0
- package/dist/browser/components/ScrollTableOnSm.d.ts +5 -0
- package/dist/browser/components/ScrollTableOnSm.d.ts.map +1 -0
- package/dist/browser/components/SectionSpacingRow/SectionSpacingRow.d.ts +3 -0
- package/dist/browser/components/SectionSpacingRow/SectionSpacingRow.d.ts.map +1 -0
- package/dist/browser/components/SectionSpacingRow/index.d.ts +2 -0
- package/dist/browser/components/SectionSpacingRow/index.d.ts.map +1 -0
- package/dist/browser/components/StyleGuide/AppBars.example.d.ts +2 -0
- package/dist/browser/components/StyleGuide/AppBars.example.d.ts.map +1 -0
- package/dist/browser/components/StyleGuide/Buttons.example.d.ts +3 -0
- package/dist/browser/components/StyleGuide/Buttons.example.d.ts.map +1 -0
- package/dist/browser/components/StyleGuide/Papers.example.d.ts +3 -0
- package/dist/browser/components/StyleGuide/Papers.example.d.ts.map +1 -0
- package/dist/browser/components/StyleGuide/StyleGuide.example.d.ts +3 -0
- package/dist/browser/components/StyleGuide/StyleGuide.example.d.ts.map +1 -0
- package/dist/browser/components/StyleGuide/Texts.example.d.ts +2 -0
- package/dist/browser/components/StyleGuide/Texts.example.d.ts.map +1 -0
- package/dist/browser/components/StyleGuide/VariantContext.example.d.ts +2 -0
- package/dist/browser/components/StyleGuide/VariantContext.example.d.ts.map +1 -0
- package/dist/browser/components/TableCell/AddressTableCell.d.ts +10 -0
- package/dist/browser/components/TableCell/AddressTableCell.d.ts.map +1 -0
- package/dist/browser/components/TableCell/EllipsisTableCell.d.ts +13 -0
- package/dist/browser/components/TableCell/EllipsisTableCell.d.ts.map +1 -0
- package/dist/browser/components/TableCell/EllipsisTableCellDeprecated.d.ts +11 -0
- package/dist/browser/components/TableCell/EllipsisTableCellDeprecated.d.ts.map +1 -0
- package/dist/browser/components/TableCell/HashTableCell.d.ts +12 -0
- package/dist/browser/components/TableCell/HashTableCell.d.ts.map +1 -0
- package/dist/browser/components/TableCell/findParent.d.ts +2 -0
- package/dist/browser/components/TableCell/findParent.d.ts.map +1 -0
- package/dist/browser/components/TableCell/getRemainingRowWidth.d.ts +2 -0
- package/dist/browser/components/TableCell/getRemainingRowWidth.d.ts.map +1 -0
- package/dist/browser/components/TableCell/getSmallestParentWidth.d.ts +2 -0
- package/dist/browser/components/TableCell/getSmallestParentWidth.d.ts.map +1 -0
- package/dist/browser/components/TableCell/index.d.ts +4 -0
- package/dist/browser/components/TableCell/index.d.ts.map +1 -0
- package/dist/browser/components/ThemeTokenAvatar/ThemeTokenAvatar.d.ts +4 -0
- package/dist/browser/components/ThemeTokenAvatar/ThemeTokenAvatar.d.ts.map +1 -0
- package/dist/browser/components/ThemeTokenAvatar/index.d.ts +2 -0
- package/dist/browser/components/ThemeTokenAvatar/index.d.ts.map +1 -0
- package/dist/browser/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.d.ts +7 -0
- package/dist/browser/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.d.ts.map +1 -0
- package/dist/browser/components/ThemeTokenAvatarGroup/index.d.ts +2 -0
- package/dist/browser/components/ThemeTokenAvatarGroup/index.d.ts.map +1 -0
- package/dist/browser/components/TokenBar/TokenBar.d.ts +13 -0
- package/dist/browser/components/TokenBar/TokenBar.d.ts.map +1 -0
- package/dist/browser/components/TokenBar/index.d.ts +2 -0
- package/dist/browser/components/TokenBar/index.d.ts.map +1 -0
- package/dist/browser/components/TokenData/TokenData.d.ts +10 -0
- package/dist/browser/components/TokenData/TokenData.d.ts.map +1 -0
- package/dist/browser/components/TokenData/img/index.d.ts +16 -0
- package/dist/browser/components/TokenData/img/index.d.ts.map +1 -0
- package/dist/browser/components/TokenData/index.d.ts +3 -0
- package/dist/browser/components/TokenData/index.d.ts.map +1 -0
- package/dist/browser/components/TokenData/useGetTokenData.d.ts +3 -0
- package/dist/browser/components/TokenData/useGetTokenData.d.ts.map +1 -0
- package/dist/browser/components/TokenSummary/TokenSummary.d.ts +11 -0
- package/dist/browser/components/TokenSummary/TokenSummary.d.ts.map +1 -0
- package/dist/browser/components/TokenSummary/index.d.ts +2 -0
- package/dist/browser/components/TokenSummary/index.d.ts.map +1 -0
- package/dist/browser/components/TypographyEx.d.ts +7 -0
- package/dist/browser/components/TypographyEx.d.ts.map +1 -0
- package/dist/browser/components/index.d.ts +20 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/components/pluginValidation/DataMissing.d.ts +7 -0
- package/dist/browser/components/pluginValidation/DataMissing.d.ts.map +1 -0
- package/dist/browser/components/pluginValidation/index.d.ts +2 -0
- package/dist/browser/components/pluginValidation/index.d.ts.map +1 -0
- package/dist/browser/contexts/ListMode/Context.d.ts +3 -0
- package/dist/browser/contexts/ListMode/Context.d.ts.map +1 -0
- package/dist/browser/contexts/ListMode/Provider.d.ts +8 -0
- package/dist/browser/contexts/ListMode/Provider.d.ts.map +1 -0
- package/dist/browser/contexts/ListMode/State.d.ts +8 -0
- package/dist/browser/contexts/ListMode/State.d.ts.map +1 -0
- package/dist/browser/contexts/ListMode/index.d.ts +5 -0
- package/dist/browser/contexts/ListMode/index.d.ts.map +1 -0
- package/dist/browser/contexts/ListMode/use.d.ts +2 -0
- package/dist/browser/contexts/ListMode/use.d.ts.map +1 -0
- package/dist/browser/contexts/contextEx/ContextExProviderProps.d.ts +6 -0
- package/dist/browser/contexts/contextEx/ContextExProviderProps.d.ts.map +1 -0
- package/dist/browser/contexts/contextEx/State.d.ts +4 -0
- package/dist/browser/contexts/contextEx/State.d.ts.map +1 -0
- package/dist/browser/contexts/contextEx/create.d.ts +3 -0
- package/dist/browser/contexts/contextEx/create.d.ts.map +1 -0
- package/dist/browser/contexts/contextEx/index.d.ts +5 -0
- package/dist/browser/contexts/contextEx/index.d.ts.map +1 -0
- package/dist/browser/contexts/contextEx/use.d.ts +5 -0
- package/dist/browser/contexts/contextEx/use.d.ts.map +1 -0
- package/dist/browser/contexts/diviner/Context.d.ts +2 -0
- package/dist/browser/contexts/diviner/Context.d.ts.map +1 -0
- package/dist/browser/contexts/diviner/Provider.d.ts +10 -0
- package/dist/browser/contexts/diviner/Provider.d.ts.map +1 -0
- package/dist/browser/contexts/diviner/State.d.ts +7 -0
- package/dist/browser/contexts/diviner/State.d.ts.map +1 -0
- package/dist/browser/contexts/diviner/index.d.ts +4 -0
- package/dist/browser/contexts/diviner/index.d.ts.map +1 -0
- package/dist/browser/contexts/index.d.ts +4 -0
- package/dist/browser/contexts/index.d.ts.map +1 -0
- package/dist/browser/hooks/GradientStyles/GradientStyles.d.ts +67 -0
- package/dist/browser/hooks/GradientStyles/GradientStyles.d.ts.map +1 -0
- package/dist/browser/hooks/GradientStyles/index.d.ts +2 -0
- package/dist/browser/hooks/GradientStyles/index.d.ts.map +1 -0
- package/dist/browser/hooks/index.d.ts +8 -0
- package/dist/browser/hooks/index.d.ts.map +1 -0
- package/dist/browser/hooks/useDataState.d.ts +3 -0
- package/dist/browser/hooks/useDataState.d.ts.map +1 -0
- package/dist/browser/hooks/useIsMobile.d.ts +3 -0
- package/dist/browser/hooks/useIsMobile.d.ts.map +1 -0
- package/dist/browser/hooks/useMediaQuery.d.ts +2 -0
- package/dist/browser/hooks/useMediaQuery.d.ts.map +1 -0
- package/dist/browser/hooks/usePayloadHash.d.ts +4 -0
- package/dist/browser/hooks/usePayloadHash.d.ts.map +1 -0
- package/dist/browser/hooks/usePromise.d.ts +2 -0
- package/dist/browser/hooks/usePromise.d.ts.map +1 -0
- package/dist/browser/hooks/useShareForwardRef.d.ts +3 -0
- package/dist/browser/hooks/useShareForwardRef.d.ts.map +1 -0
- package/dist/browser/index.d.ts +7 -320
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/lib/assertDefinedEx.d.ts +2 -0
- package/dist/browser/lib/assertDefinedEx.d.ts.map +1 -0
- package/dist/browser/lib/getActualPaddingX.d.ts +14 -0
- package/dist/browser/lib/getActualPaddingX.d.ts.map +1 -0
- package/dist/browser/lib/index.d.ts +4 -0
- package/dist/browser/lib/index.d.ts.map +1 -0
- package/dist/browser/lib/networkComponents.d.ts +12 -0
- package/dist/browser/lib/networkComponents.d.ts.map +1 -0
- package/dist/browser/lib/xyo.d.ts +4 -0
- package/dist/browser/lib/xyo.d.ts.map +1 -0
- package/dist/browser/models/ListMode.d.ts +2 -0
- package/dist/browser/models/ListMode.d.ts.map +1 -0
- package/dist/browser/models/index.d.ts +2 -0
- package/dist/browser/models/index.d.ts.map +1 -0
- package/package.json +50 -44
- package/src/components/BasicHero/BasicHero.stories.tsx +1 -5
- package/src/components/BasicHero/BasicHero.tsx +21 -6
- package/src/components/Ellipsize.tsx +16 -8
- package/src/components/LabeledTextFieldWrapper.tsx +3 -1
- package/src/components/ListItemButtonEx.tsx +3 -1
- package/src/components/LoadResult.stories.tsx +4 -6
- package/src/components/LoadResult.tsx +3 -1
- package/src/components/ScrollTableOnSm.tsx +1 -3
- package/src/components/SectionSpacingRow/SectionSpacingRow.stories.tsx +1 -5
- package/src/components/SectionSpacingRow/SectionSpacingRow.tsx +3 -1
- package/src/components/StyleGuide/AppBars.example.tsx +3 -1
- package/src/components/StyleGuide/StyleGuide.stories.tsx +1 -5
- package/src/components/TableCell/AddressTableCell.tsx +3 -1
- package/src/components/TableCell/EllipsisTableCell.tsx +4 -4
- package/src/components/TableCell/EllipsisTableCellDeprecated.tsx +6 -2
- package/src/components/TableCell/EllipsizeTableCell.stories.tsx +9 -3
- package/src/components/TableCell/HashTableCell.tsx +3 -1
- package/src/components/ThemeTokenAvatar/ThemeTokenAvatar.stories.tsx +1 -5
- package/src/components/ThemeTokenAvatarGroup/ThemeTokenAvatarGroup.stories.tsx +1 -5
- package/src/components/TokenBar/TokenBar.stories.tsx +4 -6
- package/src/components/TokenBar/TokenBar.tsx +3 -1
- package/src/components/TokenData/useGetTokenData.tsx +1 -0
- package/src/components/TokenSummary/TokenSummary.stories.tsx +1 -5
- package/src/components/TokenSummary/TokenSummary.tsx +3 -1
- package/src/contexts/ListMode/Provider.tsx +4 -2
- package/src/contexts/diviner/Provider.tsx +10 -4
- package/src/hooks/GradientStyles/GradientStyle.stories.tsx +1 -5
- package/src/hooks/GradientStyles/GradientStyles.tsx +2 -6
- package/src/lib/networkComponents.tsx +18 -6
- package/src/lib/xyo.tsx +1 -0
- package/xy.config.ts +1 -3
|
@@ -7,11 +7,7 @@ import BackgroundImage from './default-desktop.svg'
|
|
|
7
7
|
const StorybookEntry = {
|
|
8
8
|
argTypes: {},
|
|
9
9
|
component: BasicHero,
|
|
10
|
-
parameters: {
|
|
11
|
-
docs: {
|
|
12
|
-
page: null,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
10
|
+
parameters: { docs: { page: null } },
|
|
15
11
|
title: 'shared/BasicHero',
|
|
16
12
|
} as Meta<typeof BasicHero>
|
|
17
13
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Container, Grid, Typography,
|
|
3
|
+
} from '@mui/material'
|
|
2
4
|
import { ButtonEx } from '@xylabs/react-button'
|
|
3
5
|
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
4
6
|
import { FlexGrowCol, FlexGrowRow } from '@xylabs/react-flexbox'
|
|
@@ -43,11 +45,16 @@ interface ButtonSectionProps {
|
|
|
43
45
|
href?: string
|
|
44
46
|
to?: string
|
|
45
47
|
}
|
|
46
|
-
const SubLinkSection: React.FC<SubLinkSectionProps> = ({
|
|
48
|
+
const SubLinkSection: React.FC<SubLinkSectionProps> = ({
|
|
49
|
+
backgroundImageAlignment, subLinkIcon, subLinkPath, subLinkText1, subLinkText2,
|
|
50
|
+
}) => {
|
|
47
51
|
return (
|
|
48
52
|
<FlexGrowRow
|
|
49
53
|
width="100%"
|
|
50
|
-
sx={{
|
|
54
|
+
sx={{
|
|
55
|
+
flexDirection: { md: 'row', xs: 'column' },
|
|
56
|
+
justifyContent: { md: backgroundImageAlignment ? 'flex-start' : 'center', xs: 'center' },
|
|
57
|
+
}}
|
|
51
58
|
>
|
|
52
59
|
{subLinkIcon
|
|
53
60
|
? (
|
|
@@ -68,7 +75,9 @@ const SubLinkSection: React.FC<SubLinkSectionProps> = ({ backgroundImageAlignmen
|
|
|
68
75
|
)
|
|
69
76
|
}
|
|
70
77
|
|
|
71
|
-
const ButtonSection: React.FC<ButtonSectionProps> = ({
|
|
78
|
+
const ButtonSection: React.FC<ButtonSectionProps> = ({
|
|
79
|
+
href, to, buttonText,
|
|
80
|
+
}) => {
|
|
72
81
|
const isMobile = useIsSmall()
|
|
73
82
|
return (
|
|
74
83
|
<ButtonEx
|
|
@@ -118,7 +127,9 @@ export const BasicHero: React.FC<BasicHeroProps> = ({
|
|
|
118
127
|
<FlexGrowCol
|
|
119
128
|
sx={{
|
|
120
129
|
backgroundImage: `url(${backgroundImage})`,
|
|
121
|
-
backgroundPosition: {
|
|
130
|
+
backgroundPosition: {
|
|
131
|
+
lg: 'bottom', md: 'center left', xs: 'top left',
|
|
132
|
+
},
|
|
122
133
|
minHeight: {
|
|
123
134
|
md: '500px',
|
|
124
135
|
sm: '400px',
|
|
@@ -165,7 +176,11 @@ export const BasicHero: React.FC<BasicHeroProps> = ({
|
|
|
165
176
|
<Typography variant="body1" component="h2" gutterBottom textAlign={backgroundImage && !isMobile ? 'left' : 'center'}>
|
|
166
177
|
{desc}
|
|
167
178
|
</Typography>
|
|
168
|
-
<FlexGrowRow
|
|
179
|
+
<FlexGrowRow
|
|
180
|
+
sx={{ flexDirection: { lg: 'row', xs: 'column' } }}
|
|
181
|
+
width="100%"
|
|
182
|
+
marginTop={1}
|
|
183
|
+
>
|
|
169
184
|
<ButtonSection href={button1Href} to={button1To} buttonText={button1Text} />
|
|
170
185
|
<ButtonSection href={button2Href} to={button2To} buttonText={button2Text} />
|
|
171
186
|
</FlexGrowRow>
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
BoxProps, TypographyProps, TypographyTypeMap,
|
|
3
|
+
} from '@mui/material'
|
|
4
|
+
import {
|
|
5
|
+
Box, styled, Typography,
|
|
6
|
+
} from '@mui/material'
|
|
3
7
|
import type { WithChildren } from '@xylabs/react-shared'
|
|
4
|
-
import React, {
|
|
8
|
+
import React, {
|
|
9
|
+
forwardRef, useCallback, useState,
|
|
10
|
+
} from 'react'
|
|
5
11
|
|
|
6
12
|
import { useShareForwardedRef } from '../hooks/index.ts'
|
|
7
13
|
|
|
@@ -38,15 +44,15 @@ const EllipsizeRoot = styled(Box, {
|
|
|
38
44
|
const EllipsizeInnerWrap = styled(Box, {
|
|
39
45
|
name: ComponentName,
|
|
40
46
|
slot: 'innerWrap',
|
|
41
|
-
})(() => ({
|
|
42
|
-
position: 'relative',
|
|
43
|
-
}))
|
|
47
|
+
})(() => ({ position: 'relative' }))
|
|
44
48
|
|
|
45
49
|
const EllipsizeContentWrap = styled(Typography, {
|
|
46
50
|
name: ComponentName,
|
|
47
51
|
shouldForwardProp: prop => prop !== 'ellipsisPosition',
|
|
48
52
|
slot: 'contentWrap',
|
|
49
|
-
})<TypographyWithComponentProps>(({
|
|
53
|
+
})<TypographyWithComponentProps>(({
|
|
54
|
+
theme, ellipsisPosition, fontFamily,
|
|
55
|
+
}) => {
|
|
50
56
|
return theme.unstable_sx({
|
|
51
57
|
fontFamily: fontFamily ?? 'monospace',
|
|
52
58
|
left: 0,
|
|
@@ -87,7 +93,9 @@ export interface EllipsizeBoxProps extends BoxProps {
|
|
|
87
93
|
}
|
|
88
94
|
|
|
89
95
|
export const EllipsizeBox = forwardRef<HTMLDivElement, WithChildren<EllipsizeBoxProps>>(
|
|
90
|
-
({
|
|
96
|
+
({
|
|
97
|
+
children, ellipsisPosition = 'start', disableSharedRef, typographyProps, ...props
|
|
98
|
+
}, ref) => {
|
|
91
99
|
// Allow syncing of :before pseudo element height with contentWrapHeight
|
|
92
100
|
const { contentWrapRef, contentWrapHeight } = useClientHeight()
|
|
93
101
|
const sharedRef = useShareForwardedRef(ref)
|
|
@@ -6,7 +6,9 @@ export interface LabeledTextFieldWrapperProps extends StackProps {
|
|
|
6
6
|
label: string
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const LabeledTextFieldWrapper: React.FC<LabeledTextFieldWrapperProps> = ({
|
|
9
|
+
export const LabeledTextFieldWrapper: React.FC<LabeledTextFieldWrapperProps> = ({
|
|
10
|
+
children, label, ...props
|
|
11
|
+
}) => {
|
|
10
12
|
return (
|
|
11
13
|
<Stack flexDirection="column" {...props}>
|
|
12
14
|
<Typography gutterBottom variant="caption">
|
|
@@ -11,7 +11,9 @@ export interface ListItemButtonExProps extends ListItemButtonProps {
|
|
|
11
11
|
toOptions?: NavigateOptions
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export const ListItemButtonExTo: React.FC<ListItemButtonExProps> = ({
|
|
14
|
+
export const ListItemButtonExTo: React.FC<ListItemButtonExProps> = ({
|
|
15
|
+
to, toOptions, onClick, ...props
|
|
16
|
+
}) => {
|
|
15
17
|
const navigate = useNavigate()
|
|
16
18
|
const localOnClick = (event: MouseEvent<HTMLDivElement>) => {
|
|
17
19
|
onClick?.(event)
|
|
@@ -6,11 +6,7 @@ import { LoadResult } from './LoadResult.tsx'
|
|
|
6
6
|
const StorybookEntry: Meta = {
|
|
7
7
|
argTypes: {},
|
|
8
8
|
component: LoadResult,
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
page: null,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
9
|
+
parameters: { docs: { page: null } },
|
|
14
10
|
title: 'webapp/LoadResult',
|
|
15
11
|
}
|
|
16
12
|
|
|
@@ -30,6 +26,8 @@ ApiError.args = { children: <h1>Shown in case of error</h1>, error: true }
|
|
|
30
26
|
const SearchResult = Template.bind({})
|
|
31
27
|
SearchResult.args = { children: <h1>Shown when there is a valid result</h1>, searchResult: 'foo' }
|
|
32
28
|
|
|
33
|
-
export {
|
|
29
|
+
export {
|
|
30
|
+
ApiError, Default, NotFound, SearchResult,
|
|
31
|
+
}
|
|
34
32
|
|
|
35
33
|
export default StorybookEntry
|
|
@@ -14,7 +14,9 @@ export interface LoadResultProps<T> {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function LoadResult<T>(props: PropsWithChildren<LoadResultProps<T>>) {
|
|
17
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
notFound, error, searchResult, children,
|
|
19
|
+
} = props
|
|
18
20
|
if (notFound) {
|
|
19
21
|
return <NotFound />
|
|
20
22
|
}
|
|
@@ -3,9 +3,7 @@ import type { WithChildren } from '@xylabs/react-shared'
|
|
|
3
3
|
import React from 'react'
|
|
4
4
|
|
|
5
5
|
const StyledScrollTableOnSm = styled('div')(({ theme }) => ({
|
|
6
|
-
[theme.breakpoints.down('md')]: {
|
|
7
|
-
overflowX: 'scroll',
|
|
8
|
-
},
|
|
6
|
+
[theme.breakpoints.down('md')]: { overflowX: 'scroll' },
|
|
9
7
|
display: 'flex',
|
|
10
8
|
flexGrow: 1,
|
|
11
9
|
}))
|
|
@@ -7,11 +7,7 @@ import { SectionSpacingRow } from './SectionSpacingRow.tsx'
|
|
|
7
7
|
const StorybookEntry = {
|
|
8
8
|
argTypes: {},
|
|
9
9
|
component: SectionSpacingRow,
|
|
10
|
-
parameters: {
|
|
11
|
-
docs: {
|
|
12
|
-
page: null,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
10
|
+
parameters: { docs: { page: null } },
|
|
15
11
|
title: 'shared/SectionSpacingRow',
|
|
16
12
|
} as Meta<typeof SectionSpacingRow>
|
|
17
13
|
|
|
@@ -3,7 +3,9 @@ import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
|
3
3
|
import { FlexGrowRow } from '@xylabs/react-flexbox'
|
|
4
4
|
import React, { forwardRef } from 'react'
|
|
5
5
|
|
|
6
|
-
export const SectionSpacingRow = forwardRef<HTMLDivElement, FlexBoxProps>(({
|
|
6
|
+
export const SectionSpacingRow = forwardRef<HTMLDivElement, FlexBoxProps>(({
|
|
7
|
+
children, sx, ...props
|
|
8
|
+
}, ref) => {
|
|
7
9
|
const theme = useTheme()
|
|
8
10
|
return (
|
|
9
11
|
<FlexGrowRow
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Menu as MenuIcon } from '@mui/icons-material'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Button, IconButton, Toolbar, Typography,
|
|
4
|
+
} from '@mui/material'
|
|
3
5
|
import { AppBarEx } from '@xylabs/react-appbar'
|
|
4
6
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
5
7
|
import React from 'react'
|
|
@@ -6,11 +6,7 @@ import { StyleGuideExample } from './StyleGuide.example.tsx'
|
|
|
6
6
|
const StorybookEntry = {
|
|
7
7
|
argTypes: {},
|
|
8
8
|
component: StyleGuideExample,
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
page: null,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
9
|
+
parameters: { docs: { page: null } },
|
|
14
10
|
title: 'shared/StyleGuide',
|
|
15
11
|
} as Meta<typeof StyleGuideExample>
|
|
16
12
|
|
|
@@ -11,7 +11,9 @@ export interface AddressTableCellProps extends Omit<EllipsisTableCellProps, 'ref
|
|
|
11
11
|
link?: boolean
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const AddressTableCell = forwardRef<HTMLElement, AddressTableCellProps>(({
|
|
14
|
+
const AddressTableCell = forwardRef<HTMLElement, AddressTableCellProps>(({
|
|
15
|
+
value, archive, exploreDomain, link, ...props
|
|
16
|
+
}, ref) => {
|
|
15
17
|
const href = exploreDomain && archive ? `${exploreDomain}/archive/${archive}/address/${value}` : undefined
|
|
16
18
|
const to = exploreDomain === undefined && archive ? `/archive/${archive}/address/${value}` : undefined
|
|
17
19
|
|
|
@@ -10,9 +10,7 @@ const EllipsisTableCellRoot = styled(TableCell, {
|
|
|
10
10
|
name: 'EllipsisTableCell',
|
|
11
11
|
shouldForwardProp: prop => prop !== 'width',
|
|
12
12
|
slot: 'Root',
|
|
13
|
-
})(({ width = '100%' }) => ({
|
|
14
|
-
width,
|
|
15
|
-
}))
|
|
13
|
+
})(({ width = '100%' }) => ({ width }))
|
|
16
14
|
|
|
17
15
|
export interface EllipsisTableCellProps extends Omit<TableCellProps, 'ref'> {
|
|
18
16
|
href?: string
|
|
@@ -29,7 +27,9 @@ export interface EllipsisTableCellProps extends Omit<TableCellProps, 'ref'> {
|
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
export const EllipsisTableCellWithRef = forwardRef<HTMLElement, EllipsisTableCellProps>(
|
|
32
|
-
({
|
|
30
|
+
({
|
|
31
|
+
children, href, link = false, to, value, ...props
|
|
32
|
+
}, ref) => {
|
|
33
33
|
const data = useMemo(() => {
|
|
34
34
|
if (children) {
|
|
35
35
|
return children
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { TableCellProps } from '@mui/material'
|
|
2
2
|
import { TableCell, useTheme } from '@mui/material'
|
|
3
3
|
import { LinkEx } from '@xylabs/react-link'
|
|
4
|
-
import React, {
|
|
4
|
+
import React, {
|
|
5
|
+
useEffect, useRef, useState,
|
|
6
|
+
} from 'react'
|
|
5
7
|
import type { To } from 'react-router-dom'
|
|
6
8
|
|
|
7
9
|
import { getActualPaddingX } from '../../lib/index.ts'
|
|
@@ -17,7 +19,9 @@ export interface EllipsisTableCellProps extends TableCellProps {
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
/** @deprecated - use new EllipsisTableCell */
|
|
20
|
-
export const EllipsisTableCellDeprecated: React.FC<EllipsisTableCellProps> = ({
|
|
22
|
+
export const EllipsisTableCellDeprecated: React.FC<EllipsisTableCellProps> = ({
|
|
23
|
+
children, value, to, forCell, href, ...props
|
|
24
|
+
}) => {
|
|
21
25
|
const [calcCellWidth, setCalcCellWidth] = useState<number>(0)
|
|
22
26
|
const hashDivRef = useRef<HTMLDivElement>(null)
|
|
23
27
|
const theme = useTheme()
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
Table, TableBody, TableCell, TableHead, TableRow,
|
|
3
|
+
} from '@mui/material'
|
|
4
|
+
import type {
|
|
5
|
+
Decorator, Meta, StoryFn,
|
|
6
|
+
} from '@storybook/react'
|
|
3
7
|
import React from 'react'
|
|
4
8
|
import { BrowserRouter } from 'react-router-dom'
|
|
5
9
|
|
|
@@ -96,4 +100,6 @@ WithMultiple.args = {}
|
|
|
96
100
|
const WithMultipleRows = TemplateWithMultipleRows.bind({})
|
|
97
101
|
WithMultipleRows.args = {}
|
|
98
102
|
|
|
99
|
-
export {
|
|
103
|
+
export {
|
|
104
|
+
Default, WithMultiple, WithMultipleRows,
|
|
105
|
+
}
|
|
@@ -13,7 +13,9 @@ export interface HashTableCellProps extends EllipsisTableCellProps {
|
|
|
13
13
|
onHashClick?: (value: Hash) => void
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export const HashTableCell: React.FC<HashTableCellProps> = ({
|
|
16
|
+
export const HashTableCell: React.FC<HashTableCellProps> = ({
|
|
17
|
+
value, archive, dataType, network, exploreDomain, onHashClick, ...props
|
|
18
|
+
}) => {
|
|
17
19
|
const ref = useRef<HTMLTableCellElement | null>(null)
|
|
18
20
|
const [tableCellRef, dispatch] = useEvent<HTMLTableCellElement>(undefined, ref)
|
|
19
21
|
const hashPath = `/${dataType}/hash/${value}?network=${network ?? 'main'}`
|
|
@@ -7,11 +7,7 @@ import { ThemeTokenAvatar } from './ThemeTokenAvatar.tsx'
|
|
|
7
7
|
const StorybookEntry = {
|
|
8
8
|
argTypes: {},
|
|
9
9
|
component: ThemeTokenAvatar,
|
|
10
|
-
parameters: {
|
|
11
|
-
docs: {
|
|
12
|
-
page: null,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
10
|
+
parameters: { docs: { page: null } },
|
|
15
11
|
title: 'shared/ThemeTokenAvatar',
|
|
16
12
|
} as Meta<typeof ThemeTokenAvatar>
|
|
17
13
|
|
|
@@ -7,11 +7,7 @@ import { ThemeTokenAvatarGroup } from './ThemeTokenAvatarGroup.tsx'
|
|
|
7
7
|
const StorybookEntry = {
|
|
8
8
|
argTypes: {},
|
|
9
9
|
component: ThemeTokenAvatarGroup,
|
|
10
|
-
parameters: {
|
|
11
|
-
docs: {
|
|
12
|
-
page: null,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
10
|
+
parameters: { docs: { page: null } },
|
|
15
11
|
title: 'shared/ThemeTokenAvatarGroup',
|
|
16
12
|
} as Meta<typeof ThemeTokenAvatarGroup>
|
|
17
13
|
|
|
@@ -7,11 +7,7 @@ import { TokenBar } from './TokenBar.tsx'
|
|
|
7
7
|
const StorybookEntry = {
|
|
8
8
|
argTypes: {},
|
|
9
9
|
component: TokenBar,
|
|
10
|
-
parameters: {
|
|
11
|
-
docs: {
|
|
12
|
-
page: null,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
10
|
+
parameters: { docs: { page: null } },
|
|
15
11
|
title: 'shared/TokenBar',
|
|
16
12
|
} as Meta<typeof TokenBar>
|
|
17
13
|
|
|
@@ -25,7 +21,9 @@ const WithData = Template.bind({})
|
|
|
25
21
|
WithData.args = { text1: 'Hello', text2: 'World' }
|
|
26
22
|
|
|
27
23
|
const WithSuffixes = Template.bind({})
|
|
28
|
-
WithSuffixes.args = {
|
|
24
|
+
WithSuffixes.args = {
|
|
25
|
+
text1: 'ETH', text2: '0.062342', text2Suffix: <QuickTipButton title="0.06234298345834958" />,
|
|
26
|
+
}
|
|
29
27
|
|
|
30
28
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
31
29
|
// @ts-ignore
|
|
@@ -12,7 +12,9 @@ export interface TokenBarProps extends PaperProps {
|
|
|
12
12
|
text2Suffix?: ReactNode
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export const TokenBar: React.FC<TokenBarProps> = ({
|
|
15
|
+
export const TokenBar: React.FC<TokenBarProps> = ({
|
|
16
|
+
text1, text1Props, text1Suffix, text2, text2Props, text2Suffix, ...props
|
|
17
|
+
}) => {
|
|
16
18
|
return (
|
|
17
19
|
<Paper elevation={0} className="TokenBar-root" {...props}>
|
|
18
20
|
<FlexRow justifyContent="space-between">
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TokenData } from './TokenData.ts'
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line @eslint-react/hooks-extra/ensure-custom-hooks-using-other-hooks
|
|
3
4
|
export const useGetTokenData = (symbols: (string | undefined)[]) => {
|
|
4
5
|
return symbols?.map((symbol) => {
|
|
5
6
|
const additionalTokenData = TokenData.find(x => x.tokenSymbol === symbol)
|
|
@@ -8,11 +8,7 @@ import { TokenSummary } from './TokenSummary.tsx'
|
|
|
8
8
|
const StorybookEntry = {
|
|
9
9
|
argTypes: {},
|
|
10
10
|
component: TokenSummary,
|
|
11
|
-
parameters: {
|
|
12
|
-
docs: {
|
|
13
|
-
page: null,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
11
|
+
parameters: { docs: { page: null } },
|
|
16
12
|
title: 'shared/TokenSummary',
|
|
17
13
|
} as Meta<typeof TokenSummary>
|
|
18
14
|
|
|
@@ -12,7 +12,9 @@ export interface TokenSummaryProps extends CardHeaderProps {
|
|
|
12
12
|
symbolElement?: ReactNode
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export const TokenSummary: React.FC<TokenSummaryProps> = ({
|
|
15
|
+
export const TokenSummary: React.FC<TokenSummaryProps> = ({
|
|
16
|
+
icon, symbol, symbolElement, children, ...props
|
|
17
|
+
}) => {
|
|
16
18
|
return (
|
|
17
19
|
<>
|
|
18
20
|
<CardHeader
|
|
@@ -11,9 +11,11 @@ export interface ListModeProviderProps {
|
|
|
11
11
|
export const ListModeProvider: React.FC<WithChildren<ListModeProviderProps>> = ({ children, defaultListMode }) => {
|
|
12
12
|
const [listMode, setListMode] = useState(defaultListMode ?? 'default')
|
|
13
13
|
|
|
14
|
-
const value = useMemo(() => ({
|
|
14
|
+
const value = useMemo(() => ({
|
|
15
|
+
listMode,
|
|
15
16
|
provided: true,
|
|
16
|
-
setListMode
|
|
17
|
+
setListMode,
|
|
18
|
+
}), [listMode,
|
|
17
19
|
setListMode])
|
|
18
20
|
|
|
19
21
|
return (
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { WithChildren } from '@xylabs/react-shared'
|
|
2
2
|
import type { Context } from 'react'
|
|
3
|
-
import React, {
|
|
3
|
+
import React, {
|
|
4
|
+
useEffect, useMemo, useState,
|
|
5
|
+
} from 'react'
|
|
4
6
|
|
|
5
7
|
import type { ContextExProviderProps } from '../contextEx/index.ts'
|
|
6
8
|
import type { ResolvedDivinerState } from './State.ts'
|
|
@@ -11,7 +13,9 @@ export interface DivinerProviderProps<D> extends ContextExProviderProps, WithChi
|
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
/** Exposes a resolved diviner */
|
|
14
|
-
export const ResolvedDivinerProvider = <D,>({
|
|
16
|
+
export const ResolvedDivinerProvider = <D,>({
|
|
17
|
+
diviner: divinerProp, required = false, children, context,
|
|
18
|
+
}: DivinerProviderProps<D>) => {
|
|
15
19
|
const [diviner, setDiviner] = useState<D | undefined>(divinerProp)
|
|
16
20
|
|
|
17
21
|
useEffect(() => {
|
|
@@ -28,9 +32,11 @@ export const ResolvedDivinerProvider = <D,>({ diviner: divinerProp, required = f
|
|
|
28
32
|
return diviner
|
|
29
33
|
}
|
|
30
34
|
}
|
|
31
|
-
return {
|
|
35
|
+
return {
|
|
36
|
+
diviner: resolveDiviner(),
|
|
32
37
|
provided: true,
|
|
33
|
-
setDiviner
|
|
38
|
+
setDiviner,
|
|
39
|
+
}
|
|
34
40
|
}, [
|
|
35
41
|
setDiviner, divinerProp])
|
|
36
42
|
|
|
@@ -51,11 +51,7 @@ const GradientTextExample: React.FC<FlexBoxProps> = (props) => {
|
|
|
51
51
|
const StorybookEntry = {
|
|
52
52
|
argTypes: {},
|
|
53
53
|
component: GradientTextExample,
|
|
54
|
-
parameters: {
|
|
55
|
-
docs: {
|
|
56
|
-
page: null,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
54
|
+
parameters: { docs: { page: null } },
|
|
59
55
|
title: 'shared/GradientText',
|
|
60
56
|
} as Meta<typeof GradientTextExample>
|
|
61
57
|
|
|
@@ -10,9 +10,7 @@ export interface GradientStyles {
|
|
|
10
10
|
|
|
11
11
|
export const colorfulGradientLightMode = () => {
|
|
12
12
|
return {
|
|
13
|
-
background: {
|
|
14
|
-
backgroundImage: '-webkit-linear-gradient(232deg, #e17751, #d84e7a, #5898dd, #8c8ee5)',
|
|
15
|
-
},
|
|
13
|
+
background: { backgroundImage: '-webkit-linear-gradient(232deg, #e17751, #d84e7a, #5898dd, #8c8ee5)' },
|
|
16
14
|
border: {
|
|
17
15
|
borderImage: '-webkit-linear-gradient(232deg, #e17751, #d84e7a, #5898dd, #8c8ee5)',
|
|
18
16
|
borderImageSlice: 1,
|
|
@@ -32,9 +30,7 @@ export const colorfulGradientLightMode = () => {
|
|
|
32
30
|
|
|
33
31
|
export const colorfulGradientDarkMode = () => {
|
|
34
32
|
return {
|
|
35
|
-
background: {
|
|
36
|
-
backgroundImage: '-webkit-linear-gradient(232deg, #F17938, #FF5BDC, #5898dd, #B2FFFD)',
|
|
37
|
-
},
|
|
33
|
+
background: { backgroundImage: '-webkit-linear-gradient(232deg, #F17938, #FF5BDC, #5898dd, #B2FFFD)' },
|
|
38
34
|
border: {
|
|
39
35
|
borderImage: '-webkit-linear-gradient(232deg, #F17938, #FF5BDC, #5898dd, #B2FFFD)',
|
|
40
36
|
borderImageSlice: 1,
|
|
@@ -19,12 +19,24 @@ export interface NetworkComponentDetails {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const networkComponents: NetworkComponentDetails[] = [
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
{
|
|
23
|
+
icon: props => <HubRoundedIcon {...props} />, name: 'Node', slug: 'node',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
icon: props => <TimerRoundedIcon {...props} />, name: 'Sentinel', slug: 'sentinel',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
icon: props => <InsertLinkRoundedIcon {...props} />, name: 'Bridge', slug: 'bridge',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
icon: props => <Inventory2RoundedIcon {...props} />, name: 'Archivist', slug: 'archivist',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
icon: props => <BubbleChartRoundedIcon {...props} />, name: 'Diviner', slug: 'diviner',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
icon: props => <VisibilityRoundedIcon {...props} />, name: 'Witness', slug: 'witness',
|
|
39
|
+
},
|
|
28
40
|
]
|
|
29
41
|
|
|
30
42
|
export const findNetworkComponentIndex = (slug: string) => {
|
package/src/lib/xyo.tsx
CHANGED