@xyo-network/react-shared 2.25.76 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/CardEx.d.ts +2 -11
- package/dist/esm/components/CardEx.js +32 -3
- package/dist/esm/components/CardEx.js.map +1 -1
- package/dist/esm/components/PageCard.d.ts +3 -2
- package/dist/esm/components/PageCard.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CardEx.tsx +52 -15
- package/src/components/PageCard.tsx +3 -3
- package/src/components/index.ts +1 -0
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { CardProps } from '@mui/material';
|
|
2
2
|
import { CSSProperties } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export declare type CardExProps = CardProps & CSSProperties & {
|
|
4
4
|
gradient?: 'border' | 'background';
|
|
5
|
-
|
|
6
|
-
flexDirection?: CSSProperties['flexDirection'];
|
|
7
|
-
flexGrow?: CSSProperties['flexGrow'];
|
|
8
|
-
alignItems?: CSSProperties['alignItems'];
|
|
9
|
-
alignContent?: CSSProperties['alignContent'];
|
|
10
|
-
alignSelf?: CSSProperties['alignSelf'];
|
|
11
|
-
justifyItems?: CSSProperties['justifyItems'];
|
|
12
|
-
justifyContent?: CSSProperties['justifyContent'];
|
|
13
|
-
justifySelf?: CSSProperties['justifySelf'];
|
|
14
|
-
}
|
|
5
|
+
};
|
|
15
6
|
export declare const CardEx: React.FC<CardExProps>;
|
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Card } from '@mui/material';
|
|
2
|
+
import { Card, useTheme } from '@mui/material';
|
|
3
3
|
import { useGradientStyles } from '../hooks';
|
|
4
|
-
export const CardEx = ({ display, flexDirection = 'column', flexGrow, alignItems = 'stretch', alignContent, alignSelf, justifyItems = 'flex-start', justifyContent = 'flex-start', justifySelf, style, gradient, ...props }) => {
|
|
4
|
+
export const CardEx = ({ display = 'flex', flexDirection = 'column', flexGrow, alignItems = 'stretch', alignContent, alignSelf, justifyItems = 'flex-start', justifyContent = 'flex-start', justifySelf, style, gap, rowGap, columnGap, padding, paddingLeft, paddingRight, paddingTop, paddingBottom, margin, marginTop, marginBottom, marginLeft, marginRight, gradient, ...props }) => {
|
|
5
5
|
const { styles } = useGradientStyles();
|
|
6
|
+
const theme = useTheme();
|
|
7
|
+
const applySpacing = (value) => {
|
|
8
|
+
return value === undefined ? value : typeof value === 'string' ? value : theme.spacing(value);
|
|
9
|
+
};
|
|
6
10
|
const gradientStyle = gradient === 'border' ? styles.border : gradient === 'background' ? styles.background : {};
|
|
7
|
-
return (_jsx(Card, { style: {
|
|
11
|
+
return (_jsx(Card, { style: {
|
|
12
|
+
...gradientStyle,
|
|
13
|
+
alignContent,
|
|
14
|
+
alignItems,
|
|
15
|
+
alignSelf,
|
|
16
|
+
columnGap: applySpacing(columnGap),
|
|
17
|
+
display,
|
|
18
|
+
flexDirection,
|
|
19
|
+
flexGrow,
|
|
20
|
+
gap: applySpacing(gap),
|
|
21
|
+
justifyContent,
|
|
22
|
+
justifyItems,
|
|
23
|
+
justifySelf,
|
|
24
|
+
margin: applySpacing(margin),
|
|
25
|
+
marginBottom: applySpacing(marginBottom),
|
|
26
|
+
marginLeft: applySpacing(marginLeft),
|
|
27
|
+
marginRight: applySpacing(marginRight),
|
|
28
|
+
marginTop: applySpacing(marginTop),
|
|
29
|
+
padding: applySpacing(padding),
|
|
30
|
+
paddingBottom: applySpacing(paddingBottom),
|
|
31
|
+
paddingLeft: applySpacing(paddingLeft),
|
|
32
|
+
paddingRight: applySpacing(paddingRight),
|
|
33
|
+
paddingTop: applySpacing(paddingTop),
|
|
34
|
+
rowGap: applySpacing(rowGap),
|
|
35
|
+
...style,
|
|
36
|
+
}, ...props }));
|
|
8
37
|
};
|
|
9
38
|
//# sourceMappingURL=CardEx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardEx.js","sourceRoot":"","sources":["../../../src/components/CardEx.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAa,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"CardEx.js","sourceRoot":"","sources":["../../../src/components/CardEx.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAa,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAO5C,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAC5C,OAAO,GAAG,MAAM,EAChB,aAAa,GAAG,QAAQ,EACxB,QAAQ,EACR,UAAU,GAAG,SAAS,EACtB,YAAY,EACZ,SAAS,EACT,YAAY,GAAG,YAAY,EAC3B,cAAc,GAAG,YAAY,EAC7B,WAAW,EACX,KAAK,EACL,GAAG,EACH,MAAM,EACN,SAAS,EACT,OAAO,EACP,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,MAAM,EACN,SAAS,EACT,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IACtC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,YAAY,GAAG,CAAC,KAAuB,EAAE,EAAE;QAC/C,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC/F,CAAC,CAAA;IACD,MAAM,aAAa,GAAG,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAA;IAChH,OAAO,CACL,KAAC,IAAI,IACH,KAAK,EAAE;YACL,GAAG,aAAa;YAChB,YAAY;YACZ,UAAU;YACV,SAAS;YACT,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC;YAClC,OAAO;YACP,aAAa;YACb,QAAQ;YACR,GAAG,EAAE,YAAY,CAAC,GAAG,CAAC;YACtB,cAAc;YACd,YAAY;YACZ,WAAW;YACX,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC;YAC5B,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC;YACxC,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC;YACpC,WAAW,EAAE,YAAY,CAAC,WAAW,CAAC;YACtC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC;YAClC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC;YAC9B,aAAa,EAAE,YAAY,CAAC,aAAa,CAAC;YAC1C,WAAW,EAAE,YAAY,CAAC,WAAW,CAAC;YACtC,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC;YACxC,UAAU,EAAE,YAAY,CAAC,UAAU,CAAC;YACpC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC;YAC5B,GAAG,KAAK;SACT,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CardHeaderProps,
|
|
1
|
+
import { CardHeaderProps, SvgIconProps } from '@mui/material';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
|
|
3
|
+
import { CardExProps } from './CardEx';
|
|
4
|
+
export interface PageCardProps extends CardExProps {
|
|
4
5
|
icon?: (props?: SvgIconProps) => ReactNode;
|
|
5
6
|
onRefresh?: () => void;
|
|
6
7
|
subheader?: CardHeaderProps['subheader'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageCard.js","sourceRoot":"","sources":["../../../src/components/PageCard.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"PageCard.js","sourceRoot":"","sources":["../../../src/components/PageCard.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,UAAU,EAAmB,UAAU,EAAgB,MAAM,eAAe,CAAA;AAGrF,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAQ7C,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACpH,OAAO,CACL,MAAC,MAAM,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,KAAM,KAAK,aACzD,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,EACzG,KAAC,UAAU,IACT,KAAK,EACH,KAAC,YAAY,IAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,MAAM,YACvC,KAAK,GACO,EAEjB,SAAS,EAAE,SAAS,EACpB,MAAM,EACJ,4BACG,SAAS,CAAC,CAAC,CAAC,CACX,KAAC,UAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE,YACtC,KAAC,WAAW,KAAG,GACJ,CACd,CAAC,CAAC,CAAC,IAAI,GACP,GAEL,EACD,QAAQ,IACF,CACV,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
import { Card, CardProps } from '@mui/material'
|
|
1
|
+
import { Card, CardProps, useTheme } from '@mui/material'
|
|
2
2
|
import { CSSProperties } from 'react'
|
|
3
3
|
|
|
4
4
|
import { useGradientStyles } from '../hooks'
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
flexGrow?: CSSProperties['flexGrow']
|
|
11
|
-
alignItems?: CSSProperties['alignItems']
|
|
12
|
-
alignContent?: CSSProperties['alignContent']
|
|
13
|
-
alignSelf?: CSSProperties['alignSelf']
|
|
14
|
-
justifyItems?: CSSProperties['justifyItems']
|
|
15
|
-
justifyContent?: CSSProperties['justifyContent']
|
|
16
|
-
justifySelf?: CSSProperties['justifySelf']
|
|
17
|
-
}
|
|
6
|
+
export type CardExProps = CardProps &
|
|
7
|
+
CSSProperties & {
|
|
8
|
+
gradient?: 'border' | 'background'
|
|
9
|
+
}
|
|
18
10
|
|
|
19
11
|
export const CardEx: React.FC<CardExProps> = ({
|
|
20
|
-
display,
|
|
12
|
+
display = 'flex',
|
|
21
13
|
flexDirection = 'column',
|
|
22
14
|
flexGrow,
|
|
23
15
|
alignItems = 'stretch',
|
|
@@ -27,12 +19,57 @@ export const CardEx: React.FC<CardExProps> = ({
|
|
|
27
19
|
justifyContent = 'flex-start',
|
|
28
20
|
justifySelf,
|
|
29
21
|
style,
|
|
22
|
+
gap,
|
|
23
|
+
rowGap,
|
|
24
|
+
columnGap,
|
|
25
|
+
padding,
|
|
26
|
+
paddingLeft,
|
|
27
|
+
paddingRight,
|
|
28
|
+
paddingTop,
|
|
29
|
+
paddingBottom,
|
|
30
|
+
margin,
|
|
31
|
+
marginTop,
|
|
32
|
+
marginBottom,
|
|
33
|
+
marginLeft,
|
|
34
|
+
marginRight,
|
|
30
35
|
gradient,
|
|
31
36
|
...props
|
|
32
37
|
}) => {
|
|
33
38
|
const { styles } = useGradientStyles()
|
|
39
|
+
const theme = useTheme()
|
|
40
|
+
const applySpacing = (value?: number | string) => {
|
|
41
|
+
return value === undefined ? value : typeof value === 'string' ? value : theme.spacing(value)
|
|
42
|
+
}
|
|
34
43
|
const gradientStyle = gradient === 'border' ? styles.border : gradient === 'background' ? styles.background : {}
|
|
35
44
|
return (
|
|
36
|
-
<Card
|
|
45
|
+
<Card
|
|
46
|
+
style={{
|
|
47
|
+
...gradientStyle,
|
|
48
|
+
alignContent,
|
|
49
|
+
alignItems,
|
|
50
|
+
alignSelf,
|
|
51
|
+
columnGap: applySpacing(columnGap),
|
|
52
|
+
display,
|
|
53
|
+
flexDirection,
|
|
54
|
+
flexGrow,
|
|
55
|
+
gap: applySpacing(gap),
|
|
56
|
+
justifyContent,
|
|
57
|
+
justifyItems,
|
|
58
|
+
justifySelf,
|
|
59
|
+
margin: applySpacing(margin),
|
|
60
|
+
marginBottom: applySpacing(marginBottom),
|
|
61
|
+
marginLeft: applySpacing(marginLeft),
|
|
62
|
+
marginRight: applySpacing(marginRight),
|
|
63
|
+
marginTop: applySpacing(marginTop),
|
|
64
|
+
padding: applySpacing(padding),
|
|
65
|
+
paddingBottom: applySpacing(paddingBottom),
|
|
66
|
+
paddingLeft: applySpacing(paddingLeft),
|
|
67
|
+
paddingRight: applySpacing(paddingRight),
|
|
68
|
+
paddingTop: applySpacing(paddingTop),
|
|
69
|
+
rowGap: applySpacing(rowGap),
|
|
70
|
+
...style,
|
|
71
|
+
}}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
37
74
|
)
|
|
38
75
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import RefreshIcon from '@mui/icons-material/Refresh'
|
|
2
|
-
import { CardHeader, CardHeaderProps,
|
|
2
|
+
import { CardHeader, CardHeaderProps, IconButton, SvgIconProps } from '@mui/material'
|
|
3
3
|
import { ReactNode } from 'react'
|
|
4
4
|
|
|
5
|
-
import { CardEx } from './CardEx'
|
|
5
|
+
import { CardEx, CardExProps } from './CardEx'
|
|
6
6
|
import { TypographyEx } from './TypographyEx'
|
|
7
7
|
|
|
8
|
-
export interface PageCardProps extends
|
|
8
|
+
export interface PageCardProps extends CardExProps {
|
|
9
9
|
icon?: (props?: SvgIconProps) => ReactNode
|
|
10
10
|
onRefresh?: () => void
|
|
11
11
|
subheader?: CardHeaderProps['subheader']
|