@xyo-network/react-drawer 8.0.0 → 8.0.1

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.
@@ -89,4 +89,4 @@ var StyledDrawerContentPaper = styled(Paper, {
89
89
  export {
90
90
  DrawerEx
91
91
  };
92
- //# sourceMappingURL=index.mjs.map
92
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1,7 @@
1
- {"version":3,"sources":["../../src/components/Drawer.tsx"],"sourcesContent":["import type { DrawerProps } from '@mui/material'\nimport {\n Drawer, Paper, styled, Typography,\n} from '@mui/material'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport type { MouseEvent, PropsWithChildren } from 'react'\nimport React, { useMemo } from 'react'\n\nexport interface DrawerExProps extends PropsWithChildren<DrawerProps> {\n heightVariant?: 'full' | 'auto'\n subTitle?: string\n title?: string\n widthVariant?: 'full' | 'partial'\n}\n\nexport const DrawerEx: React.FC<DrawerExProps> = ({\n children,\n heightVariant = 'full',\n subTitle,\n title,\n onClose,\n widthVariant = 'partial',\n ...props\n}) => {\n const variantBasedProps = useMemo(() => {\n return {\n PaperProps: {\n sx: {\n alignItems: 'center',\n background: 'transparent',\n boxShadow: 'none',\n height: heightVariant === 'full' ? '100%' : 'auto',\n width: widthVariant === 'partial' ? 'auto' : '100%',\n },\n },\n onClick: (event: MouseEvent) => onClose?.(event, 'backdropClick'),\n }\n }, [heightVariant, onClose, widthVariant])\n\n return (\n <Drawer anchor=\"top\" onClose={onClose} {...variantBasedProps} {...props}>\n {/* Trap the event to prevent triggering the backdrop onClick */}\n <StyledDrawerContentPaper\n widthVariant={widthVariant}\n elevation={16}\n onClick={(event: MouseEvent) => event.stopPropagation()}\n sx={{ width: widthVariant === 'full' ? '100%' : undefined }}\n >\n {title || subTitle\n ? (\n <FlexCol\n sx={{\n alignItems: 'start',\n gap: 1,\n }}\n >\n {title\n ? <StyledEllipsisTypography variant=\"h3\">{title}</StyledEllipsisTypography>\n : null}\n {subTitle\n ? (\n <Typography\n variant=\"subtitle1\"\n sx={{ textTransform: 'none' }}\n >\n {subTitle}\n </Typography>\n )\n : null}\n </FlexCol>\n )\n : null}\n {children}\n </StyledDrawerContentPaper>\n </Drawer>\n )\n}\n\nconst StyledEllipsisTypography = styled(Typography, { name: 'StyledEllipsisTypography' })(() => ({\n maxWidth: '100%',\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n}))\n\nconst StyledDrawerContentPaper = styled(Paper, {\n name: 'StyledDrawerContentPaper',\n shouldForwardProp: prop => !['widthVariant'].includes(prop as string),\n})<DrawerExProps>(({ theme, widthVariant }) => ({\n alignItems: 'stretch',\n borderRadius: `0 0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px`,\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(2),\n height: '100%',\n maxWidth: '100%',\n overflowX: 'hidden',\n padding: theme.spacing(3),\n [theme.breakpoints.up('lg')]: { width: widthVariant === 'full' ? '100%' : '50%' },\n [theme.breakpoints.up('md')]: { width: widthVariant === 'full' ? '100%' : '75%' },\n}))\n"],"mappings":";AACA;AAAA,EACE;AAAA,EAAQ;AAAA,EAAO;AAAA,EAAQ;AAAA,OAClB;AACP,SAAS,eAAe;AAExB,SAAgB,eAAe;AA4CjB,SAOM,KAPN;AAnCP,IAAM,WAAoC,CAAC;AAAA,EAChD;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,QAAQ,MAAM;AACtC,WAAO;AAAA,MACL,YAAY;AAAA,QACV,IAAI;AAAA,UACF,YAAY;AAAA,UACZ,YAAY;AAAA,UACZ,WAAW;AAAA,UACX,QAAQ,kBAAkB,SAAS,SAAS;AAAA,UAC5C,OAAO,iBAAiB,YAAY,SAAS;AAAA,QAC/C;AAAA,MACF;AAAA,MACA,SAAS,CAAC,UAAsB,UAAU,OAAO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AAAA,EACxB,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,OAAO,iBAAiB,SAAS,SAAS,MAAM;AAAA,EAChF,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,OAAO,iBAAiB,SAAS,SAAS,MAAM;AAClF,EAAE;","names":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/Drawer.tsx"],
4
+ "sourcesContent": ["import type { DrawerProps } from '@mui/material'\nimport {\n Drawer, Paper, styled, Typography,\n} from '@mui/material'\nimport { FlexCol } from '@xylabs/react-flexbox'\nimport type { MouseEvent, PropsWithChildren } from 'react'\nimport React, { useMemo } from 'react'\n\nexport interface DrawerExProps extends PropsWithChildren<DrawerProps> {\n heightVariant?: 'full' | 'auto'\n subTitle?: string\n title?: string\n widthVariant?: 'full' | 'partial'\n}\n\nexport const DrawerEx: React.FC<DrawerExProps> = ({\n children,\n heightVariant = 'full',\n subTitle,\n title,\n onClose,\n widthVariant = 'partial',\n ...props\n}) => {\n const variantBasedProps = useMemo(() => {\n return {\n PaperProps: {\n sx: {\n alignItems: 'center',\n background: 'transparent',\n boxShadow: 'none',\n height: heightVariant === 'full' ? '100%' : 'auto',\n width: widthVariant === 'partial' ? 'auto' : '100%',\n },\n },\n onClick: (event: MouseEvent) => onClose?.(event, 'backdropClick'),\n }\n }, [heightVariant, onClose, widthVariant])\n\n return (\n <Drawer anchor=\"top\" onClose={onClose} {...variantBasedProps} {...props}>\n {/* Trap the event to prevent triggering the backdrop onClick */}\n <StyledDrawerContentPaper\n widthVariant={widthVariant}\n elevation={16}\n onClick={(event: MouseEvent) => event.stopPropagation()}\n sx={{ width: widthVariant === 'full' ? '100%' : undefined }}\n >\n {title || subTitle\n ? (\n <FlexCol\n sx={{\n alignItems: 'start',\n gap: 1,\n }}\n >\n {title\n ? <StyledEllipsisTypography variant=\"h3\">{title}</StyledEllipsisTypography>\n : null}\n {subTitle\n ? (\n <Typography\n variant=\"subtitle1\"\n sx={{ textTransform: 'none' }}\n >\n {subTitle}\n </Typography>\n )\n : null}\n </FlexCol>\n )\n : null}\n {children}\n </StyledDrawerContentPaper>\n </Drawer>\n )\n}\n\nconst StyledEllipsisTypography = styled(Typography, { name: 'StyledEllipsisTypography' })(() => ({\n maxWidth: '100%',\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n}))\n\nconst StyledDrawerContentPaper = styled(Paper, {\n name: 'StyledDrawerContentPaper',\n shouldForwardProp: prop => !['widthVariant'].includes(prop as string),\n})<DrawerExProps>(({ theme, widthVariant }) => ({\n alignItems: 'stretch',\n borderRadius: `0 0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px`,\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(2),\n height: '100%',\n maxWidth: '100%',\n overflowX: 'hidden',\n padding: theme.spacing(3),\n [theme.breakpoints.up('lg')]: { width: widthVariant === 'full' ? '100%' : '50%' },\n [theme.breakpoints.up('md')]: { width: widthVariant === 'full' ? '100%' : '75%' },\n}))\n"],
5
+ "mappings": ";AACA;AAAA,EACE;AAAA,EAAQ;AAAA,EAAO;AAAA,EAAQ;AAAA,OAClB;AACP,SAAS,eAAe;AAExB,SAAgB,eAAe;AA4CjB,SAOM,KAPN;AAnCP,IAAM,WAAoC,CAAC;AAAA,EAChD;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,QAAQ,MAAM;AACtC,WAAO;AAAA,MACL,YAAY;AAAA,QACV,IAAI;AAAA,UACF,YAAY;AAAA,UACZ,YAAY;AAAA,UACZ,WAAW;AAAA,UACX,QAAQ,kBAAkB,SAAS,SAAS;AAAA,UAC5C,OAAO,iBAAiB,YAAY,SAAS;AAAA,QAC/C;AAAA,MACF;AAAA,MACA,SAAS,CAAC,UAAsB,UAAU,OAAO,eAAe;AAAA,IAClE;AAAA,EACF,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GAAG,IAAI,CAAC,GAAG,EAAE,OAAO,iBAAiB,SAAS,SAAS,MAAM;AAAA,EAChF,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,OAAO,iBAAiB,SAAS,SAAS,MAAM;AAClF,EAAE;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-drawer",
3
- "version": "8.0.0",
3
+ "version": "8.0.1",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -41,33 +41,33 @@
41
41
  "README.md"
42
42
  ],
43
43
  "devDependencies": {
44
- "@mui/material": "~9.0",
44
+ "@mui/material": "^9.0.1",
45
45
  "@opentelemetry/api": "^1.9.1",
46
46
  "@opentelemetry/sdk-trace-base": "^2.7.1",
47
- "@storybook/react-vite": "~10.3.6",
47
+ "@storybook/react-vite": "~10.4.0",
48
48
  "@types/react": "^19.2.14",
49
- "@xylabs/react-flexbox": "~8.0",
50
- "@xylabs/sdk-js": "^5.1.2",
51
- "@xylabs/toolchain": "~7.13.22",
52
- "@xylabs/tsconfig": "^7.13.22",
53
- "@xylabs/tsconfig-dom": "^7.13.22",
54
- "@xylabs/tsconfig-react": "~7.13.22",
49
+ "@xylabs/react-flexbox": "~8.0.3",
50
+ "@xylabs/sdk-js": "^5.1.3",
51
+ "@xylabs/toolchain": "~8.0.6",
52
+ "@xylabs/tsconfig": "^8.0.6",
53
+ "@xylabs/tsconfig-dom": "^8.0.6",
54
+ "@xylabs/tsconfig-react": "~8.0.6",
55
55
  "async-mutex": "^0.5.0",
56
56
  "bn.js": "^5.2.3",
57
57
  "buffer": "^6.0.3",
58
58
  "chalk": "^5.6.2",
59
- "eslint": "^10.3.0",
59
+ "eslint": "^10.4.0",
60
60
  "ethers": "^6.16.0",
61
61
  "pako": "^2.1.0",
62
62
  "react": "^19.2.6",
63
63
  "react-dom": "^19.2.6",
64
- "storybook": "^10.3.6",
65
- "typescript": "^5.9.3",
66
- "vite": "^8.0.11",
64
+ "storybook": "^10.4.0",
65
+ "typescript": "^6.0.3",
66
+ "vite": "^8.0.13",
67
67
  "zod": "^4.4.3"
68
68
  },
69
69
  "peerDependencies": {
70
- "@mui/material": "~9.0",
70
+ "@mui/material": "^9.0",
71
71
  "@opentelemetry/api": "^1.9",
72
72
  "@opentelemetry/sdk-trace-base": "^2.7",
73
73
  "@xylabs/react-flexbox": "~8.0",