@xyo-network/react-chain-shared 1.3.3 → 1.3.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.
@@ -2,14 +2,15 @@ var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
4
  // src/components/menu-item/ActiveMenuItem.tsx
5
- import { MenuItem, styled } from "@mui/material";
5
+ import { MenuItem, styled, useTheme } from "@mui/material";
6
6
  import React from "react";
7
7
  var ActiveMenuItem = /* @__PURE__ */ __name(({ active, children, sx, ...props }) => {
8
+ const theme = useTheme();
8
9
  return /* @__PURE__ */ React.createElement(StyledMenuItem, {
9
10
  disableRipple: true,
10
11
  sx: {
11
- borderLeft: /* @__PURE__ */ __name((theme) => `5px solid ${active ? theme.palette.secondary.light : "transparent"}`, "borderLeft"),
12
- backgroundColor: /* @__PURE__ */ __name((theme) => active ? theme.palette.secondary.dark : "transparent", "backgroundColor"),
12
+ borderLeft: `5px solid ${active ? theme.vars.palette.secondary.light : "transparent"}`,
13
+ backgroundColor: active ? theme.vars.palette.secondary.dark : "transparent",
13
14
  color: active ? "white" : "inherit",
14
15
  ...sx
15
16
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/menu-item/ActiveMenuItem.tsx"],"sourcesContent":["import type { MenuItemProps, Theme } from '@mui/material'\nimport { MenuItem, styled } from '@mui/material'\nimport React from 'react'\n\nexport const ActiveMenuItem: React.FC<MenuItemProps & { active?: boolean }> = ({\n active, children, sx, ...props\n}) => {\n return (\n <StyledMenuItem\n disableRipple\n sx={{\n borderLeft: (theme: Theme) => `5px solid ${active ? theme.palette.secondary.light : 'transparent'}`,\n backgroundColor: (theme: Theme) => active ? theme.palette.secondary.dark : 'transparent',\n color: active ? 'white' : 'inherit',\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"],"mappings":";;;;AACA,SAASA,UAAUC,cAAc;AACjC,OAAOC,WAAW;AAEX,IAAMC,iBAAiE,wBAAC,EAC7EC,QAAQC,UAAUC,IAAI,GAAGC,MAAAA,MAC1B;AACC,SACE,sBAAA,cAACC,gBAAAA;IACCC,eAAAA;IACAH,IAAI;MACFI,YAAY,wBAACC,UAAiB,aAAaP,SAASO,MAAMC,QAAQC,UAAUC,QAAQ,aAAA,IAAxE;MACZC,iBAAiB,wBAACJ,UAAiBP,SAASO,MAAMC,QAAQC,UAAUG,OAAO,eAA1D;MACjBC,OAAOb,SAAS,UAAU;MAC1B,GAAGE;IACL;IACC,GAAGC;KAEHF,QAAAA;AAGP,GAjB8E;AAmB9E,IAAMG,iBAAiBU,OAAOC,UAAU;EAAEC,MAAM;AAAiB,CAAA,EAAG,CAAC,EAAET,MAAK,OAAQ;EAClFU,SAAS;EACTC,eAAe;EACfC,KAAKZ,MAAMa,QAAQ,CAAA;EACnBC,SAAS;EACTC,aAAaf,MAAMa,QAAQ,CAAA;EAC3BG,cAAchB,MAAMa,QAAQ,CAAA;AAC9B,EAAA;","names":["MenuItem","styled","React","ActiveMenuItem","active","children","sx","props","StyledMenuItem","disableRipple","borderLeft","theme","palette","secondary","light","backgroundColor","dark","color","styled","MenuItem","name","display","flexDirection","gap","spacing","padding","paddingLeft","marginBottom"]}
1
+ {"version":3,"sources":["../../src/components/menu-item/ActiveMenuItem.tsx"],"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 borderLeft: `5px solid ${active ? theme.vars.palette.secondary.light : 'transparent'}`,\n backgroundColor: active ? theme.vars.palette.secondary.dark : 'transparent',\n color: active ? 'white' : 'inherit',\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"],"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;MACFM,YAAY,aAAaR,SAASI,MAAMK,KAAKC,QAAQC,UAAUC,QAAQ,aAAA;MACvEC,iBAAiBb,SAASI,MAAMK,KAAKC,QAAQC,UAAUG,OAAO;MAC9DC,OAAOf,SAAS,UAAU;MAC1B,GAAGE;IACL;IACC,GAAGC;KAEHF,QAAAA;AAGP,GAlB8E;AAoB9E,IAAMK,iBAAiBU,OAAOC,UAAU;EAAEC,MAAM;AAAiB,CAAA,EAAG,CAAC,EAAEd,MAAK,OAAQ;EAClFe,SAAS;EACTC,eAAe;EACfC,KAAKjB,MAAMkB,QAAQ,CAAA;EACnBC,SAAS;EACTC,aAAapB,MAAMkB,QAAQ,CAAA;EAC3BG,cAAcrB,MAAMkB,QAAQ,CAAA;AAC9B,EAAA;","names":["MenuItem","styled","useTheme","React","ActiveMenuItem","active","children","sx","props","theme","useTheme","StyledMenuItem","disableRipple","borderLeft","vars","palette","secondary","light","backgroundColor","dark","color","styled","MenuItem","name","display","flexDirection","gap","spacing","padding","paddingLeft","marginBottom"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ActiveMenuItem.d.ts","sourceRoot":"","sources":["../../../../src/components/menu-item/ActiveMenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAS,MAAM,eAAe,CAAA;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAiBzE,CAAA"}
1
+ {"version":3,"file":"ActiveMenuItem.d.ts","sourceRoot":"","sources":["../../../../src/components/menu-item/ActiveMenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAIlD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAkBzE,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.3.3",
4
+ "version": "1.3.4",
5
5
  "description": "XYO Layer One React SDK",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -42,8 +42,8 @@
42
42
  "@emotion/styled": "^11.14.0",
43
43
  "@mui/material": "^7.0.2",
44
44
  "@types/react": "^19.1.2",
45
- "@xylabs/ts-scripts-yarn3": "^6.3.4",
46
- "@xylabs/tsconfig-react": "^6.3.4",
45
+ "@xylabs/ts-scripts-yarn3": "^6.3.5",
46
+ "@xylabs/tsconfig-react": "^6.3.5",
47
47
  "react": "^19.1.0",
48
48
  "react-dom": "^19.1.0",
49
49
  "typescript": "^5.8.3"
@@ -1,16 +1,19 @@
1
- import type { MenuItemProps, Theme } from '@mui/material'
2
- import { MenuItem, styled } from '@mui/material'
1
+ import type { MenuItemProps } from '@mui/material'
2
+ import {
3
+ MenuItem, styled, useTheme,
4
+ } from '@mui/material'
3
5
  import React from 'react'
4
6
 
5
7
  export const ActiveMenuItem: React.FC<MenuItemProps & { active?: boolean }> = ({
6
8
  active, children, sx, ...props
7
9
  }) => {
10
+ const theme = useTheme()
8
11
  return (
9
12
  <StyledMenuItem
10
13
  disableRipple
11
14
  sx={{
12
- borderLeft: (theme: Theme) => `5px solid ${active ? theme.palette.secondary.light : 'transparent'}`,
13
- backgroundColor: (theme: Theme) => active ? theme.palette.secondary.dark : 'transparent',
15
+ borderLeft: `5px solid ${active ? theme.vars.palette.secondary.light : 'transparent'}`,
16
+ backgroundColor: active ? theme.vars.palette.secondary.dark : 'transparent',
14
17
  color: active ? 'white' : 'inherit',
15
18
  ...sx,
16
19
  }}
@@ -0,0 +1 @@
1
+ import type {} from '@mui/material/themeCssVarsAugmentation'