@xyo-network/react-card 5.0.7 → 5.1.0

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.
@@ -50,7 +50,7 @@ import { Card } from "@mui/material";
50
50
  import { useGradientStyles } from "@xyo-network/react-shared";
51
51
  import React2 from "react";
52
52
  var CardExWithRef = /* @__PURE__ */ __name(({ ref, style, gradient, ...props }) => {
53
- const { styles } = useGradientStyles();
53
+ const styles = useGradientStyles();
54
54
  const gradientStyle = gradient === "border" ? styles.border : gradient === "background" ? styles.background : {};
55
55
  return /* @__PURE__ */ React2.createElement(Card, {
56
56
  style: {
@@ -68,14 +68,14 @@ var CardEx = CardExWithRef;
68
68
  import { ArrowForwardRounded as ArrowForwardRoundedIcon } from "@mui/icons-material";
69
69
  import { alpha, Card as Card2, CardActions, CardContent as CardContent2, CardMedia, Grid, IconButton, Typography, useTheme, Zoom } from "@mui/material";
70
70
  import { FlexGrowCol } from "@xylabs/react-flexbox";
71
- import { useIsMobile } from "@xyo-network/react-shared";
71
+ import { useIsSmall } from "@xyo-network/react-shared";
72
72
  import React3, { useState } from "react";
73
73
  import { useNavigate } from "react-router-dom";
74
74
  var FullWidthCard = /* @__PURE__ */ __name(({ cardIsButton, desc, href, media, name, small, to, ...props }) => {
75
75
  const theme = useTheme();
76
76
  const [raised, setRaised] = useState(false);
77
77
  const navigate = useNavigate();
78
- const isMobile = useIsMobile();
78
+ const isMobile = useIsSmall();
79
79
  const localRouteChange = /* @__PURE__ */ __name((to2) => {
80
80
  to2 ? void navigate(to2) : void navigate("/404");
81
81
  }, "localRouteChange");
@@ -109,25 +109,28 @@ var FullWidthCard = /* @__PURE__ */ __name(({ cardIsButton, desc, href, media, n
109
109
  paddingY: 2,
110
110
  paddingX: 2
111
111
  }, /* @__PURE__ */ React3.createElement(Grid, {
112
- item: true,
113
- xs: 12,
114
- md: 6
112
+ size: {
113
+ xs: 12,
114
+ md: 6
115
+ }
115
116
  }, typeof name === "string" ? /* @__PURE__ */ React3.createElement(Typography, {
116
117
  fontWeight: 700,
117
118
  variant: "h2",
118
119
  textAlign: "left",
119
120
  paddingBottom: 1
120
121
  }, name) : name), /* @__PURE__ */ React3.createElement(Grid, {
121
- item: true,
122
- xs: 12,
123
- md: 5
122
+ size: {
123
+ xs: 12,
124
+ md: 5
125
+ }
124
126
  }, /* @__PURE__ */ React3.createElement(Typography, {
125
127
  variant: "body1",
126
128
  fontWeight: 400,
127
129
  textAlign: "left"
128
130
  }, desc)), /* @__PURE__ */ React3.createElement(Grid, {
129
- item: true,
130
- xs: 1,
131
+ size: {
132
+ xs: 1
133
+ },
131
134
  display: isMobile ? "none" : "flex",
132
135
  justifyContent: "center"
133
136
  }, /* @__PURE__ */ React3.createElement(Zoom, {
@@ -196,14 +199,14 @@ var PageCard = PageCardWithRef;
196
199
  import { ArrowForwardRounded as ArrowForwardRoundedIcon2 } from "@mui/icons-material";
197
200
  import { alpha as alpha2, CardActions as CardActions2, CardContent as CardContent3, CardMedia as CardMedia2, IconButton as IconButton3, Typography as Typography2, useTheme as useTheme2 } from "@mui/material";
198
201
  import { FlexCol, FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
199
- import { useIsMobile as useIsMobile2 } from "@xyo-network/react-shared";
202
+ import { useIsMobile } from "@xyo-network/react-shared";
200
203
  import React5, { useState as useState2 } from "react";
201
204
  import { useNavigate as useNavigate2 } from "react-router-dom";
202
205
  var SimpleCard = /* @__PURE__ */ __name(({ children, desc, iconImage, interactionVariant = "card", headline, href, media, small, subtitle, sx, to, ...props }) => {
203
206
  const theme = useTheme2();
204
207
  const [raised, setRaised] = useState2(false);
205
208
  const navigate = useNavigate2();
206
- const isMobile = useIsMobile2();
209
+ const isMobile = useIsMobile();
207
210
  const localRouteChange = /* @__PURE__ */ __name((to2) => {
208
211
  to2 ? void navigate(to2) : void navigate("/404");
209
212
  }, "localRouteChange");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/CardContentEx.tsx","../../src/components/CardEx.tsx","../../src/components/FullWidthCard/FullWidthCard.tsx","../../src/components/PageCard.tsx","../../src/components/SimpleCard/SimpleCard.tsx"],"sourcesContent":["import type { CardContentProps } from '@mui/material'\nimport { CardContent, styled } from '@mui/material'\nimport { useShareForwardedRef } from '@xyo-network/react-shared'\nimport React, { useEffect } from 'react'\n\nconst CardContentExRoot = styled(CardContent, {\n name: 'CardContentEx',\n shouldForwardProp: (prop: string) => !['variant', 'removePadding'].includes(prop),\n slot: 'Root',\n})<CardContentExProps>(({ variant, removePadding }) => ({\n ...((variant === 'scrollable' || removePadding) && {\n [':last-child']: { paddingBottom: 0 },\n overflow: 'auto',\n paddingTop: 0,\n ...(removePadding && { padding: 0 }),\n }),\n}))\n\nexport type CardContentExProps = CardContentProps & {\n refreshRef?: number\n removePadding?: boolean\n scrollToTop?: number\n variant?: 'scrollable' | 'normal'\n}\n\nexport const CardContentExWithRef = ({\n ref, scrollToTop = 0, refreshRef = 0, ...props\n}: CardContentExProps & { ref?: React.RefObject<HTMLDivElement | null> }) => {\n const sharedRef = useShareForwardedRef<HTMLDivElement>(ref, refreshRef)\n\n useEffect(() => {\n if (sharedRef && scrollToTop) {\n sharedRef.current?.scroll({ behavior: 'smooth', top: 0 })\n }\n }, [sharedRef, scrollToTop])\n\n return <CardContentExRoot ref={sharedRef} {...props} />\n}\n\nCardContentExWithRef.displayName = 'CardContentEx'\n\nexport const CardContentEx = CardContentExWithRef\n","import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport { useGradientStyles } from '@xyo-network/react-shared'\nimport React from 'react'\n\nexport interface CardExProps extends CardProps {\n gradient?: 'border' | 'background'\n}\n\nexport const CardExWithRef = ({\n ref, style, gradient, ...props\n}: CardExProps) => {\n const { styles } = useGradientStyles()\n const gradientStyle\n = gradient === 'border'\n ? styles.border\n : gradient === 'background'\n ? styles.background\n : {}\n return (\n <Card\n style={{\n ...gradientStyle,\n ...style,\n }}\n ref={ref}\n {...props}\n />\n )\n}\n\nCardExWithRef.displayName = 'CardEx'\n\nexport const CardEx = CardExWithRef\n","import { ArrowForwardRounded as ArrowForwardRoundedIcon } from '@mui/icons-material'\nimport type { CardProps } from '@mui/material'\nimport {\n alpha, Card, CardActions, CardContent, CardMedia, Grid, IconButton, Typography, useTheme, Zoom,\n} from '@mui/material'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsMobile } from '@xyo-network/react-shared'\nimport type { ReactNode } from 'react'\nimport React, { useState } from 'react'\nimport type { To } from 'react-router-dom'\nimport { useNavigate } from 'react-router-dom'\n\nexport interface FullWidthCardProps extends CardProps {\n cardIsButton?: boolean\n desc?: ReactNode\n href?: string\n linkText?: string\n media?: string\n name: ReactNode\n small?: boolean\n to?: To\n}\n\nexport const FullWidthCard: React.FC<FullWidthCardProps> = ({\n cardIsButton, desc, href, media, name, small, to, ...props\n}) => {\n const theme = useTheme()\n const [raised, setRaised] = useState(false)\n const navigate = useNavigate()\n const isMobile = useIsMobile()\n\n const localRouteChange = (to: To | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n to ? void navigate(to) : void navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n href ? void window.open(href) : void navigate('/404')\n }\n\n return (\n <Card\n elevation={raised ? 3 : 0}\n style={{ height: '100%', width: '100%' }}\n {...props}\n sx={{\n '&:hover': { cursor: 'pointer' },\n 'backgroundColor': alpha(theme.palette.primary.light, 0.05),\n }}\n onMouseEnter={() =>\n isMobile\n ? null\n : cardIsButton\n ? setRaised(true)\n : null}\n onMouseLeave={() =>\n isMobile\n ? null\n : cardIsButton\n ? setRaised(false)\n : null}\n onClick={() =>\n cardIsButton\n ? href\n ? externalRouteChange(href)\n : to\n ? localRouteChange(to)\n : navigate('/404')\n : null}\n >\n {media\n ? <CardMedia component=\"img\" height=\"100\" image={media} alt=\"\" />\n : null}\n\n <CardContent>\n <Grid container alignItems=\"center\" paddingY={2} paddingX={2}>\n <Grid item xs={12} md={6}>\n {typeof name === 'string'\n ? (\n <Typography fontWeight={700} variant=\"h2\" textAlign=\"left\" paddingBottom={1}>\n {name}\n </Typography>\n )\n : name}\n </Grid>\n <Grid item xs={12} md={5}>\n <Typography variant=\"body1\" fontWeight={400} textAlign=\"left\">\n {desc}\n </Typography>\n </Grid>\n <Grid item xs={1} display={isMobile ? 'none' : 'flex'} justifyContent=\"center\">\n <Zoom in={raised}>\n <IconButton\n color=\"primary\"\n size={small ? 'small' : 'medium'}\n onClick={() =>\n href\n ? externalRouteChange(href)\n : to\n ? localRouteChange(to)\n : navigate('/404')}\n disableFocusRipple\n disableRipple\n disableTouchRipple\n >\n <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />\n </IconButton>\n </Zoom>\n </Grid>\n </Grid>\n </CardContent>\n <CardActions sx={{ display: { md: isMobile ? 'flex' : 'none' } }}>\n <FlexGrowCol alignItems=\"flex-end\">\n <IconButton\n color=\"primary\"\n size={small ? 'small' : 'medium'}\n onClick={() =>\n href\n ? externalRouteChange(href)\n : to\n ? localRouteChange(to)\n : navigate('/404')}\n disableFocusRipple\n disableRipple\n disableTouchRipple\n >\n <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />\n </IconButton>\n </FlexGrowCol>\n </CardActions>\n </Card>\n )\n}\n","import { Refresh as RefreshIcon } from '@mui/icons-material'\nimport type { CardHeaderProps } from '@mui/material'\nimport { CardHeader, IconButton } from '@mui/material'\nimport { TypographyEx } from '@xyo-network/react-shared'\nimport type { ReactNode } from 'react'\nimport React from 'react'\n\nimport type { CardExProps } from './CardEx.tsx'\nimport { CardEx } from './CardEx.tsx'\n\nexport interface PageCardProps extends CardExProps {\n action?: ReactNode\n onRefresh?: () => void\n subheader?: CardHeaderProps['subheader']\n}\n\nconst PageCardWithRef = ({\n ref, subheader, title, onRefresh, children, action, style, ...props\n}: PageCardProps) => {\n return (\n <CardEx\n style={{\n backgroundColor: 'transparent', position: 'relative', ...style,\n }}\n elevation={0}\n ref={ref}\n {...props}\n >\n <CardHeader\n title={(\n <TypographyEx variant=\"h5\" gutterBottom>\n {title}\n </TypographyEx>\n )}\n subheader={<TypographyEx variant=\"subtitle1\">{subheader}</TypographyEx>}\n action={\n action ?? (\n <>\n {onRefresh\n ? (\n <IconButton onClick={() => onRefresh?.()}>\n <RefreshIcon />\n </IconButton>\n )\n : null}\n </>\n )\n }\n />\n {children}\n </CardEx>\n )\n}\n\nPageCardWithRef.displayName = 'PageCard'\n\nexport const PageCard = PageCardWithRef\n","import { ArrowForwardRounded as ArrowForwardRoundedIcon } from '@mui/icons-material'\nimport {\n alpha, CardActions, CardContent, CardMedia, IconButton, Typography, useTheme,\n} from '@mui/material'\nimport { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsMobile } from '@xyo-network/react-shared'\nimport type { ReactNode } from 'react'\nimport React, { useState } from 'react'\nimport type { To } from 'react-router-dom'\nimport { useNavigate } from 'react-router-dom'\n\nimport type { CardExProps } from '../CardEx.tsx'\nimport { CardEx } from '../CardEx.tsx'\n\nexport interface SimpleCardProps extends CardExProps {\n desc?: ReactNode\n headline?: ReactNode\n href?: string\n iconImage?: string\n interactionVariant?: 'button' | 'card'\n media?: string\n small?: boolean\n subtitle?: string\n to?: To\n}\n\nexport const SimpleCard: React.FC<SimpleCardProps> = ({\n children,\n desc,\n iconImage,\n interactionVariant = 'card',\n headline,\n href,\n media,\n small,\n subtitle,\n sx,\n to,\n ...props\n}) => {\n const theme = useTheme()\n const [raised, setRaised] = useState(false)\n const navigate = useNavigate()\n const isMobile = useIsMobile()\n const localRouteChange = (to: To | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n to ? void navigate(to) : void navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n href ? void window.open(href) : void navigate('/404')\n }\n return (\n <CardEx\n elevation={raised ? 3 : 0}\n sx={{\n '&:hover': { cursor: interactionVariant == 'button' ? 'pointer' : null },\n 'backgroundColor': alpha(theme.palette.primary.light, 0.05),\n ...sx,\n }}\n onMouseEnter={() =>\n isMobile\n ? null\n : interactionVariant == 'button'\n ? setRaised(true)\n : null}\n onMouseLeave={() =>\n isMobile\n ? null\n : interactionVariant == 'button'\n ? setRaised(false)\n : null}\n onClick={() =>\n interactionVariant == 'button'\n ? href\n ? externalRouteChange(href)\n : to\n ? localRouteChange(to)\n : navigate('/404')\n : null}\n {...props}\n >\n {media\n ? <CardMedia component=\"img\" height=\"100\" image={media} alt=\"\" />\n : null}\n\n <CardContent sx={{ height: '100%' }}>\n <FlexCol width=\"100%\" alignItems=\"flex-start\">\n {iconImage\n ? <img src={iconImage} height=\"40px\" style={{ paddingBottom: '8px' }} />\n : null}\n {typeof headline === 'string'\n ? (\n <Typography variant={small ? 'body1' : 'h6'} textAlign=\"left\" gutterBottom>\n {headline}\n </Typography>\n )\n : headline}\n {subtitle\n ? (\n <Typography variant=\"subtitle2\" textAlign=\"left\" gutterBottom>\n {subtitle}\n </Typography>\n )\n : null}\n <Typography variant={small ? 'caption' : 'body1'} textAlign=\"left\" gutterBottom>\n {desc}\n </Typography>\n </FlexCol>\n </CardContent>\n {children}\n {interactionVariant == 'button'\n ? (\n <CardActions>\n <FlexGrowCol alignItems=\"flex-end\">\n <IconButton\n color={raised ? 'secondary' : 'primary'}\n size={small ? 'small' : 'medium'}\n onClick={() =>\n href\n ? externalRouteChange(href)\n : to\n ? localRouteChange(to)\n : navigate('/404')}\n disableFocusRipple\n disableRipple\n disableTouchRipple\n >\n <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />\n </IconButton>\n </FlexGrowCol>\n </CardActions>\n )\n : null}\n </CardEx>\n )\n}\n"],"mappings":";;;;AACA,SAASA,aAAaC,cAAc;AACpC,SAASC,4BAA4B;AACrC,OAAOC,SAASC,iBAAiB;AAEjC,IAAMC,oBAAoBC,OAAOC,aAAa;EAC5CC,MAAM;EACNC,mBAA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B1C,YACG,gBAAAuB,OAAA,cAACoB,OAAAA;IAAIC,KAAK5C;IAAWoC,QAAO;IAAOS,OAAO;MAAEC,eAAe;IAAM;OACjE,MACH,OAAO5C,aAAa,WAEf,gBAAAqB,OAAA,cAACwB,aAAAA;IAAWC,SAAS3C,QAAQ,UAAU;IAAM4C,WAAU;IAAOC,cAAAA;KAC3DhD,QAAAA,IAGLA,UACHI,WAEK,gBAAAiB,OAAA,cAACwB,aAAAA;IAAWC,SAAQ;IAAYC,WAAU;IAAOC,cAAAA;KAC9C5C,QAAAA,IAGL,MACJ,gBAAAiB,OAAA,cAACwB,aAAAA;IAAWC,SAAS3C,QAAQ,YAAY;IAAS4C,WAAU;IAAOC,cAAAA;KAChEnD,IAAAA,CAAAA,CAAAA,GAIND,UACAG,sBAAsB,WAEjB,gBAAAsB,OAAA,cAAC4B,cAAAA,MACC,gBAAA5B,OAAA,cAAC6B,cAAAA;IAAYV,YAAW;KACtB,gBAAAnB,OAAA,cAAC8B,aAAAA;IACCC,OAAO1C,SAAS,cAAc;IAC9B2C,MAAMlD,QAAQ,UAAU;IACxB4B,SAAS,6BACP9B,OACIiB,oBAAoBjB,IAAAA,IACpBK,KACEW,iBAAiBX,EAAAA,IACjBO,SAAS,MAAA,GALR;IAMTyC,oBAAAA;IACAC,eAAAA;IACAC,oBAAAA;KAEA,gBAAAnC,OAAA,cAACoC,0BAAAA;IAAwBC,UAAUvD,QAAQ,UAAU;UAK7D,IAAA;AAGV,GA9GqD;","names":["CardContent","styled","useShareForwardedRef","React","useEffect","CardContentExRoot","styled","CardContent","name","shouldForwardProp","prop","includes","slot","variant","removePadding","paddingBottom","overflow","paddingTop","padding","CardContentExWithRef","ref","scrollToTop","refreshRef","props","sharedRef","useShareForwardedRef","useEffect","current","scroll","behavior","top","displayName","CardContentEx","Card","useGradientStyles","React","CardExWithRef","ref","style","gradient","props","styles","useGradientStyles","gradientStyle","border","background","React","Card","displayName","CardEx","ArrowForwardRounded","ArrowForwardRoundedIcon","alpha","Card","CardActions","CardContent","CardMedia","Grid","IconButton","Typography","useTheme","Zoom","FlexGrowCol","useIsMobile","React","useState","useNavigate","FullWidthCard","cardIsButton","desc","href","media","name","small","to","props","theme","useTheme","raised","setRaised","useState","navigate","useNavigate","isMobile","useIsMobile","localRouteChange","externalRouteChange","window","open","React","Card","elevation","style","height","width","sx","cursor","alpha","palette","primary","light","onMouseEnter","onMouseLeave","onClick","CardMedia","component","image","alt","CardContent","Grid","container","alignItems","paddingY","paddingX","item","xs","md","Typography","fontWeight","variant","textAlign","paddingBottom","display","justifyContent","Zoom","in","IconButton","color","size","disableFocusRipple","disableRipple","disableTouchRipple","ArrowForwardRoundedIcon","fontSize","CardActions","FlexGrowCol","Refresh","RefreshIcon","CardHeader","IconButton","TypographyEx","React","PageCardWithRef","ref","subheader","title","onRefresh","children","action","style","props","React","CardEx","backgroundColor","position","elevation","CardHeader","TypographyEx","variant","gutterBottom","IconButton","onClick","RefreshIcon","displayName","PageCard","ArrowForwardRounded","ArrowForwardRoundedIcon","alpha","CardActions","CardContent","CardMedia","IconButton","Typography","useTheme","FlexCol","FlexGrowCol","useIsMobile","React","useState","useNavigate","SimpleCard","children","desc","iconImage","interactionVariant","headline","href","media","small","subtitle","sx","to","props","theme","useTheme","raised","setRaised","useState","navigate","useNavigate","isMobile","useIsMobile","localRouteChange","externalRouteChange","window","open","React","CardEx","elevation","cursor","alpha","palette","primary","light","onMouseEnter","onMouseLeave","onClick","CardMedia","component","height","image","alt","CardContent","FlexCol","width","alignItems","img","src","style","paddingBottom","Typography","variant","textAlign","gutterBottom","CardActions","FlexGrowCol","IconButton","color","size","disableFocusRipple","disableRipple","disableTouchRipple","ArrowForwardRoundedIcon","fontSize"]}
1
+ {"version":3,"sources":["../../src/components/CardContentEx.tsx","../../src/components/CardEx.tsx","../../src/components/FullWidthCard/FullWidthCard.tsx","../../src/components/PageCard.tsx","../../src/components/SimpleCard/SimpleCard.tsx"],"sourcesContent":["import type { CardContentProps } from '@mui/material'\nimport { CardContent, styled } from '@mui/material'\nimport { useShareForwardedRef } from '@xyo-network/react-shared'\nimport React, { useEffect } from 'react'\n\nconst CardContentExRoot = styled(CardContent, {\n name: 'CardContentEx',\n shouldForwardProp: (prop: string) => !['variant', 'removePadding'].includes(prop),\n slot: 'Root',\n})<CardContentExProps>(({ variant, removePadding }) => ({\n ...((variant === 'scrollable' || removePadding) && {\n [':last-child']: { paddingBottom: 0 },\n overflow: 'auto',\n paddingTop: 0,\n ...(removePadding && { padding: 0 }),\n }),\n}))\n\nexport type CardContentExProps = CardContentProps & {\n refreshRef?: number\n removePadding?: boolean\n scrollToTop?: number\n variant?: 'scrollable' | 'normal'\n}\n\nexport const CardContentExWithRef = ({\n ref, scrollToTop = 0, refreshRef = 0, ...props\n}: CardContentExProps & { ref?: React.RefObject<HTMLDivElement | null> }) => {\n const sharedRef = useShareForwardedRef<HTMLDivElement>(ref, refreshRef)\n\n useEffect(() => {\n if (sharedRef && scrollToTop) {\n sharedRef.current?.scroll({ behavior: 'smooth', top: 0 })\n }\n }, [sharedRef, scrollToTop])\n\n return <CardContentExRoot ref={sharedRef} {...props} />\n}\n\nCardContentExWithRef.displayName = 'CardContentEx'\n\nexport const CardContentEx = CardContentExWithRef\n","import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport { useGradientStyles } from '@xyo-network/react-shared'\nimport React from 'react'\n\nexport interface CardExProps extends CardProps {\n gradient?: 'border' | 'background'\n}\n\nexport const CardExWithRef = ({\n ref, style, gradient, ...props\n}: CardExProps) => {\n const styles = useGradientStyles()\n const gradientStyle\n = gradient === 'border'\n ? styles.border\n : gradient === 'background'\n ? styles.background\n : {}\n return (\n <Card\n style={{\n ...gradientStyle,\n ...style,\n }}\n ref={ref}\n {...props}\n />\n )\n}\n\nCardExWithRef.displayName = 'CardEx'\n\nexport const CardEx = CardExWithRef\n","import { ArrowForwardRounded as ArrowForwardRoundedIcon } from '@mui/icons-material'\nimport type { CardProps } from '@mui/material'\nimport {\n alpha, Card, CardActions, CardContent, CardMedia, Grid, IconButton, Typography, useTheme, Zoom,\n} from '@mui/material'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsSmall } from '@xyo-network/react-shared'\nimport type { ReactNode } from 'react'\nimport React, { useState } from 'react'\nimport type { To } from 'react-router-dom'\nimport { useNavigate } from 'react-router-dom'\n\nexport interface FullWidthCardProps extends CardProps {\n cardIsButton?: boolean\n desc?: ReactNode\n href?: string\n linkText?: string\n media?: string\n name: ReactNode\n small?: boolean\n to?: To\n}\n\nexport const FullWidthCard: React.FC<FullWidthCardProps> = ({\n cardIsButton, desc, href, media, name, small, to, ...props\n}) => {\n const theme = useTheme()\n const [raised, setRaised] = useState(false)\n const navigate = useNavigate()\n const isMobile = useIsSmall()\n\n const localRouteChange = (to: To | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n to ? void navigate(to) : void navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n href ? void window.open(href) : void navigate('/404')\n }\n\n return (\n <Card\n elevation={raised ? 3 : 0}\n style={{ height: '100%', width: '100%' }}\n {...props}\n sx={{\n '&:hover': { cursor: 'pointer' },\n 'backgroundColor': alpha(theme.palette.primary.light, 0.05),\n }}\n onMouseEnter={() =>\n isMobile\n ? null\n : cardIsButton\n ? setRaised(true)\n : null}\n onMouseLeave={() =>\n isMobile\n ? null\n : cardIsButton\n ? setRaised(false)\n : null}\n onClick={() =>\n cardIsButton\n ? href\n ? externalRouteChange(href)\n : to\n ? localRouteChange(to)\n : navigate('/404')\n : null}\n >\n {media\n ? <CardMedia component=\"img\" height=\"100\" image={media} alt=\"\" />\n : null}\n\n <CardContent>\n <Grid container alignItems=\"center\" paddingY={2} paddingX={2}>\n <Grid size={{ xs: 12, md: 6 }}>\n {typeof name === 'string'\n ? (\n <Typography fontWeight={700} variant=\"h2\" textAlign=\"left\" paddingBottom={1}>\n {name}\n </Typography>\n )\n : name}\n </Grid>\n <Grid size={{ xs: 12, md: 5 }}>\n <Typography variant=\"body1\" fontWeight={400} textAlign=\"left\">\n {desc}\n </Typography>\n </Grid>\n <Grid size={{ xs: 1 }} display={isMobile ? 'none' : 'flex'} justifyContent=\"center\">\n <Zoom in={raised}>\n <IconButton\n color=\"primary\"\n size={small ? 'small' : 'medium'}\n onClick={() =>\n href\n ? externalRouteChange(href)\n : to\n ? localRouteChange(to)\n : navigate('/404')}\n disableFocusRipple\n disableRipple\n disableTouchRipple\n >\n <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />\n </IconButton>\n </Zoom>\n </Grid>\n </Grid>\n </CardContent>\n <CardActions sx={{ display: { md: isMobile ? 'flex' : 'none' } }}>\n <FlexGrowCol alignItems=\"flex-end\">\n <IconButton\n color=\"primary\"\n size={small ? 'small' : 'medium'}\n onClick={() =>\n href\n ? externalRouteChange(href)\n : to\n ? localRouteChange(to)\n : navigate('/404')}\n disableFocusRipple\n disableRipple\n disableTouchRipple\n >\n <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />\n </IconButton>\n </FlexGrowCol>\n </CardActions>\n </Card>\n )\n}\n","import { Refresh as RefreshIcon } from '@mui/icons-material'\nimport type { CardHeaderProps } from '@mui/material'\nimport { CardHeader, IconButton } from '@mui/material'\nimport { TypographyEx } from '@xyo-network/react-shared'\nimport type { ReactNode } from 'react'\nimport React from 'react'\n\nimport type { CardExProps } from './CardEx.tsx'\nimport { CardEx } from './CardEx.tsx'\n\nexport interface PageCardProps extends CardExProps {\n action?: ReactNode\n onRefresh?: () => void\n subheader?: CardHeaderProps['subheader']\n}\n\nconst PageCardWithRef = ({\n ref, subheader, title, onRefresh, children, action, style, ...props\n}: PageCardProps) => {\n return (\n <CardEx\n style={{\n backgroundColor: 'transparent', position: 'relative', ...style,\n }}\n elevation={0}\n ref={ref}\n {...props}\n >\n <CardHeader\n title={(\n <TypographyEx variant=\"h5\" gutterBottom>\n {title}\n </TypographyEx>\n )}\n subheader={<TypographyEx variant=\"subtitle1\">{subheader}</TypographyEx>}\n action={\n action ?? (\n <>\n {onRefresh\n ? (\n <IconButton onClick={() => onRefresh?.()}>\n <RefreshIcon />\n </IconButton>\n )\n : null}\n </>\n )\n }\n />\n {children}\n </CardEx>\n )\n}\n\nPageCardWithRef.displayName = 'PageCard'\n\nexport const PageCard = PageCardWithRef\n","import { ArrowForwardRounded as ArrowForwardRoundedIcon } from '@mui/icons-material'\nimport {\n alpha, CardActions, CardContent, CardMedia, IconButton, Typography, useTheme,\n} from '@mui/material'\nimport { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsMobile } from '@xyo-network/react-shared'\nimport type { ReactNode } from 'react'\nimport React, { useState } from 'react'\nimport type { To } from 'react-router-dom'\nimport { useNavigate } from 'react-router-dom'\n\nimport type { CardExProps } from '../CardEx.tsx'\nimport { CardEx } from '../CardEx.tsx'\n\nexport interface SimpleCardProps extends CardExProps {\n desc?: ReactNode\n headline?: ReactNode\n href?: string\n iconImage?: string\n interactionVariant?: 'button' | 'card'\n media?: string\n small?: boolean\n subtitle?: string\n to?: To\n}\n\nexport const SimpleCard: React.FC<SimpleCardProps> = ({\n children,\n desc,\n iconImage,\n interactionVariant = 'card',\n headline,\n href,\n media,\n small,\n subtitle,\n sx,\n to,\n ...props\n}) => {\n const theme = useTheme()\n const [raised, setRaised] = useState(false)\n const navigate = useNavigate()\n const isMobile = useIsMobile()\n const localRouteChange = (to: To | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n to ? void navigate(to) : void navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n href ? void window.open(href) : void navigate('/404')\n }\n return (\n <CardEx\n elevation={raised ? 3 : 0}\n sx={{\n '&:hover': { cursor: interactionVariant == 'button' ? 'pointer' : null },\n 'backgroundColor': alpha(theme.palette.primary.light, 0.05),\n ...sx,\n }}\n onMouseEnter={() =>\n isMobile\n ? null\n : interactionVariant == 'button'\n ? setRaised(true)\n : null}\n onMouseLeave={() =>\n isMobile\n ? null\n : interactionVariant == 'button'\n ? setRaised(false)\n : null}\n onClick={() =>\n interactionVariant == 'button'\n ? href\n ? externalRouteChange(href)\n : to\n ? localRouteChange(to)\n : navigate('/404')\n : null}\n {...props}\n >\n {media\n ? <CardMedia component=\"img\" height=\"100\" image={media} alt=\"\" />\n : null}\n\n <CardContent sx={{ height: '100%' }}>\n <FlexCol width=\"100%\" alignItems=\"flex-start\">\n {iconImage\n ? <img src={iconImage} height=\"40px\" style={{ paddingBottom: '8px' }} />\n : null}\n {typeof headline === 'string'\n ? (\n <Typography variant={small ? 'body1' : 'h6'} textAlign=\"left\" gutterBottom>\n {headline}\n </Typography>\n )\n : headline}\n {subtitle\n ? (\n <Typography variant=\"subtitle2\" textAlign=\"left\" gutterBottom>\n {subtitle}\n </Typography>\n )\n : null}\n <Typography variant={small ? 'caption' : 'body1'} textAlign=\"left\" gutterBottom>\n {desc}\n </Typography>\n </FlexCol>\n </CardContent>\n {children}\n {interactionVariant == 'button'\n ? (\n <CardActions>\n <FlexGrowCol alignItems=\"flex-end\">\n <IconButton\n color={raised ? 'secondary' : 'primary'}\n size={small ? 'small' : 'medium'}\n onClick={() =>\n href\n ? externalRouteChange(href)\n : to\n ? localRouteChange(to)\n : navigate('/404')}\n disableFocusRipple\n disableRipple\n disableTouchRipple\n >\n <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />\n </IconButton>\n </FlexGrowCol>\n </CardActions>\n )\n : null}\n </CardEx>\n )\n}\n"],"mappings":";;;;AACA,SAASA,aAAaC,cAAc;AACpC,SAASC,4BAA4B;AACrC,OAAOC,SAASC,iBAAiB;AAEjC,IAAMC,oBAAoBC,OAAOC,aAAa;EAC5CC,MAAM;EACNC,mBAAmB,wBAACC,SAAiB,CAAC;IAAC;IAAW;IAAiBC,SAASD,IAAAA,GAAzD;EACnBE,MAAM;AACR,CAAA,EAAuB,CAAC,EA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H,OAAO5C,aAAa,WAEf,gBAAAqB,OAAA,cAACwB,aAAAA;IAAWC,SAAS3C,QAAQ,UAAU;IAAM4C,WAAU;IAAOC,cAAAA;KAC3DhD,QAAAA,IAGLA,UACHI,WAEK,gBAAAiB,OAAA,cAACwB,aAAAA;IAAWC,SAAQ;IAAYC,WAAU;IAAOC,cAAAA;KAC9C5C,QAAAA,IAGL,MACJ,gBAAAiB,OAAA,cAACwB,aAAAA;IAAWC,SAAS3C,QAAQ,YAAY;IAAS4C,WAAU;IAAOC,cAAAA;KAChEnD,IAAAA,CAAAA,CAAAA,GAIND,UACAG,sBAAsB,WAEjB,gBAAAsB,OAAA,cAAC4B,cAAAA,MACC,gBAAA5B,OAAA,cAAC6B,cAAAA;IAAYV,YAAW;KACtB,gBAAAnB,OAAA,cAAC8B,aAAAA;IACCC,OAAO1C,SAAS,cAAc;IAC9B2C,MAAMlD,QAAQ,UAAU;IACxB4B,SAAS,6BACP9B,OACIiB,oBAAoBjB,IAAAA,IACpBK,KACEW,iBAAiBX,EAAAA,IACjBO,SAAS,MAAA,GALR;IAMTyC,oBAAAA;IACAC,eAAAA;IACAC,oBAAAA;KAEA,gBAAAnC,OAAA,cAACoC,0BAAAA;IAAwBC,UAAUvD,QAAQ,UAAU;UAK7D,IAAA;AAGV,GA9GqD;","names":["CardContent","styled","useShareForwardedRef","React","useEffect","CardContentExRoot","styled","CardContent","name","shouldForwardProp","prop","includes","slot","variant","removePadding","paddingBottom","overflow","paddingTop","padding","CardContentExWithRef","ref","scrollToTop","refreshRef","props","sharedRef","useShareForwardedRef","useEffect","current","scroll","behavior","top","displayName","CardContentEx","Card","useGradientStyles","React","CardExWithRef","ref","style","gradient","props","styles","useGradientStyles","gradientStyle","border","background","React","Card","displayName","CardEx","ArrowForwardRounded","ArrowForwardRoundedIcon","alpha","Card","CardActions","CardContent","CardMedia","Grid","IconButton","Typography","useTheme","Zoom","FlexGrowCol","useIsSmall","React","useState","useNavigate","FullWidthCard","cardIsButton","desc","href","media","name","small","to","props","theme","useTheme","raised","setRaised","useState","navigate","useNavigate","isMobile","useIsSmall","localRouteChange","externalRouteChange","window","open","React","Card","elevation","style","height","width","sx","cursor","alpha","palette","primary","light","onMouseEnter","onMouseLeave","onClick","CardMedia","component","image","alt","CardContent","Grid","container","alignItems","paddingY","paddingX","size","xs","md","Typography","fontWeight","variant","textAlign","paddingBottom","display","justifyContent","Zoom","in","IconButton","color","disableFocusRipple","disableRipple","disableTouchRipple","ArrowForwardRoundedIcon","fontSize","CardActions","FlexGrowCol","Refresh","RefreshIcon","CardHeader","IconButton","TypographyEx","React","PageCardWithRef","ref","subheader","title","onRefresh","children","action","style","props","React","CardEx","backgroundColor","position","elevation","CardHeader","TypographyEx","variant","gutterBottom","IconButton","onClick","RefreshIcon","displayName","PageCard","ArrowForwardRounded","ArrowForwardRoundedIcon","alpha","CardActions","CardContent","CardMedia","IconButton","Typography","useTheme","FlexCol","FlexGrowCol","useIsMobile","React","useState","useNavigate","SimpleCard","children","desc","iconImage","interactionVariant","headline","href","media","small","subtitle","sx","to","props","theme","useTheme","raised","setRaised","useState","navigate","useNavigate","isMobile","useIsMobile","localRouteChange","externalRouteChange","window","open","React","CardEx","elevation","cursor","alpha","palette","primary","light","onMouseEnter","onMouseLeave","onClick","CardMedia","component","height","image","alt","CardContent","FlexCol","width","alignItems","img","src","style","paddingBottom","Typography","variant","textAlign","gutterBottom","CardActions","FlexGrowCol","IconButton","color","size","disableFocusRipple","disableRipple","disableTouchRipple","ArrowForwardRoundedIcon","fontSize"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleCardGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/SimpleCardGrid/SimpleCardGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAG7D,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,KAAK,CAAC,EAAE,eAAe,EAAE,CAAA;CAC1B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAaxD,CAAA"}
1
+ {"version":3,"file":"SimpleCardGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/SimpleCardGrid/SimpleCardGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAG7D,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,KAAK,CAAC,EAAE,eAAe,EAAE,CAAA;CAC1B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAkBxD,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-card",
3
- "version": "5.0.7",
3
+ "version": "5.1.0",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -39,28 +39,26 @@
39
39
  "module": "dist/browser/index.mjs",
40
40
  "types": "dist/types/index.d.ts",
41
41
  "dependencies": {
42
- "@xylabs/react-flexbox": "^6.0.8",
43
- "@xyo-network/react-shared": "^5.0.7",
44
- "react-router-dom": "^7.4.0"
42
+ "@xylabs/react-flexbox": "^6.1.0",
43
+ "@xyo-network/react-shared": "^5.1.0",
44
+ "react-router-dom": "^7.4.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@mui/icons-material": "^6.4.8",
48
- "@mui/material": "^6.4.8",
49
- "@mui/styles": "^6.4.8",
50
- "@storybook/react": "^8.6.7",
47
+ "@mui/icons-material": "^7.0.1",
48
+ "@mui/material": "^7.0.1",
49
+ "@storybook/react": "^8.6.11",
51
50
  "@types/react": "^19.0.12",
52
- "@xylabs/ts-scripts-yarn3": "^6.1.4",
53
- "@xylabs/tsconfig-react": "^6.1.4",
54
- "@xyo-network/react-storybook": "^5.0.7",
55
- "react": "^19.0.0",
56
- "react-dom": "^19.0.0",
57
- "storybook": "^8.6.7",
51
+ "@xylabs/ts-scripts-yarn3": "^6.2.0",
52
+ "@xylabs/tsconfig-react": "^6.2.0",
53
+ "@xyo-network/react-storybook": "^5.1.0",
54
+ "react": "^19.1.0",
55
+ "react-dom": "^19.1.0",
56
+ "storybook": "^8.6.11",
58
57
  "typescript": "^5.8.2"
59
58
  },
60
59
  "peerDependencies": {
61
- "@mui/icons-material": "^6",
62
- "@mui/material": "^6",
63
- "@mui/styles": "^6",
60
+ "@mui/icons-material": ">=6 <=7",
61
+ "@mui/material": ">=6 <=7",
64
62
  "react": "^19",
65
63
  "react-dom": "^19"
66
64
  },
@@ -10,7 +10,7 @@ export interface CardExProps extends CardProps {
10
10
  export const CardExWithRef = ({
11
11
  ref, style, gradient, ...props
12
12
  }: CardExProps) => {
13
- const { styles } = useGradientStyles()
13
+ const styles = useGradientStyles()
14
14
  const gradientStyle
15
15
  = gradient === 'border'
16
16
  ? styles.border
@@ -4,7 +4,7 @@ import {
4
4
  alpha, Card, CardActions, CardContent, CardMedia, Grid, IconButton, Typography, useTheme, Zoom,
5
5
  } from '@mui/material'
6
6
  import { FlexGrowCol } from '@xylabs/react-flexbox'
7
- import { useIsMobile } from '@xyo-network/react-shared'
7
+ import { useIsSmall } from '@xyo-network/react-shared'
8
8
  import type { ReactNode } from 'react'
9
9
  import React, { useState } from 'react'
10
10
  import type { To } from 'react-router-dom'
@@ -27,7 +27,7 @@ export const FullWidthCard: React.FC<FullWidthCardProps> = ({
27
27
  const theme = useTheme()
28
28
  const [raised, setRaised] = useState(false)
29
29
  const navigate = useNavigate()
30
- const isMobile = useIsMobile()
30
+ const isMobile = useIsSmall()
31
31
 
32
32
  const localRouteChange = (to: To | undefined) => {
33
33
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
@@ -74,7 +74,7 @@ export const FullWidthCard: React.FC<FullWidthCardProps> = ({
74
74
 
75
75
  <CardContent>
76
76
  <Grid container alignItems="center" paddingY={2} paddingX={2}>
77
- <Grid item xs={12} md={6}>
77
+ <Grid size={{ xs: 12, md: 6 }}>
78
78
  {typeof name === 'string'
79
79
  ? (
80
80
  <Typography fontWeight={700} variant="h2" textAlign="left" paddingBottom={1}>
@@ -83,12 +83,12 @@ export const FullWidthCard: React.FC<FullWidthCardProps> = ({
83
83
  )
84
84
  : name}
85
85
  </Grid>
86
- <Grid item xs={12} md={5}>
86
+ <Grid size={{ xs: 12, md: 5 }}>
87
87
  <Typography variant="body1" fontWeight={400} textAlign="left">
88
88
  {desc}
89
89
  </Typography>
90
90
  </Grid>
91
- <Grid item xs={1} display={isMobile ? 'none' : 'flex'} justifyContent="center">
91
+ <Grid size={{ xs: 1 }} display={isMobile ? 'none' : 'flex'} justifyContent="center">
92
92
  <Zoom in={raised}>
93
93
  <IconButton
94
94
  color="primary"
@@ -17,16 +17,28 @@ const StorybookEntry = {
17
17
  const Template: StoryFn<typeof SimpleCard> = args => (
18
18
  <BrowserRouter>
19
19
  <Grid container spacing={2}>
20
- <Grid item xs={12} sm={6} md={3}>
20
+ <Grid size={{
21
+ xs: 12, sm: 6, md: 3,
22
+ }}
23
+ >
21
24
  <SimpleCard {...args}></SimpleCard>
22
25
  </Grid>
23
- <Grid item xs={12} sm={6} md={3}>
26
+ <Grid size={{
27
+ xs: 12, sm: 6, md: 3,
28
+ }}
29
+ >
24
30
  <SimpleCard {...args}></SimpleCard>
25
31
  </Grid>
26
- <Grid item xs={12} sm={6} md={3}>
32
+ <Grid size={{
33
+ xs: 12, sm: 6, md: 3,
34
+ }}
35
+ >
27
36
  <SimpleCard {...args}></SimpleCard>
28
37
  </Grid>
29
- <Grid item xs={12} sm={6} md={3}>
38
+ <Grid size={{
39
+ xs: 12, sm: 6, md: 3,
40
+ }}
41
+ >
30
42
  <SimpleCard {...args}></SimpleCard>
31
43
  </Grid>
32
44
  </Grid>
@@ -13,7 +13,12 @@ export const SimpleCardGrid: React.FC<SimpleCardGridProps> = ({ cards, ...props
13
13
  return (
14
14
  <Grid container {...props}>
15
15
  {cards?.map((card, index) => (
16
- <Grid item key={index} xs={12} sm={6} md={4}>
16
+ <Grid
17
+ key={index}
18
+ size={{
19
+ xs: 12, sm: 6, md: 4,
20
+ }}
21
+ >
17
22
  <SimpleCard
18
23
  {...card}
19
24
  sx={{ flexDirection: 'column', height: '100%' }}