@xyo-network/react-card 2.77.0-rc.1 → 2.77.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/components/CardContentEx.tsx","../../src/components/CardEx.tsx","../../src/components/FullWidthCard/FullWidthCard.tsx","../../src/components/PageCard.tsx","../../src/components/SimpleCard/SimpleCard.tsx"],"sourcesContent":["export * from './components'\n","import { CardContent, CardContentProps, styled } from '@mui/material'\nimport { useShareForwardedRef } from '@xyo-network/react-shared'\nimport { forwardRef, 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']: {\n paddingBottom: 0,\n },\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 = forwardRef<HTMLDivElement | null, CardContentExProps>(({ scrollToTop = 0, refreshRef = 0, ...props }, ref) => {\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 { Card, CardProps } from '@mui/material'\nimport { useGradientStyles } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nexport interface CardExProps extends CardProps {\n gradient?: 'border' | 'background'\n}\n\nexport const CardExWithRef = forwardRef<HTMLDivElement, CardExProps>(({ style, gradient, ...props }, ref) => {\n const { styles } = useGradientStyles()\n const gradientStyle =\n gradient === 'border' ? styles.border\n : gradient === 'background' ? 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 { alpha, Card, CardActions, CardContent, CardMedia, CardProps, Grid, IconButton, Typography, useTheme, Zoom } from '@mui/material'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsMobile } from '@xyo-network/react-shared'\nimport { ReactNode, useState } from 'react'\nimport { To, 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> = ({ cardIsButton, desc, href, media, name, small, to, ...props }) => {\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 to ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n href ? window.open(href) : 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': {\n cursor: 'pointer',\n },\n backgroundColor: alpha(theme.palette.primary.light, 0.05),\n }}\n onMouseEnter={() =>\n isMobile ? null\n : cardIsButton ? setRaised(true)\n : null\n }\n onMouseLeave={() =>\n isMobile ? null\n : cardIsButton ? setRaised(false)\n : null\n }\n onClick={() =>\n cardIsButton ?\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n : null\n }\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 <Typography fontWeight={700} variant=\"h2\" textAlign=\"left\" paddingBottom={1}>\n {name}\n </Typography>\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 ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\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 ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\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 { CardHeader, CardHeaderProps, IconButton } from '@mui/material'\nimport { TypographyEx } from '@xyo-network/react-shared'\nimport { forwardRef, ReactNode } from 'react'\n\nimport { CardEx, CardExProps } from './CardEx'\n\nexport interface PageCardProps extends CardExProps {\n action?: ReactNode\n onRefresh?: () => void\n subheader?: CardHeaderProps['subheader']\n}\n\nconst PageCardWithRef = forwardRef<HTMLDivElement, PageCardProps>(({ subheader, title, onRefresh, children, action, style, ...props }, ref) => {\n return (\n <CardEx style={{ backgroundColor: 'transparent', position: 'relative', ...style }} elevation={0} ref={ref} {...props}>\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 <IconButton onClick={() => onRefresh?.()}>\n <RefreshIcon />\n </IconButton>\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 { alpha, CardActions, CardContent, CardMedia, IconButton, Typography, useTheme } from '@mui/material'\nimport { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsMobile } from '@xyo-network/react-shared'\nimport { ReactNode, useState } from 'react'\nimport { To, useNavigate } from 'react-router-dom'\n\nimport { CardEx, CardExProps } from '../CardEx'\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 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 to ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n href ? window.open(href) : navigate('/404')\n }\n return (\n <CardEx\n elevation={raised ? 3 : 0}\n sx={{\n '&:hover': {\n cursor: interactionVariant == 'button' ? 'pointer' : null,\n },\n backgroundColor: alpha(theme.palette.primary.light, 0.05),\n ...sx,\n }}\n onMouseEnter={() =>\n isMobile ? null\n : interactionVariant == 'button' ? setRaised(true)\n : null\n }\n onMouseLeave={() =>\n isMobile ? null\n : interactionVariant == 'button' ? setRaised(false)\n : null\n }\n onClick={() =>\n interactionVariant == 'button' ?\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n : null\n }\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 <Typography variant={small ? 'body1' : 'h6'} textAlign=\"left\" gutterBottom>\n {headline}\n </Typography>\n : headline}\n {subtitle ?\n <Typography variant=\"subtitle2\" textAlign=\"left\" gutterBottom>\n {subtitle}\n </Typography>\n : null}\n <Typography variant={small ? 'caption' : 'body1'} textAlign=\"left\" gutterBottom>\n {desc}\n </Typography>\n </FlexCol>\n </CardContent>\n {interactionVariant == 'button' ?\n <CardActions>\n <FlexGrowCol alignItems=\"flex-end\">\n <IconButton\n color={raised ? 'secondary' : 'primary'}\n size={small ? 'small' : 'medium'}\n onClick={() =>\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\n disableFocusRipple\n disableRipple\n disableTouchRipple\n >\n <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />\n </IconButton>\n </FlexGrowCol>\n </CardActions>\n : null}\n </CardEx>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,sBAAsD;AACtD,0BAAqC;AACrC,mBAAsC;AAiC7B;AA/BT,IAAM,wBAAoB,wBAAO,6BAAa;AAAA,EAC5C,MAAM;AAAA,EACN,mBAAmB,CAAC,SAAiB,CAAC,CAAC,WAAW,eAAe,EAAE,SAAS,IAAI;AAAA,EAChF,MAAM;AACR,CAAC,EAAsB,CAAC,EAAE,SAAS,cAAc,OAAO;AAAA,EACtD,IAAK,YAAY,gBAAgB,kBAAkB;AAAA,IACjD,CAAC,aAAa,GAAG;AAAA,MAC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,GACF,IACA;AAAA;AAAA;AAAA,EACJ;AAEJ;","names":["import_material","import_react_shared","import_react","import_jsx_runtime","import_material","import_react_shared","import_react","import_jsx_runtime","to","href","ArrowForwardRoundedIcon","import_icons_material","import_material","import_react_shared","import_react","import_jsx_runtime","RefreshIcon","import_icons_material","import_material","import_react_flexbox","import_react_shared","import_react","import_react_router_dom","import_jsx_runtime","to","href","ArrowForwardRoundedIcon"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/components/CardContentEx.tsx","../../src/components/CardEx.tsx","../../src/components/FullWidthCard/FullWidthCard.tsx","../../src/components/PageCard.tsx","../../src/components/SimpleCard/SimpleCard.tsx"],"sourcesContent":["export * from './components'\n","import { CardContent, CardContentProps, styled } from '@mui/material'\nimport { useShareForwardedRef } from '@xyo-network/react-shared'\nimport { forwardRef, 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']: {\n paddingBottom: 0,\n },\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 = forwardRef<HTMLDivElement | null, CardContentExProps>(({ scrollToTop = 0, refreshRef = 0, ...props }, ref) => {\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 { Card, CardProps } from '@mui/material'\nimport { useGradientStyles } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nexport interface CardExProps extends CardProps {\n gradient?: 'border' | 'background'\n}\n\nexport const CardExWithRef = forwardRef<HTMLDivElement, CardExProps>(({ style, gradient, ...props }, ref) => {\n const { styles } = useGradientStyles()\n const gradientStyle =\n gradient === 'border' ? styles.border\n : gradient === 'background' ? 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 { alpha, Card, CardActions, CardContent, CardMedia, CardProps, Grid, IconButton, Typography, useTheme, Zoom } from '@mui/material'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsMobile } from '@xyo-network/react-shared'\nimport { ReactNode, useState } from 'react'\nimport { To, 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> = ({ cardIsButton, desc, href, media, name, small, to, ...props }) => {\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 to ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n href ? window.open(href) : 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': {\n cursor: 'pointer',\n },\n backgroundColor: alpha(theme.palette.primary.light, 0.05),\n }}\n onMouseEnter={() =>\n isMobile ? null\n : cardIsButton ? setRaised(true)\n : null\n }\n onMouseLeave={() =>\n isMobile ? null\n : cardIsButton ? setRaised(false)\n : null\n }\n onClick={() =>\n cardIsButton ?\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n : null\n }\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 <Typography fontWeight={700} variant=\"h2\" textAlign=\"left\" paddingBottom={1}>\n {name}\n </Typography>\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 ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\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 ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\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 { CardHeader, CardHeaderProps, IconButton } from '@mui/material'\nimport { TypographyEx } from '@xyo-network/react-shared'\nimport { forwardRef, ReactNode } from 'react'\n\nimport { CardEx, CardExProps } from './CardEx'\n\nexport interface PageCardProps extends CardExProps {\n action?: ReactNode\n onRefresh?: () => void\n subheader?: CardHeaderProps['subheader']\n}\n\nconst PageCardWithRef = forwardRef<HTMLDivElement, PageCardProps>(({ subheader, title, onRefresh, children, action, style, ...props }, ref) => {\n return (\n <CardEx style={{ backgroundColor: 'transparent', position: 'relative', ...style }} elevation={0} ref={ref} {...props}>\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 <IconButton onClick={() => onRefresh?.()}>\n <RefreshIcon />\n </IconButton>\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 { alpha, CardActions, CardContent, CardMedia, IconButton, Typography, useTheme } from '@mui/material'\nimport { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsMobile } from '@xyo-network/react-shared'\nimport { ReactNode, useState } from 'react'\nimport { To, useNavigate } from 'react-router-dom'\n\nimport { CardEx, CardExProps } from '../CardEx'\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 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 to ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n href ? window.open(href) : navigate('/404')\n }\n return (\n <CardEx\n elevation={raised ? 3 : 0}\n sx={{\n '&:hover': {\n cursor: interactionVariant == 'button' ? 'pointer' : null,\n },\n backgroundColor: alpha(theme.palette.primary.light, 0.05),\n ...sx,\n }}\n onMouseEnter={() =>\n isMobile ? null\n : interactionVariant == 'button' ? setRaised(true)\n : null\n }\n onMouseLeave={() =>\n isMobile ? null\n : interactionVariant == 'button' ? setRaised(false)\n : null\n }\n onClick={() =>\n interactionVariant == 'button' ?\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n : null\n }\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 <Typography variant={small ? 'body1' : 'h6'} textAlign=\"left\" gutterBottom>\n {headline}\n </Typography>\n : headline}\n {subtitle ?\n <Typography variant=\"subtitle2\" textAlign=\"left\" gutterBottom>\n {subtitle}\n </Typography>\n : null}\n <Typography variant={small ? 'caption' : 'body1'} textAlign=\"left\" gutterBottom>\n {desc}\n </Typography>\n </FlexCol>\n </CardContent>\n {interactionVariant == 'button' ?\n <CardActions>\n <FlexGrowCol alignItems=\"flex-end\">\n <IconButton\n color={raised ? 'secondary' : 'primary'}\n size={small ? 'small' : 'medium'}\n onClick={() =>\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\n disableFocusRipple\n disableRipple\n disableTouchRipple\n >\n <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />\n </IconButton>\n </FlexGrowCol>\n </CardActions>\n : null}\n </CardEx>\n )\n}\n"],"mappings":"6aAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,GAAA,yBAAAC,EAAA,WAAAC,EAAA,kBAAAC,EAAA,kBAAAC,GAAA,aAAAC,GAAA,eAAAC,KAAA,eAAAC,GAAAT,ICAA,IAAAU,EAAsD,yBACtDC,EAAqC,qCACrCC,EAAsC,iBAiC7BC,EAAA,6BA/BHC,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MAAM,OAAO,MAAM,MAAOA,EAAO,IAAI,GAAG,EAC7D,QAEF,OAAC,eAAY,GAAI,CAAE,OAAQ,MAAO,EAChC,oBAAC,WAAQ,MAAM,OAAO,WAAW,aAC9B,UAAAJ,KACC,OAAC,OAAI,IAAKA,EAAW,OAAO,OAAO,MAAO,CAAE,cAAe,KAAM,EAAG,EACpE,KACD,OAAOE,GAAa,YACnB,OAAC,cAAW,QAASG,EAAQ,QAAU,KAAM,UAAU,OAAO,aAAY,GACvE,SAAAH,EACH,EACAA,EACDI,KACC,OAAC,cAAW,QAAQ,YAAY,UAAU,OAAO,aAAY,GAC1D,SAAAA,EACH,EACA,QACF,OAAC,cAAW,QAASD,EAAQ,UAAY,QAAS,UAAU,OAAO,aAAY,GAC5E,SAAAN,EACH,GACF,EACF,EACCE,GAAsB,YACrB,OAAC,eACC,mBAAC,eAAY,WAAW,WACtB,mBAAC,cACC,MAAOU,EAAS,YAAc,UAC9B,KAAMN,EAAQ,QAAU,SACxB,QAAS,IACPF,EAAOa,EAAoBb,CAAI,EAC7BK,EAAKO,EAAiBP,CAAE,EACxBK,EAAS,MAAM,EAEnB,mBAAkB,GAClB,cAAa,GACb,mBAAkB,GAElB,mBAAC,EAAAK,oBAAA,CAAwB,SAAUb,EAAQ,QAAU,SAAU,EACjE,EACF,EACF,EACA,MACJ,CAEJ","names":["src_exports","__export","CardContentEx","CardContentExWithRef","CardEx","CardExWithRef","FullWidthCard","PageCard","SimpleCard","__toCommonJS","import_material","import_react_shared","import_react","import_jsx_runtime","CardContentExRoot","prop","variant","removePadding","CardContentExWithRef","scrollToTop","refreshRef","props","ref","sharedRef","_a","CardContentEx","import_material","import_react_shared","import_react","import_jsx_runtime","CardExWithRef","style","gradient","props","ref","styles","gradientStyle","CardEx","import_icons_material","import_material","import_react_flexbox","import_react_shared","import_react","import_react_router_dom","import_jsx_runtime","FullWidthCard","cardIsButton","desc","href","media","name","small","to","props","theme","raised","setRaised","navigate","isMobile","localRouteChange","externalRouteChange","ArrowForwardRoundedIcon","import_icons_material","import_material","import_react_shared","import_react","import_jsx_runtime","PageCardWithRef","subheader","title","onRefresh","children","action","style","props","ref","CardEx","RefreshIcon","PageCard","import_icons_material","import_material","import_react_flexbox","import_react_shared","import_react","import_react_router_dom","import_jsx_runtime","SimpleCard","desc","iconImage","interactionVariant","headline","href","media","small","subtitle","sx","to","props","theme","raised","setRaised","navigate","isMobile","localRouteChange","externalRouteChange","CardEx","ArrowForwardRoundedIcon"]}
@@ -1,226 +1,2 @@
1
- // src/components/CardContentEx.tsx
2
- import { CardContent, styled } from "@mui/material";
3
- import { useShareForwardedRef } from "@xyo-network/react-shared";
4
- import { forwardRef, useEffect } from "react";
5
- import { jsx } from "react/jsx-runtime";
6
- var CardContentExRoot = styled(CardContent, {
7
- name: "CardContentEx",
8
- shouldForwardProp: (prop) => !["variant", "removePadding"].includes(prop),
9
- slot: "Root"
10
- })(({ variant, removePadding }) => ({
11
- ...(variant === "scrollable" || removePadding) && {
12
- [":last-child"]: {
13
- paddingBottom: 0
14
- },
15
- overflow: "auto",
16
- paddingTop: 0,
17
- ...removePadding && { padding: 0 }
18
- }
19
- }));
20
- var CardContentExWithRef = forwardRef(({ scrollToTop = 0, refreshRef = 0, ...props }, ref) => {
21
- const sharedRef = useShareForwardedRef(ref, refreshRef);
22
- useEffect(() => {
23
- var _a;
24
- if (sharedRef && scrollToTop) {
25
- (_a = sharedRef.current) == null ? void 0 : _a.scroll({ behavior: "smooth", top: 0 });
26
- }
27
- }, [sharedRef, scrollToTop]);
28
- return /* @__PURE__ */ jsx(CardContentExRoot, { ref: sharedRef, ...props });
29
- });
30
- CardContentExWithRef.displayName = "CardContentEx";
31
- var CardContentEx = CardContentExWithRef;
32
-
33
- // src/components/CardEx.tsx
34
- import { Card } from "@mui/material";
35
- import { useGradientStyles } from "@xyo-network/react-shared";
36
- import { forwardRef as forwardRef2 } from "react";
37
- import { jsx as jsx2 } from "react/jsx-runtime";
38
- var CardExWithRef = forwardRef2(({ style, gradient, ...props }, ref) => {
39
- const { styles } = useGradientStyles();
40
- const gradientStyle = gradient === "border" ? styles.border : gradient === "background" ? styles.background : {};
41
- return /* @__PURE__ */ jsx2(
42
- Card,
43
- {
44
- style: {
45
- ...gradientStyle,
46
- ...style
47
- },
48
- ref,
49
- ...props
50
- }
51
- );
52
- });
53
- CardExWithRef.displayName = "CardEx";
54
- var CardEx = CardExWithRef;
55
-
56
- // src/components/FullWidthCard/FullWidthCard.tsx
57
- import { ArrowForwardRounded as ArrowForwardRoundedIcon } from "@mui/icons-material";
58
- import { alpha, Card as Card2, CardActions, CardContent as CardContent2, CardMedia, Grid, IconButton, Typography, useTheme, Zoom } from "@mui/material";
59
- import { FlexGrowCol } from "@xylabs/react-flexbox";
60
- import { useIsMobile } from "@xyo-network/react-shared";
61
- import { useState } from "react";
62
- import { useNavigate } from "react-router-dom";
63
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
64
- var FullWidthCard = ({ cardIsButton, desc, href, media, name, small, to, ...props }) => {
65
- const theme = useTheme();
66
- const [raised, setRaised] = useState(false);
67
- const navigate = useNavigate();
68
- const isMobile = useIsMobile();
69
- const localRouteChange = (to2) => {
70
- to2 ? navigate(to2) : navigate("/404");
71
- };
72
- const externalRouteChange = (href2) => {
73
- href2 ? window.open(href2) : navigate("/404");
74
- };
75
- return /* @__PURE__ */ jsxs(
76
- Card2,
77
- {
78
- elevation: raised ? 3 : 0,
79
- style: { height: "100%", width: "100%" },
80
- ...props,
81
- sx: {
82
- "&:hover": {
83
- cursor: "pointer"
84
- },
85
- backgroundColor: alpha(theme.palette.primary.light, 0.05)
86
- },
87
- onMouseEnter: () => isMobile ? null : cardIsButton ? setRaised(true) : null,
88
- onMouseLeave: () => isMobile ? null : cardIsButton ? setRaised(false) : null,
89
- onClick: () => cardIsButton ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null,
90
- children: [
91
- media ? /* @__PURE__ */ jsx3(CardMedia, { component: "img", height: "100", image: media, alt: "" }) : null,
92
- /* @__PURE__ */ jsx3(CardContent2, { children: /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", paddingY: 2, paddingX: 2, children: [
93
- /* @__PURE__ */ jsx3(Grid, { item: true, xs: 12, md: 6, children: typeof name === "string" ? /* @__PURE__ */ jsx3(Typography, { fontWeight: 700, variant: "h2", textAlign: "left", paddingBottom: 1, children: name }) : name }),
94
- /* @__PURE__ */ jsx3(Grid, { item: true, xs: 12, md: 5, children: /* @__PURE__ */ jsx3(Typography, { variant: "body1", fontWeight: 400, textAlign: "left", children: desc }) }),
95
- /* @__PURE__ */ jsx3(Grid, { item: true, xs: 1, display: isMobile ? "none" : "flex", justifyContent: "center", children: /* @__PURE__ */ jsx3(Zoom, { in: raised, children: /* @__PURE__ */ jsx3(
96
- IconButton,
97
- {
98
- color: "primary",
99
- size: small ? "small" : "medium",
100
- onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
101
- disableFocusRipple: true,
102
- disableRipple: true,
103
- disableTouchRipple: true,
104
- children: /* @__PURE__ */ jsx3(ArrowForwardRoundedIcon, { fontSize: small ? "small" : "medium" })
105
- }
106
- ) }) })
107
- ] }) }),
108
- /* @__PURE__ */ jsx3(CardActions, { sx: { display: { md: isMobile ? "flex" : "none" } }, children: /* @__PURE__ */ jsx3(FlexGrowCol, { alignItems: "flex-end", children: /* @__PURE__ */ jsx3(
109
- IconButton,
110
- {
111
- color: "primary",
112
- size: small ? "small" : "medium",
113
- onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
114
- disableFocusRipple: true,
115
- disableRipple: true,
116
- disableTouchRipple: true,
117
- children: /* @__PURE__ */ jsx3(ArrowForwardRoundedIcon, { fontSize: small ? "small" : "medium" })
118
- }
119
- ) }) })
120
- ]
121
- }
122
- );
123
- };
124
-
125
- // src/components/PageCard.tsx
126
- import { Refresh as RefreshIcon } from "@mui/icons-material";
127
- import { CardHeader, IconButton as IconButton2 } from "@mui/material";
128
- import { TypographyEx } from "@xyo-network/react-shared";
129
- import { forwardRef as forwardRef3 } from "react";
130
- import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
131
- var PageCardWithRef = forwardRef3(({ subheader, title, onRefresh, children, action, style, ...props }, ref) => {
132
- return /* @__PURE__ */ jsxs2(CardEx, { style: { backgroundColor: "transparent", position: "relative", ...style }, elevation: 0, ref, ...props, children: [
133
- /* @__PURE__ */ jsx4(
134
- CardHeader,
135
- {
136
- title: /* @__PURE__ */ jsx4(TypographyEx, { variant: "h5", gutterBottom: true, children: title }),
137
- subheader: /* @__PURE__ */ jsx4(TypographyEx, { variant: "subtitle1", children: subheader }),
138
- action: action ?? /* @__PURE__ */ jsx4(Fragment, { children: onRefresh ? /* @__PURE__ */ jsx4(IconButton2, { onClick: () => onRefresh == null ? void 0 : onRefresh(), children: /* @__PURE__ */ jsx4(RefreshIcon, {}) }) : null })
139
- }
140
- ),
141
- children
142
- ] });
143
- });
144
- PageCardWithRef.displayName = "PageCard";
145
- var PageCard = PageCardWithRef;
146
-
147
- // src/components/SimpleCard/SimpleCard.tsx
148
- import { ArrowForwardRounded as ArrowForwardRoundedIcon2 } from "@mui/icons-material";
149
- 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";
150
- import { FlexCol, FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
151
- import { useIsMobile as useIsMobile2 } from "@xyo-network/react-shared";
152
- import { useState as useState2 } from "react";
153
- import { useNavigate as useNavigate2 } from "react-router-dom";
154
- import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
155
- var SimpleCard = ({
156
- desc,
157
- iconImage,
158
- interactionVariant = "card",
159
- headline,
160
- href,
161
- media,
162
- small,
163
- subtitle,
164
- sx,
165
- to,
166
- ...props
167
- }) => {
168
- const theme = useTheme2();
169
- const [raised, setRaised] = useState2(false);
170
- const navigate = useNavigate2();
171
- const isMobile = useIsMobile2();
172
- const localRouteChange = (to2) => {
173
- to2 ? navigate(to2) : navigate("/404");
174
- };
175
- const externalRouteChange = (href2) => {
176
- href2 ? window.open(href2) : navigate("/404");
177
- };
178
- return /* @__PURE__ */ jsxs3(
179
- CardEx,
180
- {
181
- elevation: raised ? 3 : 0,
182
- sx: {
183
- "&:hover": {
184
- cursor: interactionVariant == "button" ? "pointer" : null
185
- },
186
- backgroundColor: alpha2(theme.palette.primary.light, 0.05),
187
- ...sx
188
- },
189
- onMouseEnter: () => isMobile ? null : interactionVariant == "button" ? setRaised(true) : null,
190
- onMouseLeave: () => isMobile ? null : interactionVariant == "button" ? setRaised(false) : null,
191
- onClick: () => interactionVariant == "button" ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null,
192
- ...props,
193
- children: [
194
- media ? /* @__PURE__ */ jsx5(CardMedia2, { component: "img", height: "100", image: media, alt: "" }) : null,
195
- /* @__PURE__ */ jsx5(CardContent3, { sx: { height: "100%" }, children: /* @__PURE__ */ jsxs3(FlexCol, { width: "100%", alignItems: "flex-start", children: [
196
- iconImage ? /* @__PURE__ */ jsx5("img", { src: iconImage, height: "40px", style: { paddingBottom: "8px" } }) : null,
197
- typeof headline === "string" ? /* @__PURE__ */ jsx5(Typography2, { variant: small ? "body1" : "h6", textAlign: "left", gutterBottom: true, children: headline }) : headline,
198
- subtitle ? /* @__PURE__ */ jsx5(Typography2, { variant: "subtitle2", textAlign: "left", gutterBottom: true, children: subtitle }) : null,
199
- /* @__PURE__ */ jsx5(Typography2, { variant: small ? "caption" : "body1", textAlign: "left", gutterBottom: true, children: desc })
200
- ] }) }),
201
- interactionVariant == "button" ? /* @__PURE__ */ jsx5(CardActions2, { children: /* @__PURE__ */ jsx5(FlexGrowCol2, { alignItems: "flex-end", children: /* @__PURE__ */ jsx5(
202
- IconButton3,
203
- {
204
- color: raised ? "secondary" : "primary",
205
- size: small ? "small" : "medium",
206
- onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
207
- disableFocusRipple: true,
208
- disableRipple: true,
209
- disableTouchRipple: true,
210
- children: /* @__PURE__ */ jsx5(ArrowForwardRoundedIcon2, { fontSize: small ? "small" : "medium" })
211
- }
212
- ) }) }) : null
213
- ]
214
- }
215
- );
216
- };
217
- export {
218
- CardContentEx,
219
- CardContentExWithRef,
220
- CardEx,
221
- CardExWithRef,
222
- FullWidthCard,
223
- PageCard,
224
- SimpleCard
225
- };
1
+ import{CardContent as S,styled as G}from"@mui/material";import{useShareForwardedRef as W}from"@xyo-network/react-shared";import{forwardRef as H,useEffect as z}from"react";import{jsx as D}from"react/jsx-runtime";var L=G(S,{name:"CardContentEx",shouldForwardProp:t=>!["variant","removePadding"].includes(t),slot:"Root"})(({variant:t,removePadding:r})=>({...(t==="scrollable"||r)&&{":last-child":{paddingBottom:0},overflow:"auto",paddingTop:0,...r&&{padding:0}}})),T=H(({scrollToTop:t=0,refreshRef:r=0,...o},d)=>{let e=W(d,r);return z(()=>{var n;e&&t&&((n=e.current)==null||n.scroll({behavior:"smooth",top:0}))},[e,t]),D(L,{ref:e,...o})});T.displayName="CardContentEx";var To=T;import{Card as Z}from"@mui/material";import{useGradientStyles as X}from"@xyo-network/react-shared";import{forwardRef as Y}from"react";import{jsx as q}from"react/jsx-runtime";var w=Y(({style:t,gradient:r,...o},d)=>{let{styles:e}=X(),n=r==="border"?e.border:r==="background"?e.background:{};return q(Z,{style:{...n,...t},ref:d,...o})});w.displayName="CardEx";var y=w;import{ArrowForwardRounded as F}from"@mui/icons-material";import{alpha as J,Card as K,CardActions as O,CardContent as Q,CardMedia as U,Grid as b,IconButton as I,Typography as M,useTheme as _,Zoom as $}from"@mui/material";import{FlexGrowCol as V}from"@xylabs/react-flexbox";import{useIsMobile as j}from"@xyo-network/react-shared";import{useState as oo}from"react";import{useNavigate as eo}from"react-router-dom";import{jsx as a,jsxs as k}from"react/jsx-runtime";var Yo=({cardIsButton:t,desc:r,href:o,media:d,name:e,small:n,to:i,...c})=>{let R=_(),[u,h]=oo(!1),p=eo(),C=j(),g=m=>{p(m||"/404")},s=m=>{m?window.open(m):p("/404")};return k(K,{elevation:u?3:0,style:{height:"100%",width:"100%"},...c,sx:{"&:hover":{cursor:"pointer"},backgroundColor:J(R.palette.primary.light,.05)},onMouseEnter:()=>C?null:t?h(!0):null,onMouseLeave:()=>C?null:t?h(!1):null,onClick:()=>t?o?s(o):i?g(i):p("/404"):null,children:[d?a(U,{component:"img",height:"100",image:d,alt:""}):null,a(Q,{children:k(b,{container:!0,alignItems:"center",paddingY:2,paddingX:2,children:[a(b,{item:!0,xs:12,md:6,children:typeof e=="string"?a(M,{fontWeight:700,variant:"h2",textAlign:"left",paddingBottom:1,children:e}):e}),a(b,{item:!0,xs:12,md:5,children:a(M,{variant:"body1",fontWeight:400,textAlign:"left",children:r})}),a(b,{item:!0,xs:1,display:C?"none":"flex",justifyContent:"center",children:a($,{in:u,children:a(I,{color:"primary",size:n?"small":"medium",onClick:()=>o?s(o):i?g(i):p("/404"),disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0,children:a(F,{fontSize:n?"small":"medium"})})})})]})}),a(O,{sx:{display:{md:C?"flex":"none"}},children:a(V,{alignItems:"flex-end",children:a(I,{color:"primary",size:n?"small":"medium",onClick:()=>o?s(o):i?g(i):p("/404"),disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0,children:a(F,{fontSize:n?"small":"medium"})})})})]})};import{Refresh as to}from"@mui/icons-material";import{CardHeader as ro,IconButton as no}from"@mui/material";import{TypographyEx as A}from"@xyo-network/react-shared";import{forwardRef as ao}from"react";import{Fragment as io,jsx as f,jsxs as lo}from"react/jsx-runtime";var B=ao(({subheader:t,title:r,onRefresh:o,children:d,action:e,style:n,...i},c)=>lo(y,{style:{backgroundColor:"transparent",position:"relative",...n},elevation:0,ref:c,...i,children:[f(ro,{title:f(A,{variant:"h5",gutterBottom:!0,children:r}),subheader:f(A,{variant:"subtitle1",children:t}),action:e??f(io,{children:o?f(no,{onClick:()=>o==null?void 0:o(),children:f(to,{})}):null})}),d]}));B.displayName="PageCard";var oe=B;import{ArrowForwardRounded as so}from"@mui/icons-material";import{alpha as po,CardActions as mo,CardContent as uo,CardMedia as Co,IconButton as co,Typography as E,useTheme as go}from"@mui/material";import{FlexCol as fo,FlexGrowCol as xo}from"@xylabs/react-flexbox";import{useIsMobile as ho}from"@xyo-network/react-shared";import{useState as yo}from"react";import{useNavigate as bo}from"react-router-dom";import{jsx as l,jsxs as N}from"react/jsx-runtime";var Ce=({desc:t,iconImage:r,interactionVariant:o="card",headline:d,href:e,media:n,small:i,subtitle:c,sx:R,to:u,...h})=>{let p=go(),[C,g]=yo(!1),s=bo(),m=ho(),P=x=>{s(x||"/404")},v=x=>{x?window.open(x):s("/404")};return N(y,{elevation:C?3:0,sx:{"&:hover":{cursor:o=="button"?"pointer":null},backgroundColor:po(p.palette.primary.light,.05),...R},onMouseEnter:()=>m?null:o=="button"?g(!0):null,onMouseLeave:()=>m?null:o=="button"?g(!1):null,onClick:()=>o=="button"?e?v(e):u?P(u):s("/404"):null,...h,children:[n?l(Co,{component:"img",height:"100",image:n,alt:""}):null,l(uo,{sx:{height:"100%"},children:N(fo,{width:"100%",alignItems:"flex-start",children:[r?l("img",{src:r,height:"40px",style:{paddingBottom:"8px"}}):null,typeof d=="string"?l(E,{variant:i?"body1":"h6",textAlign:"left",gutterBottom:!0,children:d}):d,c?l(E,{variant:"subtitle2",textAlign:"left",gutterBottom:!0,children:c}):null,l(E,{variant:i?"caption":"body1",textAlign:"left",gutterBottom:!0,children:t})]})}),o=="button"?l(mo,{children:l(xo,{alignItems:"flex-end",children:l(co,{color:C?"secondary":"primary",size:i?"small":"medium",onClick:()=>e?v(e):u?P(u):s("/404"),disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0,children:l(so,{fontSize:i?"small":"medium"})})})}):null]})};export{To as CardContentEx,T as CardContentExWithRef,y as CardEx,w as CardExWithRef,Yo as FullWidthCard,oe as PageCard,Ce as SimpleCard};
226
2
  //# sourceMappingURL=index.js.map
@@ -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 { CardContent, CardContentProps, styled } from '@mui/material'\nimport { useShareForwardedRef } from '@xyo-network/react-shared'\nimport { forwardRef, 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']: {\n paddingBottom: 0,\n },\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 = forwardRef<HTMLDivElement | null, CardContentExProps>(({ scrollToTop = 0, refreshRef = 0, ...props }, ref) => {\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 { Card, CardProps } from '@mui/material'\nimport { useGradientStyles } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nexport interface CardExProps extends CardProps {\n gradient?: 'border' | 'background'\n}\n\nexport const CardExWithRef = forwardRef<HTMLDivElement, CardExProps>(({ style, gradient, ...props }, ref) => {\n const { styles } = useGradientStyles()\n const gradientStyle =\n gradient === 'border' ? styles.border\n : gradient === 'background' ? 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 { alpha, Card, CardActions, CardContent, CardMedia, CardProps, Grid, IconButton, Typography, useTheme, Zoom } from '@mui/material'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsMobile } from '@xyo-network/react-shared'\nimport { ReactNode, useState } from 'react'\nimport { To, 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> = ({ cardIsButton, desc, href, media, name, small, to, ...props }) => {\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 to ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n href ? window.open(href) : 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': {\n cursor: 'pointer',\n },\n backgroundColor: alpha(theme.palette.primary.light, 0.05),\n }}\n onMouseEnter={() =>\n isMobile ? null\n : cardIsButton ? setRaised(true)\n : null\n }\n onMouseLeave={() =>\n isMobile ? null\n : cardIsButton ? setRaised(false)\n : null\n }\n onClick={() =>\n cardIsButton ?\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n : null\n }\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 <Typography fontWeight={700} variant=\"h2\" textAlign=\"left\" paddingBottom={1}>\n {name}\n </Typography>\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 ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\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 ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\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 { CardHeader, CardHeaderProps, IconButton } from '@mui/material'\nimport { TypographyEx } from '@xyo-network/react-shared'\nimport { forwardRef, ReactNode } from 'react'\n\nimport { CardEx, CardExProps } from './CardEx'\n\nexport interface PageCardProps extends CardExProps {\n action?: ReactNode\n onRefresh?: () => void\n subheader?: CardHeaderProps['subheader']\n}\n\nconst PageCardWithRef = forwardRef<HTMLDivElement, PageCardProps>(({ subheader, title, onRefresh, children, action, style, ...props }, ref) => {\n return (\n <CardEx style={{ backgroundColor: 'transparent', position: 'relative', ...style }} elevation={0} ref={ref} {...props}>\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 <IconButton onClick={() => onRefresh?.()}>\n <RefreshIcon />\n </IconButton>\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 { alpha, CardActions, CardContent, CardMedia, IconButton, Typography, useTheme } from '@mui/material'\nimport { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsMobile } from '@xyo-network/react-shared'\nimport { ReactNode, useState } from 'react'\nimport { To, useNavigate } from 'react-router-dom'\n\nimport { CardEx, CardExProps } from '../CardEx'\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 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 to ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n href ? window.open(href) : navigate('/404')\n }\n return (\n <CardEx\n elevation={raised ? 3 : 0}\n sx={{\n '&:hover': {\n cursor: interactionVariant == 'button' ? 'pointer' : null,\n },\n backgroundColor: alpha(theme.palette.primary.light, 0.05),\n ...sx,\n }}\n onMouseEnter={() =>\n isMobile ? null\n : interactionVariant == 'button' ? setRaised(true)\n : null\n }\n onMouseLeave={() =>\n isMobile ? null\n : interactionVariant == 'button' ? setRaised(false)\n : null\n }\n onClick={() =>\n interactionVariant == 'button' ?\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n : null\n }\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 <Typography variant={small ? 'body1' : 'h6'} textAlign=\"left\" gutterBottom>\n {headline}\n </Typography>\n : headline}\n {subtitle ?\n <Typography variant=\"subtitle2\" textAlign=\"left\" gutterBottom>\n {subtitle}\n </Typography>\n : null}\n <Typography variant={small ? 'caption' : 'body1'} textAlign=\"left\" gutterBottom>\n {desc}\n </Typography>\n </FlexCol>\n </CardContent>\n {interactionVariant == 'button' ?\n <CardActions>\n <FlexGrowCol alignItems=\"flex-end\">\n <IconButton\n color={raised ? 'secondary' : 'primary'}\n size={small ? 'small' : 'medium'}\n onClick={() =>\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\n disableFocusRipple\n disableRipple\n disableTouchRipple\n >\n <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />\n </IconButton>\n </FlexGrowCol>\n </CardActions>\n : null}\n </CardEx>\n )\n}\n"],"mappings":";AAAA,SAAS,aAA+B,cAAc;AACtD,SAAS,4BAA4B;AACrC,SAAS,YAAY,iBAAiB;AAiC7B;AA/BT,IAAM,oBAAoB,OAAO,aAAa;AAAA,EAC5C,MAAM;AAAA,EACN,mBAAmB,CAAC,SAAiB,CAAC,CAAC,WAAW,eAAe,EAAE,SAAS,IAAI;AAAA,EAChF,MAAM;AACR,CAAC,EAAsB,CAAC,EAAE,SAAS,cAAc,OAAO;AAAA,EACtD,IAAK,YAAY,gBAAgB,kBAAkB;AAAA,IACjD,CAAC,aAAa,GAAG;AAAA,MACf,eAAe;AAAA,IACjB;AAAA,IACA,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAI,iBAAiB,E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5E,gBACH;AAAA,WACF,GACF;AAAA,QACC,sBAAsB,WACrB,gBAAAX,KAACY,cAAA,EACC,0BAAAZ,KAACa,cAAA,EAAY,YAAW,YACtB,0BAAAb;AAAA,UAACc;AAAA,UAAA;AAAA,YACC,OAAO,SAAS,cAAc;AAAA,YAC9B,MAAM,QAAQ,UAAU;AAAA,YACxB,SAAS,MACP,OAAO,oBAAoB,IAAI,IAC7B,KAAK,iBAAiB,EAAE,IACxB,SAAS,MAAM;AAAA,YAEnB,oBAAkB;AAAA,YAClB,eAAa;AAAA,YACb,oBAAkB;AAAA,YAElB,0BAAAd,KAACe,0BAAA,EAAwB,UAAU,QAAQ,UAAU,UAAU;AAAA;AAAA,QACjE,GACF,GACF,IACA;AAAA;AAAA;AAAA,EACJ;AAEJ;","names":["forwardRef","jsx","Card","CardContent","jsx","to","href","IconButton","forwardRef","jsx","jsxs","forwardRef","IconButton","ArrowForwardRoundedIcon","alpha","CardActions","CardContent","CardMedia","IconButton","Typography","useTheme","FlexGrowCol","useIsMobile","useState","useNavigate","jsx","jsxs","useTheme","useState","useNavigate","useIsMobile","to","href","alpha","CardMedia","CardContent","Typography","CardActions","FlexGrowCol","IconButton","ArrowForwardRoundedIcon"]}
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 { CardContent, CardContentProps, styled } from '@mui/material'\nimport { useShareForwardedRef } from '@xyo-network/react-shared'\nimport { forwardRef, 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']: {\n paddingBottom: 0,\n },\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 = forwardRef<HTMLDivElement | null, CardContentExProps>(({ scrollToTop = 0, refreshRef = 0, ...props }, ref) => {\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 { Card, CardProps } from '@mui/material'\nimport { useGradientStyles } from '@xyo-network/react-shared'\nimport { forwardRef } from 'react'\n\nexport interface CardExProps extends CardProps {\n gradient?: 'border' | 'background'\n}\n\nexport const CardExWithRef = forwardRef<HTMLDivElement, CardExProps>(({ style, gradient, ...props }, ref) => {\n const { styles } = useGradientStyles()\n const gradientStyle =\n gradient === 'border' ? styles.border\n : gradient === 'background' ? 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 { alpha, Card, CardActions, CardContent, CardMedia, CardProps, Grid, IconButton, Typography, useTheme, Zoom } from '@mui/material'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsMobile } from '@xyo-network/react-shared'\nimport { ReactNode, useState } from 'react'\nimport { To, 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> = ({ cardIsButton, desc, href, media, name, small, to, ...props }) => {\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 to ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n href ? window.open(href) : 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': {\n cursor: 'pointer',\n },\n backgroundColor: alpha(theme.palette.primary.light, 0.05),\n }}\n onMouseEnter={() =>\n isMobile ? null\n : cardIsButton ? setRaised(true)\n : null\n }\n onMouseLeave={() =>\n isMobile ? null\n : cardIsButton ? setRaised(false)\n : null\n }\n onClick={() =>\n cardIsButton ?\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n : null\n }\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 <Typography fontWeight={700} variant=\"h2\" textAlign=\"left\" paddingBottom={1}>\n {name}\n </Typography>\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 ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\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 ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\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 { CardHeader, CardHeaderProps, IconButton } from '@mui/material'\nimport { TypographyEx } from '@xyo-network/react-shared'\nimport { forwardRef, ReactNode } from 'react'\n\nimport { CardEx, CardExProps } from './CardEx'\n\nexport interface PageCardProps extends CardExProps {\n action?: ReactNode\n onRefresh?: () => void\n subheader?: CardHeaderProps['subheader']\n}\n\nconst PageCardWithRef = forwardRef<HTMLDivElement, PageCardProps>(({ subheader, title, onRefresh, children, action, style, ...props }, ref) => {\n return (\n <CardEx style={{ backgroundColor: 'transparent', position: 'relative', ...style }} elevation={0} ref={ref} {...props}>\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 <IconButton onClick={() => onRefresh?.()}>\n <RefreshIcon />\n </IconButton>\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 { alpha, CardActions, CardContent, CardMedia, IconButton, Typography, useTheme } from '@mui/material'\nimport { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useIsMobile } from '@xyo-network/react-shared'\nimport { ReactNode, useState } from 'react'\nimport { To, useNavigate } from 'react-router-dom'\n\nimport { CardEx, CardExProps } from '../CardEx'\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 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 to ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n href ? window.open(href) : navigate('/404')\n }\n return (\n <CardEx\n elevation={raised ? 3 : 0}\n sx={{\n '&:hover': {\n cursor: interactionVariant == 'button' ? 'pointer' : null,\n },\n backgroundColor: alpha(theme.palette.primary.light, 0.05),\n ...sx,\n }}\n onMouseEnter={() =>\n isMobile ? null\n : interactionVariant == 'button' ? setRaised(true)\n : null\n }\n onMouseLeave={() =>\n isMobile ? null\n : interactionVariant == 'button' ? setRaised(false)\n : null\n }\n onClick={() =>\n interactionVariant == 'button' ?\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n : null\n }\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 <Typography variant={small ? 'body1' : 'h6'} textAlign=\"left\" gutterBottom>\n {headline}\n </Typography>\n : headline}\n {subtitle ?\n <Typography variant=\"subtitle2\" textAlign=\"left\" gutterBottom>\n {subtitle}\n </Typography>\n : null}\n <Typography variant={small ? 'caption' : 'body1'} textAlign=\"left\" gutterBottom>\n {desc}\n </Typography>\n </FlexCol>\n </CardContent>\n {interactionVariant == 'button' ?\n <CardActions>\n <FlexGrowCol alignItems=\"flex-end\">\n <IconButton\n color={raised ? 'secondary' : 'primary'}\n size={small ? 'small' : 'medium'}\n onClick={() =>\n href ? externalRouteChange(href)\n : to ? localRouteChange(to)\n : navigate('/404')\n }\n disableFocusRipple\n disableRipple\n disableTouchRipple\n >\n <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />\n </IconButton>\n </FlexGrowCol>\n </CardActions>\n : null}\n </CardEx>\n )\n}\n"],"mappings":"AAAA,OAAS,eAAAA,EAA+B,UAAAC,MAAc,gBACtD,OAAS,wBAAAC,MAA4B,4BACrC,OAAS,cAAAC,EAAY,aAAAC,MAAiB,QAiC7B,cAAAC,MAAA,oBA/BT,IAAMC,EAAoBL,EAAOD,EAAa,CAC5C,KAAM,gBACN,kBAAoBO,GAAiB,CAAC,CAAC,UAAW,eAAe,EAAE,SAASA,CAAI,EAChF,KAAM,MACR,CAAC,EAAsB,CAAC,CAAE,QAAAC,EAAS,cAAAC,CAAc,KAAO,CACtD,IAAKD,IAAY,cAAgBC,IAAkB,CAChD,cAAgB,CACf,cAAe,CACjB,EACA,SAAU,OACV,WAAY,EACZ,GAAIA,GAAiB,CAAE,QAAS,CAAE,CACpC,CACF,EAAE,EASWC,EAAuBP,EAAsD,CAAC,CAAE,YAAAQ,EAAc,EAAG,WAAAC,EAAa,EAAG,GAAGC,CAAM,EAAGC,IAAQ,CAChJ,IAAMC,EAAYb,EAAqCY,EAAKF,CAAU,EAEtE,OAAAR,EAAU,IAAM,CA7BlB,IAAAY,EA8BQD,GAAaJ,KACfK,EAAAD,EAAU,UAAV,MAAAC,EAAmB,OAAO,CAAE,SAAU,SAAU,IAAK,CAAE,GAE3D,EAAG,CAACD,EAAWJ,CAAW,CAAC,EAEpBN,EAACC,EAAA,CAAkB,IAAKS,EAAY,GAAGF,EAAO,CACvD,CAAC,EAEDH,EAAqB,YAAc,gBAE5B,IAAMO,GAAgBP,ECxC7B,OAAS,QAAAQ,MAAuB,gBAChC,OAAS,qBAAAC,MAAyB,4BAClC,OAAS,cAAAC,MAAkB,QAavB,cAAAC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4B,GAAA,CAAY,GAAI,CAAE,OAAQ,MAAO,EAChC,SAAA3B,EAAC4B,GAAA,CAAQ,MAAM,OAAO,WAAW,aAC9B,UAAAzB,EACCJ,EAAC,OAAI,IAAKI,EAAW,OAAO,OAAO,MAAO,CAAE,cAAe,KAAM,EAAG,EACpE,KACD,OAAOE,GAAa,SACnBN,EAAC8B,EAAA,CAAW,QAASrB,EAAQ,QAAU,KAAM,UAAU,OAAO,aAAY,GACvE,SAAAH,EACH,EACAA,EACDI,EACCV,EAAC8B,EAAA,CAAW,QAAQ,YAAY,UAAU,OAAO,aAAY,GAC1D,SAAApB,EACH,EACA,KACFV,EAAC8B,EAAA,CAAW,QAASrB,EAAQ,UAAY,QAAS,UAAU,OAAO,aAAY,GAC5E,SAAAN,EACH,GACF,EACF,EACCE,GAAsB,SACrBL,EAAC+B,GAAA,CACC,SAAA/B,EAACgC,GAAA,CAAY,WAAW,WACtB,SAAAhC,EAACiC,GAAA,CACC,MAAOjB,EAAS,YAAc,UAC9B,KAAMP,EAAQ,QAAU,SACxB,QAAS,IACPF,EAAOiB,EAAoBjB,CAAI,EAC7BK,EAAKW,EAAiBX,CAAE,EACxBO,EAAS,MAAM,EAEnB,mBAAkB,GAClB,cAAa,GACb,mBAAkB,GAElB,SAAAnB,EAACkC,GAAA,CAAwB,SAAUzB,EAAQ,QAAU,SAAU,EACjE,EACF,EACF,EACA,MACJ,CAEJ","names":["CardContent","styled","useShareForwardedRef","forwardRef","useEffect","jsx","CardContentExRoot","prop","variant","removePadding","CardContentExWithRef","scrollToTop","refreshRef","props","ref","sharedRef","_a","CardContentEx","Card","useGradientStyles","forwardRef","jsx","CardExWithRef","style","gradient","props","ref","styles","gradientStyle","CardEx","ArrowForwardRoundedIcon","alpha","Card","CardActions","CardContent","CardMedia","Grid","IconButton","Typography","useTheme","Zoom","FlexGrowCol","useIsMobile","useState","useNavigate","jsx","jsxs","FullWidthCard","cardIsButton","desc","href","media","name","small","to","props","theme","raised","setRaised","navigate","isMobile","localRouteChange","externalRouteChange","RefreshIcon","CardHeader","IconButton","TypographyEx","forwardRef","Fragment","jsx","jsxs","PageCardWithRef","forwardRef","subheader","title","onRefresh","children","action","style","props","ref","CardEx","CardHeader","TypographyEx","IconButton","RefreshIcon","PageCard","ArrowForwardRoundedIcon","alpha","CardActions","CardContent","CardMedia","IconButton","Typography","useTheme","FlexCol","FlexGrowCol","useIsMobile","useState","useNavigate","jsx","jsxs","SimpleCard","desc","iconImage","interactionVariant","headline","href","media","small","subtitle","sx","to","props","theme","useTheme","raised","setRaised","useState","navigate","useNavigate","isMobile","useIsMobile","localRouteChange","externalRouteChange","CardEx","alpha","CardMedia","CardContent","FlexCol","Typography","CardActions","FlexGrowCol","IconButton","ArrowForwardRoundedIcon"]}
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@xylabs/react-flexbox": "^3.1.7",
14
- "@xyo-network/react-shared": "~2.77.0-rc.1",
14
+ "@xyo-network/react-shared": "~2.77.1",
15
15
  "react-router-dom": "^6.23.1"
16
16
  },
17
17
  "peerDependencies": {
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@storybook/react": "^7.6.19",
26
- "@xylabs/ts-scripts-yarn3": "^3.10.4",
27
- "@xylabs/tsconfig-react": "^3.10.4",
28
- "@xyo-network/react-storybook": "~2.77.0-rc.1",
26
+ "@xylabs/ts-scripts-yarn3": "^3.11.7",
27
+ "@xylabs/tsconfig-react": "^3.11.7",
28
+ "@xyo-network/react-storybook": "~2.77.1",
29
29
  "typescript": "^5.4.5"
30
30
  },
31
31
  "description": "Common React library for all XYO projects that use React",
@@ -79,7 +79,6 @@
79
79
  },
80
80
  "sideEffects": false,
81
81
  "types": "dist/browser/index.d.ts",
82
- "version": "2.77.0-rc.1",
83
- "type": "module",
84
- "stableVersion": "2.76.6"
82
+ "version": "2.77.1",
83
+ "type": "module"
85
84
  }