@xyo-network/react-card 3.0.2 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser/components/CardContentEx.d.ts +11 -0
- package/dist/browser/components/CardContentEx.d.ts.map +1 -0
- package/dist/browser/components/CardEx.d.ts +8 -0
- package/dist/browser/components/CardEx.d.ts.map +1 -0
- package/dist/browser/components/FullWidthCard/FullWidthCard.d.ts +16 -0
- package/dist/browser/components/FullWidthCard/FullWidthCard.d.ts.map +1 -0
- package/dist/browser/components/FullWidthCard/index.d.ts +2 -0
- package/dist/browser/components/FullWidthCard/index.d.ts.map +1 -0
- package/dist/browser/components/PageCard.d.ts +11 -0
- package/dist/browser/components/PageCard.d.ts.map +1 -0
- package/dist/browser/components/SimpleCard/SimpleCard.d.ts +17 -0
- package/dist/browser/components/SimpleCard/SimpleCard.d.ts.map +1 -0
- package/dist/browser/components/SimpleCard/index.d.ts +2 -0
- package/dist/browser/components/SimpleCard/index.d.ts.map +1 -0
- package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.ts +8 -0
- package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.ts.map +1 -0
- package/dist/browser/components/SimpleCardGrid/index.d.ts +2 -0
- package/dist/browser/components/SimpleCardGrid/index.d.ts.map +1 -0
- package/dist/browser/components/index.d.ts +6 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/index.d.ts +2 -52
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +52 -46
- package/src/components/CardContentEx.stories.tsx +7 -7
- package/src/components/CardContentEx.tsx +4 -4
- package/src/components/CardEx.tsx +3 -1
- package/src/components/FullWidthCard/FullWidthCard.stories.tsx +2 -5
- package/src/components/FullWidthCard/FullWidthCard.tsx +7 -5
- package/src/components/PageCard.stories.tsx +7 -19
- package/src/components/PageCard.tsx +11 -2
- package/src/components/SimpleCard/SimpleCard.stories.tsx +5 -6
- package/src/components/SimpleCard/SimpleCard.tsx +4 -4
- package/src/components/SimpleCardGrid/SimpleCardGrid.stories.tsx +2 -5
- package/src/components/SimpleCardGrid/SimpleCardGrid.tsx +4 -1
- package/xy.config.ts +1 -3
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { CardContentProps } from '@mui/material';
|
2
|
+
import React from 'react';
|
3
|
+
export type CardContentExProps = CardContentProps & {
|
4
|
+
refreshRef?: number;
|
5
|
+
removePadding?: boolean;
|
6
|
+
scrollToTop?: number;
|
7
|
+
variant?: 'scrollable' | 'normal';
|
8
|
+
};
|
9
|
+
export declare const CardContentExWithRef: React.ForwardRefExoticComponent<Omit<CardContentExProps, "ref"> & React.RefAttributes<HTMLDivElement | null>>;
|
10
|
+
export declare const CardContentEx: React.ForwardRefExoticComponent<Omit<CardContentExProps, "ref"> & React.RefAttributes<HTMLDivElement | null>>;
|
11
|
+
//# sourceMappingURL=CardContentEx.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CardContentEx.d.ts","sourceRoot":"","sources":["../../../src/components/CardContentEx.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAGrD,OAAO,KAAgC,MAAM,OAAO,CAAA;AAepD,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG;IAClD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAA;CAClC,CAAA;AAED,eAAO,MAAM,oBAAoB,+GAY/B,CAAA;AAIF,eAAO,MAAM,aAAa,+GAAuB,CAAA"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { CardProps } from '@mui/material';
|
2
|
+
import React from 'react';
|
3
|
+
export interface CardExProps extends CardProps {
|
4
|
+
gradient?: 'border' | 'background';
|
5
|
+
}
|
6
|
+
export declare const CardExWithRef: React.ForwardRefExoticComponent<Omit<CardExProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
7
|
+
export declare const CardEx: React.ForwardRefExoticComponent<Omit<CardExProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
8
|
+
//# sourceMappingURL=CardEx.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CardEx.d.ts","sourceRoot":"","sources":["../../../src/components/CardEx.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,QAAQ,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAA;CACnC;AAED,eAAO,MAAM,aAAa,iGAoBxB,CAAA;AAIF,eAAO,MAAM,MAAM,iGAAgB,CAAA"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import type { CardProps } from '@mui/material';
|
2
|
+
import type { ReactNode } from 'react';
|
3
|
+
import React from 'react';
|
4
|
+
import type { To } from 'react-router-dom';
|
5
|
+
export interface FullWidthCardProps extends CardProps {
|
6
|
+
cardIsButton?: boolean;
|
7
|
+
desc?: ReactNode;
|
8
|
+
href?: string;
|
9
|
+
linkText?: string;
|
10
|
+
media?: string;
|
11
|
+
name: ReactNode;
|
12
|
+
small?: boolean;
|
13
|
+
to?: To;
|
14
|
+
}
|
15
|
+
export declare const FullWidthCard: React.FC<FullWidthCardProps>;
|
16
|
+
//# sourceMappingURL=FullWidthCard.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FullWidthCard.d.ts","sourceRoot":"","sources":["../../../../src/components/FullWidthCard/FullWidthCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAM9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAmB,MAAM,OAAO,CAAA;AACvC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAG1C,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,EAAE,CAAC,EAAE,EAAE,CAAA;CACR;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA6GtD,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/FullWidthCard/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { CardHeaderProps } from '@mui/material';
|
2
|
+
import type { ReactNode } from 'react';
|
3
|
+
import React from 'react';
|
4
|
+
import type { CardExProps } from './CardEx.tsx';
|
5
|
+
export interface PageCardProps extends CardExProps {
|
6
|
+
action?: ReactNode;
|
7
|
+
onRefresh?: () => void;
|
8
|
+
subheader?: CardHeaderProps['subheader'];
|
9
|
+
}
|
10
|
+
export declare const PageCard: React.ForwardRefExoticComponent<Omit<PageCardProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
11
|
+
//# sourceMappingURL=PageCard.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PageCard.d.ts","sourceRoot":"","sources":["../../../src/components/PageCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAG/C,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,SAAS,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAA;CACzC;AA0CD,eAAO,MAAM,QAAQ,mGAAkB,CAAA"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { ReactNode } from 'react';
|
2
|
+
import React from 'react';
|
3
|
+
import type { To } from 'react-router-dom';
|
4
|
+
import type { CardExProps } from '../CardEx.tsx';
|
5
|
+
export interface SimpleCardProps extends CardExProps {
|
6
|
+
desc?: ReactNode;
|
7
|
+
headline?: ReactNode;
|
8
|
+
href?: string;
|
9
|
+
iconImage?: string;
|
10
|
+
interactionVariant?: 'button' | 'card';
|
11
|
+
media?: string;
|
12
|
+
small?: boolean;
|
13
|
+
subtitle?: string;
|
14
|
+
to?: To;
|
15
|
+
}
|
16
|
+
export declare const SimpleCard: React.FC<SimpleCardProps>;
|
17
|
+
//# sourceMappingURL=SimpleCard.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SimpleCard.d.ts","sourceRoot":"","sources":["../../../../src/components/SimpleCard/SimpleCard.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAmB,MAAM,OAAO,CAAA;AACvC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AAG1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGhD,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kBAAkB,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,EAAE,CAAC,EAAE,EAAE,CAAA;CACR;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA4GhD,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/SimpleCard/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { GridProps } from '@mui/material';
|
2
|
+
import React from 'react';
|
3
|
+
import type { SimpleCardProps } from '../SimpleCard/index.ts';
|
4
|
+
export interface SimpleCardGridProps extends GridProps {
|
5
|
+
cards?: SimpleCardProps[];
|
6
|
+
}
|
7
|
+
export declare const SimpleCardGrid: React.FC<SimpleCardGridProps>;
|
8
|
+
//# sourceMappingURL=SimpleCardGrid.d.ts.map
|
@@ -0,0 +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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/SimpleCardGrid/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA"}
|
package/dist/browser/index.d.ts
CHANGED
@@ -1,52 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import { To } from 'react-router-dom';
|
4
|
-
|
5
|
-
type CardContentExProps = CardContentProps & {
|
6
|
-
refreshRef?: number;
|
7
|
-
removePadding?: boolean;
|
8
|
-
scrollToTop?: number;
|
9
|
-
variant?: 'scrollable' | 'normal';
|
10
|
-
};
|
11
|
-
declare const CardContentExWithRef: React.ForwardRefExoticComponent<Omit<CardContentExProps, "ref"> & React.RefAttributes<HTMLDivElement | null>>;
|
12
|
-
declare const CardContentEx: React.ForwardRefExoticComponent<Omit<CardContentExProps, "ref"> & React.RefAttributes<HTMLDivElement | null>>;
|
13
|
-
|
14
|
-
interface CardExProps extends CardProps {
|
15
|
-
gradient?: 'border' | 'background';
|
16
|
-
}
|
17
|
-
declare const CardExWithRef: React.ForwardRefExoticComponent<Omit<CardExProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
18
|
-
declare const CardEx: React.ForwardRefExoticComponent<Omit<CardExProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
19
|
-
|
20
|
-
interface FullWidthCardProps extends CardProps {
|
21
|
-
cardIsButton?: boolean;
|
22
|
-
desc?: ReactNode;
|
23
|
-
href?: string;
|
24
|
-
linkText?: string;
|
25
|
-
media?: string;
|
26
|
-
name: ReactNode;
|
27
|
-
small?: boolean;
|
28
|
-
to?: To;
|
29
|
-
}
|
30
|
-
declare const FullWidthCard: React.FC<FullWidthCardProps>;
|
31
|
-
|
32
|
-
interface PageCardProps extends CardExProps {
|
33
|
-
action?: ReactNode;
|
34
|
-
onRefresh?: () => void;
|
35
|
-
subheader?: CardHeaderProps['subheader'];
|
36
|
-
}
|
37
|
-
declare const PageCard: React.ForwardRefExoticComponent<Omit<PageCardProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
38
|
-
|
39
|
-
interface SimpleCardProps extends CardExProps {
|
40
|
-
desc?: ReactNode;
|
41
|
-
headline?: ReactNode;
|
42
|
-
href?: string;
|
43
|
-
iconImage?: string;
|
44
|
-
interactionVariant?: 'button' | 'card';
|
45
|
-
media?: string;
|
46
|
-
small?: boolean;
|
47
|
-
subtitle?: string;
|
48
|
-
to?: To;
|
49
|
-
}
|
50
|
-
declare const SimpleCard: React.FC<SimpleCardProps>;
|
51
|
-
|
52
|
-
export { CardContentEx, type CardContentExProps, CardContentExWithRef, CardEx, type CardExProps, CardExWithRef, FullWidthCard, type FullWidthCardProps, PageCard, type PageCardProps, SimpleCard, type SimpleCardProps };
|
1
|
+
export * from './components/index.ts';
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
|
@@ -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, { 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 type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport { useGradientStyles } from '@xyo-network/react-shared'\nimport React, { 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'\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 { alpha, Card, CardActions, CardContent, CardMedia, Grid, IconButton, Typography, useTheme, Zoom } 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> = ({ 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 // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n to ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\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\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, { forwardRef } 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 = 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 ? (\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 { 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 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 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 ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\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\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 {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,YAAYC,iBAAiB;AAE7C,IAAMC,oBAAoBC,OAAOC,aAAa;EAC5CC,MAAM;EACNC,mBAAmB,wBAACC,SAAiB,CAAC;IAAC;IAAW;IAAiBC,SAASD,IAAAA,GAAzD;EACnBE,MAAM;AACR,CAAA,EAAuB,CAAC,EAAEC,SAASC,cAAa,OAAQ;EACtD,IAAKD,YAAY,gBAAgBC,kBAAkB;IACjD,CAAC,aAAA,GAAgB;MACfC,eAAe;IACjB;IACAC,UAAU;IACVC,YAAY;IACZ,GAAIH,iBAAiB;MAAEI,SAAS;IAAE;EACpC;AACF,EAAA;AASO,IAAMC,uBAAuBC,2BAAsD,CAAC,EAAEC,cAAc,GAAGC,aAAa,GAAG,GAAGC,MAAAA,GAASC,QAAAA;A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A,cAACwB,aAAAA;IAAWC,SAAS3C,QAAQ,YAAY;IAAS4C,WAAU;IAAOC,cAAAA;KAChEnD,IAAAA,CAAAA,CAAAA,GAINE,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","forwardRef","useEffect","CardContentExRoot","styled","CardContent","name","shouldForwardProp","prop","includes","slot","variant","removePadding","paddingBottom","overflow","paddingTop","padding","CardContentExWithRef","forwardRef","scrollToTop","refreshRef","props","ref","sharedRef","useShareForwardedRef","useEffect","current","scroll","behavior","top","displayName","CardContentEx","Card","useGradientStyles","React","forwardRef","CardExWithRef","style","gradient","props","ref","styles","gradientStyle","border","background","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","forwardRef","PageCardWithRef","forwardRef","subheader","title","onRefresh","children","action","style","props","ref","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","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, { 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']: { 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 = forwardRef<HTMLDivElement | null, CardContentExProps>(({\n scrollToTop = 0, refreshRef = 0, ...props\n}, 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 type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport { useGradientStyles } from '@xyo-network/react-shared'\nimport React, { forwardRef } from 'react'\n\nexport interface CardExProps extends CardProps {\n gradient?: 'border' | 'background'\n}\n\nexport const CardExWithRef = forwardRef<HTMLDivElement, CardExProps>(({\n style, gradient, ...props\n}, ref) => {\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 ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\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': { 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, { forwardRef } 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 = forwardRef<HTMLDivElement, PageCardProps>(({\n subheader, title, onRefresh, children, action, style, ...props\n}, ref) => {\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 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 ? navigate(to) : navigate('/404')\n }\n const externalRouteChange = (href: string | undefined) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n href ? window.open(href) : 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 {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,YAAYC,iBAAiB;AAE7C,IAAMC,oBAAoBC,OAAOC,aAAa;EAC5CC,MAAM;EACNC,mBAAmB,wBAACC,SAAiB,CAAC;IAAC;IAAW;IAAiBC,SAASD,IAAAA,GAAzD;EACnBE,MAAM;AACR,CAAA,EAAuB,CAAC,EAAEC,SAASC,cAAa,OAAQ;EACtD,IAAKD,YAAY,gBAAgBC,kBAAkB;IACjD,CAAC,aAAA,GAAgB;MAAEC,eAAe;IAAE;IACpCC,UAAU;IACVC,YAAY;IACZ,GAAIH,iBAAiB;MAAEI,SAAS;IAAE;EACpC;AACF,EAAA;AASO,IAAMC,uBAAuBC,2BAAsD,CAAC,EACzFC,cAAc,GAAGC,aAAa,GAAG,GAAGC,MAAAA,GACnCC,QAAAA;AACD,QAAMC,YAAYC,qBAAqCF,KAAKF,UAAAA;AAE5DK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,WAAU;IAAOC,cAAAA;KAChEnD,IAAAA,CAAAA,CAAAA,GAINE,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,GA5GqD;","names":["CardContent","styled","useShareForwardedRef","React","forwardRef","useEffect","CardContentExRoot","styled","CardContent","name","shouldForwardProp","prop","includes","slot","variant","removePadding","paddingBottom","overflow","paddingTop","padding","CardContentExWithRef","forwardRef","scrollToTop","refreshRef","props","ref","sharedRef","useShareForwardedRef","useEffect","current","scroll","behavior","top","displayName","CardContentEx","Card","useGradientStyles","React","forwardRef","CardExWithRef","style","gradient","props","ref","styles","gradientStyle","border","background","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","forwardRef","PageCardWithRef","forwardRef","subheader","title","onRefresh","children","action","style","props","ref","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","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"]}
|
package/package.json
CHANGED
@@ -1,35 +1,30 @@
|
|
1
1
|
{
|
2
2
|
"name": "@xyo-network/react-card",
|
3
|
-
"
|
4
|
-
|
5
|
-
|
6
|
-
"
|
7
|
-
|
3
|
+
"version": "3.0.4",
|
4
|
+
"description": "Common React library for all XYO projects that use React",
|
5
|
+
"keywords": [
|
6
|
+
"xyo",
|
7
|
+
"utility",
|
8
|
+
"typescript",
|
9
|
+
"react"
|
10
|
+
],
|
11
|
+
"homepage": "https://xyo.network",
|
8
12
|
"bugs": {
|
9
|
-
"
|
10
|
-
"
|
11
|
-
},
|
12
|
-
"dependencies": {
|
13
|
-
"@xylabs/react-flexbox": "^4.0.3",
|
14
|
-
"@xyo-network/react-shared": "^3.0.2",
|
15
|
-
"react-router-dom": "^6.26.1"
|
13
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues",
|
14
|
+
"email": "support@xyo.network"
|
16
15
|
},
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"@mui/styles": "^5",
|
21
|
-
"react": "^18",
|
22
|
-
"react-dom": "^18"
|
16
|
+
"repository": {
|
17
|
+
"type": "git",
|
18
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
|
23
19
|
},
|
24
|
-
"
|
25
|
-
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"typescript": "^5.5.4"
|
20
|
+
"license": "LGPL-3.0-only",
|
21
|
+
"author": {
|
22
|
+
"name": "XYO Development Team",
|
23
|
+
"email": "support@xyo.network",
|
24
|
+
"url": "https://xyo.network"
|
30
25
|
},
|
31
|
-
"
|
32
|
-
"
|
26
|
+
"sideEffects": false,
|
27
|
+
"type": "module",
|
33
28
|
"exports": {
|
34
29
|
".": {
|
35
30
|
"import": {
|
@@ -42,27 +37,38 @@
|
|
42
37
|
"./package.json": "./package.json"
|
43
38
|
},
|
44
39
|
"module": "dist/browser/index.mjs",
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"typescript",
|
50
|
-
"react"
|
51
|
-
],
|
52
|
-
"license": "LGPL-3.0-only",
|
53
|
-
"publishConfig": {
|
54
|
-
"access": "public"
|
40
|
+
"types": "dist/browser/index.d.ts",
|
41
|
+
"scripts": {
|
42
|
+
"license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\"",
|
43
|
+
"lint-pkg": "npmPkgJsonLint ."
|
55
44
|
},
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"
|
45
|
+
"dependencies": {
|
46
|
+
"@xylabs/react-flexbox": "^4.0.3",
|
47
|
+
"@xyo-network/react-shared": "^3.0.4",
|
48
|
+
"react-router-dom": "^6.26.1"
|
59
49
|
},
|
60
|
-
"
|
61
|
-
"
|
62
|
-
"
|
50
|
+
"devDependencies": {
|
51
|
+
"@mui/icons-material": "^5.16.7",
|
52
|
+
"@mui/material": "^5.16.7",
|
53
|
+
"@mui/styles": "^5.16.7",
|
54
|
+
"@storybook/react": "^8.2.9",
|
55
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.7",
|
56
|
+
"@xylabs/tsconfig-react": "^4.0.7",
|
57
|
+
"@xyo-network/react-storybook": "^3.0.4",
|
58
|
+
"react": "^18.3.1",
|
59
|
+
"react-dom": "^18.3.1",
|
60
|
+
"storybook": "^8.2.9",
|
61
|
+
"typescript": "^5.5.4"
|
63
62
|
},
|
64
|
-
"
|
65
|
-
|
66
|
-
|
67
|
-
|
63
|
+
"peerDependencies": {
|
64
|
+
"@mui/icons-material": "^5",
|
65
|
+
"@mui/material": "^5",
|
66
|
+
"@mui/styles": "^5",
|
67
|
+
"react": "^18",
|
68
|
+
"react-dom": "^18"
|
69
|
+
},
|
70
|
+
"publishConfig": {
|
71
|
+
"access": "public"
|
72
|
+
},
|
73
|
+
"docs": "dist/docs.json"
|
68
74
|
}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { Button, Typography } from '@mui/material'
|
2
|
-
import type {
|
2
|
+
import type {
|
3
|
+
Decorator, Meta, StoryFn,
|
4
|
+
} from '@storybook/react'
|
3
5
|
import { FlexGrowCol } from '@xylabs/react-flexbox'
|
4
6
|
import { WithRefDecorator } from '@xyo-network/react-storybook'
|
5
7
|
import React, { useRef, useState } from 'react'
|
@@ -30,11 +32,7 @@ const ScrollableDecorator: Decorator = (Story, args) => {
|
|
30
32
|
const StorybookEntry: Meta = {
|
31
33
|
argTypes: {},
|
32
34
|
component: CardContentEx,
|
33
|
-
parameters: {
|
34
|
-
docs: {
|
35
|
-
page: null,
|
36
|
-
},
|
37
|
-
},
|
35
|
+
parameters: { docs: { page: null } },
|
38
36
|
title: 'shared/CardContentEx',
|
39
37
|
}
|
40
38
|
|
@@ -63,6 +61,8 @@ const WithVariant = Template.bind({})
|
|
63
61
|
WithVariant.args = { variant: 'scrollable' }
|
64
62
|
WithVariant.decorators = [ScrollableDecorator]
|
65
63
|
|
66
|
-
export {
|
64
|
+
export {
|
65
|
+
Default, WithRef, WithVariant,
|
66
|
+
}
|
67
67
|
|
68
68
|
export default StorybookEntry
|
@@ -9,9 +9,7 @@ const CardContentExRoot = styled(CardContent, {
|
|
9
9
|
slot: 'Root',
|
10
10
|
})<CardContentExProps>(({ variant, removePadding }) => ({
|
11
11
|
...((variant === 'scrollable' || removePadding) && {
|
12
|
-
[':last-child']: {
|
13
|
-
paddingBottom: 0,
|
14
|
-
},
|
12
|
+
[':last-child']: { paddingBottom: 0 },
|
15
13
|
overflow: 'auto',
|
16
14
|
paddingTop: 0,
|
17
15
|
...(removePadding && { padding: 0 }),
|
@@ -25,7 +23,9 @@ export type CardContentExProps = CardContentProps & {
|
|
25
23
|
variant?: 'scrollable' | 'normal'
|
26
24
|
}
|
27
25
|
|
28
|
-
export const CardContentExWithRef = forwardRef<HTMLDivElement | null, CardContentExProps>(({
|
26
|
+
export const CardContentExWithRef = forwardRef<HTMLDivElement | null, CardContentExProps>(({
|
27
|
+
scrollToTop = 0, refreshRef = 0, ...props
|
28
|
+
}, ref) => {
|
29
29
|
const sharedRef = useShareForwardedRef<HTMLDivElement>(ref, refreshRef)
|
30
30
|
|
31
31
|
useEffect(() => {
|
@@ -7,7 +7,9 @@ export interface CardExProps extends CardProps {
|
|
7
7
|
gradient?: 'border' | 'background'
|
8
8
|
}
|
9
9
|
|
10
|
-
export const CardExWithRef = forwardRef<HTMLDivElement, CardExProps>(({
|
10
|
+
export const CardExWithRef = forwardRef<HTMLDivElement, CardExProps>(({
|
11
|
+
style, gradient, ...props
|
12
|
+
}, ref) => {
|
11
13
|
const { styles } = useGradientStyles()
|
12
14
|
const gradientStyle
|
13
15
|
= gradient === 'border'
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable @stylistic/max-len */
|
1
2
|
import type { Meta, StoryFn } from '@storybook/react'
|
2
3
|
import React from 'react'
|
3
4
|
import { BrowserRouter } from 'react-router-dom'
|
@@ -6,11 +7,7 @@ import { FullWidthCard } from './FullWidthCard.tsx'
|
|
6
7
|
const StorybookEntry = {
|
7
8
|
argTypes: {},
|
8
9
|
component: FullWidthCard,
|
9
|
-
parameters: {
|
10
|
-
docs: {
|
11
|
-
page: null,
|
12
|
-
},
|
13
|
-
},
|
10
|
+
parameters: { docs: { page: null } },
|
14
11
|
title: 'shared/FullWidthCard',
|
15
12
|
} as Meta<typeof FullWidthCard>
|
16
13
|
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { ArrowForwardRounded as ArrowForwardRoundedIcon } from '@mui/icons-material'
|
2
2
|
import type { CardProps } from '@mui/material'
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
alpha, Card, CardActions, CardContent, CardMedia, Grid, IconButton, Typography, useTheme, Zoom,
|
5
|
+
} from '@mui/material'
|
4
6
|
import { FlexGrowCol } from '@xylabs/react-flexbox'
|
5
7
|
import { useIsMobile } from '@xyo-network/react-shared'
|
6
8
|
import type { ReactNode } from 'react'
|
@@ -19,7 +21,9 @@ export interface FullWidthCardProps extends CardProps {
|
|
19
21
|
to?: To
|
20
22
|
}
|
21
23
|
|
22
|
-
export const FullWidthCard: React.FC<FullWidthCardProps> = ({
|
24
|
+
export const FullWidthCard: React.FC<FullWidthCardProps> = ({
|
25
|
+
cardIsButton, desc, href, media, name, small, to, ...props
|
26
|
+
}) => {
|
23
27
|
const theme = useTheme()
|
24
28
|
const [raised, setRaised] = useState(false)
|
25
29
|
const navigate = useNavigate()
|
@@ -40,9 +44,7 @@ export const FullWidthCard: React.FC<FullWidthCardProps> = ({ cardIsButton, desc
|
|
40
44
|
style={{ height: '100%', width: '100%' }}
|
41
45
|
{...props}
|
42
46
|
sx={{
|
43
|
-
'&:hover': {
|
44
|
-
cursor: 'pointer',
|
45
|
-
},
|
47
|
+
'&:hover': { cursor: 'pointer' },
|
46
48
|
'backgroundColor': alpha(theme.palette.primary.light, 0.05),
|
47
49
|
}}
|
48
50
|
onMouseEnter={() =>
|
@@ -6,19 +6,9 @@ import React, { useState } from 'react'
|
|
6
6
|
import { PageCard } from './PageCard.tsx'
|
7
7
|
|
8
8
|
const StorybookEntry: Meta = {
|
9
|
-
argTypes: {
|
10
|
-
onRefresh: {
|
11
|
-
table: {
|
12
|
-
disable: true,
|
13
|
-
},
|
14
|
-
},
|
15
|
-
},
|
9
|
+
argTypes: { onRefresh: { table: { disable: true } } },
|
16
10
|
component: PageCard,
|
17
|
-
parameters: {
|
18
|
-
docs: {
|
19
|
-
page: null,
|
20
|
-
},
|
21
|
-
},
|
11
|
+
parameters: { docs: { page: null } },
|
22
12
|
title: 'shared/PageCard',
|
23
13
|
}
|
24
14
|
|
@@ -49,19 +39,17 @@ const TemplateWithNoOnRefresh: StoryFn<typeof PageCard> = (props) => {
|
|
49
39
|
|
50
40
|
const Default = Template.bind({})
|
51
41
|
Default.args = {}
|
52
|
-
Default.parameters = {
|
53
|
-
actions: { argTypesRegex: '' },
|
54
|
-
}
|
42
|
+
Default.parameters = { actions: { argTypesRegex: '' } }
|
55
43
|
|
56
44
|
const WithNoOnRefresh = TemplateWithNoOnRefresh.bind({})
|
57
45
|
WithNoOnRefresh.args = {}
|
58
|
-
WithNoOnRefresh.parameters = {
|
59
|
-
actions: { argTypesRegex: '' },
|
60
|
-
}
|
46
|
+
WithNoOnRefresh.parameters = { actions: { argTypesRegex: '' } }
|
61
47
|
|
62
48
|
const WithRef = Template.bind({})
|
63
49
|
WithRef.decorators = [WithRefDecorator]
|
64
50
|
|
65
|
-
export {
|
51
|
+
export {
|
52
|
+
Default, WithNoOnRefresh, WithRef,
|
53
|
+
}
|
66
54
|
|
67
55
|
export default StorybookEntry
|
@@ -14,9 +14,18 @@ export interface PageCardProps extends CardExProps {
|
|
14
14
|
subheader?: CardHeaderProps['subheader']
|
15
15
|
}
|
16
16
|
|
17
|
-
const PageCardWithRef = forwardRef<HTMLDivElement, PageCardProps>(({
|
17
|
+
const PageCardWithRef = forwardRef<HTMLDivElement, PageCardProps>(({
|
18
|
+
subheader, title, onRefresh, children, action, style, ...props
|
19
|
+
}, ref) => {
|
18
20
|
return (
|
19
|
-
<CardEx
|
21
|
+
<CardEx
|
22
|
+
style={{
|
23
|
+
backgroundColor: 'transparent', position: 'relative', ...style,
|
24
|
+
}}
|
25
|
+
elevation={0}
|
26
|
+
ref={ref}
|
27
|
+
{...props}
|
28
|
+
>
|
20
29
|
<CardHeader
|
21
30
|
title={(
|
22
31
|
<TypographyEx variant="h5" gutterBottom>
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable @stylistic/max-len */
|
1
2
|
import { Grid } from '@mui/material'
|
2
3
|
import type { Meta, StoryFn } from '@storybook/react'
|
3
4
|
import React from 'react'
|
@@ -9,11 +10,7 @@ import { SimpleCard } from './SimpleCard.tsx'
|
|
9
10
|
const StorybookEntry = {
|
10
11
|
argTypes: {},
|
11
12
|
component: SimpleCard,
|
12
|
-
parameters: {
|
13
|
-
docs: {
|
14
|
-
page: null,
|
15
|
-
},
|
16
|
-
},
|
13
|
+
parameters: { docs: { page: null } },
|
17
14
|
title: 'shared/SimpleCard',
|
18
15
|
} as Meta<typeof SimpleCard>
|
19
16
|
|
@@ -83,6 +80,8 @@ CardWithAllParameters.args = {
|
|
83
80
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
84
81
|
// @ts-ignore
|
85
82
|
|
86
|
-
export {
|
83
|
+
export {
|
84
|
+
CardWithAllParameters, Default, DefaultMediaCard, DefaultSmallCard, DefaultWithImage, VariantButton,
|
85
|
+
}
|
87
86
|
|
88
87
|
export default StorybookEntry
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { ArrowForwardRounded as ArrowForwardRoundedIcon } from '@mui/icons-material'
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
alpha, CardActions, CardContent, CardMedia, IconButton, Typography, useTheme,
|
4
|
+
} from '@mui/material'
|
3
5
|
import { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'
|
4
6
|
import { useIsMobile } from '@xyo-network/react-shared'
|
5
7
|
import type { ReactNode } from 'react'
|
@@ -51,9 +53,7 @@ export const SimpleCard: React.FC<SimpleCardProps> = ({
|
|
51
53
|
<CardEx
|
52
54
|
elevation={raised ? 3 : 0}
|
53
55
|
sx={{
|
54
|
-
'&:hover': {
|
55
|
-
cursor: interactionVariant == 'button' ? 'pointer' : null,
|
56
|
-
},
|
56
|
+
'&:hover': { cursor: interactionVariant == 'button' ? 'pointer' : null },
|
57
57
|
'backgroundColor': alpha(theme.palette.primary.light, 0.05),
|
58
58
|
...sx,
|
59
59
|
}}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable @stylistic/max-len */
|
1
2
|
import type { Meta, StoryFn } from '@storybook/react'
|
2
3
|
import React from 'react'
|
3
4
|
import { BrowserRouter } from 'react-router-dom'
|
@@ -8,11 +9,7 @@ import { SimpleCardGrid } from './SimpleCardGrid.tsx'
|
|
8
9
|
const StorybookEntry = {
|
9
10
|
argTypes: {},
|
10
11
|
component: SimpleCardGrid,
|
11
|
-
parameters: {
|
12
|
-
docs: {
|
13
|
-
page: null,
|
14
|
-
},
|
15
|
-
},
|
12
|
+
parameters: { docs: { page: null } },
|
16
13
|
title: 'shared/SimpleCardGrid',
|
17
14
|
} as Meta<typeof SimpleCardGrid>
|
18
15
|
|
@@ -14,7 +14,10 @@ export const SimpleCardGrid: React.FC<SimpleCardGridProps> = ({ cards, ...props
|
|
14
14
|
<Grid container {...props}>
|
15
15
|
{cards?.map((card, index) => (
|
16
16
|
<Grid item key={index} xs={12} sm={6} md={4}>
|
17
|
-
<SimpleCard
|
17
|
+
<SimpleCard
|
18
|
+
{...card}
|
19
|
+
sx={{ flexDirection: 'column', height: '100%' }}
|
20
|
+
/>
|
18
21
|
</Grid>
|
19
22
|
))}
|
20
23
|
</Grid>
|