@xyo-network/react-property 2.25.20 → 2.25.23

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 (105) hide show
  1. package/dist/cjs/components/{PropertyAction.d.ts → Action.d.ts} +0 -0
  2. package/dist/cjs/components/{PropertyProps.js → Action.js} +1 -1
  3. package/dist/cjs/components/Action.js.map +1 -0
  4. package/dist/{esm/components/PropertyActions.d.ts → cjs/components/Actions.d.ts} +1 -1
  5. package/dist/cjs/components/{PropertyActions.js → Actions.js} +1 -1
  6. package/dist/cjs/components/Actions.js.map +1 -0
  7. package/dist/cjs/components/{PropertyActionsMenu.d.ts → ActionsMenu.d.ts} +1 -1
  8. package/dist/cjs/components/{PropertyActionsMenu.js → ActionsMenu.js} +1 -1
  9. package/dist/cjs/components/ActionsMenu.js.map +1 -0
  10. package/dist/cjs/components/{PropertyActionsProps.d.ts → ActionsProps.d.ts} +1 -1
  11. package/dist/cjs/components/{PropertyAction.js → ActionsProps.js} +1 -1
  12. package/dist/cjs/components/ActionsProps.js.map +1 -0
  13. package/dist/{esm/components/PropertyGroup.d.ts → cjs/components/Group.d.ts} +1 -1
  14. package/dist/cjs/components/Group.js +26 -0
  15. package/dist/cjs/components/Group.js.map +1 -0
  16. package/dist/cjs/components/IdenticonCorner.js +1 -1
  17. package/dist/cjs/components/IdenticonCorner.js.map +1 -1
  18. package/dist/cjs/components/Property.d.ts +1 -1
  19. package/dist/cjs/components/Property.js +14 -14
  20. package/dist/cjs/components/Property.js.map +1 -1
  21. package/dist/cjs/components/Props.d.ts +34 -0
  22. package/dist/cjs/components/{PropertyActionsProps.js → Props.js} +1 -1
  23. package/dist/cjs/components/Props.js.map +1 -0
  24. package/dist/cjs/components/Title.d.ts +4 -1
  25. package/dist/cjs/components/Title.js +17 -3
  26. package/dist/cjs/components/Title.js.map +1 -1
  27. package/dist/cjs/components/Value.js +1 -1
  28. package/dist/cjs/components/Value.js.map +1 -1
  29. package/dist/cjs/components/index.d.ts +3 -4
  30. package/dist/cjs/components/index.js +3 -4
  31. package/dist/cjs/components/index.js.map +1 -1
  32. package/dist/docs.json +2607 -52115
  33. package/dist/esm/components/{PropertyAction.d.ts → Action.d.ts} +0 -0
  34. package/dist/esm/components/Action.js +2 -0
  35. package/dist/esm/components/Action.js.map +1 -0
  36. package/dist/{cjs/components/PropertyActions.d.ts → esm/components/Actions.d.ts} +1 -1
  37. package/dist/esm/components/{PropertyActions.js → Actions.js} +1 -1
  38. package/dist/esm/components/Actions.js.map +1 -0
  39. package/dist/esm/components/{PropertyActionsMenu.d.ts → ActionsMenu.d.ts} +1 -1
  40. package/dist/esm/components/{PropertyActionsMenu.js → ActionsMenu.js} +1 -1
  41. package/dist/esm/components/ActionsMenu.js.map +1 -0
  42. package/dist/esm/components/{PropertyActionsProps.d.ts → ActionsProps.d.ts} +1 -1
  43. package/dist/esm/components/ActionsProps.js +2 -0
  44. package/dist/esm/components/ActionsProps.js.map +1 -0
  45. package/dist/{cjs/components/PropertyGroup.d.ts → esm/components/Group.d.ts} +1 -1
  46. package/dist/esm/components/Group.js +19 -0
  47. package/dist/esm/components/Group.js.map +1 -0
  48. package/dist/esm/components/IdenticonCorner.js +1 -1
  49. package/dist/esm/components/IdenticonCorner.js.map +1 -1
  50. package/dist/esm/components/Property.d.ts +1 -1
  51. package/dist/esm/components/Property.js +14 -15
  52. package/dist/esm/components/Property.js.map +1 -1
  53. package/dist/esm/components/Props.d.ts +34 -0
  54. package/dist/esm/components/Props.js +2 -0
  55. package/dist/esm/components/Props.js.map +1 -0
  56. package/dist/esm/components/Title.d.ts +4 -1
  57. package/dist/esm/components/Title.js +18 -4
  58. package/dist/esm/components/Title.js.map +1 -1
  59. package/dist/esm/components/Value.js +1 -1
  60. package/dist/esm/components/Value.js.map +1 -1
  61. package/dist/esm/components/index.d.ts +3 -4
  62. package/dist/esm/components/index.js +3 -4
  63. package/dist/esm/components/index.js.map +1 -1
  64. package/package.json +7 -7
  65. package/src/components/{PropertyAction.ts → Action.ts} +0 -0
  66. package/src/components/{PropertyActions.tsx → Actions.tsx} +1 -1
  67. package/src/components/{PropertyActionsMenu.tsx → ActionsMenu.tsx} +1 -1
  68. package/src/components/{PropertyActionsProps.ts → ActionsProps.ts} +1 -1
  69. package/src/components/Group.tsx +42 -0
  70. package/src/components/IdenticonCorner.tsx +1 -1
  71. package/src/components/Property.tsx +24 -55
  72. package/src/components/{Property.stories.tsx → PropertyBox.stories.tsx} +9 -9
  73. package/src/components/PropertyPaper.stories.tsx +174 -0
  74. package/src/components/Props.tsx +48 -0
  75. package/src/components/Title.tsx +38 -10
  76. package/src/components/Value.tsx +1 -1
  77. package/src/components/index.ts +3 -4
  78. package/dist/cjs/components/PropertyAction.js.map +0 -1
  79. package/dist/cjs/components/PropertyActions.js.map +0 -1
  80. package/dist/cjs/components/PropertyActionsMenu.js.map +0 -1
  81. package/dist/cjs/components/PropertyActionsProps.js.map +0 -1
  82. package/dist/cjs/components/PropertyGroup.js +0 -19
  83. package/dist/cjs/components/PropertyGroup.js.map +0 -1
  84. package/dist/cjs/components/PropertyProps.d.ts +0 -18
  85. package/dist/cjs/components/PropertyProps.js.map +0 -1
  86. package/dist/cjs/components/usePropertyHeroProps.d.ts +0 -6
  87. package/dist/cjs/components/usePropertyHeroProps.js +0 -15
  88. package/dist/cjs/components/usePropertyHeroProps.js.map +0 -1
  89. package/dist/esm/components/PropertyAction.js +0 -2
  90. package/dist/esm/components/PropertyAction.js.map +0 -1
  91. package/dist/esm/components/PropertyActions.js.map +0 -1
  92. package/dist/esm/components/PropertyActionsMenu.js.map +0 -1
  93. package/dist/esm/components/PropertyActionsProps.js +0 -2
  94. package/dist/esm/components/PropertyActionsProps.js.map +0 -1
  95. package/dist/esm/components/PropertyGroup.js +0 -13
  96. package/dist/esm/components/PropertyGroup.js.map +0 -1
  97. package/dist/esm/components/PropertyProps.d.ts +0 -18
  98. package/dist/esm/components/PropertyProps.js +0 -2
  99. package/dist/esm/components/PropertyProps.js.map +0 -1
  100. package/dist/esm/components/usePropertyHeroProps.d.ts +0 -6
  101. package/dist/esm/components/usePropertyHeroProps.js +0 -12
  102. package/dist/esm/components/usePropertyHeroProps.js.map +0 -1
  103. package/src/components/PropertyGroup.tsx +0 -45
  104. package/src/components/PropertyProps.tsx +0 -21
  105. package/src/components/usePropertyHeroProps.tsx +0 -12
@@ -0,0 +1,174 @@
1
+ import ReplayIcon from '@mui/icons-material/Replay'
2
+ import { TextField } from '@mui/material'
3
+ import { ComponentMeta, ComponentStory } from '@storybook/react'
4
+ import { FlexCol, FlexRow } from '@xylabs/sdk-react'
5
+
6
+ import { appThemeDecorator, sampleBlockWithPayloads } from '../.storybook'
7
+ import { Property } from './Property'
8
+ import { PropertyPaperProps } from './Props'
9
+
10
+ const StorybookEntry = {
11
+ argTypes: {},
12
+ component: Property,
13
+ parameters: {
14
+ docs: {
15
+ page: null,
16
+ },
17
+ },
18
+ title: 'Properties/PropertyPaper',
19
+ } as ComponentMeta<typeof Property>
20
+
21
+ const Template: ComponentStory<typeof Property> = (args) => <Property {...(args as PropertyPaperProps)} paper={true}></Property>
22
+
23
+ const TemplateWithCompare: ComponentStory<typeof Property> = (args) => (
24
+ <FlexCol gap={1} alignItems="stretch">
25
+ <FlexRow gap={1}>
26
+ <TextField size="small" value="Sample text Field" />
27
+ <Property {...(args as PropertyPaperProps)} paper={true} size="small"></Property>
28
+ </FlexRow>
29
+ <FlexRow gap={1}>
30
+ <Property {...(args as PropertyPaperProps)} paper={true} size="small"></Property>
31
+ <Property {...(args as PropertyPaperProps)} paper={true} size="small"></Property>
32
+ </FlexRow>
33
+ <FlexRow gap={1}>
34
+ <TextField size="medium" value="Sample text Field" />
35
+ <Property {...(args as PropertyPaperProps)} paper={true} size="medium"></Property>
36
+ </FlexRow>
37
+ <FlexRow gap={1}>
38
+ <Property {...(args as PropertyPaperProps)} paper={true} size="medium"></Property>
39
+ <Property {...(args as PropertyPaperProps)} paper={true} size="medium"></Property>
40
+ </FlexRow>
41
+ <FlexRow gap={1}>
42
+ <TextField value="Sample text Field" />
43
+ <Property {...(args as PropertyPaperProps)} paper={true} size="large"></Property>
44
+ </FlexRow>
45
+ <FlexRow gap={1}>
46
+ <Property {...(args as PropertyPaperProps)} paper={true} size="large"></Property>
47
+ <Property {...(args as PropertyPaperProps)} paper={true} size="large"></Property>
48
+ </FlexRow>
49
+ </FlexCol>
50
+ )
51
+
52
+ const Default = Template.bind({})
53
+ Default.args = {}
54
+ Default.decorators = [appThemeDecorator]
55
+
56
+ const WithTitle = Template.bind({})
57
+ WithTitle.args = { title: 'No Data' }
58
+ WithTitle.decorators = [appThemeDecorator]
59
+
60
+ const WithUndefinedData = Template.bind({})
61
+ WithUndefinedData.args = { title: 'Block Hash' }
62
+ WithUndefinedData.decorators = [appThemeDecorator]
63
+
64
+ const WithData = Template.bind({})
65
+ WithData.args = { title: 'Block Hash', value: sampleBlockWithPayloads._hash }
66
+ WithData.decorators = [appThemeDecorator]
67
+
68
+ const WithDataSmall = Template.bind({})
69
+ WithDataSmall.args = { size: 'small', title: 'Block Hash', value: sampleBlockWithPayloads._hash }
70
+ WithDataSmall.decorators = [appThemeDecorator]
71
+
72
+ const WithDataCompare = TemplateWithCompare.bind({})
73
+ WithDataCompare.args = { tip: 'This is the block hash', title: 'Block Hash', value: sampleBlockWithPayloads._hash }
74
+ WithDataCompare.decorators = [appThemeDecorator]
75
+
76
+ const WithDataCompareOutlined = TemplateWithCompare.bind({})
77
+ WithDataCompareOutlined.args = { tip: 'This is the block hash', title: 'Block Hash', value: sampleBlockWithPayloads._hash, variant: 'outlined' }
78
+ WithDataCompareOutlined.decorators = [appThemeDecorator]
79
+
80
+ const WithDataCompareElevation = TemplateWithCompare.bind({})
81
+ WithDataCompareElevation.args = { tip: 'This is the block hash', title: 'Block Hash', value: sampleBlockWithPayloads._hash, variant: 'elevation' }
82
+ WithDataCompareElevation.decorators = [appThemeDecorator]
83
+
84
+ const WithDataAndBadgeSmall = Template.bind({})
85
+ WithDataAndBadgeSmall.args = { badge: true, size: 'small', tip: 'This is the block hash', title: 'Block Hash', value: sampleBlockWithPayloads._hash }
86
+ WithDataAndBadgeSmall.decorators = [appThemeDecorator]
87
+
88
+ const WithDataAndBadgeMedium = Template.bind({})
89
+ WithDataAndBadgeMedium.args = { badge: true, size: 'medium', tip: 'This is the block hash', title: 'Block Hash', value: sampleBlockWithPayloads._hash }
90
+ WithDataAndBadgeMedium.decorators = [appThemeDecorator]
91
+
92
+ const WithDataAndBadgeLarge = Template.bind({})
93
+ WithDataAndBadgeLarge.args = { badge: true, size: 'large', tip: 'This is the block hash', title: 'Block Hash', value: sampleBlockWithPayloads._hash }
94
+ WithDataAndBadgeLarge.decorators = [appThemeDecorator]
95
+
96
+ const WithTip = Template.bind({})
97
+ WithTip.args = {
98
+ tip: 'This is the block hash',
99
+ title: 'Block Hash',
100
+ value: sampleBlockWithPayloads._hash,
101
+ }
102
+ WithTip.decorators = [appThemeDecorator]
103
+
104
+ const WithTipAndBadge = Template.bind({})
105
+ WithTipAndBadge.args = {
106
+ badge: true,
107
+ tip: 'This is the block hash',
108
+ title: 'Block Hash',
109
+ value: sampleBlockWithPayloads._hash,
110
+ }
111
+ WithTipAndBadge.decorators = [appThemeDecorator]
112
+
113
+ const WithActions = Template.bind({})
114
+ WithActions.args = {
115
+ actions: [{ name: 'ActionOne' }, { name: 'ActionTwo' }],
116
+ tip: 'This is the block hash',
117
+ title: 'Block Hash',
118
+ value: sampleBlockWithPayloads._hash,
119
+ }
120
+ WithActions.decorators = [appThemeDecorator]
121
+
122
+ const LargeWithValue = Template.bind({})
123
+ LargeWithValue.args = {
124
+ badge: true,
125
+ size: 'large',
126
+ tip: 'This is the block hash',
127
+ title: 'Block Hash',
128
+ value: sampleBlockWithPayloads._hash,
129
+ }
130
+ LargeWithValue.decorators = [appThemeDecorator]
131
+
132
+ const LargeWithValueAndActions = Template.bind({})
133
+ LargeWithValueAndActions.args = {
134
+ actions: [{ icon: <ReplayIcon />, name: 'ActionOne' }, { name: 'ActionTwo' }],
135
+ badge: true,
136
+ size: 'large',
137
+ tip: 'This is the block hash',
138
+ title: 'Block Hash',
139
+ value: sampleBlockWithPayloads._hash,
140
+ }
141
+ LargeWithValueAndActions.decorators = [appThemeDecorator]
142
+
143
+ const SmallWithValueAndActions = Template.bind({})
144
+ SmallWithValueAndActions.args = {
145
+ actions: [{ icon: <ReplayIcon />, name: 'ActionOne' }, { name: 'ActionTwo' }],
146
+ badge: true,
147
+ size: 'small',
148
+ tip: 'This is the block hash',
149
+ title: 'Block Hash',
150
+ value: sampleBlockWithPayloads._hash,
151
+ }
152
+ SmallWithValueAndActions.decorators = [appThemeDecorator]
153
+
154
+ export {
155
+ Default,
156
+ LargeWithValue,
157
+ LargeWithValueAndActions,
158
+ SmallWithValueAndActions,
159
+ WithActions,
160
+ WithData,
161
+ WithDataAndBadgeLarge,
162
+ WithDataAndBadgeMedium,
163
+ WithDataAndBadgeSmall,
164
+ WithDataCompare,
165
+ WithDataCompareElevation,
166
+ WithDataCompareOutlined,
167
+ WithDataSmall,
168
+ WithTip,
169
+ WithTipAndBadge,
170
+ WithUndefinedData,
171
+ }
172
+
173
+ // eslint-disable-next-line import/no-default-export
174
+ export default StorybookEntry
@@ -0,0 +1,48 @@
1
+ import { PaperProps } from '@mui/material'
2
+ import { FlexBoxProps } from '@xylabs/sdk-react'
3
+ import { SizeProp } from '@xyo-network/react-shared'
4
+ import { ReactNode } from 'react'
5
+
6
+ import { PropertyAction } from './Action'
7
+ import { PropertyTitleProps } from './Title'
8
+
9
+ export interface PropertyBaseProps {
10
+ tip?: ReactNode
11
+ title?: string
12
+ paper?: boolean
13
+ titleProps?: PropertyTitleProps
14
+ }
15
+
16
+ export type PropertyFieldBaseProps = PropertyBaseProps & {
17
+ actions?: PropertyAction[]
18
+ required?: boolean
19
+ value?: string | number | boolean | null
20
+ badge?: boolean
21
+ size?: SizeProp
22
+ }
23
+
24
+ export type PropertyBoxProps = PropertyFieldBaseProps &
25
+ FlexBoxProps & {
26
+ paper?: false
27
+ }
28
+
29
+ export type PropertyPaperProps = PropertyFieldBaseProps &
30
+ PaperProps & {
31
+ paper: true
32
+ }
33
+
34
+ export type PropertyProps = PropertyBoxProps | PropertyPaperProps
35
+
36
+ export type PropertyGroupBaseProps = PropertyBaseProps
37
+
38
+ export type PropertyGroupBoxProps = PropertyGroupBaseProps &
39
+ FlexBoxProps & {
40
+ paper?: false
41
+ }
42
+
43
+ export type PropertyGroupPaperProps = PropertyGroupBaseProps &
44
+ PaperProps & {
45
+ paper: true
46
+ }
47
+
48
+ export type PropertyGroupProps = PropertyGroupBoxProps | PropertyGroupPaperProps
@@ -1,32 +1,60 @@
1
- import { Typography, TypographyVariant, useTheme } from '@mui/material'
1
+ import { darken, lighten, Typography, TypographyVariant, useTheme } from '@mui/material'
2
2
  import { FlexBoxProps, FlexRow, QuickTipButton } from '@xylabs/sdk-react'
3
3
  import { SizeProp } from '@xyo-network/react-shared'
4
4
  import { ReactNode } from 'react'
5
5
 
6
+ type TitleSizeProp = SizeProp | 'full'
7
+
6
8
  export interface PropertyTitleProps extends FlexBoxProps {
7
9
  tip?: ReactNode
8
10
  more?: ReactNode
9
11
  title?: string
10
- size?: SizeProp
12
+ size?: TitleSizeProp
13
+ elevation?: number
11
14
  }
12
15
 
13
- export const PropertyTitle: React.FC<PropertyTitleProps> = ({ size = 'medium', tip, more, title, ...props }) => {
14
- const sizeVariants: Record<SizeProp, TypographyVariant> = {
15
- large: 'h6',
16
+ export const PropertyTitle: React.FC<PropertyTitleProps> = ({ elevation = 1, size = 'medium', tip, more, title, ...props }) => {
17
+ const sizeVariants: Record<TitleSizeProp, TypographyVariant> = {
18
+ full: 'caption',
19
+ large: 'caption',
16
20
  medium: 'caption',
17
21
  small: 'caption',
18
22
  }
19
23
 
24
+ const sizeTitleHeight: Record<TitleSizeProp, number | undefined> = {
25
+ full: undefined,
26
+ large: 32,
27
+ medium: 20,
28
+ small: 16,
29
+ }
30
+
31
+ const sizeFontSize: Record<TitleSizeProp, number> = {
32
+ full: 16,
33
+ large: 16,
34
+ medium: 14,
35
+ small: 10,
36
+ }
37
+
38
+ const quickTipSize = sizeFontSize[size] < 16 ? sizeFontSize[size] : 16
39
+
20
40
  const theme = useTheme()
21
41
 
22
42
  return (
23
- <FlexRow justifyContent="space-between" {...props}>
24
- <FlexRow paddingX={1}>
25
- <Typography noWrap variant={sizeVariants[size]}>
26
- {title}
43
+ <FlexRow
44
+ bgcolor={theme.palette.mode === 'dark' ? lighten(theme.palette.background.paper, 0.05 * elevation) : darken(theme.palette.background.paper, 0.05 * elevation)}
45
+ alignItems="center"
46
+ height={sizeTitleHeight[size]}
47
+ justifyContent="space-between"
48
+ {...props}
49
+ >
50
+ <FlexRow paddingX={1} paddingY={0.5}>
51
+ <Typography fontWeight={500} noWrap variant={sizeVariants[size]} fontSize={sizeFontSize[size]}>
52
+ <small>
53
+ <strong>{title}</strong>
54
+ </small>
27
55
  </Typography>
28
56
  {tip ? (
29
- <QuickTipButton style={{ fontSize: theme.typography[sizeVariants[size]].fontSize }} color="inherit" title={title ?? ''}>
57
+ <QuickTipButton style={{ fontSize: quickTipSize }} color="inherit" title={title ?? ''}>
30
58
  {tip}
31
59
  </QuickTipButton>
32
60
  ) : null}
@@ -48,7 +48,7 @@ export const PropertyValue: React.FC<PropertyValueProps> = ({ value, shortSpace,
48
48
  }, [])
49
49
 
50
50
  return value !== undefined ? (
51
- <Typography minWidth={0} marginX={1} ref={ref} component="div" variant={typographyVariant} fontFamily="monospace" fontWeight="light" {...customThemeProps} {...props}>
51
+ <Typography minWidth={0} ref={ref} component="div" variant={typographyVariant} fontFamily="monospace" fontWeight="light" {...customThemeProps} {...props}>
52
52
  {value}
53
53
  </Typography>
54
54
  ) : null
@@ -1,6 +1,5 @@
1
+ export * from './Action'
2
+ export * from './Group'
1
3
  export * from './Property'
2
- export * from './PropertyAction'
3
- export * from './PropertyGroup'
4
- export * from './PropertyProps'
5
- export * from './usePropertyHeroProps'
4
+ export * from './Props'
6
5
  export * from './Value'
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyAction.js","sourceRoot":"","sources":["../../../src/components/PropertyAction.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyActions.js","sourceRoot":"","sources":["../../../src/components/PropertyActions.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAiD;AACjD,iDAAqD;AAI9C,MAAM,eAAe,GAAmC,CAAC,EAAsC,EAAE,EAAE;;QAA1C,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,OAAY,EAAP,KAAK,sBAApC,sBAAsC,CAAF;IAClG,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAClC,uBAAC,mBAAO,oBAAK,KAAK,cAChB,uBAAC,gBAAK,kBAAC,SAAS,EAAC,KAAK,EAAC,OAAO,EAAE,CAAC,gBAC9B,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBAC7B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CACnB,uBAAC,qBAAU,kBAAC,IAAI,EAAC,OAAO,EAAa,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,MAAM,CAAC,OAAO,gBACzE,MAAM,CAAC,IAAI,KADgB,KAAK,CAEtB,CACd,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACZ,uBAAC,oBAAQ,kBAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAC,SAAS,EAAa,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAC,WAAW,gBACpI,MAAM,CAAC,IAAI,KAD8B,KAAK,CAEtC,CACZ,CAAC,CAAC,CAAC,IAAI,CAAA;gBACV,CAAC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CACL,uBAAC,mBAAQ,kBAEP,OAAO,EAAE,GAAG,EAAE;;4BACZ,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,sDAAI,CAAA;4BACnB,WAAW,EAAE,CAAA;wBACf,CAAC,gBAEA,MAAM,CAAC,IAAI,KANP,MAAM,CAAC,IAAI,CAOP,CACZ,CAAA;gBACH,CAAC,CAAC,IACG,KACC,CACX,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CAAA;AAjCY,QAAA,mBAAmB,uBAiC/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyActionsProps.js","sourceRoot":"","sources":["../../../src/components/PropertyActionsProps.ts"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PropertyGroup = void 0;
4
- const tslib_1 = require("tslib");
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const material_1 = require("@mui/material");
7
- const sdk_react_1 = require("@xylabs/sdk-react");
8
- const core_1 = require("@xyo-network/core");
9
- const PropertyGroup = (_a) => {
10
- var { border, borderColor, borderRadius, variant = 'outlined', children, title, color = 'secondary', tip } = _a, props = tslib_1.__rest(_a, ["border", "borderColor", "borderRadius", "variant", "children", "title", "color", "tip"]);
11
- const theme = (0, material_1.useTheme)();
12
- const bgcolor = color === 'primary' || color === 'secondary' ? theme.palette[color].main : color;
13
- const childrenArray = (0, core_1.typeOf)(children) === 'array' ? children : undefined;
14
- return ((0, jsx_runtime_1.jsxs)(sdk_react_1.FlexRow, Object.assign({ border: (border !== null && border !== void 0 ? border : variant === 'outlined') ? 1 : 0, borderColor: (borderColor !== null && borderColor !== void 0 ? borderColor : variant === 'outlined') ? theme.palette.divider : undefined, borderRadius: (borderRadius !== null && borderRadius !== void 0 ? borderRadius : variant === 'outlined') ? 1 : undefined, overflow: "hidden", justifyContent: "flex-start", alignItems: "stretch" }, props, { children: [(0, jsx_runtime_1.jsxs)(sdk_react_1.FlexRow, Object.assign({ padding: 1, justifyContent: "start", bgcolor: bgcolor, color: theme.palette.getContrastText(bgcolor) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: title }), tip ? ((0, jsx_runtime_1.jsx)(sdk_react_1.QuickTipButton, Object.assign({ color: "inherit", title: title }, { children: tip }))) : null] })), childrenArray ? ((0, jsx_runtime_1.jsx)(sdk_react_1.FlexGrowRow, { children: childrenArray === null || childrenArray === void 0 ? void 0 : childrenArray.map((child, index) => {
15
- return child ? ((0, jsx_runtime_1.jsx)(sdk_react_1.FlexGrowRow, Object.assign({ borderLeft: 1, borderColor: theme.palette.divider }, { children: child }), index)) : null;
16
- }) })) : (children)] })));
17
- };
18
- exports.PropertyGroup = PropertyGroup;
19
- //# sourceMappingURL=PropertyGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyGroup.js","sourceRoot":"","sources":["../../../src/components/PropertyGroup.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAoD;AACpD,iDAAwE;AACxE,4CAA0C;AAKnC,MAAM,aAAa,GAAiC,CAAC,EAAgH,EAAE,EAAE;QAApH,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,GAAG,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,WAAW,EAAE,GAAG,OAAY,EAAP,KAAK,sBAA9G,yFAAgH,CAAF;IACxK,MAAM,KAAK,GAAG,IAAA,mBAAQ,GAAE,CAAA;IACxB,MAAM,OAAO,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAA;IAChG,MAAM,aAAa,GAAG,IAAA,aAAM,EAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,CAAC,CAAE,QAA2B,CAAC,CAAC,CAAC,SAAS,CAAA;IAC7F,OAAO,CACL,wBAAC,mBAAO,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,CACT,KACO,CACX,CAAA;AACH,CAAC,CAAA;AArCY,QAAA,aAAa,iBAqCzB"}
@@ -1,18 +0,0 @@
1
- import { FlexBoxProps } from '@xylabs/sdk-react';
2
- import { SizeProp } from '@xyo-network/react-shared';
3
- import { ReactNode } from 'react';
4
- import { PropertyAction } from './PropertyAction';
5
- export interface PropertyBaseProps extends FlexBoxProps {
6
- tip?: ReactNode;
7
- title?: string;
8
- color?: 'primary' | 'secondary' | string;
9
- variant?: 'outlined' | 'default';
10
- }
11
- export interface PropertyProps extends PropertyBaseProps {
12
- actions?: PropertyAction[];
13
- required?: boolean;
14
- value?: string | number | boolean | null;
15
- badge?: boolean;
16
- size?: SizeProp;
17
- }
18
- export declare type PropertyGroupProps = PropertyBaseProps;
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyProps.js","sourceRoot":"","sources":["../../../src/components/PropertyProps.tsx"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- declare const usePropertyHeroProps: (props: Record<any, any>) => {
2
- isHero: any;
3
- paddingFactor: any;
4
- showBadge: any;
5
- };
6
- export { usePropertyHeroProps };
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.usePropertyHeroProps = void 0;
4
- // Any is ok since we are destructuring props of any shape
5
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
- const usePropertyHeroProps = (props) => {
7
- const { isHero, paddingFactor, showBadge } = props;
8
- return {
9
- isHero,
10
- paddingFactor,
11
- showBadge,
12
- };
13
- };
14
- exports.usePropertyHeroProps = usePropertyHeroProps;
15
- //# sourceMappingURL=usePropertyHeroProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePropertyHeroProps.js","sourceRoot":"","sources":["../../../src/components/usePropertyHeroProps.tsx"],"names":[],"mappings":";;;AAAA,0DAA0D;AAC1D,8DAA8D;AAC9D,MAAM,oBAAoB,GAAG,CAAC,KAAuB,EAAE,EAAE;IACvD,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAClD,OAAO;QACL,MAAM;QACN,aAAa;QACb,SAAS;KACV,CAAA;AACH,CAAC,CAAA;AAEQ,oDAAoB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=PropertyAction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyAction.js","sourceRoot":"","sources":["../../../src/components/PropertyAction.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyActions.js","sourceRoot":"","sources":["../../../src/components/PropertyActions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAIrD,MAAM,CAAC,MAAM,eAAe,GAAmC,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACxG,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAClC,KAAC,OAAO,OAAK,KAAK,YAChB,KAAC,KAAK,IAAC,SAAS,EAAC,KAAK,EAAC,OAAO,EAAE,CAAC,YAC9B,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;oBAC7B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CACnB,KAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAa,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,MAAM,CAAC,OAAO,YACzE,MAAM,CAAC,IAAI,IADgB,KAAK,CAEtB,CACd,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACZ,KAAC,QAAQ,IAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAC,SAAS,EAAa,IAAI,EAAC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E,WAAW,YAC3D,KAAC,aAAa,IAAC,QAAQ,EAAC,SAAS,GAAG,GACzB,EACb,KAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,YACvD,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;oBACvB,OAAO,CACL,KAAC,QAAQ,IAEP,OAAO,EAAE,GAAG,EAAE;4BACZ,MAAM,EAAE,OAAO,EAAE,EAAE,CAAA;4BACnB,WAAW,EAAE,CAAA;wBACf,CAAC,YAEA,MAAM,CAAC,IAAI,IANP,MAAM,CAAC,IAAI,CAOP,CACZ,CAAA;gBACH,CAAC,CAAC,GACG,IACC,CACX,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=PropertyActionsProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyActionsProps.js","sourceRoot":"","sources":["../../../src/components/PropertyActionsProps.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Typography, useTheme } from '@mui/material';
3
- import { FlexGrowRow, FlexRow, QuickTipButton } from '@xylabs/sdk-react';
4
- import { typeOf } from '@xyo-network/core';
5
- export const PropertyGroup = ({ border, borderColor, borderRadius, variant = 'outlined', children, title, color = 'secondary', tip, ...props }) => {
6
- const theme = useTheme();
7
- const bgcolor = color === 'primary' || color === 'secondary' ? theme.palette[color].main : color;
8
- const childrenArray = typeOf(children) === 'array' ? children : undefined;
9
- return (_jsxs(FlexRow, { border: border ?? variant === 'outlined' ? 1 : 0, borderColor: borderColor ?? variant === 'outlined' ? theme.palette.divider : undefined, borderRadius: borderRadius ?? variant === 'outlined' ? 1 : undefined, overflow: "hidden", justifyContent: "flex-start", alignItems: "stretch", ...props, children: [_jsxs(FlexRow, { padding: 1, justifyContent: "start", bgcolor: bgcolor, color: theme.palette.getContrastText(bgcolor), children: [_jsx(Typography, { children: title }), tip ? (_jsx(QuickTipButton, { color: "inherit", title: title, children: tip })) : null] }), childrenArray ? (_jsx(FlexGrowRow, { children: childrenArray?.map((child, index) => {
10
- return child ? (_jsx(FlexGrowRow, { borderLeft: 1, borderColor: theme.palette.divider, children: child }, index)) : null;
11
- }) })) : (children)] }));
12
- };
13
- //# sourceMappingURL=PropertyGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyGroup.js","sourceRoot":"","sources":["../../../src/components/PropertyGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAK1C,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,GAAG,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,WAAW,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC9K,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,OAAO,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAA;IAChG,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,CAAC,CAAE,QAA2B,CAAC,CAAC,CAAC,SAAS,CAAA;IAC7F,OAAO,CACL,MAAC,OAAO,IACN,MAAM,EAAE,MAAM,IAAI,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAChD,WAAW,EAAE,WAAW,IAAI,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACtF,YAAY,EAAE,YAAY,IAAI,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EACpE,QAAQ,EAAC,QAAQ,EACjB,cAAc,EAAC,YAAY,EAC3B,UAAU,EAAC,SAAS,KAChB,KAAK,aAET,MAAC,OAAO,IAAC,OAAO,EAAE,CAAC,EAAE,cAAc,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,aACzG,KAAC,UAAU,cAAE,KAAK,GAAc,EAC/B,GAAG,CAAC,CAAC,CAAC,CACL,KAAC,cAAc,IAAC,KAAK,EAAC,SAAS,EAAC,KAAK,EAAE,KAAK,YACzC,GAAG,GACW,CAClB,CAAC,CAAC,CAAC,IAAI,IACA,EACT,aAAa,CAAC,CAAC,CAAC,CACf,KAAC,WAAW,cACT,aAAa,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;oBACnC,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,WAAW,IAAa,UAAU,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,YACvE,KAAK,IADU,KAAK,CAET,CACf,CAAC,CAAC,CAAC,IAAI,CAAA;gBACV,CAAC,CAAC,GACU,CACf,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,IACO,CACX,CAAA;AACH,CAAC,CAAA"}
@@ -1,18 +0,0 @@
1
- import { FlexBoxProps } from '@xylabs/sdk-react';
2
- import { SizeProp } from '@xyo-network/react-shared';
3
- import { ReactNode } from 'react';
4
- import { PropertyAction } from './PropertyAction';
5
- export interface PropertyBaseProps extends FlexBoxProps {
6
- tip?: ReactNode;
7
- title?: string;
8
- color?: 'primary' | 'secondary' | string;
9
- variant?: 'outlined' | 'default';
10
- }
11
- export interface PropertyProps extends PropertyBaseProps {
12
- actions?: PropertyAction[];
13
- required?: boolean;
14
- value?: string | number | boolean | null;
15
- badge?: boolean;
16
- size?: SizeProp;
17
- }
18
- export declare type PropertyGroupProps = PropertyBaseProps;
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=PropertyProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyProps.js","sourceRoot":"","sources":["../../../src/components/PropertyProps.tsx"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- declare const usePropertyHeroProps: (props: Record<any, any>) => {
2
- isHero: any;
3
- paddingFactor: any;
4
- showBadge: any;
5
- };
6
- export { usePropertyHeroProps };
@@ -1,12 +0,0 @@
1
- // Any is ok since we are destructuring props of any shape
2
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3
- const usePropertyHeroProps = (props) => {
4
- const { isHero, paddingFactor, showBadge } = props;
5
- return {
6
- isHero,
7
- paddingFactor,
8
- showBadge,
9
- };
10
- };
11
- export { usePropertyHeroProps };
12
- //# sourceMappingURL=usePropertyHeroProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePropertyHeroProps.js","sourceRoot":"","sources":["../../../src/components/usePropertyHeroProps.tsx"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,8DAA8D;AAC9D,MAAM,oBAAoB,GAAG,CAAC,KAAuB,EAAE,EAAE;IACvD,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAClD,OAAO;QACL,MAAM;QACN,aAAa;QACb,SAAS;KACV,CAAA;AACH,CAAC,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
@@ -1,45 +0,0 @@
1
- import { Typography, useTheme } from '@mui/material'
2
- import { FlexGrowRow, FlexRow, QuickTipButton } from '@xylabs/sdk-react'
3
- import { typeOf } from '@xyo-network/core'
4
- import { ReactElement } from 'react'
5
-
6
- import { PropertyGroupProps } from './PropertyProps'
7
-
8
- export const PropertyGroup: React.FC<PropertyGroupProps> = ({ border, borderColor, borderRadius, variant = 'outlined', children, title, color = 'secondary', tip, ...props }) => {
9
- const theme = useTheme()
10
- const bgcolor = color === 'primary' || color === 'secondary' ? theme.palette[color].main : color
11
- const childrenArray = typeOf(children) === 'array' ? (children as ReactElement[]) : undefined
12
- return (
13
- <FlexRow
14
- border={border ?? variant === 'outlined' ? 1 : 0}
15
- borderColor={borderColor ?? variant === 'outlined' ? theme.palette.divider : undefined}
16
- borderRadius={borderRadius ?? variant === 'outlined' ? 1 : undefined}
17
- overflow="hidden"
18
- justifyContent="flex-start"
19
- alignItems="stretch"
20
- {...props}
21
- >
22
- <FlexRow padding={1} justifyContent="start" bgcolor={bgcolor} color={theme.palette.getContrastText(bgcolor)}>
23
- <Typography>{title}</Typography>
24
- {tip ? (
25
- <QuickTipButton color="inherit" title={title}>
26
- {tip}
27
- </QuickTipButton>
28
- ) : null}
29
- </FlexRow>
30
- {childrenArray ? (
31
- <FlexGrowRow>
32
- {childrenArray?.map((child, index) => {
33
- return child ? (
34
- <FlexGrowRow key={index} borderLeft={1} borderColor={theme.palette.divider}>
35
- {child}
36
- </FlexGrowRow>
37
- ) : null
38
- })}
39
- </FlexGrowRow>
40
- ) : (
41
- children
42
- )}
43
- </FlexRow>
44
- )
45
- }
@@ -1,21 +0,0 @@
1
- import { FlexBoxProps } from '@xylabs/sdk-react'
2
- import { SizeProp } from '@xyo-network/react-shared'
3
- import { ReactNode } from 'react'
4
-
5
- import { PropertyAction } from './PropertyAction'
6
-
7
- export interface PropertyBaseProps extends FlexBoxProps {
8
- tip?: ReactNode
9
- title?: string
10
- color?: 'primary' | 'secondary' | string
11
- variant?: 'outlined' | 'default'
12
- }
13
- export interface PropertyProps extends PropertyBaseProps {
14
- actions?: PropertyAction[]
15
- required?: boolean
16
- value?: string | number | boolean | null
17
- badge?: boolean
18
- size?: SizeProp
19
- }
20
-
21
- export type PropertyGroupProps = PropertyBaseProps
@@ -1,12 +0,0 @@
1
- // Any is ok since we are destructuring props of any shape
2
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3
- const usePropertyHeroProps = (props: Record<any, any>) => {
4
- const { isHero, paddingFactor, showBadge } = props
5
- return {
6
- isHero,
7
- paddingFactor,
8
- showBadge,
9
- }
10
- }
11
-
12
- export { usePropertyHeroProps }