@xyo-network/react-shared 2.27.30 → 2.27.31

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.
@@ -1,10 +1,10 @@
1
1
  import { PaperProps, TypographyProps } from '@mui/material';
2
2
  import { ReactNode } from 'react';
3
3
  export interface TokenBarProps extends PaperProps {
4
- text1?: string | number;
4
+ text1?: ReactNode;
5
5
  text1Props?: TypographyProps;
6
6
  text1Suffix?: ReactNode;
7
- text2?: string | number;
7
+ text2?: ReactNode;
8
8
  text2Props?: TypographyProps;
9
9
  text2Suffix?: ReactNode;
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TokenBar.d.ts","sourceRoot":"","sources":["../../../../src/components/TokenBar/TokenBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAc,eAAe,EAAE,MAAM,eAAe,CAAA;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAA;CACxB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAe5C,CAAA"}
1
+ {"version":3,"file":"TokenBar.d.ts","sourceRoot":"","sources":["../../../../src/components/TokenBar/TokenBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAc,eAAe,EAAE,MAAM,eAAe,CAAA;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAA;CACxB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAe5C,CAAA"}
@@ -1,8 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { AvatarProps, CardHeaderProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
3
  export interface TokenSummaryProps extends CardHeaderProps {
4
4
  icon?: string;
5
5
  symbol?: string;
6
+ symbolElement?: ReactNode;
6
7
  imgBgProps?: AvatarProps;
7
8
  }
8
9
  export declare const TokenSummary: React.FC<TokenSummaryProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"TokenSummary.d.ts","sourceRoot":"","sources":["../../../../src/components/TokenSummary/TokenSummary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAU,WAAW,EAAc,eAAe,EAAwB,MAAM,eAAe,CAAA;AAEtG,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,WAAW,CAAA;CACzB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyBpD,CAAA"}
1
+ {"version":3,"file":"TokenSummary.d.ts","sourceRoot":"","sources":["../../../../src/components/TokenSummary/TokenSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,WAAW,EAAc,eAAe,EAAwB,MAAM,eAAe,CAAA;AACtG,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB,UAAU,CAAC,EAAE,WAAW,CAAA;CACzB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyBpD,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Avatar, CardHeader, Typography, useTheme } from '@mui/material';
3
- export const TokenSummary = ({ imgBgProps = {}, icon, symbol, children, ...props }) => {
3
+ export const TokenSummary = ({ imgBgProps = {}, icon, symbol, symbolElement, children, ...props }) => {
4
4
  const theme = useTheme();
5
5
  const avatarProps = {
6
6
  ...imgBgProps,
@@ -11,6 +11,6 @@ export const TokenSummary = ({ imgBgProps = {}, icon, symbol, children, ...props
11
11
  ...imgBgProps.sx,
12
12
  },
13
13
  };
14
- return (_jsxs(_Fragment, { children: [_jsx(CardHeader, { avatar: _jsx(Avatar, { src: icon, alt: symbol, ...avatarProps }), title: _jsx(Typography, { variant: "h6", fontWeight: 300, textTransform: "uppercase", children: symbol }), ...props }), children] }));
14
+ return (_jsxs(_Fragment, { children: [_jsx(CardHeader, { avatar: _jsx(Avatar, { src: icon, alt: symbol, ...avatarProps }), title: _jsx(Typography, { variant: "h6", fontWeight: 300, textTransform: "uppercase", children: symbolElement ?? symbol }), ...props }), children] }));
15
15
  };
16
16
  //# sourceMappingURL=TokenSummary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TokenSummary.js","sourceRoot":"","sources":["../../../../src/components/TokenSummary/TokenSummary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAe,UAAU,EAAmB,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAQtG,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EAAE,UAAU,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACjH,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,WAAW,GAAG;QAClB,GAAG,UAAU;QACb,EAAE,EAAE;YACF,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK;YACtC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YAC5B,GAAG,UAAU,CAAC,EAAE;SACjB;KACF,CAAA;IACD,OAAO,CACL,8BACE,KAAC,UAAU,IACT,MAAM,EAAE,KAAC,MAAM,IAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAM,WAAW,GAAI,EAC3D,KAAK,EACH,KAAC,UAAU,IAAC,OAAO,EAAC,IAAI,EAAC,UAAU,EAAE,GAAG,EAAE,aAAa,EAAC,WAAW,YAChE,MAAM,GACI,KAEX,KAAK,GACT,EACD,QAAQ,IACR,CACJ,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"TokenSummary.js","sourceRoot":"","sources":["../../../../src/components/TokenSummary/TokenSummary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAe,UAAU,EAAmB,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAUtG,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EAAE,UAAU,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAChI,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,WAAW,GAAG;QAClB,GAAG,UAAU;QACb,EAAE,EAAE;YACF,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK;YACtC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YAC5B,GAAG,UAAU,CAAC,EAAE;SACjB;KACF,CAAA;IACD,OAAO,CACL,8BACE,KAAC,UAAU,IACT,MAAM,EAAE,KAAC,MAAM,IAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAM,WAAW,GAAI,EAC3D,KAAK,EACH,KAAC,UAAU,IAAC,OAAO,EAAC,IAAI,EAAC,UAAU,EAAE,GAAG,EAAE,aAAa,EAAC,WAAW,YAChE,aAAa,IAAI,MAAM,GACb,KAEX,KAAK,GACT,EACD,QAAQ,IACR,CACJ,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -35,9 +35,9 @@
35
35
  "devDependencies": {
36
36
  "@storybook/react": "^6.5.10",
37
37
  "@xylabs/pixel": "^1.4.5",
38
- "@xylabs/tsconfig-dom": "^2.5.97",
38
+ "@xylabs/tsconfig-dom": "^2.5.99",
39
39
  "@xyo-network/api": "^2.25.2",
40
- "@xyo-network/react-storybook": "^2.27.30"
40
+ "@xyo-network/react-storybook": "^2.27.31"
41
41
  },
42
42
  "browser": "dist/esm/index.js",
43
43
  "docs": "dist/docs.json",
@@ -81,5 +81,5 @@
81
81
  },
82
82
  "sideEffects": false,
83
83
  "types": "dist/esm/index.d.ts",
84
- "version": "2.27.30"
84
+ "version": "2.27.31"
85
85
  }
@@ -2,10 +2,10 @@ import { Paper, PaperProps, Typography, TypographyProps } from '@mui/material'
2
2
  import { FlexRow } from '@xylabs/react-flexbox'
3
3
  import { ReactNode } from 'react'
4
4
  export interface TokenBarProps extends PaperProps {
5
- text1?: string | number
5
+ text1?: ReactNode
6
6
  text1Props?: TypographyProps
7
7
  text1Suffix?: ReactNode
8
- text2?: string | number
8
+ text2?: ReactNode
9
9
  text2Props?: TypographyProps
10
10
  text2Suffix?: ReactNode
11
11
  }
@@ -1,6 +1,8 @@
1
+ import { Link } from '@mui/material'
1
2
  import { ComponentMeta, ComponentStory } from '@storybook/react'
2
3
  import { BrowserRouter } from 'react-router-dom'
3
4
 
5
+ import * as tokenData from '../TokenData'
4
6
  import { TokenSummary } from './TokenSummary'
5
7
  const StorybookEntry = {
6
8
  argTypes: {},
@@ -20,9 +22,20 @@ const Template: ComponentStory<typeof TokenSummary> = (args) => (
20
22
  )
21
23
 
22
24
  const WithData = Template.bind({})
23
- WithData.args = { icon: 'string', symbol: 'string' }
25
+ WithData.args = { icon: tokenData.TokenData[0].icon, symbol: 'string' }
24
26
 
25
- export { WithData }
27
+ const SymbolElement = Template.bind({})
28
+ SymbolElement.args = {
29
+ icon: tokenData.TokenData[0].icon,
30
+ symbol: 'string',
31
+ symbolElement: (
32
+ <Link underline="hover" href="#">
33
+ Linked Title
34
+ </Link>
35
+ ),
36
+ }
37
+
38
+ export { SymbolElement, WithData }
26
39
 
27
40
  // eslint-disable-next-line import/no-default-export
28
41
  export default StorybookEntry
@@ -1,12 +1,14 @@
1
1
  import { Avatar, AvatarProps, CardHeader, CardHeaderProps, Typography, useTheme } from '@mui/material'
2
+ import { ReactNode } from 'react'
2
3
 
3
4
  export interface TokenSummaryProps extends CardHeaderProps {
4
5
  icon?: string
5
6
  symbol?: string
7
+ symbolElement?: ReactNode
6
8
  imgBgProps?: AvatarProps
7
9
  }
8
10
 
9
- export const TokenSummary: React.FC<TokenSummaryProps> = ({ imgBgProps = {}, icon, symbol, children, ...props }) => {
11
+ export const TokenSummary: React.FC<TokenSummaryProps> = ({ imgBgProps = {}, icon, symbol, symbolElement, children, ...props }) => {
10
12
  const theme = useTheme()
11
13
  const avatarProps = {
12
14
  ...imgBgProps,
@@ -23,7 +25,7 @@ export const TokenSummary: React.FC<TokenSummaryProps> = ({ imgBgProps = {}, ico
23
25
  avatar={<Avatar src={icon} alt={symbol} {...avatarProps} />}
24
26
  title={
25
27
  <Typography variant="h6" fontWeight={300} textTransform="uppercase">
26
- {symbol}
28
+ {symbolElement ?? symbol}
27
29
  </Typography>
28
30
  }
29
31
  {...props}