@xyo-network/react-chain-shared 1.5.12 → 1.5.14

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.
@@ -41,19 +41,20 @@ var StyledMenuItem = styled(MenuItem, {
41
41
  // src/components/stack/DetailsStack.tsx
42
42
  import { Stack, styled as styled2, Tooltip, Typography, useTheme as useTheme2 } from "@mui/material";
43
43
  import { isDefined } from "@xylabs/typeof";
44
- import React2, { useMemo } from "react";
44
+ import React2, { Fragment, useMemo } from "react";
45
+ var isComponentType = /* @__PURE__ */ __name((value) => typeof value === "function" || typeof value === "object" && value !== null && ("$$typeof" in value || "render" in value), "isComponentType");
45
46
  var DetailsStack = /* @__PURE__ */ __name(({ IconComponent, heading, children, tooltipTitle, ...props }) => {
46
47
  const theme = useTheme2();
47
48
  const hasTooltip = isDefined(tooltipTitle);
48
49
  const resolvedIconComponent = useMemo(() => {
49
- return IconComponent ? /* @__PURE__ */ React2.createElement(IconComponent, {
50
+ return isComponentType(IconComponent) ? /* @__PURE__ */ React2.createElement(IconComponent, {
50
51
  style: {
51
52
  /** height and marginTop adjusted to account for font not filling container with line-height: 1 */
52
53
  height: "0.85rem",
53
54
  marginTop: 0.5,
54
55
  marginLeft: theme.spacing(1)
55
56
  }
56
- }) : /* @__PURE__ */ React2.createElement(React2.Fragment, null);
57
+ }) : IconComponent ?? /* @__PURE__ */ React2.createElement(Fragment, null);
57
58
  }, [
58
59
  IconComponent
59
60
  ]);
@@ -65,7 +66,7 @@ var DetailsStack = /* @__PURE__ */ __name(({ IconComponent, heading, children, t
65
66
  ...props
66
67
  }, /* @__PURE__ */ React2.createElement(SectionHeadingTypography, null, heading, hasTooltip ? /* @__PURE__ */ React2.createElement(Tooltip, {
67
68
  title: tooltipTitle
68
- }, resolvedIconComponent) : resolvedIconComponent), children);
69
+ }, /* @__PURE__ */ React2.createElement("span", null, resolvedIconComponent)) : resolvedIconComponent), children);
69
70
  }, "DetailsStack");
70
71
  var SectionHeadingTypography = styled2(Typography, {
71
72
  name: "SectionHeadingTypography"
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/menu-item/ActiveMenuItem.tsx","../../src/components/stack/DetailsStack.tsx","../../src/components/stack/LabelValueStack.tsx","../../src/story/buildRandomBlockchain.ts"],"sourcesContent":["import type { MenuItemProps } from '@mui/material'\nimport {\n MenuItem, styled, useTheme,\n} from '@mui/material'\nimport React from 'react'\n\nexport const ActiveMenuItem: React.FC<MenuItemProps & { active?: boolean }> = ({\n active, children, sx, ...props\n}) => {\n const theme = useTheme()\n return (\n <StyledMenuItem\n disableRipple\n sx={{\n // left border color and background color for active state\n 'borderLeft': `5px solid ${active ? theme.vars.palette.secondary.light : 'transparent'}`,\n 'backgroundColor': active ? theme.vars.palette.secondary.dark : 'transparent',\n // force white text color for active state for improved readability with background color\n 'color': active ? 'white' : 'unset',\n '&:hover': {\n // overriding default hover color and backgroundColor since active state conflicts visually with\n // default styles of MenuItem hover\n ...(active ? { backgroundColor: theme.vars.palette.secondary.dark } : {}),\n color: active ? 'white' : 'unset',\n },\n ...sx,\n }}\n {...props}\n >\n {children}\n </StyledMenuItem>\n )\n}\n\nconst StyledMenuItem = styled(MenuItem, { name: 'StyledMenuItem' })(({ theme }) => ({\n display: 'flex-inline',\n flexDirection: 'row',\n gap: theme.spacing(1),\n padding: 0,\n paddingLeft: theme.spacing(1),\n marginBottom: theme.spacing(1),\n}))\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, styled, Tooltip, Typography,\n useTheme,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/typeof'\nimport type { ComponentType, SVGAttributes } from 'react'\nimport React, { useMemo } from 'react'\n\nexport interface DetailsStackProps extends StackProps {\n IconComponent?: ComponentType<SVGAttributes<SVGElement>>\n heading?: string\n tooltipTitle?: string\n}\n\nexport const DetailsStack: React.FC<DetailsStackProps> = ({\n IconComponent, heading, children, tooltipTitle, ...props\n}) => {\n const theme = useTheme()\n\n const hasTooltip = isDefined(tooltipTitle)\n const resolvedIconComponent = useMemo(() => {\n return IconComponent\n ? (\n <IconComponent\n style={{\n /** height and marginTop adjusted to account for font not filling container with line-height: 1 */\n height: '0.85rem',\n marginTop: 0.5,\n marginLeft: theme.spacing(1),\n }}\n />\n )\n : <></>\n }, [IconComponent])\n\n return (\n <Stack direction=\"column\" flexGrow={1} flexWrap=\"wrap\" minWidth=\"1px\" {...props}>\n <SectionHeadingTypography>\n {heading}\n {hasTooltip\n ? (\n <Tooltip title={tooltipTitle}>\n {resolvedIconComponent}\n </Tooltip>\n )\n : resolvedIconComponent}\n </SectionHeadingTypography>\n {children}\n </Stack>\n )\n}\n\nconst SectionHeadingTypography = styled(Typography, { name: 'SectionHeadingTypography' })(({ theme }) => ({\n display: 'flex',\n fontFamily: 'monospace',\n lineHeight: 1,\n marginBottom: theme.spacing(1.5),\n}))\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, Typography, useTheme,\n} from '@mui/material'\nimport React from 'react'\n\nexport interface LabelValueStackProps extends StackProps {\n labels: string[]\n values: (string | undefined)[]\n}\n\nexport const LabelValueStack: React.FC<LabelValueStackProps> = ({\n labels, values, ...props\n}) => {\n const theme = useTheme()\n\n return (\n <Stack flexDirection=\"row\" flexGrow={1} {...props}>\n <Stack>\n {labels.map(label => (\n <Typography\n fontWeight=\"300\"\n key={label}\n variant=\"body2\"\n sx={{ borderBottom: `1px solid ${theme.vars?.palette.divider}`, opacity: 0.7 }}\n >\n {label}\n :\n </Typography>\n ))}\n </Stack>\n <Stack alignItems=\"end\" flexGrow={1}>\n {values.map((value, index) => (\n <Typography\n fontFamily=\"monospace\"\n variant=\"body2\"\n // Use matching label as key since values might be the same\n key={labels[index]}\n width=\"100%\"\n sx={{\n display: 'flex', justifyContent: 'end', borderBottom: `1px solid ${theme.vars?.palette.divider}`,\n }}\n >\n {value}\n </Typography>\n ))}\n </Stack>\n </Stack>\n )\n}\n","import { Account } from '@xyo-network/account'\nimport { buildRandomChain } from '@xyo-network/chain-protocol'\nimport type { HydratedBlock } from '@xyo-network/xl1-protocol'\n\nexport const buildRandomBlockChain = async (blockCount = 10) => {\n // Create a producer\n const initialBlockProducer = await Account.random()\n\n // Create multiple blocks\n const blocks: HydratedBlock[] = await buildRandomChain(initialBlockProducer, blockCount)\n return blocks\n}\n\nexport const buildRandomBlockChainBlocksOnly = async (blockCount = 10) => {\n const chain = await buildRandomChain(await Account.random(), blockCount)\n return chain\n}\n"],"mappings":";;;;AACA,SACEA,UAAUC,QAAQC,gBACb;AACP,OAAOC,WAAW;AAEX,IAAMC,iBAAiE,wBAAC,EAC7EC,QAAQC,UAAUC,IAAI,GAAGC,MAAAA,MAC1B;AACC,QAAMC,QAAQC,SAAAA;AACd,SACE,sBAAA,cAACC,gBAAAA;IACCC,eAAAA;IACAL,IAAI;;MAEF,cAAc,aAAaF,SAASI,MAAMI,KAAKC,QAAQC,UAAUC,QAAQ,aAAA;MACzE,mBAAmBX,SAASI,MAAMI,KAAKC,QAAQC,UAAUE,OAAO;;MAEhE,SAASZ,SAAS,UAAU;MAC5B,WAAW;;;QAGT,GAAIA,SAAS;UAAEa,iBAAiBT,MAAMI,KAAKC,QAAQC,UAAUE;QAAK,IAAI,CAAC;QACvEE,OAAOd,SAAS,UAAU;MAC5B;MACA,GAAGE;IACL;IACC,GAAGC;KAEHF,QAAAA;AAGP,GA1B8E;AA4B9E,IAAMK,iBAAiBS,OAAOC,UAAU;EAAEC,MAAM;AAAiB,CAAA,EAAG,CAAC,EAAEb,MAAK,OAAQ;EAClFc,SAAS;EACTC,eAAe;EACfC,KAAKhB,MAAMiB,QAAQ,CAAA;EACnBC,SAAS;EACTC,aAAanB,MAAMiB,QAAQ,CAAA;EAC3BG,cAAcpB,MAAMiB,QAAQ,CAAA;AAC9B,EAAA;;;ACxCA,SACEI,OAAOC,UAAAA,SAAQC,SAASC,YACxBC,YAAAA,iBACK;AACP,SAASC,iBAAiB;AAE1B,OAAOC,UAASC,eAAe;AAQxB,IAAMC,eAA4C,wBAAC,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,OAAAA;MAAWC,SAAS;IAAI;KAE5EV,OAAM,GAAA,CAAA,CAAA,GAKb,gBAAAL,OAAA,cAACC,QAAAA;IAAMe,YAAW;IAAMb,UAAU;KAC/BP,OAAOQ,IAAI,CAACa,OAAOC,UAClB,gBAAAlB,OAAA,cAACM,aAAAA;IACCa,YAAW;IACXV,SAAQ;;IAERD,KAAKb,OAAOuB,KAAAA;IACZE,OAAM;IACNV,IAAI;MACFW,SAAS;MAAQC,gBAAgB;MAAOX,cAAc,aAAab,MAAMc,MAAMC,QAAQC,OAAAA;IACzF;KAECG,KAAAA,CAAAA,CAAAA,CAAAA;AAMb,GAtC+D;;;ACX/D,SAASM,eAAe;AACxB,SAASC,wBAAwB;AAG1B,IAAMC,wBAAwB,8BAAOC,aAAa,OAAE;AAEzD,QAAMC,uBAAuB,MAAMC,QAAQC,OAAM;AAGjD,QAAMC,SAA0B,MAAMC,iBAAiBJ,sBAAsBD,UAAAA;AAC7E,SAAOI;AACT,GAPqC;AAS9B,IAAME,kCAAkC,8BAAON,aAAa,OAAE;AACnE,QAAMO,QAAQ,MAAMF,iBAAiB,MAAMH,QAAQC,OAAM,GAAIH,UAAAA;AAC7D,SAAOO;AACT,GAH+C;","names":["MenuItem","styled","useTheme","React","ActiveMenuItem","active","children","sx","props","theme","useTheme","StyledMenuItem","disableRipple","vars","palette","secondary","light","dark","backgroundColor","color","styled","MenuItem","name","display","flexDirection","gap","spacing","padding","paddingLeft","marginBottom","Stack","styled","Tooltip","Typography","useTheme","isDefined","React","useMemo","DetailsStack","IconComponent","heading","children","tooltipTitle","props","theme","useTheme","hasTooltip","isDefined","resolvedIconComponent","useMemo","React","style","height","marginTop","marginLeft","spacing","Stack","direction","flexGrow","flexWrap","minWidth","SectionHeadingTypography","Tooltip","title","styled","Typography","name","display","fontFamily","lineHeight","marginBottom","Stack","Typography","useTheme","React","LabelValueStack","labels","values","props","theme","useTheme","React","Stack","flexDirection","flexGrow","map","label","Typography","fontWeight","key","variant","sx","borderBottom","vars","palette","divider","opacity","alignItems","value","index","fontFamily","width","display","justifyContent","Account","buildRandomChain","buildRandomBlockChain","blockCount","initialBlockProducer","Account","random","blocks","buildRandomChain","buildRandomBlockChainBlocksOnly","chain"]}
1
+ {"version":3,"sources":["../../src/components/menu-item/ActiveMenuItem.tsx","../../src/components/stack/DetailsStack.tsx","../../src/components/stack/LabelValueStack.tsx","../../src/story/buildRandomBlockchain.ts"],"sourcesContent":["import type { MenuItemProps } from '@mui/material'\nimport {\n MenuItem, styled, useTheme,\n} from '@mui/material'\nimport React from 'react'\n\nexport const ActiveMenuItem: React.FC<MenuItemProps & { active?: boolean }> = ({\n active, children, sx, ...props\n}) => {\n const theme = useTheme()\n return (\n <StyledMenuItem\n disableRipple\n sx={{\n // left border color and background color for active state\n 'borderLeft': `5px solid ${active ? theme.vars.palette.secondary.light : 'transparent'}`,\n 'backgroundColor': active ? theme.vars.palette.secondary.dark : 'transparent',\n // force white text color for active state for improved readability with background color\n 'color': active ? 'white' : 'unset',\n '&:hover': {\n // overriding default hover color and backgroundColor since active state conflicts visually with\n // default styles of MenuItem hover\n ...(active ? { backgroundColor: theme.vars.palette.secondary.dark } : {}),\n color: active ? 'white' : 'unset',\n },\n ...sx,\n }}\n {...props}\n >\n {children}\n </StyledMenuItem>\n )\n}\n\nconst StyledMenuItem = styled(MenuItem, { name: 'StyledMenuItem' })(({ theme }) => ({\n display: 'flex-inline',\n flexDirection: 'row',\n gap: theme.spacing(1),\n padding: 0,\n paddingLeft: theme.spacing(1),\n marginBottom: theme.spacing(1),\n}))\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, styled, Tooltip, Typography,\n useTheme,\n} from '@mui/material'\nimport { isDefined } from '@xylabs/typeof'\nimport type {\n ComponentType, ReactNode, SVGAttributes,\n} from 'react'\nimport React, { Fragment, useMemo } from 'react'\n\nconst isComponentType = (value: unknown): value is ComponentType<SVGAttributes<SVGElement>> =>\n typeof value === 'function'\n || (typeof value === 'object' && value !== null && ('$$typeof' in value || 'render' in value))\n\nexport interface DetailsStackProps extends StackProps {\n IconComponent?: ComponentType<SVGAttributes<SVGElement>> | ReactNode\n heading?: string\n tooltipTitle?: string\n}\n\nexport const DetailsStack: React.FC<DetailsStackProps> = ({\n IconComponent, heading, children, tooltipTitle, ...props\n}) => {\n const theme = useTheme()\n\n const hasTooltip = isDefined(tooltipTitle)\n const resolvedIconComponent = useMemo(() => {\n return isComponentType(IconComponent)\n ? (\n <IconComponent\n style={{\n /** height and marginTop adjusted to account for font not filling container with line-height: 1 */\n height: '0.85rem',\n marginTop: 0.5,\n marginLeft: theme.spacing(1),\n }}\n />\n )\n : IconComponent ?? <Fragment />\n }, [IconComponent])\n\n return (\n <Stack direction=\"column\" flexGrow={1} flexWrap=\"wrap\" minWidth=\"1px\" {...props}>\n <SectionHeadingTypography>\n {heading}\n {hasTooltip\n ? (\n <Tooltip title={tooltipTitle}>\n <span>{resolvedIconComponent}</span>\n </Tooltip>\n )\n : resolvedIconComponent}\n </SectionHeadingTypography>\n {children}\n </Stack>\n )\n}\n\nconst SectionHeadingTypography = styled(Typography, { name: 'SectionHeadingTypography' })(({ theme }) => ({\n display: 'flex',\n fontFamily: 'monospace',\n lineHeight: 1,\n marginBottom: theme.spacing(1.5),\n}))\n","import type { StackProps } from '@mui/material'\nimport {\n Stack, Typography, useTheme,\n} from '@mui/material'\nimport React from 'react'\n\nexport interface LabelValueStackProps extends StackProps {\n labels: string[]\n values: (string | undefined)[]\n}\n\nexport const LabelValueStack: React.FC<LabelValueStackProps> = ({\n labels, values, ...props\n}) => {\n const theme = useTheme()\n\n return (\n <Stack flexDirection=\"row\" flexGrow={1} {...props}>\n <Stack>\n {labels.map(label => (\n <Typography\n fontWeight=\"300\"\n key={label}\n variant=\"body2\"\n sx={{ borderBottom: `1px solid ${theme.vars?.palette.divider}`, opacity: 0.7 }}\n >\n {label}\n :\n </Typography>\n ))}\n </Stack>\n <Stack alignItems=\"end\" flexGrow={1}>\n {values.map((value, index) => (\n <Typography\n fontFamily=\"monospace\"\n variant=\"body2\"\n // Use matching label as key since values might be the same\n key={labels[index]}\n width=\"100%\"\n sx={{\n display: 'flex', justifyContent: 'end', borderBottom: `1px solid ${theme.vars?.palette.divider}`,\n }}\n >\n {value}\n </Typography>\n ))}\n </Stack>\n </Stack>\n )\n}\n","import { Account } from '@xyo-network/account'\nimport { buildRandomChain } from '@xyo-network/chain-protocol'\nimport type { HydratedBlock } from '@xyo-network/xl1-protocol'\n\nexport const buildRandomBlockChain = async (blockCount = 10) => {\n // Create a producer\n const initialBlockProducer = await Account.random()\n\n // Create multiple blocks\n const blocks: HydratedBlock[] = await buildRandomChain(initialBlockProducer, blockCount)\n return blocks\n}\n\nexport const buildRandomBlockChainBlocksOnly = async (blockCount = 10) => {\n const chain = await buildRandomChain(await Account.random(), blockCount)\n return chain\n}\n"],"mappings":";;;;AACA,SACEA,UAAUC,QAAQC,gBACb;AACP,OAAOC,WAAW;AAEX,IAAMC,iBAAiE,wBAAC,EAC7EC,QAAQC,UAAUC,IAAI,GAAGC,MAAAA,MAC1B;AACC,QAAMC,QAAQC,SAAAA;AACd,SACE,sBAAA,cAACC,gBAAAA;IACCC,eAAAA;IACAL,IAAI;;MAEF,cAAc,aAAaF,SAASI,MAAMI,KAAKC,QAAQC,UAAUC,QAAQ,aAAA;MACzE,mBAAmBX,SAASI,MAAMI,KAAKC,QAAQC,UAAUE,OAAO;;MAEhE,SAASZ,SAAS,UAAU;MAC5B,WAAW;;;QAGT,GAAIA,SAAS;UAAEa,iBAAiBT,MAAMI,KAAKC,QAAQC,UAAUE;QAAK,IAAI,CAAC;QACvEE,OAAOd,SAAS,UAAU;MAC5B;MACA,GAAGE;IACL;IACC,GAAGC;KAEHF,QAAAA;AAGP,GA1B8E;AA4B9E,IAAMK,iBAAiBS,OAAOC,UAAU;EAAEC,MAAM;AAAiB,CAAA,EAAG,CAAC,EAAEb,MAAK,OAAQ;EAClFc,SAAS;EACTC,eAAe;EACfC,KAAKhB,MAAMiB,QA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sx","props","theme","useTheme","StyledMenuItem","disableRipple","vars","palette","secondary","light","dark","backgroundColor","color","styled","MenuItem","name","display","flexDirection","gap","spacing","padding","paddingLeft","marginBottom","Stack","styled","Tooltip","Typography","useTheme","isDefined","React","Fragment","useMemo","isComponentType","value","DetailsStack","IconComponent","heading","children","tooltipTitle","props","theme","useTheme","hasTooltip","isDefined","resolvedIconComponent","useMemo","React","style","height","marginTop","marginLeft","spacing","Fragment","Stack","direction","flexGrow","flexWrap","minWidth","SectionHeadingTypography","Tooltip","title","span","styled","Typography","name","display","fontFamily","lineHeight","marginBottom","Stack","Typography","useTheme","React","LabelValueStack","labels","values","props","theme","useTheme","React","Stack","flexDirection","flexGrow","map","label","Typography","fontWeight","key","variant","sx","borderBottom","vars","palette","divider","opacity","alignItems","value","index","fontFamily","width","display","justifyContent","Account","buildRandomChain","buildRandomBlockChain","blockCount","initialBlockProducer","Account","random","blocks","buildRandomChain","buildRandomBlockChainBlocksOnly","chain"]}
@@ -1,8 +1,8 @@
1
1
  import type { StackProps } from '@mui/material';
2
- import type { ComponentType, SVGAttributes } from 'react';
2
+ import type { ComponentType, ReactNode, SVGAttributes } from 'react';
3
3
  import React from 'react';
4
4
  export interface DetailsStackProps extends StackProps {
5
- IconComponent?: ComponentType<SVGAttributes<SVGElement>>;
5
+ IconComponent?: ComponentType<SVGAttributes<SVGElement>> | ReactNode;
6
6
  heading?: string;
7
7
  tooltipTitle?: string;
8
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DetailsStack.d.ts","sourceRoot":"","sources":["../../../../src/components/stack/DetailsStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,aAAa,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAA;IACxD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoCpD,CAAA"}
1
+ {"version":3,"file":"DetailsStack.d.ts","sourceRoot":"","sources":["../../../../src/components/stack/DetailsStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAAK,EACV,aAAa,EAAE,SAAS,EAAE,aAAa,EACxC,MAAM,OAAO,CAAA;AACd,OAAO,KAA4B,MAAM,OAAO,CAAA;AAMhD,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,aAAa,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,GAAG,SAAS,CAAA;IACpE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoCpD,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/package.json",
3
3
  "name": "@xyo-network/react-chain-shared",
4
- "version": "1.5.12",
4
+ "version": "1.5.14",
5
5
  "description": "XYO Layer One React SDK",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -38,18 +38,19 @@
38
38
  "start": "storybook dev -p 6006"
39
39
  },
40
40
  "dependencies": {
41
+ "@xylabs/typeof": "^4.11.11",
41
42
  "@xyo-network/account": "^3.18.2",
42
- "@xyo-network/chain-protocol": "^1.5.12",
43
- "@xyo-network/xl1-protocol": "^1.4.16"
43
+ "@xyo-network/chain-protocol": "^1.5.14",
44
+ "@xyo-network/xl1-protocol": "^1.4.19"
44
45
  },
45
46
  "devDependencies": {
46
47
  "@emotion/react": "^11.14.0",
47
48
  "@emotion/styled": "^11.14.0",
48
49
  "@mui/material": "^7.1.1",
49
50
  "@types/react": "^19.1.6",
50
- "@xylabs/ts-scripts-yarn3": "^6.5.7",
51
- "@xylabs/tsconfig-react": "^6.5.7",
52
- "knip": "^5.59.1",
51
+ "@xylabs/ts-scripts-yarn3": "^6.5.8",
52
+ "@xylabs/tsconfig-react": "^6.5.8",
53
+ "knip": "^5.60.2",
53
54
  "react": "^19.1.0",
54
55
  "react-dom": "^19.1.0",
55
56
  "typescript": "^5.8.3"
@@ -4,11 +4,17 @@ import {
4
4
  useTheme,
5
5
  } from '@mui/material'
6
6
  import { isDefined } from '@xylabs/typeof'
7
- import type { ComponentType, SVGAttributes } from 'react'
8
- import React, { useMemo } from 'react'
7
+ import type {
8
+ ComponentType, ReactNode, SVGAttributes,
9
+ } from 'react'
10
+ import React, { Fragment, useMemo } from 'react'
11
+
12
+ const isComponentType = (value: unknown): value is ComponentType<SVGAttributes<SVGElement>> =>
13
+ typeof value === 'function'
14
+ || (typeof value === 'object' && value !== null && ('$$typeof' in value || 'render' in value))
9
15
 
10
16
  export interface DetailsStackProps extends StackProps {
11
- IconComponent?: ComponentType<SVGAttributes<SVGElement>>
17
+ IconComponent?: ComponentType<SVGAttributes<SVGElement>> | ReactNode
12
18
  heading?: string
13
19
  tooltipTitle?: string
14
20
  }
@@ -20,7 +26,7 @@ export const DetailsStack: React.FC<DetailsStackProps> = ({
20
26
 
21
27
  const hasTooltip = isDefined(tooltipTitle)
22
28
  const resolvedIconComponent = useMemo(() => {
23
- return IconComponent
29
+ return isComponentType(IconComponent)
24
30
  ? (
25
31
  <IconComponent
26
32
  style={{
@@ -31,7 +37,7 @@ export const DetailsStack: React.FC<DetailsStackProps> = ({
31
37
  }}
32
38
  />
33
39
  )
34
- : <></>
40
+ : IconComponent ?? <Fragment />
35
41
  }, [IconComponent])
36
42
 
37
43
  return (
@@ -41,7 +47,7 @@ export const DetailsStack: React.FC<DetailsStackProps> = ({
41
47
  {hasTooltip
42
48
  ? (
43
49
  <Tooltip title={tooltipTitle}>
44
- {resolvedIconComponent}
50
+ <span>{resolvedIconComponent}</span>
45
51
  </Tooltip>
46
52
  )
47
53
  : resolvedIconComponent}