@xyo-network/react-card 2.78.0 → 2.78.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,248 @@
1
- "use strict";var F=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var oo=(e,t)=>{for(var r in t)F(e,r,{get:t[r],enumerable:!0})},eo=(e,t,r,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of V(t))!j.call(e,n)&&n!==r&&F(e,n,{get:()=>t[n],enumerable:!(d=$(t,n))||d.enumerable});return e};var to=e=>eo(F({},"__esModule",{value:!0}),e);var so={};oo(so,{CardContentEx:()=>no,CardContentExWithRef:()=>I,CardEx:()=>b,CardExWithRef:()=>M,FullWidthCard:()=>ao,PageCard:()=>io,SimpleCard:()=>lo});module.exports=to(so);var E=require("@mui/material"),S=require("@xyo-network/react-shared"),P=require("react"),G=require("react/jsx-runtime"),ro=(0,E.styled)(E.CardContent,{name:"CardContentEx",shouldForwardProp:e=>!["variant","removePadding"].includes(e),slot:"Root"})(({variant:e,removePadding:t})=>({...(e==="scrollable"||t)&&{":last-child":{paddingBottom:0},overflow:"auto",paddingTop:0,...t&&{padding:0}}})),I=(0,P.forwardRef)(({scrollToTop:e=0,refreshRef:t=0,...r},d)=>{let n=(0,S.useShareForwardedRef)(d,t);return(0,P.useEffect)(()=>{n&&e&&n.current?.scroll({behavior:"smooth",top:0})},[n,e]),(0,G.jsx)(ro,{ref:n,...r})});I.displayName="CardContentEx";var no=I;var W=require("@mui/material"),H=require("@xyo-network/react-shared"),z=require("react"),L=require("react/jsx-runtime"),M=(0,z.forwardRef)(({style:e,gradient:t,...r},d)=>{let{styles:n}=(0,H.useGradientStyles)(),p=t==="border"?n.border:t==="background"?n.background:{};return(0,L.jsx)(W.Card,{style:{...p,...e},ref:d,...r})});M.displayName="CardEx";var b=M;var k=require("@mui/icons-material"),o=require("@mui/material"),D=require("@xylabs/react-flexbox"),Z=require("@xyo-network/react-shared"),X=require("react"),Y=require("react-router-dom"),a=require("react/jsx-runtime"),ao=({cardIsButton:e,desc:t,href:r,media:d,name:n,small:p,to:s,...x})=>{let w=(0,o.useTheme)(),[g,R]=(0,X.useState)(!1),C=(0,Y.useNavigate)(),f=(0,Z.useIsMobile)(),h=c=>{C(c||"/404")},u=c=>{c?window.open(c):C("/404")};return(0,a.jsxs)(o.Card,{elevation:g?3:0,style:{height:"100%",width:"100%"},...x,sx:{"&:hover":{cursor:"pointer"},backgroundColor:(0,o.alpha)(w.palette.primary.light,.05)},onMouseEnter:()=>f?null:e?R(!0):null,onMouseLeave:()=>f?null:e?R(!1):null,onClick:()=>e?r?u(r):s?h(s):C("/404"):null,children:[d?(0,a.jsx)(o.CardMedia,{component:"img",height:"100",image:d,alt:""}):null,(0,a.jsx)(o.CardContent,{children:(0,a.jsxs)(o.Grid,{container:!0,alignItems:"center",paddingY:2,paddingX:2,children:[(0,a.jsx)(o.Grid,{item:!0,xs:12,md:6,children:typeof n=="string"?(0,a.jsx)(o.Typography,{fontWeight:700,variant:"h2",textAlign:"left",paddingBottom:1,children:n}):n}),(0,a.jsx)(o.Grid,{item:!0,xs:12,md:5,children:(0,a.jsx)(o.Typography,{variant:"body1",fontWeight:400,textAlign:"left",children:t})}),(0,a.jsx)(o.Grid,{item:!0,xs:1,display:f?"none":"flex",justifyContent:"center",children:(0,a.jsx)(o.Zoom,{in:g,children:(0,a.jsx)(o.IconButton,{color:"primary",size:p?"small":"medium",onClick:()=>r?u(r):s?h(s):C("/404"),disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0,children:(0,a.jsx)(k.ArrowForwardRounded,{fontSize:p?"small":"medium"})})})})]})}),(0,a.jsx)(o.CardActions,{sx:{display:{md:f?"flex":"none"}},children:(0,a.jsx)(D.FlexGrowCol,{alignItems:"flex-end",children:(0,a.jsx)(o.IconButton,{color:"primary",size:p?"small":"medium",onClick:()=>r?u(r):s?h(s):C("/404"),disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0,children:(0,a.jsx)(k.ArrowForwardRounded,{fontSize:p?"small":"medium"})})})})]})};var q=require("@mui/icons-material"),v=require("@mui/material"),A=require("@xyo-network/react-shared"),J=require("react");var m=require("react/jsx-runtime"),K=(0,J.forwardRef)(({subheader:e,title:t,onRefresh:r,children:d,action:n,style:p,...s},x)=>(0,m.jsxs)(b,{style:{backgroundColor:"transparent",position:"relative",...p},elevation:0,ref:x,...s,children:[(0,m.jsx)(v.CardHeader,{title:(0,m.jsx)(A.TypographyEx,{variant:"h5",gutterBottom:!0,children:t}),subheader:(0,m.jsx)(A.TypographyEx,{variant:"subtitle1",children:e}),action:n??(0,m.jsx)(m.Fragment,{children:r?(0,m.jsx)(v.IconButton,{onClick:()=>r?.(),children:(0,m.jsx)(q.Refresh,{})}):null})}),d]}));K.displayName="PageCard";var io=K;var O=require("@mui/icons-material"),i=require("@mui/material"),T=require("@xylabs/react-flexbox"),Q=require("@xyo-network/react-shared"),U=require("react"),_=require("react-router-dom");var l=require("react/jsx-runtime"),lo=({desc:e,iconImage:t,interactionVariant:r="card",headline:d,href:n,media:p,small:s,subtitle:x,sx:w,to:g,...R})=>{let C=(0,i.useTheme)(),[f,h]=(0,U.useState)(!1),u=(0,_.useNavigate)(),c=(0,Q.useIsMobile)(),B=y=>{u(y||"/404")},N=y=>{y?window.open(y):u("/404")};return(0,l.jsxs)(b,{elevation:f?3:0,sx:{"&:hover":{cursor:r=="button"?"pointer":null},backgroundColor:(0,i.alpha)(C.palette.primary.light,.05),...w},onMouseEnter:()=>c?null:r=="button"?h(!0):null,onMouseLeave:()=>c?null:r=="button"?h(!1):null,onClick:()=>r=="button"?n?N(n):g?B(g):u("/404"):null,...R,children:[p?(0,l.jsx)(i.CardMedia,{component:"img",height:"100",image:p,alt:""}):null,(0,l.jsx)(i.CardContent,{sx:{height:"100%"},children:(0,l.jsxs)(T.FlexCol,{width:"100%",alignItems:"flex-start",children:[t?(0,l.jsx)("img",{src:t,height:"40px",style:{paddingBottom:"8px"}}):null,typeof d=="string"?(0,l.jsx)(i.Typography,{variant:s?"body1":"h6",textAlign:"left",gutterBottom:!0,children:d}):d,x?(0,l.jsx)(i.Typography,{variant:"subtitle2",textAlign:"left",gutterBottom:!0,children:x}):null,(0,l.jsx)(i.Typography,{variant:s?"caption":"body1",textAlign:"left",gutterBottom:!0,children:e})]})}),r=="button"?(0,l.jsx)(i.CardActions,{children:(0,l.jsx)(T.FlexGrowCol,{alignItems:"flex-end",children:(0,l.jsx)(i.IconButton,{color:f?"secondary":"primary",size:s?"small":"medium",onClick:()=>n?N(n):g?B(g):u("/404"),disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0,children:(0,l.jsx)(O.ArrowForwardRounded,{fontSize:s?"small":"medium"})})})}):null]})};
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ CardContentEx: () => CardContentEx,
24
+ CardContentExWithRef: () => CardContentExWithRef,
25
+ CardEx: () => CardEx,
26
+ CardExWithRef: () => CardExWithRef,
27
+ FullWidthCard: () => FullWidthCard,
28
+ PageCard: () => PageCard,
29
+ SimpleCard: () => SimpleCard
30
+ });
31
+ module.exports = __toCommonJS(src_exports);
32
+
33
+ // src/components/CardContentEx.tsx
34
+ var import_material = require("@mui/material");
35
+ var import_react_shared = require("@xyo-network/react-shared");
36
+ var import_react = require("react");
37
+ var import_jsx_runtime = require("react/jsx-runtime");
38
+ var CardContentExRoot = (0, import_material.styled)(import_material.CardContent, {
39
+ name: "CardContentEx",
40
+ shouldForwardProp: (prop) => !["variant", "removePadding"].includes(prop),
41
+ slot: "Root"
42
+ })(({ variant, removePadding }) => ({
43
+ ...(variant === "scrollable" || removePadding) && {
44
+ [":last-child"]: {
45
+ paddingBottom: 0
46
+ },
47
+ overflow: "auto",
48
+ paddingTop: 0,
49
+ ...removePadding && { padding: 0 }
50
+ }
51
+ }));
52
+ var CardContentExWithRef = (0, import_react.forwardRef)(({ scrollToTop = 0, refreshRef = 0, ...props }, ref) => {
53
+ const sharedRef = (0, import_react_shared.useShareForwardedRef)(ref, refreshRef);
54
+ (0, import_react.useEffect)(() => {
55
+ if (sharedRef && scrollToTop) {
56
+ sharedRef.current?.scroll({ behavior: "smooth", top: 0 });
57
+ }
58
+ }, [sharedRef, scrollToTop]);
59
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardContentExRoot, { ref: sharedRef, ...props });
60
+ });
61
+ CardContentExWithRef.displayName = "CardContentEx";
62
+ var CardContentEx = CardContentExWithRef;
63
+
64
+ // src/components/CardEx.tsx
65
+ var import_material2 = require("@mui/material");
66
+ var import_react_shared2 = require("@xyo-network/react-shared");
67
+ var import_react2 = require("react");
68
+ var import_jsx_runtime2 = require("react/jsx-runtime");
69
+ var CardExWithRef = (0, import_react2.forwardRef)(({ style, gradient, ...props }, ref) => {
70
+ const { styles } = (0, import_react_shared2.useGradientStyles)();
71
+ const gradientStyle = gradient === "border" ? styles.border : gradient === "background" ? styles.background : {};
72
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
73
+ import_material2.Card,
74
+ {
75
+ style: {
76
+ ...gradientStyle,
77
+ ...style
78
+ },
79
+ ref,
80
+ ...props
81
+ }
82
+ );
83
+ });
84
+ CardExWithRef.displayName = "CardEx";
85
+ var CardEx = CardExWithRef;
86
+
87
+ // src/components/FullWidthCard/FullWidthCard.tsx
88
+ var import_icons_material = require("@mui/icons-material");
89
+ var import_material3 = require("@mui/material");
90
+ var import_react_flexbox = require("@xylabs/react-flexbox");
91
+ var import_react_shared3 = require("@xyo-network/react-shared");
92
+ var import_react3 = require("react");
93
+ var import_react_router_dom = require("react-router-dom");
94
+ var import_jsx_runtime3 = require("react/jsx-runtime");
95
+ var FullWidthCard = ({ cardIsButton, desc, href, media, name, small, to, ...props }) => {
96
+ const theme = (0, import_material3.useTheme)();
97
+ const [raised, setRaised] = (0, import_react3.useState)(false);
98
+ const navigate = (0, import_react_router_dom.useNavigate)();
99
+ const isMobile = (0, import_react_shared3.useIsMobile)();
100
+ const localRouteChange = (to2) => {
101
+ to2 ? navigate(to2) : navigate("/404");
102
+ };
103
+ const externalRouteChange = (href2) => {
104
+ href2 ? window.open(href2) : navigate("/404");
105
+ };
106
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
107
+ import_material3.Card,
108
+ {
109
+ elevation: raised ? 3 : 0,
110
+ style: { height: "100%", width: "100%" },
111
+ ...props,
112
+ sx: {
113
+ "&:hover": {
114
+ cursor: "pointer"
115
+ },
116
+ backgroundColor: (0, import_material3.alpha)(theme.palette.primary.light, 0.05)
117
+ },
118
+ onMouseEnter: () => isMobile ? null : cardIsButton ? setRaised(true) : null,
119
+ onMouseLeave: () => isMobile ? null : cardIsButton ? setRaised(false) : null,
120
+ onClick: () => cardIsButton ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null,
121
+ children: [
122
+ media ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.CardMedia, { component: "img", height: "100", image: media, alt: "" }) : null,
123
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.CardContent, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_material3.Grid, { container: true, alignItems: "center", paddingY: 2, paddingX: 2, children: [
124
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Grid, { item: true, xs: 12, md: 6, children: typeof name === "string" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Typography, { fontWeight: 700, variant: "h2", textAlign: "left", paddingBottom: 1, children: name }) : name }),
125
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Grid, { item: true, xs: 12, md: 5, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Typography, { variant: "body1", fontWeight: 400, textAlign: "left", children: desc }) }),
126
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Grid, { item: true, xs: 1, display: isMobile ? "none" : "flex", justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Zoom, { in: raised, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
127
+ import_material3.IconButton,
128
+ {
129
+ color: "primary",
130
+ size: small ? "small" : "medium",
131
+ onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
132
+ disableFocusRipple: true,
133
+ disableRipple: true,
134
+ disableTouchRipple: true,
135
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material.ArrowForwardRounded, { fontSize: small ? "small" : "medium" })
136
+ }
137
+ ) }) })
138
+ ] }) }),
139
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.CardActions, { sx: { display: { md: isMobile ? "flex" : "none" } }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_flexbox.FlexGrowCol, { alignItems: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
140
+ import_material3.IconButton,
141
+ {
142
+ color: "primary",
143
+ size: small ? "small" : "medium",
144
+ onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
145
+ disableFocusRipple: true,
146
+ disableRipple: true,
147
+ disableTouchRipple: true,
148
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material.ArrowForwardRounded, { fontSize: small ? "small" : "medium" })
149
+ }
150
+ ) }) })
151
+ ]
152
+ }
153
+ );
154
+ };
155
+
156
+ // src/components/PageCard.tsx
157
+ var import_icons_material2 = require("@mui/icons-material");
158
+ var import_material4 = require("@mui/material");
159
+ var import_react_shared4 = require("@xyo-network/react-shared");
160
+ var import_react4 = require("react");
161
+ var import_jsx_runtime4 = require("react/jsx-runtime");
162
+ var PageCardWithRef = (0, import_react4.forwardRef)(({ subheader, title, onRefresh, children, action, style, ...props }, ref) => {
163
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(CardEx, { style: { backgroundColor: "transparent", position: "relative", ...style }, elevation: 0, ref, ...props, children: [
164
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
165
+ import_material4.CardHeader,
166
+ {
167
+ title: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_shared4.TypographyEx, { variant: "h5", gutterBottom: true, children: title }),
168
+ subheader: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_shared4.TypographyEx, { variant: "subtitle1", children: subheader }),
169
+ action: action ?? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: onRefresh ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.IconButton, { onClick: () => onRefresh?.(), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons_material2.Refresh, {}) }) : null })
170
+ }
171
+ ),
172
+ children
173
+ ] });
174
+ });
175
+ PageCardWithRef.displayName = "PageCard";
176
+ var PageCard = PageCardWithRef;
177
+
178
+ // src/components/SimpleCard/SimpleCard.tsx
179
+ var import_icons_material3 = require("@mui/icons-material");
180
+ var import_material5 = require("@mui/material");
181
+ var import_react_flexbox2 = require("@xylabs/react-flexbox");
182
+ var import_react_shared5 = require("@xyo-network/react-shared");
183
+ var import_react5 = require("react");
184
+ var import_react_router_dom2 = require("react-router-dom");
185
+ var import_jsx_runtime5 = require("react/jsx-runtime");
186
+ var SimpleCard = ({
187
+ desc,
188
+ iconImage,
189
+ interactionVariant = "card",
190
+ headline,
191
+ href,
192
+ media,
193
+ small,
194
+ subtitle,
195
+ sx,
196
+ to,
197
+ ...props
198
+ }) => {
199
+ const theme = (0, import_material5.useTheme)();
200
+ const [raised, setRaised] = (0, import_react5.useState)(false);
201
+ const navigate = (0, import_react_router_dom2.useNavigate)();
202
+ const isMobile = (0, import_react_shared5.useIsMobile)();
203
+ const localRouteChange = (to2) => {
204
+ to2 ? navigate(to2) : navigate("/404");
205
+ };
206
+ const externalRouteChange = (href2) => {
207
+ href2 ? window.open(href2) : navigate("/404");
208
+ };
209
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
210
+ CardEx,
211
+ {
212
+ elevation: raised ? 3 : 0,
213
+ sx: {
214
+ "&:hover": {
215
+ cursor: interactionVariant == "button" ? "pointer" : null
216
+ },
217
+ backgroundColor: (0, import_material5.alpha)(theme.palette.primary.light, 0.05),
218
+ ...sx
219
+ },
220
+ onMouseEnter: () => isMobile ? null : interactionVariant == "button" ? setRaised(true) : null,
221
+ onMouseLeave: () => isMobile ? null : interactionVariant == "button" ? setRaised(false) : null,
222
+ onClick: () => interactionVariant == "button" ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null,
223
+ ...props,
224
+ children: [
225
+ media ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.CardMedia, { component: "img", height: "100", image: media, alt: "" }) : null,
226
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.CardContent, { sx: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_flexbox2.FlexCol, { width: "100%", alignItems: "flex-start", children: [
227
+ iconImage ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { src: iconImage, height: "40px", style: { paddingBottom: "8px" } }) : null,
228
+ typeof headline === "string" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.Typography, { variant: small ? "body1" : "h6", textAlign: "left", gutterBottom: true, children: headline }) : headline,
229
+ subtitle ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.Typography, { variant: "subtitle2", textAlign: "left", gutterBottom: true, children: subtitle }) : null,
230
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.Typography, { variant: small ? "caption" : "body1", textAlign: "left", gutterBottom: true, children: desc })
231
+ ] }) }),
232
+ interactionVariant == "button" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.CardActions, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_flexbox2.FlexGrowCol, { alignItems: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
233
+ import_material5.IconButton,
234
+ {
235
+ color: raised ? "secondary" : "primary",
236
+ size: small ? "small" : "medium",
237
+ onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
238
+ disableFocusRipple: true,
239
+ disableRipple: true,
240
+ disableTouchRipple: true,
241
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_icons_material3.ArrowForwardRounded, { fontSize: small ? "small" : "medium" })
242
+ }
243
+ ) }) }) : null
244
+ ]
245
+ }
246
+ );
247
+ };
2
248
  //# sourceMappingURL=index.cjs.map
@@ -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":"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,MAAoB,UAAO,cAAa,CAC5C,KAAM,gBACN,kBAAoBC,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,KAAuB,cAAsD,CAAC,CAAE,YAAAC,EAAc,EAAG,WAAAC,EAAa,EAAG,GAAGC,CAAM,EAAGC,IAAQ,CAChJ,IAAMC,KAAY,wBAAqCD,EAAKF,CAAU,EAEtE,sBAAU,IAAM,CACVG,GAAaJ,GACfI,EAAU,SAAS,OAAO,CAAE,SAAU,SAAU,IAAK,CAAE,CAAC,CAE5D,EAAG,CAACA,EAAWJ,CAAW,CAAC,KAEpB,OAACL,GAAA,CAAkB,IAAKS,EAAY,GAAGF,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,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","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
+ {"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,MACf,eAAe;AAAA,IACjB;AAAA,IACA,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAI,iBAAiB,EAAE,SAAS,EAAE;AAAA,EACpC;AACF,EAAE;AASK,IAAM,2BAAuB,yBAAsD,CAAC,EAAE,cAAc,GAAG,aAAa,GAAG,GAAG,MAAM,GAAG,QAAQ;AAChJ,QAAM,gBAAY,0CAAqC,KAAK,UAAU;AAEtE,8BAAU,MAAM;AACd,QAAI,aAAa,aAAa;AAC5B,gBAAU,SAAS,OAAO,EAAE,UAAU,UAAU,KAAK,EAAE,CAAC;AAAA,IAC1D;AAAA,EACF,GAAG,CAAC,WAAW,WAAW,CAAC;AAE3B,SAAO,4CAAC,qBAAkB,KAAK,WAAY,GAAG,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QAAO,YAAW,cAC9B;AAAA,sBACC,6CAAC,SAAI,KAAK,WAAW,QAAO,QAAO,OAAO,EAAE,eAAe,MAAM,GAAG,IACpE;AAAA,UACD,OAAO,aAAa,WACnB,6CAAC,+BAAW,SAAS,QAAQ,UAAU,MAAM,WAAU,QAAO,cAAY,MACvE,oBACH,IACA;AAAA,UACD,WACC,6CAAC,+BAAW,SAAQ,aAAY,WAAU,QAAO,cAAY,MAC1D,oBACH,IACA;AAAA,UACF,6CAAC,+BAAW,SAAS,QAAQ,YAAY,SAAS,WAAU,QAAO,cAAY,MAC5E,gBACH;AAAA,WACF,GACF;AAAA,QACC,sBAAsB,WACrB,6CAAC,gCACC,uDAAC,qCAAY,YAAW,YACtB;AAAA,UAAC;AAAA;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,uDAAC,uBAAAC,qBAAA,EAAwB,UAAU,QAAQ,UAAU,UAAU;AAAA;AAAA,QACjE,GACF,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,2 +1,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},i)=>{let e=W(i,r);return z(()=>{e&&t&&e.current?.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},i)=>{let{styles:e}=X(),d=r==="border"?e.border:r==="background"?e.background:{};return q(Z,{style:{...d,...t},ref:i,...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 n,jsxs as k}from"react/jsx-runtime";var Yo=({cardIsButton:t,desc:r,href:o,media:i,name:e,small:d,to:a,...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):a?g(a):p("/404"):null,children:[i?n(U,{component:"img",height:"100",image:i,alt:""}):null,n(Q,{children:k(b,{container:!0,alignItems:"center",paddingY:2,paddingX:2,children:[n(b,{item:!0,xs:12,md:6,children:typeof e=="string"?n(M,{fontWeight:700,variant:"h2",textAlign:"left",paddingBottom:1,children:e}):e}),n(b,{item:!0,xs:12,md:5,children:n(M,{variant:"body1",fontWeight:400,textAlign:"left",children:r})}),n(b,{item:!0,xs:1,display:C?"none":"flex",justifyContent:"center",children:n($,{in:u,children:n(I,{color:"primary",size:d?"small":"medium",onClick:()=>o?s(o):a?g(a):p("/404"),disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0,children:n(F,{fontSize:d?"small":"medium"})})})})]})}),n(O,{sx:{display:{md:C?"flex":"none"}},children:n(V,{alignItems:"flex-end",children:n(I,{color:"primary",size:d?"small":"medium",onClick:()=>o?s(o):a?g(a):p("/404"),disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0,children:n(F,{fontSize:d?"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:i,action:e,style:d,...a},c)=>lo(y,{style:{backgroundColor:"transparent",position:"relative",...d},elevation:0,ref:c,...a,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?.(),children:f(to,{})}):null})}),i]}));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:i,href:e,media:d,small:a,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:[d?l(Co,{component:"img",height:"100",image:d,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 i=="string"?l(E,{variant:a?"body1":"h6",textAlign:"left",gutterBottom:!0,children:i}):i,c?l(E,{variant:"subtitle2",textAlign:"left",gutterBottom:!0,children:c}):null,l(E,{variant:a?"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:a?"small":"medium",onClick:()=>e?v(e):u?P(u):s("/404"),disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0,children:l(so,{fontSize:a?"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};
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
+ if (sharedRef && scrollToTop) {
24
+ sharedRef.current?.scroll({ behavior: "smooth", top: 0 });
25
+ }
26
+ }, [sharedRef, scrollToTop]);
27
+ return /* @__PURE__ */ jsx(CardContentExRoot, { ref: sharedRef, ...props });
28
+ });
29
+ CardContentExWithRef.displayName = "CardContentEx";
30
+ var CardContentEx = CardContentExWithRef;
31
+
32
+ // src/components/CardEx.tsx
33
+ import { Card } from "@mui/material";
34
+ import { useGradientStyles } from "@xyo-network/react-shared";
35
+ import { forwardRef as forwardRef2 } from "react";
36
+ import { jsx as jsx2 } from "react/jsx-runtime";
37
+ var CardExWithRef = forwardRef2(({ style, gradient, ...props }, ref) => {
38
+ const { styles } = useGradientStyles();
39
+ const gradientStyle = gradient === "border" ? styles.border : gradient === "background" ? styles.background : {};
40
+ return /* @__PURE__ */ jsx2(
41
+ Card,
42
+ {
43
+ style: {
44
+ ...gradientStyle,
45
+ ...style
46
+ },
47
+ ref,
48
+ ...props
49
+ }
50
+ );
51
+ });
52
+ CardExWithRef.displayName = "CardEx";
53
+ var CardEx = CardExWithRef;
54
+
55
+ // src/components/FullWidthCard/FullWidthCard.tsx
56
+ import { ArrowForwardRounded as ArrowForwardRoundedIcon } from "@mui/icons-material";
57
+ import { alpha, Card as Card2, CardActions, CardContent as CardContent2, CardMedia, Grid, IconButton, Typography, useTheme, Zoom } from "@mui/material";
58
+ import { FlexGrowCol } from "@xylabs/react-flexbox";
59
+ import { useIsMobile } from "@xyo-network/react-shared";
60
+ import { useState } from "react";
61
+ import { useNavigate } from "react-router-dom";
62
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
63
+ var FullWidthCard = ({ cardIsButton, desc, href, media, name, small, to, ...props }) => {
64
+ const theme = useTheme();
65
+ const [raised, setRaised] = useState(false);
66
+ const navigate = useNavigate();
67
+ const isMobile = useIsMobile();
68
+ const localRouteChange = (to2) => {
69
+ to2 ? navigate(to2) : navigate("/404");
70
+ };
71
+ const externalRouteChange = (href2) => {
72
+ href2 ? window.open(href2) : navigate("/404");
73
+ };
74
+ return /* @__PURE__ */ jsxs(
75
+ Card2,
76
+ {
77
+ elevation: raised ? 3 : 0,
78
+ style: { height: "100%", width: "100%" },
79
+ ...props,
80
+ sx: {
81
+ "&:hover": {
82
+ cursor: "pointer"
83
+ },
84
+ backgroundColor: alpha(theme.palette.primary.light, 0.05)
85
+ },
86
+ onMouseEnter: () => isMobile ? null : cardIsButton ? setRaised(true) : null,
87
+ onMouseLeave: () => isMobile ? null : cardIsButton ? setRaised(false) : null,
88
+ onClick: () => cardIsButton ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null,
89
+ children: [
90
+ media ? /* @__PURE__ */ jsx3(CardMedia, { component: "img", height: "100", image: media, alt: "" }) : null,
91
+ /* @__PURE__ */ jsx3(CardContent2, { children: /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", paddingY: 2, paddingX: 2, children: [
92
+ /* @__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 }),
93
+ /* @__PURE__ */ jsx3(Grid, { item: true, xs: 12, md: 5, children: /* @__PURE__ */ jsx3(Typography, { variant: "body1", fontWeight: 400, textAlign: "left", children: desc }) }),
94
+ /* @__PURE__ */ jsx3(Grid, { item: true, xs: 1, display: isMobile ? "none" : "flex", justifyContent: "center", children: /* @__PURE__ */ jsx3(Zoom, { in: raised, children: /* @__PURE__ */ jsx3(
95
+ IconButton,
96
+ {
97
+ color: "primary",
98
+ size: small ? "small" : "medium",
99
+ onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
100
+ disableFocusRipple: true,
101
+ disableRipple: true,
102
+ disableTouchRipple: true,
103
+ children: /* @__PURE__ */ jsx3(ArrowForwardRoundedIcon, { fontSize: small ? "small" : "medium" })
104
+ }
105
+ ) }) })
106
+ ] }) }),
107
+ /* @__PURE__ */ jsx3(CardActions, { sx: { display: { md: isMobile ? "flex" : "none" } }, children: /* @__PURE__ */ jsx3(FlexGrowCol, { alignItems: "flex-end", children: /* @__PURE__ */ jsx3(
108
+ IconButton,
109
+ {
110
+ color: "primary",
111
+ size: small ? "small" : "medium",
112
+ onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
113
+ disableFocusRipple: true,
114
+ disableRipple: true,
115
+ disableTouchRipple: true,
116
+ children: /* @__PURE__ */ jsx3(ArrowForwardRoundedIcon, { fontSize: small ? "small" : "medium" })
117
+ }
118
+ ) }) })
119
+ ]
120
+ }
121
+ );
122
+ };
123
+
124
+ // src/components/PageCard.tsx
125
+ import { Refresh as RefreshIcon } from "@mui/icons-material";
126
+ import { CardHeader, IconButton as IconButton2 } from "@mui/material";
127
+ import { TypographyEx } from "@xyo-network/react-shared";
128
+ import { forwardRef as forwardRef3 } from "react";
129
+ import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
130
+ var PageCardWithRef = forwardRef3(({ subheader, title, onRefresh, children, action, style, ...props }, ref) => {
131
+ return /* @__PURE__ */ jsxs2(CardEx, { style: { backgroundColor: "transparent", position: "relative", ...style }, elevation: 0, ref, ...props, children: [
132
+ /* @__PURE__ */ jsx4(
133
+ CardHeader,
134
+ {
135
+ title: /* @__PURE__ */ jsx4(TypographyEx, { variant: "h5", gutterBottom: true, children: title }),
136
+ subheader: /* @__PURE__ */ jsx4(TypographyEx, { variant: "subtitle1", children: subheader }),
137
+ action: action ?? /* @__PURE__ */ jsx4(Fragment, { children: onRefresh ? /* @__PURE__ */ jsx4(IconButton2, { onClick: () => onRefresh?.(), children: /* @__PURE__ */ jsx4(RefreshIcon, {}) }) : null })
138
+ }
139
+ ),
140
+ children
141
+ ] });
142
+ });
143
+ PageCardWithRef.displayName = "PageCard";
144
+ var PageCard = PageCardWithRef;
145
+
146
+ // src/components/SimpleCard/SimpleCard.tsx
147
+ import { ArrowForwardRounded as ArrowForwardRoundedIcon2 } from "@mui/icons-material";
148
+ 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";
149
+ import { FlexCol, FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
150
+ import { useIsMobile as useIsMobile2 } from "@xyo-network/react-shared";
151
+ import { useState as useState2 } from "react";
152
+ import { useNavigate as useNavigate2 } from "react-router-dom";
153
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
154
+ var SimpleCard = ({
155
+ desc,
156
+ iconImage,
157
+ interactionVariant = "card",
158
+ headline,
159
+ href,
160
+ media,
161
+ small,
162
+ subtitle,
163
+ sx,
164
+ to,
165
+ ...props
166
+ }) => {
167
+ const theme = useTheme2();
168
+ const [raised, setRaised] = useState2(false);
169
+ const navigate = useNavigate2();
170
+ const isMobile = useIsMobile2();
171
+ const localRouteChange = (to2) => {
172
+ to2 ? navigate(to2) : navigate("/404");
173
+ };
174
+ const externalRouteChange = (href2) => {
175
+ href2 ? window.open(href2) : navigate("/404");
176
+ };
177
+ return /* @__PURE__ */ jsxs3(
178
+ CardEx,
179
+ {
180
+ elevation: raised ? 3 : 0,
181
+ sx: {
182
+ "&:hover": {
183
+ cursor: interactionVariant == "button" ? "pointer" : null
184
+ },
185
+ backgroundColor: alpha2(theme.palette.primary.light, 0.05),
186
+ ...sx
187
+ },
188
+ onMouseEnter: () => isMobile ? null : interactionVariant == "button" ? setRaised(true) : null,
189
+ onMouseLeave: () => isMobile ? null : interactionVariant == "button" ? setRaised(false) : null,
190
+ onClick: () => interactionVariant == "button" ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null,
191
+ ...props,
192
+ children: [
193
+ media ? /* @__PURE__ */ jsx5(CardMedia2, { component: "img", height: "100", image: media, alt: "" }) : null,
194
+ /* @__PURE__ */ jsx5(CardContent3, { sx: { height: "100%" }, children: /* @__PURE__ */ jsxs3(FlexCol, { width: "100%", alignItems: "flex-start", children: [
195
+ iconImage ? /* @__PURE__ */ jsx5("img", { src: iconImage, height: "40px", style: { paddingBottom: "8px" } }) : null,
196
+ typeof headline === "string" ? /* @__PURE__ */ jsx5(Typography2, { variant: small ? "body1" : "h6", textAlign: "left", gutterBottom: true, children: headline }) : headline,
197
+ subtitle ? /* @__PURE__ */ jsx5(Typography2, { variant: "subtitle2", textAlign: "left", gutterBottom: true, children: subtitle }) : null,
198
+ /* @__PURE__ */ jsx5(Typography2, { variant: small ? "caption" : "body1", textAlign: "left", gutterBottom: true, children: desc })
199
+ ] }) }),
200
+ interactionVariant == "button" ? /* @__PURE__ */ jsx5(CardActions2, { children: /* @__PURE__ */ jsx5(FlexGrowCol2, { alignItems: "flex-end", children: /* @__PURE__ */ jsx5(
201
+ IconButton3,
202
+ {
203
+ color: raised ? "secondary" : "primary",
204
+ size: small ? "small" : "medium",
205
+ onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
206
+ disableFocusRipple: true,
207
+ disableRipple: true,
208
+ disableTouchRipple: true,
209
+ children: /* @__PURE__ */ jsx5(ArrowForwardRoundedIcon2, { fontSize: small ? "small" : "medium" })
210
+ }
211
+ ) }) }) : null
212
+ ]
213
+ }
214
+ );
215
+ };
216
+ export {
217
+ CardContentEx,
218
+ CardContentExWithRef,
219
+ CardEx,
220
+ CardExWithRef,
221
+ FullWidthCard,
222
+ PageCard,
223
+ SimpleCard
224
+ };
2
225
  //# sourceMappingURL=index.js.map