@xyo-network/react-card 2.81.9 → 2.82.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser/components/CardContentEx.d.cts +3 -2
- package/dist/browser/components/CardContentEx.d.cts.map +1 -1
- package/dist/browser/components/CardContentEx.d.mts +3 -2
- package/dist/browser/components/CardContentEx.d.mts.map +1 -1
- package/dist/browser/components/CardContentEx.d.ts +3 -2
- package/dist/browser/components/CardContentEx.d.ts.map +1 -1
- package/dist/browser/components/CardEx.d.cts +3 -2
- package/dist/browser/components/CardEx.d.cts.map +1 -1
- package/dist/browser/components/CardEx.d.mts +3 -2
- package/dist/browser/components/CardEx.d.mts.map +1 -1
- package/dist/browser/components/CardEx.d.ts +3 -2
- package/dist/browser/components/CardEx.d.ts.map +1 -1
- package/dist/browser/components/FullWidthCard/FullWidthCard.d.cts +1 -1
- package/dist/browser/components/FullWidthCard/FullWidthCard.d.cts.map +1 -1
- package/dist/browser/components/FullWidthCard/FullWidthCard.d.mts +1 -1
- package/dist/browser/components/FullWidthCard/FullWidthCard.d.mts.map +1 -1
- package/dist/browser/components/FullWidthCard/FullWidthCard.d.ts +1 -1
- package/dist/browser/components/FullWidthCard/FullWidthCard.d.ts.map +1 -1
- package/dist/browser/components/FullWidthCard/index.d.cts +1 -1
- package/dist/browser/components/FullWidthCard/index.d.cts.map +1 -1
- package/dist/browser/components/FullWidthCard/index.d.mts +1 -1
- package/dist/browser/components/FullWidthCard/index.d.mts.map +1 -1
- package/dist/browser/components/FullWidthCard/index.d.ts +1 -1
- package/dist/browser/components/FullWidthCard/index.d.ts.map +1 -1
- package/dist/browser/components/PageCard.d.cts +3 -3
- package/dist/browser/components/PageCard.d.cts.map +1 -1
- package/dist/browser/components/PageCard.d.mts +3 -3
- package/dist/browser/components/PageCard.d.mts.map +1 -1
- package/dist/browser/components/PageCard.d.ts +3 -3
- package/dist/browser/components/PageCard.d.ts.map +1 -1
- package/dist/browser/components/SimpleCard/SimpleCard.d.cts +2 -2
- package/dist/browser/components/SimpleCard/SimpleCard.d.cts.map +1 -1
- package/dist/browser/components/SimpleCard/SimpleCard.d.mts +2 -2
- package/dist/browser/components/SimpleCard/SimpleCard.d.mts.map +1 -1
- package/dist/browser/components/SimpleCard/SimpleCard.d.ts +2 -2
- package/dist/browser/components/SimpleCard/SimpleCard.d.ts.map +1 -1
- package/dist/browser/components/SimpleCard/index.d.cts +1 -1
- package/dist/browser/components/SimpleCard/index.d.cts.map +1 -1
- package/dist/browser/components/SimpleCard/index.d.mts +1 -1
- package/dist/browser/components/SimpleCard/index.d.mts.map +1 -1
- package/dist/browser/components/SimpleCard/index.d.ts +1 -1
- package/dist/browser/components/SimpleCard/index.d.ts.map +1 -1
- package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.cts +2 -1
- package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.cts.map +1 -1
- package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.mts +2 -1
- package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.mts.map +1 -1
- package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.ts +2 -1
- package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.ts.map +1 -1
- package/dist/browser/components/SimpleCardGrid/index.d.cts +1 -1
- package/dist/browser/components/SimpleCardGrid/index.d.cts.map +1 -1
- package/dist/browser/components/SimpleCardGrid/index.d.mts +1 -1
- package/dist/browser/components/SimpleCardGrid/index.d.mts.map +1 -1
- package/dist/browser/components/SimpleCardGrid/index.d.ts +1 -1
- package/dist/browser/components/SimpleCardGrid/index.d.ts.map +1 -1
- package/dist/browser/components/index.d.cts +5 -5
- package/dist/browser/components/index.d.cts.map +1 -1
- package/dist/browser/components/index.d.mts +5 -5
- package/dist/browser/components/index.d.mts.map +1 -1
- package/dist/browser/components/index.d.ts +5 -5
- package/dist/browser/components/index.d.ts.map +1 -1
- package/dist/browser/index.cjs +207 -146
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +1 -1
- package/dist/browser/index.d.mts +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.mjs +278 -0
- package/dist/browser/index.mjs.map +1 -0
- package/dist/neutral/components/CardContentEx.d.cts +3 -2
- package/dist/neutral/components/CardContentEx.d.cts.map +1 -1
- package/dist/neutral/components/CardContentEx.d.mts +3 -2
- package/dist/neutral/components/CardContentEx.d.mts.map +1 -1
- package/dist/neutral/components/CardContentEx.d.ts +3 -2
- package/dist/neutral/components/CardContentEx.d.ts.map +1 -1
- package/dist/neutral/components/CardEx.d.cts +3 -2
- package/dist/neutral/components/CardEx.d.cts.map +1 -1
- package/dist/neutral/components/CardEx.d.mts +3 -2
- package/dist/neutral/components/CardEx.d.mts.map +1 -1
- package/dist/neutral/components/CardEx.d.ts +3 -2
- package/dist/neutral/components/CardEx.d.ts.map +1 -1
- package/dist/neutral/components/FullWidthCard/FullWidthCard.d.cts +1 -1
- package/dist/neutral/components/FullWidthCard/FullWidthCard.d.cts.map +1 -1
- package/dist/neutral/components/FullWidthCard/FullWidthCard.d.mts +1 -1
- package/dist/neutral/components/FullWidthCard/FullWidthCard.d.mts.map +1 -1
- package/dist/neutral/components/FullWidthCard/FullWidthCard.d.ts +1 -1
- package/dist/neutral/components/FullWidthCard/FullWidthCard.d.ts.map +1 -1
- package/dist/neutral/components/FullWidthCard/index.d.cts +1 -1
- package/dist/neutral/components/FullWidthCard/index.d.cts.map +1 -1
- package/dist/neutral/components/FullWidthCard/index.d.mts +1 -1
- package/dist/neutral/components/FullWidthCard/index.d.mts.map +1 -1
- package/dist/neutral/components/FullWidthCard/index.d.ts +1 -1
- package/dist/neutral/components/FullWidthCard/index.d.ts.map +1 -1
- package/dist/neutral/components/PageCard.d.cts +3 -3
- package/dist/neutral/components/PageCard.d.cts.map +1 -1
- package/dist/neutral/components/PageCard.d.mts +3 -3
- package/dist/neutral/components/PageCard.d.mts.map +1 -1
- package/dist/neutral/components/PageCard.d.ts +3 -3
- package/dist/neutral/components/PageCard.d.ts.map +1 -1
- package/dist/neutral/components/SimpleCard/SimpleCard.d.cts +2 -2
- package/dist/neutral/components/SimpleCard/SimpleCard.d.cts.map +1 -1
- package/dist/neutral/components/SimpleCard/SimpleCard.d.mts +2 -2
- package/dist/neutral/components/SimpleCard/SimpleCard.d.mts.map +1 -1
- package/dist/neutral/components/SimpleCard/SimpleCard.d.ts +2 -2
- package/dist/neutral/components/SimpleCard/SimpleCard.d.ts.map +1 -1
- package/dist/neutral/components/SimpleCard/index.d.cts +1 -1
- package/dist/neutral/components/SimpleCard/index.d.cts.map +1 -1
- package/dist/neutral/components/SimpleCard/index.d.mts +1 -1
- package/dist/neutral/components/SimpleCard/index.d.mts.map +1 -1
- package/dist/neutral/components/SimpleCard/index.d.ts +1 -1
- package/dist/neutral/components/SimpleCard/index.d.ts.map +1 -1
- package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.cts +2 -1
- package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.cts.map +1 -1
- package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.mts +2 -1
- package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.mts.map +1 -1
- package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.ts +2 -1
- package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.ts.map +1 -1
- package/dist/neutral/components/SimpleCardGrid/index.d.cts +1 -1
- package/dist/neutral/components/SimpleCardGrid/index.d.cts.map +1 -1
- package/dist/neutral/components/SimpleCardGrid/index.d.mts +1 -1
- package/dist/neutral/components/SimpleCardGrid/index.d.mts.map +1 -1
- package/dist/neutral/components/SimpleCardGrid/index.d.ts +1 -1
- package/dist/neutral/components/SimpleCardGrid/index.d.ts.map +1 -1
- package/dist/neutral/components/index.d.cts +5 -5
- package/dist/neutral/components/index.d.cts.map +1 -1
- package/dist/neutral/components/index.d.mts +5 -5
- package/dist/neutral/components/index.d.mts.map +1 -1
- package/dist/neutral/components/index.d.ts +5 -5
- package/dist/neutral/components/index.d.ts.map +1 -1
- package/dist/neutral/index.cjs +207 -146
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts +1 -1
- package/dist/neutral/index.d.mts +1 -1
- package/dist/neutral/index.d.ts +1 -1
- package/dist/neutral/index.mjs +278 -0
- package/dist/neutral/index.mjs.map +1 -0
- package/dist/node/components/CardContentEx.d.cts +3 -2
- package/dist/node/components/CardContentEx.d.cts.map +1 -1
- package/dist/node/components/CardContentEx.d.mts +3 -2
- package/dist/node/components/CardContentEx.d.mts.map +1 -1
- package/dist/node/components/CardContentEx.d.ts +3 -2
- package/dist/node/components/CardContentEx.d.ts.map +1 -1
- package/dist/node/components/CardEx.d.cts +3 -2
- package/dist/node/components/CardEx.d.cts.map +1 -1
- package/dist/node/components/CardEx.d.mts +3 -2
- package/dist/node/components/CardEx.d.mts.map +1 -1
- package/dist/node/components/CardEx.d.ts +3 -2
- package/dist/node/components/CardEx.d.ts.map +1 -1
- package/dist/node/components/FullWidthCard/FullWidthCard.d.cts +1 -1
- package/dist/node/components/FullWidthCard/FullWidthCard.d.cts.map +1 -1
- package/dist/node/components/FullWidthCard/FullWidthCard.d.mts +1 -1
- package/dist/node/components/FullWidthCard/FullWidthCard.d.mts.map +1 -1
- package/dist/node/components/FullWidthCard/FullWidthCard.d.ts +1 -1
- package/dist/node/components/FullWidthCard/FullWidthCard.d.ts.map +1 -1
- package/dist/node/components/FullWidthCard/index.d.cts +1 -1
- package/dist/node/components/FullWidthCard/index.d.cts.map +1 -1
- package/dist/node/components/FullWidthCard/index.d.mts +1 -1
- package/dist/node/components/FullWidthCard/index.d.mts.map +1 -1
- package/dist/node/components/FullWidthCard/index.d.ts +1 -1
- package/dist/node/components/FullWidthCard/index.d.ts.map +1 -1
- package/dist/node/components/PageCard.d.cts +3 -3
- package/dist/node/components/PageCard.d.cts.map +1 -1
- package/dist/node/components/PageCard.d.mts +3 -3
- package/dist/node/components/PageCard.d.mts.map +1 -1
- package/dist/node/components/PageCard.d.ts +3 -3
- package/dist/node/components/PageCard.d.ts.map +1 -1
- package/dist/node/components/SimpleCard/SimpleCard.d.cts +2 -2
- package/dist/node/components/SimpleCard/SimpleCard.d.cts.map +1 -1
- package/dist/node/components/SimpleCard/SimpleCard.d.mts +2 -2
- package/dist/node/components/SimpleCard/SimpleCard.d.mts.map +1 -1
- package/dist/node/components/SimpleCard/SimpleCard.d.ts +2 -2
- package/dist/node/components/SimpleCard/SimpleCard.d.ts.map +1 -1
- package/dist/node/components/SimpleCard/index.d.cts +1 -1
- package/dist/node/components/SimpleCard/index.d.cts.map +1 -1
- package/dist/node/components/SimpleCard/index.d.mts +1 -1
- package/dist/node/components/SimpleCard/index.d.mts.map +1 -1
- package/dist/node/components/SimpleCard/index.d.ts +1 -1
- package/dist/node/components/SimpleCard/index.d.ts.map +1 -1
- package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.cts +2 -1
- package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.cts.map +1 -1
- package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.mts +2 -1
- package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.mts.map +1 -1
- package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.ts +2 -1
- package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.ts.map +1 -1
- package/dist/node/components/SimpleCardGrid/index.d.cts +1 -1
- package/dist/node/components/SimpleCardGrid/index.d.cts.map +1 -1
- package/dist/node/components/SimpleCardGrid/index.d.mts +1 -1
- package/dist/node/components/SimpleCardGrid/index.d.mts.map +1 -1
- package/dist/node/components/SimpleCardGrid/index.d.ts +1 -1
- package/dist/node/components/SimpleCardGrid/index.d.ts.map +1 -1
- package/dist/node/components/index.d.cts +5 -5
- package/dist/node/components/index.d.cts.map +1 -1
- package/dist/node/components/index.d.mts +5 -5
- package/dist/node/components/index.d.mts.map +1 -1
- package/dist/node/components/index.d.ts +5 -5
- package/dist/node/components/index.d.ts.map +1 -1
- package/dist/node/index.cjs +207 -146
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +1 -1
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.mjs +279 -0
- package/dist/node/index.mjs.map +1 -0
- package/package.json +12 -12
- package/src/components/CardContentEx.stories.tsx +8 -7
- package/src/components/CardContentEx.tsx +1 -1
- package/src/components/CardEx.tsx +7 -5
- package/src/components/FullWidthCard/FullWidthCard.stories.tsx +3 -3
- package/src/components/FullWidthCard/FullWidthCard.tsx +41 -32
- package/src/components/FullWidthCard/index.ts +1 -1
- package/src/components/PageCard.stories.tsx +6 -5
- package/src/components/PageCard.tsx +11 -9
- package/src/components/SimpleCard/SimpleCard.stories.tsx +4 -4
- package/src/components/SimpleCard/SimpleCard.tsx +65 -53
- package/src/components/SimpleCard/index.ts +1 -1
- package/src/components/SimpleCardGrid/SimpleCardGrid.stories.tsx +4 -4
- package/src/components/SimpleCardGrid/SimpleCardGrid.tsx +2 -1
- package/src/components/SimpleCardGrid/index.ts +1 -1
- package/src/components/index.ts +5 -5
- package/src/index.ts +1 -1
- package/dist/browser/index.js +0 -225
- package/dist/browser/index.js.map +0 -1
- package/dist/neutral/index.js +0 -225
- package/dist/neutral/index.js.map +0 -1
- package/dist/node/index.js +0 -226
- package/dist/node/index.js.map +0 -1
package/dist/browser/index.cjs
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __create = Object.create;
|
2
3
|
var __defProp = Object.defineProperty;
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
6
9
|
var __export = (target, all) => {
|
7
10
|
for (var name in all)
|
8
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
@@ -15,6 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
15
18
|
}
|
16
19
|
return to;
|
17
20
|
};
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
27
|
+
mod
|
28
|
+
));
|
18
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
30
|
|
20
31
|
// src/index.ts
|
@@ -33,11 +44,13 @@ module.exports = __toCommonJS(src_exports);
|
|
33
44
|
// src/components/CardContentEx.tsx
|
34
45
|
var import_material = require("@mui/material");
|
35
46
|
var import_react_shared = require("@xyo-network/react-shared");
|
36
|
-
var import_react = require("react");
|
37
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
47
|
+
var import_react = __toESM(require("react"), 1);
|
38
48
|
var CardContentExRoot = (0, import_material.styled)(import_material.CardContent, {
|
39
49
|
name: "CardContentEx",
|
40
|
-
shouldForwardProp: (prop) => ![
|
50
|
+
shouldForwardProp: /* @__PURE__ */ __name((prop) => ![
|
51
|
+
"variant",
|
52
|
+
"removePadding"
|
53
|
+
].includes(prop), "shouldForwardProp"),
|
41
54
|
slot: "Root"
|
42
55
|
})(({ variant, removePadding }) => ({
|
43
56
|
...(variant === "scrollable" || removePadding) && {
|
@@ -46,17 +59,28 @@ var CardContentExRoot = (0, import_material.styled)(import_material.CardContent,
|
|
46
59
|
},
|
47
60
|
overflow: "auto",
|
48
61
|
paddingTop: 0,
|
49
|
-
...removePadding && {
|
62
|
+
...removePadding && {
|
63
|
+
padding: 0
|
64
|
+
}
|
50
65
|
}
|
51
66
|
}));
|
52
|
-
var CardContentExWithRef = (0, import_react.forwardRef)(({ scrollToTop = 0, refreshRef = 0, ...props }, ref) => {
|
67
|
+
var CardContentExWithRef = /* @__PURE__ */ (0, import_react.forwardRef)(({ scrollToTop = 0, refreshRef = 0, ...props }, ref) => {
|
53
68
|
const sharedRef = (0, import_react_shared.useShareForwardedRef)(ref, refreshRef);
|
54
69
|
(0, import_react.useEffect)(() => {
|
55
70
|
if (sharedRef && scrollToTop) {
|
56
|
-
sharedRef.current?.scroll({
|
71
|
+
sharedRef.current?.scroll({
|
72
|
+
behavior: "smooth",
|
73
|
+
top: 0
|
74
|
+
});
|
57
75
|
}
|
58
|
-
}, [
|
59
|
-
|
76
|
+
}, [
|
77
|
+
sharedRef,
|
78
|
+
scrollToTop
|
79
|
+
]);
|
80
|
+
return /* @__PURE__ */ import_react.default.createElement(CardContentExRoot, {
|
81
|
+
ref: sharedRef,
|
82
|
+
...props
|
83
|
+
});
|
60
84
|
});
|
61
85
|
CardContentExWithRef.displayName = "CardContentEx";
|
62
86
|
var CardContentEx = CardContentExWithRef;
|
@@ -64,22 +88,18 @@ var CardContentEx = CardContentExWithRef;
|
|
64
88
|
// src/components/CardEx.tsx
|
65
89
|
var import_material2 = require("@mui/material");
|
66
90
|
var import_react_shared2 = require("@xyo-network/react-shared");
|
67
|
-
var import_react2 = require("react");
|
68
|
-
var
|
69
|
-
var CardExWithRef = (0, import_react2.forwardRef)(({ style, gradient, ...props }, ref) => {
|
91
|
+
var import_react2 = __toESM(require("react"), 1);
|
92
|
+
var CardExWithRef = /* @__PURE__ */ (0, import_react2.forwardRef)(({ style, gradient, ...props }, ref) => {
|
70
93
|
const { styles } = (0, import_react_shared2.useGradientStyles)();
|
71
94
|
const gradientStyle = gradient === "border" ? styles.border : gradient === "background" ? styles.background : {};
|
72
|
-
return /* @__PURE__ */ (
|
73
|
-
|
74
|
-
|
75
|
-
style
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
...props
|
81
|
-
}
|
82
|
-
);
|
95
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_material2.Card, {
|
96
|
+
style: {
|
97
|
+
...gradientStyle,
|
98
|
+
...style
|
99
|
+
},
|
100
|
+
ref,
|
101
|
+
...props
|
102
|
+
});
|
83
103
|
});
|
84
104
|
CardExWithRef.displayName = "CardEx";
|
85
105
|
var CardEx = CardExWithRef;
|
@@ -89,88 +109,125 @@ var import_icons_material = require("@mui/icons-material");
|
|
89
109
|
var import_material3 = require("@mui/material");
|
90
110
|
var import_react_flexbox = require("@xylabs/react-flexbox");
|
91
111
|
var import_react_shared3 = require("@xyo-network/react-shared");
|
92
|
-
var import_react3 = require("react");
|
112
|
+
var import_react3 = __toESM(require("react"), 1);
|
93
113
|
var import_react_router_dom = require("react-router-dom");
|
94
|
-
var
|
95
|
-
var FullWidthCard = ({ cardIsButton, desc, href, media, name, small, to, ...props }) => {
|
114
|
+
var FullWidthCard = /* @__PURE__ */ __name(({ cardIsButton, desc, href, media, name, small, to, ...props }) => {
|
96
115
|
const theme = (0, import_material3.useTheme)();
|
97
116
|
const [raised, setRaised] = (0, import_react3.useState)(false);
|
98
117
|
const navigate = (0, import_react_router_dom.useNavigate)();
|
99
118
|
const isMobile = (0, import_react_shared3.useIsMobile)();
|
100
|
-
const localRouteChange = (to2) => {
|
119
|
+
const localRouteChange = /* @__PURE__ */ __name((to2) => {
|
101
120
|
to2 ? navigate(to2) : navigate("/404");
|
102
|
-
};
|
103
|
-
const externalRouteChange = (href2) => {
|
121
|
+
}, "localRouteChange");
|
122
|
+
const externalRouteChange = /* @__PURE__ */ __name((href2) => {
|
104
123
|
href2 ? window.open(href2) : navigate("/404");
|
105
|
-
};
|
106
|
-
return /* @__PURE__ */ (
|
107
|
-
|
108
|
-
{
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
backgroundColor: (0, import_material3.alpha)(theme.palette.primary.light, 0.05)
|
124
|
+
}, "externalRouteChange");
|
125
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_material3.Card, {
|
126
|
+
elevation: raised ? 3 : 0,
|
127
|
+
style: {
|
128
|
+
height: "100%",
|
129
|
+
width: "100%"
|
130
|
+
},
|
131
|
+
...props,
|
132
|
+
sx: {
|
133
|
+
"&:hover": {
|
134
|
+
cursor: "pointer"
|
117
135
|
},
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
136
|
+
"backgroundColor": (0, import_material3.alpha)(theme.palette.primary.light, 0.05)
|
137
|
+
},
|
138
|
+
onMouseEnter: /* @__PURE__ */ __name(() => isMobile ? null : cardIsButton ? setRaised(true) : null, "onMouseEnter"),
|
139
|
+
onMouseLeave: /* @__PURE__ */ __name(() => isMobile ? null : cardIsButton ? setRaised(false) : null, "onMouseLeave"),
|
140
|
+
onClick: /* @__PURE__ */ __name(() => cardIsButton ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null, "onClick")
|
141
|
+
}, media ? /* @__PURE__ */ import_react3.default.createElement(import_material3.CardMedia, {
|
142
|
+
component: "img",
|
143
|
+
height: "100",
|
144
|
+
image: media,
|
145
|
+
alt: ""
|
146
|
+
}) : null, /* @__PURE__ */ import_react3.default.createElement(import_material3.CardContent, null, /* @__PURE__ */ import_react3.default.createElement(import_material3.Grid, {
|
147
|
+
container: true,
|
148
|
+
alignItems: "center",
|
149
|
+
paddingY: 2,
|
150
|
+
paddingX: 2
|
151
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_material3.Grid, {
|
152
|
+
item: true,
|
153
|
+
xs: 12,
|
154
|
+
md: 6
|
155
|
+
}, typeof name === "string" ? /* @__PURE__ */ import_react3.default.createElement(import_material3.Typography, {
|
156
|
+
fontWeight: 700,
|
157
|
+
variant: "h2",
|
158
|
+
textAlign: "left",
|
159
|
+
paddingBottom: 1
|
160
|
+
}, name) : name), /* @__PURE__ */ import_react3.default.createElement(import_material3.Grid, {
|
161
|
+
item: true,
|
162
|
+
xs: 12,
|
163
|
+
md: 5
|
164
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_material3.Typography, {
|
165
|
+
variant: "body1",
|
166
|
+
fontWeight: 400,
|
167
|
+
textAlign: "left"
|
168
|
+
}, desc)), /* @__PURE__ */ import_react3.default.createElement(import_material3.Grid, {
|
169
|
+
item: true,
|
170
|
+
xs: 1,
|
171
|
+
display: isMobile ? "none" : "flex",
|
172
|
+
justifyContent: "center"
|
173
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_material3.Zoom, {
|
174
|
+
in: raised
|
175
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_material3.IconButton, {
|
176
|
+
color: "primary",
|
177
|
+
size: small ? "small" : "medium",
|
178
|
+
onClick: /* @__PURE__ */ __name(() => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"), "onClick"),
|
179
|
+
disableFocusRipple: true,
|
180
|
+
disableRipple: true,
|
181
|
+
disableTouchRipple: true
|
182
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_icons_material.ArrowForwardRounded, {
|
183
|
+
fontSize: small ? "small" : "medium"
|
184
|
+
})))))), /* @__PURE__ */ import_react3.default.createElement(import_material3.CardActions, {
|
185
|
+
sx: {
|
186
|
+
display: {
|
187
|
+
md: isMobile ? "flex" : "none"
|
188
|
+
}
|
152
189
|
}
|
153
|
-
|
154
|
-
|
190
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_flexbox.FlexGrowCol, {
|
191
|
+
alignItems: "flex-end"
|
192
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_material3.IconButton, {
|
193
|
+
color: "primary",
|
194
|
+
size: small ? "small" : "medium",
|
195
|
+
onClick: /* @__PURE__ */ __name(() => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"), "onClick"),
|
196
|
+
disableFocusRipple: true,
|
197
|
+
disableRipple: true,
|
198
|
+
disableTouchRipple: true
|
199
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_icons_material.ArrowForwardRounded, {
|
200
|
+
fontSize: small ? "small" : "medium"
|
201
|
+
})))));
|
202
|
+
}, "FullWidthCard");
|
155
203
|
|
156
204
|
// src/components/PageCard.tsx
|
157
205
|
var import_icons_material2 = require("@mui/icons-material");
|
158
206
|
var import_material4 = require("@mui/material");
|
159
207
|
var import_react_shared4 = require("@xyo-network/react-shared");
|
160
|
-
var import_react4 = require("react");
|
161
|
-
var
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
208
|
+
var import_react4 = __toESM(require("react"), 1);
|
209
|
+
var PageCardWithRef = /* @__PURE__ */ (0, import_react4.forwardRef)(({ subheader, title, onRefresh, children, action, style, ...props }, ref) => {
|
210
|
+
return /* @__PURE__ */ import_react4.default.createElement(CardEx, {
|
211
|
+
style: {
|
212
|
+
backgroundColor: "transparent",
|
213
|
+
position: "relative",
|
214
|
+
...style
|
215
|
+
},
|
216
|
+
elevation: 0,
|
217
|
+
ref,
|
218
|
+
...props
|
219
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_material4.CardHeader, {
|
220
|
+
title: /* @__PURE__ */ import_react4.default.createElement(import_react_shared4.TypographyEx, {
|
221
|
+
variant: "h5",
|
222
|
+
gutterBottom: true
|
223
|
+
}, title),
|
224
|
+
subheader: /* @__PURE__ */ import_react4.default.createElement(import_react_shared4.TypographyEx, {
|
225
|
+
variant: "subtitle1"
|
226
|
+
}, subheader),
|
227
|
+
action: action ?? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, onRefresh ? /* @__PURE__ */ import_react4.default.createElement(import_material4.IconButton, {
|
228
|
+
onClick: /* @__PURE__ */ __name(() => onRefresh?.(), "onClick")
|
229
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_icons_material2.Refresh, null)) : null)
|
230
|
+
}), children);
|
174
231
|
});
|
175
232
|
PageCardWithRef.displayName = "PageCard";
|
176
233
|
var PageCard = PageCardWithRef;
|
@@ -180,69 +237,73 @@ var import_icons_material3 = require("@mui/icons-material");
|
|
180
237
|
var import_material5 = require("@mui/material");
|
181
238
|
var import_react_flexbox2 = require("@xylabs/react-flexbox");
|
182
239
|
var import_react_shared5 = require("@xyo-network/react-shared");
|
183
|
-
var import_react5 = require("react");
|
240
|
+
var import_react5 = __toESM(require("react"), 1);
|
184
241
|
var import_react_router_dom2 = require("react-router-dom");
|
185
|
-
var
|
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
|
-
}) => {
|
242
|
+
var SimpleCard = /* @__PURE__ */ __name(({ desc, iconImage, interactionVariant = "card", headline, href, media, small, subtitle, sx, to, ...props }) => {
|
199
243
|
const theme = (0, import_material5.useTheme)();
|
200
244
|
const [raised, setRaised] = (0, import_react5.useState)(false);
|
201
245
|
const navigate = (0, import_react_router_dom2.useNavigate)();
|
202
246
|
const isMobile = (0, import_react_shared5.useIsMobile)();
|
203
|
-
const localRouteChange = (to2) => {
|
247
|
+
const localRouteChange = /* @__PURE__ */ __name((to2) => {
|
204
248
|
to2 ? navigate(to2) : navigate("/404");
|
205
|
-
};
|
206
|
-
const externalRouteChange = (href2) => {
|
249
|
+
}, "localRouteChange");
|
250
|
+
const externalRouteChange = /* @__PURE__ */ __name((href2) => {
|
207
251
|
href2 ? window.open(href2) : navigate("/404");
|
208
|
-
};
|
209
|
-
return /* @__PURE__ */ (
|
210
|
-
|
211
|
-
{
|
212
|
-
|
213
|
-
|
214
|
-
"&:hover": {
|
215
|
-
cursor: interactionVariant == "button" ? "pointer" : null
|
216
|
-
},
|
217
|
-
backgroundColor: (0, import_material5.alpha)(theme.palette.primary.light, 0.05),
|
218
|
-
...sx
|
252
|
+
}, "externalRouteChange");
|
253
|
+
return /* @__PURE__ */ import_react5.default.createElement(CardEx, {
|
254
|
+
elevation: raised ? 3 : 0,
|
255
|
+
sx: {
|
256
|
+
"&:hover": {
|
257
|
+
cursor: interactionVariant == "button" ? "pointer" : null
|
219
258
|
},
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
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
|
-
]
|
259
|
+
"backgroundColor": (0, import_material5.alpha)(theme.palette.primary.light, 0.05),
|
260
|
+
...sx
|
261
|
+
},
|
262
|
+
onMouseEnter: /* @__PURE__ */ __name(() => isMobile ? null : interactionVariant == "button" ? setRaised(true) : null, "onMouseEnter"),
|
263
|
+
onMouseLeave: /* @__PURE__ */ __name(() => isMobile ? null : interactionVariant == "button" ? setRaised(false) : null, "onMouseLeave"),
|
264
|
+
onClick: /* @__PURE__ */ __name(() => interactionVariant == "button" ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null, "onClick"),
|
265
|
+
...props
|
266
|
+
}, media ? /* @__PURE__ */ import_react5.default.createElement(import_material5.CardMedia, {
|
267
|
+
component: "img",
|
268
|
+
height: "100",
|
269
|
+
image: media,
|
270
|
+
alt: ""
|
271
|
+
}) : null, /* @__PURE__ */ import_react5.default.createElement(import_material5.CardContent, {
|
272
|
+
sx: {
|
273
|
+
height: "100%"
|
245
274
|
}
|
246
|
-
|
247
|
-
|
275
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_flexbox2.FlexCol, {
|
276
|
+
width: "100%",
|
277
|
+
alignItems: "flex-start"
|
278
|
+
}, iconImage ? /* @__PURE__ */ import_react5.default.createElement("img", {
|
279
|
+
src: iconImage,
|
280
|
+
height: "40px",
|
281
|
+
style: {
|
282
|
+
paddingBottom: "8px"
|
283
|
+
}
|
284
|
+
}) : null, typeof headline === "string" ? /* @__PURE__ */ import_react5.default.createElement(import_material5.Typography, {
|
285
|
+
variant: small ? "body1" : "h6",
|
286
|
+
textAlign: "left",
|
287
|
+
gutterBottom: true
|
288
|
+
}, headline) : headline, subtitle ? /* @__PURE__ */ import_react5.default.createElement(import_material5.Typography, {
|
289
|
+
variant: "subtitle2",
|
290
|
+
textAlign: "left",
|
291
|
+
gutterBottom: true
|
292
|
+
}, subtitle) : null, /* @__PURE__ */ import_react5.default.createElement(import_material5.Typography, {
|
293
|
+
variant: small ? "caption" : "body1",
|
294
|
+
textAlign: "left",
|
295
|
+
gutterBottom: true
|
296
|
+
}, desc))), interactionVariant == "button" ? /* @__PURE__ */ import_react5.default.createElement(import_material5.CardActions, null, /* @__PURE__ */ import_react5.default.createElement(import_react_flexbox2.FlexGrowCol, {
|
297
|
+
alignItems: "flex-end"
|
298
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_material5.IconButton, {
|
299
|
+
color: raised ? "secondary" : "primary",
|
300
|
+
size: small ? "small" : "medium",
|
301
|
+
onClick: /* @__PURE__ */ __name(() => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"), "onClick"),
|
302
|
+
disableFocusRipple: true,
|
303
|
+
disableRipple: true,
|
304
|
+
disableTouchRipple: true
|
305
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_icons_material3.ArrowForwardRounded, {
|
306
|
+
fontSize: small ? "small" : "medium"
|
307
|
+
})))) : null);
|
308
|
+
}, "SimpleCard");
|
248
309
|
//# 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/index.js'\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.js'\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.js'\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,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BAAoB,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
|
+
{"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/index.ts'\n","import { CardContent, CardContentProps, 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 { Card, CardProps } 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 { 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 React, { 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 // 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 { CardHeader, CardHeaderProps, IconButton } from '@mui/material'\nimport { TypographyEx } from '@xyo-network/react-shared'\nimport React, { forwardRef, ReactNode } from 'react'\n\nimport { CardEx, CardExProps } 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 React, { ReactNode, useState } from 'react'\nimport { To, useNavigate } from 'react-router-dom'\n\nimport { CardEx, CardExProps } 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;ACAA,sBAAsD;AACtD,0BAAqC;AACrC,mBAA6C;AAE7C,IAAMA,wBAAoBC,wBAAOC,6BAAa;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,6CAAsD,CAAC,EAAEC,cAAc,GAAGC,aAAa,GAAG,GAAGC,MAAAA,GAASC,QAAAA;AACxI,QAAMC,gBAAYC,0CAAqCF,KAAKF,UAAAA;AAE5DK,8BAAU,MAAA;AACR,QAAIF,aAAaJ,aAAa;AAC5BI,gBAAUG,SAASC,OAAO;QAAEC,UAAU;QAAUC,KAAK;MAAE,CAAA;IACzD;EACF,GAAG;IAACN;IAAWJ;GAAY;AAE3B,SAAO,6BAAAW,QAAA,cAAC3B,mBAAAA;IAAkBmB,KAAKC;IAAY,GAAGF;;AAChD,CAAA;AAEAJ,qBAAqBc,cAAc;AAE5B,IAAMC,gBAAgBf;;;ACxC7B,IAAAgB,mBAAgC;AAChC,IAAAC,uBAAkC;AAClC,IAAAC,gBAAkC;AAM3B,IAAMC,gBAAgBC,8CAAwC,CAAC,EAAEC,OAAOC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O;IAAMC,OAAOjC;IAAOkC,KAAI;OAC1D,MAEJ,8BAAAf,QAAA,cAACgB,8BAAAA;IAAYhC,IAAI;MAAE6B,QAAQ;IAAO;KAChC,8BAAAb,QAAA,cAACiB,+BAAAA;IAAQC,OAAM;IAAOC,YAAW;KAC9B1C,YACG,8BAAAuB,QAAA,cAACoB,OAAAA;IAAIC,KAAK5C;IAAWoC,QAAO;IAAOS,OAAO;MAAEC,eAAe;IAAM;OACjE,MACH,OAAO5C,aAAa,WAEf,8BAAAqB,QAAA,cAACwB,6BAAAA;IAAWC,SAAS3C,QAAQ,UAAU;IAAM4C,WAAU;IAAOC,cAAAA;KAC3DhD,QAAAA,IAGLA,UACHI,WAEK,8BAAAiB,QAAA,cAACwB,6BAAAA;IAAWC,SAAQ;IAAYC,WAAU;IAAOC,cAAAA;KAC9C5C,QAAAA,IAGL,MACJ,8BAAAiB,QAAA,cAACwB,6BAAAA;IAAWC,SAAS3C,QAAQ,YAAY;IAAS4C,WAAU;IAAOC,cAAAA;KAChEnD,IAAAA,CAAAA,CAAAA,GAINE,sBAAsB,WAEjB,8BAAAsB,QAAA,cAAC4B,8BAAAA,MACC,8BAAA5B,QAAA,cAAC6B,mCAAAA;IAAYV,YAAW;KACtB,8BAAAnB,QAAA,cAAC8B,6BAAAA;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,8BAAAnC,QAAA,cAACoC,uBAAAA,qBAAAA;IAAwBC,UAAUvD,QAAQ,UAAU;UAK7D,IAAA;AAGV,GA9GqD;","names":["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","React","displayName","CardContentEx","import_material","import_react_shared","import_react","CardExWithRef","forwardRef","style","gradient","props","ref","styles","useGradientStyles","gradientStyle","border","background","React","Card","displayName","CardEx","import_material","import_react_shared","import_react","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","import_icons_material","import_material","import_react_shared","import_react","PageCardWithRef","forwardRef","subheader","title","onRefresh","children","action","style","props","ref","React","CardEx","backgroundColor","position","elevation","CardHeader","TypographyEx","variant","gutterBottom","IconButton","onClick","RefreshIcon","displayName","PageCard","import_icons_material","import_material","import_react_flexbox","import_react_shared","import_react","import_react_router_dom","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/dist/browser/index.d.cts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './components/index.
|
1
|
+
export * from './components/index.ts';
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.d.mts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './components/index.
|
1
|
+
export * from './components/index.ts';
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './components/index.
|
1
|
+
export * from './components/index.ts';
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|