@xyo-network/react-property 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-property",
3
- "version": "7.5.8",
3
+ "version": "7.5.11",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -36,50 +36,113 @@
36
36
  },
37
37
  "./package.json": "./package.json"
38
38
  },
39
- "module": "dist/browser/index.mjs",
40
- "types": "dist/browser/index.d.ts",
41
39
  "files": [
42
40
  "dist",
43
- "src"
41
+ "README.md"
44
42
  ],
45
43
  "dependencies": {
46
- "@xylabs/react-flexbox": "~7.1.17",
47
- "@xylabs/react-identicon": "~7.1.17",
48
- "@xylabs/react-quick-tip-button": "~7.1.17",
49
- "@xylabs/react-theme": "~7.1.17",
50
- "@xyo-network/react-shared": "7.5.8",
51
- "@xyo-network/typeof": "~5.3.17"
44
+ "@xyo-network/react-shared": "~7.5.11"
52
45
  },
53
46
  "devDependencies": {
54
- "@mui/icons-material": "~7.3.9",
55
- "@mui/material": "~7.3.9",
56
- "@storybook/react-vite": "~10.3.3",
47
+ "@bitauth/libauth": "~3.0.0",
48
+ "@mui/icons-material": "^7.3.10",
49
+ "@mui/material": "^7.3.10",
50
+ "@opentelemetry/api": "^1.9.1",
51
+ "@opentelemetry/sdk-trace-base": "^2.7.0",
52
+ "@scure/base": "~2.2.0",
53
+ "@storybook/react-vite": "~10.3.5",
54
+ "@types/node": "~25.6.0",
57
55
  "@types/react": "^19.2.14",
58
- "@xylabs/react-button": "~7.1.17",
59
- "@xylabs/react-theme": "~7.1.17",
60
- "@xylabs/ts-scripts-common": "~7.5.6",
61
- "@xylabs/ts-scripts-yarn3": "~7.5.6",
62
- "@xylabs/tsconfig": "~7.5.6",
63
- "@xylabs/tsconfig-dom": "~7.5.6",
64
- "@xylabs/tsconfig-react": "~7.5.6",
65
- "react": "^19.2.4",
66
- "react-dom": "^19.2.4",
67
- "react-router-dom": "^7.13.2",
68
- "storybook": "~10.3.3",
56
+ "@xylabs/react-async-effect": "~7.1.20",
57
+ "@xylabs/react-button": "~7.1.20",
58
+ "@xylabs/react-dialogs": "~7.1.20",
59
+ "@xylabs/react-flexbox": "~7.1.20",
60
+ "@xylabs/react-hooks": "~7.1.20",
61
+ "@xylabs/react-identicon": "~7.1.20",
62
+ "@xylabs/react-link": "~7.1.20",
63
+ "@xylabs/react-promise": "~7.1.20",
64
+ "@xylabs/react-quick-tip-button": "~7.1.20",
65
+ "@xylabs/react-shared": "~7.1.20",
66
+ "@xylabs/react-theme": "~7.1.20",
67
+ "@xylabs/sdk-js": "^5.0.100",
68
+ "@xylabs/threads": "~5.0.100",
69
+ "@xylabs/toolchain": "~7.11.9",
70
+ "@xylabs/tsconfig": "^7.11.9",
71
+ "@xylabs/tsconfig-dom": "^7.11.9",
72
+ "@xylabs/tsconfig-react": "~7.11.9",
73
+ "@xylabs/zod": "~5.0.100",
74
+ "@xyo-network/boundwitness-model": "^5.5.1",
75
+ "@xyo-network/boundwitness-validator": "^5.5.1",
76
+ "@xyo-network/payload-builder": "^5.5.1",
77
+ "@xyo-network/payload-model": "^5.5.1",
78
+ "@xyo-network/typeof": "~5.3.30",
79
+ "async-mutex": "^0.5.0",
80
+ "axios": "^1.15.2",
81
+ "bn.js": "^5.2.3",
82
+ "bowser": "^2.14.1",
83
+ "buffer": "^6.0.3",
84
+ "chalk": "^5.6.2",
85
+ "debug": "~4.4.3",
86
+ "esbuild": "~0.28.0",
87
+ "eslint": "^10.2.1",
88
+ "ethers": "^6.16.0",
89
+ "fast-deep-equal": "~3.1.3",
90
+ "hash-wasm": "~4.12.0",
91
+ "js-cookie": "~3.0.5",
92
+ "observable-fns": "~0.6.1",
93
+ "pako": "^2.1.0",
94
+ "react": "^19.2.5",
95
+ "react-dom": "^19.2.5",
96
+ "react-router-dom": "^7.14.2",
97
+ "spark-md5": "~3.0.2",
98
+ "storybook": "^10.3.5",
69
99
  "typescript": "^5.9.3",
70
- "vite": "~8.0.3",
100
+ "vite": "^8.0.10",
101
+ "wasm-feature-detect": "~1.8.0",
71
102
  "zod": "^4.3.6"
72
103
  },
73
104
  "peerDependencies": {
74
- "@mui/icons-material": ">=6 <8",
75
- "@mui/material": ">=6 <8",
76
- "react": "^19",
77
- "react-dom": "^19",
78
- "react-router-dom": "^7",
79
- "zod": "^4"
105
+ "@mui/icons-material": "^7.3.10",
106
+ "@mui/material": "^7.3.10",
107
+ "@opentelemetry/api": "^1.9.1",
108
+ "@opentelemetry/sdk-trace-base": "^2.7.0",
109
+ "@scure/base": "~2.2.0",
110
+ "@xylabs/react-async-effect": "~7.1.20",
111
+ "@xylabs/react-button": "~7.1.20",
112
+ "@xylabs/react-dialogs": "~7.1.20",
113
+ "@xylabs/react-flexbox": "~7.1.20",
114
+ "@xylabs/react-hooks": "~7.1.20",
115
+ "@xylabs/react-identicon": "~7.1.20",
116
+ "@xylabs/react-link": "~7.1.20",
117
+ "@xylabs/react-promise": "~7.1.20",
118
+ "@xylabs/react-quick-tip-button": "~7.1.20",
119
+ "@xylabs/react-shared": "~7.1.20",
120
+ "@xylabs/react-theme": "~7.1.20",
121
+ "@xylabs/sdk-js": "^5.0.100",
122
+ "@xylabs/zod": "~5.0.100",
123
+ "@xyo-network/boundwitness-model": "^5.5.1",
124
+ "@xyo-network/boundwitness-validator": "^5.5.1",
125
+ "@xyo-network/payload-builder": "^5.5.1",
126
+ "@xyo-network/payload-model": "^5.5.1",
127
+ "@xyo-network/typeof": "~5.3.30",
128
+ "async-mutex": "^0.5.0",
129
+ "axios": "^1.15.2",
130
+ "bn.js": "^5.2.3",
131
+ "bowser": "^2.14.1",
132
+ "buffer": "^6.0.3",
133
+ "chalk": "^5.6.2",
134
+ "ethers": "^6.16.0",
135
+ "fast-deep-equal": "~3.1.3",
136
+ "js-cookie": "~3.0.5",
137
+ "pako": "^2.1.0",
138
+ "react": "^19.2.5",
139
+ "react-dom": "^19.2.5",
140
+ "react-router-dom": "^7.14.2",
141
+ "spark-md5": "~3.0.2",
142
+ "zod": "^4.3.6"
80
143
  },
81
144
  "publishConfig": {
82
145
  "access": "public"
83
146
  },
84
147
  "docs": "dist/docs.json"
85
- }
148
+ }
@@ -1,8 +0,0 @@
1
- import type { ReactNode } from 'react'
2
-
3
- export interface PropertyAction {
4
- disabled?: boolean
5
- icon?: ReactNode
6
- name: string
7
- onClick?: () => void
8
- }
@@ -1,45 +0,0 @@
1
- import { IconButton } from '@mui/material'
2
- import { ButtonEx } from '@xylabs/react-button'
3
- import { FlexRow } from '@xylabs/react-flexbox'
4
- import React from 'react'
5
-
6
- import type { PropertyActionsProps } from './ActionsProps.ts'
7
-
8
- export const PropertyActions: React.FC<PropertyActionsProps> = ({
9
- buttons = false, actions, ...props
10
- }) => {
11
- if (actions) {
12
- return (actions?.length ?? 0) > 0
13
- ? (
14
- <FlexRow gap={1} {...props}>
15
- {actions.map((action, index) => {
16
- return (
17
- action.icon
18
- ? (
19
- <IconButton size="small" key={index} color="inherit" onClick={action.onClick}>
20
- {action.icon}
21
- </IconButton>
22
- )
23
- : buttons
24
- ? (
25
- <ButtonEx
26
- paddingY={0}
27
- color="primary"
28
- key={index}
29
- size="small"
30
- disabled={action.disabled}
31
- onClick={action.onClick}
32
- variant="contained"
33
- >
34
- {action.name}
35
- </ButtonEx>
36
- )
37
- : null
38
- )
39
- })}
40
- </FlexRow>
41
- )
42
- : null
43
- }
44
- return null
45
- }
@@ -1,45 +0,0 @@
1
- import { MoreHoriz as MoreHorizIcon } from '@mui/icons-material'
2
- import {
3
- IconButton, Menu, MenuItem,
4
- } from '@mui/material'
5
- import { FlexRow } from '@xylabs/react-flexbox'
6
- import React, { useState } from 'react'
7
-
8
- import type { PropertyActionsProps } from './ActionsProps.ts'
9
-
10
- export const PropertyActionsMenu: React.FC<PropertyActionsProps> = ({ actions, ...props }) => {
11
- const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null)
12
- const open = !!anchorEl
13
-
14
- const handleClick = (event: React.MouseEvent<HTMLElement>) => {
15
- setAnchorEl(event.currentTarget)
16
- }
17
- const handleClose = () => {
18
- setAnchorEl(null)
19
- }
20
-
21
- return actions && actions?.length > 0
22
- ? (
23
- <FlexRow {...props}>
24
- <IconButton size="small" color="inherit" onClick={handleClick}>
25
- <MoreHorizIcon fontSize="inherit" />
26
- </IconButton>
27
- <Menu anchorEl={anchorEl} open={open} onClose={handleClose}>
28
- {actions?.map((action) => {
29
- return (
30
- <MenuItem
31
- key={action.name}
32
- onClick={() => {
33
- action?.onClick?.()
34
- handleClose()
35
- }}
36
- >
37
- {action.name}
38
- </MenuItem>
39
- )
40
- })}
41
- </Menu>
42
- </FlexRow>
43
- )
44
- : null
45
- }
@@ -1,8 +0,0 @@
1
- import type { FlexBoxProps } from '@xylabs/react-flexbox'
2
-
3
- import type { PropertyAction } from './Action.ts'
4
-
5
- export interface PropertyActionsProps extends FlexBoxProps {
6
- actions?: PropertyAction[]
7
- buttons?: boolean
8
- }
@@ -1,62 +0,0 @@
1
- import { Paper, useTheme } from '@mui/material'
2
- import {
3
- FlexCol, FlexGrowRow, FlexRow,
4
- } from '@xylabs/react-flexbox'
5
- import { typeOf } from '@xyo-network/typeof'
6
- import type { ReactElement } from 'react'
7
- import React from 'react'
8
-
9
- import type {
10
- PropertyGroupBoxProps, PropertyGroupPaperProps, PropertyGroupProps,
11
- } from './Props.ts'
12
- import { PropertyTitle } from './Title.tsx'
13
-
14
- const PropertyGroupBox: React.FC<PropertyGroupBoxProps> = ({
15
- titleProps, children, title, tip, ...props
16
- }) => {
17
- const theme = useTheme()
18
- const childrenArray = typeOf(children) === 'array' ? (children as ReactElement[]) : undefined
19
- return (
20
- <FlexCol alignItems="stretch" overflow="hidden" {...props}>
21
- <FlexRow overflow="hidden" justifyContent="stretch" alignItems="stretch">
22
- <PropertyTitle alignItems="flex-start" size="full" title={title} tip={tip} {...titleProps} />
23
- {childrenArray
24
- ? (
25
- <FlexGrowRow>
26
- {childrenArray?.map((child, index) => {
27
- return child
28
- ? (
29
- <FlexGrowRow key={index} borderLeft={1} borderColor={theme.vars.palette.divider}>
30
- {child}
31
- </FlexGrowRow>
32
- )
33
- : null
34
- })}
35
- </FlexGrowRow>
36
- )
37
- : <FlexGrowRow overflow="hidden">{children}</FlexGrowRow>}
38
- </FlexRow>
39
- </FlexCol>
40
- )
41
- }
42
-
43
- const PropertyGroupPaper: React.FC<PropertyGroupPaperProps> = ({
44
- style, variant, elevation, square, ...props
45
- }) => {
46
- return (
47
- <Paper
48
- style={{
49
- minWidth: 0, overflow: 'hidden', ...style,
50
- }}
51
- variant={variant}
52
- elevation={elevation}
53
- square={square}
54
- >
55
- <PropertyGroupBox {...props} paper={false} />
56
- </Paper>
57
- )
58
- }
59
-
60
- export const PropertyGroup: React.FC<PropertyGroupProps> = (props) => {
61
- return props.paper ? <PropertyGroupPaper {...props} /> : <PropertyGroupBox {...props} />
62
- }
@@ -1,28 +0,0 @@
1
- import { useTheme } from '@mui/material'
2
- import type { FlexBoxProps } from '@xylabs/react-flexbox'
3
- import { FlexRow } from '@xylabs/react-flexbox'
4
- import { Identicon } from '@xylabs/react-identicon'
5
- import React, { useMemo, useRef } from 'react'
6
-
7
- export interface IdenticonCornerProps extends FlexBoxProps {
8
- value?: string | number | boolean | null
9
- }
10
-
11
- export const IdenticonCorner: React.FC<IdenticonCornerProps> = ({ value, ...props }) => {
12
- const theme = useTheme()
13
- const ref = useRef<HTMLDivElement>(null)
14
-
15
- const parentHeight = useMemo(() => ref.current?.parentElement?.parentElement?.clientHeight, [ref.current])
16
-
17
- const calculatedHeight = parentHeight ?? 0
18
-
19
- return (
20
- <FlexRow alignItems="flex-start" height="100%">
21
- <FlexRow background height={calculatedHeight} width={calculatedHeight} borderLeft={`1px solid ${theme.vars.palette.divider}`}>
22
- <div ref={ref}>
23
- <Identicon size={calculatedHeight * 0.6} value={`${value}`} sx={{ padding: `${calculatedHeight * 0.2}px` }} {...props} />
24
- </div>
25
- </FlexRow>
26
- </FlexRow>
27
- )
28
- }
@@ -1,86 +0,0 @@
1
- import type { TypographyVariant } from '@mui/material'
2
- import { CircularProgress, Paper } from '@mui/material'
3
- import { FlexRow } from '@xylabs/react-flexbox'
4
- import type { SizeProp } from '@xyo-network/react-shared'
5
- import React from 'react'
6
-
7
- import { PropertyActionsMenu } from './ActionsMenu.tsx'
8
- import { IdenticonCorner } from './IdenticonCorner.tsx'
9
- import type {
10
- PropertyBoxProps, PropertyPaperProps, PropertyProps,
11
- } from './Props.ts'
12
- import { PropertyTitle } from './Title.tsx'
13
- import { PropertyValue } from './Value.tsx'
14
-
15
- const PropertyBox: React.FC<PropertyBoxProps> = ({
16
- titleProps, title, value, children, size = 'medium', tip, actions, required, badge = false, ...props
17
- }) => {
18
- const sizeValueHeight: Record<SizeProp, number> = {
19
- large: 48,
20
- medium: 36,
21
- small: 24,
22
- }
23
-
24
- const sizeVariants: Record<SizeProp, TypographyVariant> = {
25
- large: 'h6',
26
- medium: 'body1',
27
- small: 'body2',
28
- }
29
-
30
- return (
31
- <FlexRow flexDirection="column" minWidth={0} alignItems="stretch" overflow="hidden" {...props}>
32
- {title === undefined
33
- ? null
34
- : (
35
- <PropertyTitle
36
- tip={tip}
37
- title={required ? `${title}*` : title}
38
- size={size}
39
- more={<PropertyActionsMenu actions={actions} />}
40
- {...titleProps}
41
- />
42
- )}
43
- <FlexRow
44
- pl={1}
45
- columnGap={1}
46
- justifyContent={value === undefined ? 'center' : 'space-between'}
47
- overflow="hidden"
48
- height={sizeValueHeight[size]}
49
- >
50
- {children ?? ((value === undefined)
51
- ? <CircularProgress size={16} />
52
- : <PropertyValue value={value} typographyVariant={sizeVariants[size]} />)}
53
- {value === undefined
54
- ? null
55
- : badge
56
- ? <IdenticonCorner value={value} />
57
- : null}
58
- </FlexRow>
59
- </FlexRow>
60
- )
61
- }
62
- PropertyBox.displayName = 'PropertyBox'
63
-
64
- const PropertyPaper: React.FC<PropertyPaperProps> = ({
65
- ref, style, variant, elevation = 2, square, ...props
66
- }) => {
67
- return (
68
- <Paper
69
- ref={ref}
70
- style={{
71
- minWidth: 0, overflow: 'hidden', ...style,
72
- }}
73
- variant={variant}
74
- elevation={elevation}
75
- square={square}
76
- >
77
- <PropertyBox {...props} paper={false} />
78
- </Paper>
79
- )
80
- }
81
- PropertyPaper.displayName = 'PropertyPaper'
82
-
83
- export const Property: React.FC<PropertyProps> = ({ ...props }) => {
84
- return props.paper ? <PropertyPaper {...props} /> : <PropertyBox {...props} />
85
- }
86
- Property.displayName = 'Property'
@@ -1,173 +0,0 @@
1
- import { Replay as ReplayIcon } from '@mui/icons-material'
2
- import { TextField } from '@mui/material'
3
- import type { Meta, StoryFn } from '@storybook/react-vite'
4
- import { FlexCol, FlexRow } from '@xylabs/react-flexbox'
5
- import React from 'react'
6
-
7
- import { Property } from './Property.tsx'
8
- import type { PropertyProps } from './Props.ts'
9
-
10
- const StorybookEntry = {
11
- argTypes: {},
12
- component: Property,
13
- parameters: { docs: { page: null } },
14
- title: 'property/PropertyBox',
15
- } as Meta<typeof Property>
16
-
17
- const Template: StoryFn = (args: PropertyProps) => <Property {...args} paper={false}></Property>
18
-
19
- const TemplateWithCompare: StoryFn = (args: PropertyProps) => (
20
- <FlexCol gap={1} alignItems="stretch">
21
- <FlexRow gap={1}>
22
- <TextField size="small" value="Sample text Field" />
23
- <Property {...args} size="small"></Property>
24
- </FlexRow>
25
- <FlexRow gap={1}>
26
- <Property {...args} size="small"></Property>
27
- <Property {...args} size="small"></Property>
28
- </FlexRow>
29
- <FlexRow gap={1}>
30
- <TextField size="medium" value="Sample text Field" />
31
- <Property {...args} size="medium"></Property>
32
- </FlexRow>
33
- <FlexRow gap={1}>
34
- <Property {...args} size="medium"></Property>
35
- <Property {...args} size="medium"></Property>
36
- </FlexRow>
37
- <FlexRow gap={1}>
38
- <TextField value="Sample text Field" />
39
- <Property {...args} size="large"></Property>
40
- </FlexRow>
41
- <FlexRow gap={1}>
42
- <Property {...args} size="large"></Property>
43
- <Property {...args} size="large"></Property>
44
- </FlexRow>
45
- </FlexCol>
46
- )
47
-
48
- const Default = Template.bind({})
49
- Default.args = {}
50
-
51
- const WithTitle = Template.bind({})
52
- WithTitle.args = { title: 'No Data' }
53
-
54
- const WithUndefinedData = Template.bind({})
55
- WithUndefinedData.args = { title: 'Block Hash' }
56
-
57
- const WithData = Template.bind({})
58
- WithData.args = {
59
- title: 'Block Hash',
60
- // value: await PayloadBuilder.dataHash(sampleBlock)
61
- }
62
-
63
- const WithDataSmall = Template.bind({})
64
- WithDataSmall.args = {
65
- size: 'small',
66
- title: 'Block Hash',
67
- // value: await PayloadBuilder.dataHash(sampleBlock)
68
- }
69
-
70
- const WithDataCompare = TemplateWithCompare.bind({})
71
- WithDataCompare.args = {
72
- tip: 'This is the block hash',
73
- title: 'Block Hash',
74
- // value: await PayloadBuilder.dataHash(sampleBlock),
75
- }
76
-
77
- const WithDataAndBadgeSmall = Template.bind({})
78
- WithDataAndBadgeSmall.args = {
79
- badge: true,
80
- size: 'small',
81
- tip: 'This is the block hash',
82
- title: 'Block Hash',
83
- // value: await PayloadBuilder.dataHash(sampleBlock),
84
- }
85
-
86
- const WithDataAndBadgeMedium = Template.bind({})
87
- WithDataAndBadgeMedium.args = {
88
- badge: true,
89
- size: 'medium',
90
- tip: 'This is the block hash',
91
- title: 'Block Hash',
92
- // value: await PayloadBuilder.dataHash(sampleBlock),
93
- }
94
-
95
- const WithDataAndBadgeLarge = Template.bind({})
96
- WithDataAndBadgeLarge.args = {
97
- badge: true,
98
- size: 'large',
99
- tip: 'This is the block hash',
100
- title: 'Block Hash',
101
- // value: await PayloadBuilder.dataHash(sampleBlock),
102
- }
103
-
104
- const WithTip = Template.bind({})
105
- WithTip.args = {
106
- tip: 'This is the block hash',
107
- title: 'Block Hash',
108
- // value: await PayloadBuilder.dataHash(sampleBlock),
109
- }
110
-
111
- const WithTipAndBadge = Template.bind({})
112
- WithTipAndBadge.args = {
113
- badge: true,
114
- tip: 'This is the block hash',
115
- title: 'Block Hash',
116
- // value: await PayloadBuilder.dataHash(sampleBlock),
117
- }
118
-
119
- const WithActions = Template.bind({})
120
- WithActions.args = {
121
- actions: [{ name: 'ActionOne' }, { name: 'ActionTwo' }],
122
- tip: 'This is the block hash',
123
- title: 'Block Hash',
124
- // value: await PayloadBuilder.dataHash(sampleBlock),
125
- }
126
-
127
- const LargeWithValue = Template.bind({})
128
- LargeWithValue.args = {
129
- badge: true,
130
- size: 'large',
131
- tip: 'This is the block hash',
132
- title: 'Block Hash',
133
- // value: await PayloadBuilder.dataHash(sampleBlock),
134
- }
135
-
136
- const LargeWithValueAndActions = Template.bind({})
137
- LargeWithValueAndActions.args = {
138
- actions: [{ icon: <ReplayIcon />, name: 'ActionOne' }, { name: 'ActionTwo' }],
139
- badge: true,
140
- size: 'large',
141
- tip: 'This is the block hash',
142
- title: 'Block Hash',
143
- // value: await PayloadBuilder.dataHash(sampleBlock),
144
- }
145
-
146
- const SmallWithValueAndActions = Template.bind({})
147
- SmallWithValueAndActions.args = {
148
- actions: [{ icon: <ReplayIcon />, name: 'ActionOne' }, { name: 'ActionTwo' }],
149
- badge: true,
150
- size: 'small',
151
- tip: 'This is the block hash',
152
- title: 'Block Hash',
153
- // value: await PayloadBuilder.dataHash(sampleBlock),
154
- }
155
-
156
- export {
157
- Default,
158
- LargeWithValue,
159
- LargeWithValueAndActions,
160
- SmallWithValueAndActions,
161
- WithActions,
162
- WithData,
163
- WithDataAndBadgeLarge,
164
- WithDataAndBadgeMedium,
165
- WithDataAndBadgeSmall,
166
- WithDataCompare,
167
- WithDataSmall,
168
- WithTip,
169
- WithTipAndBadge,
170
- WithUndefinedData,
171
- }
172
-
173
- export default StorybookEntry