@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/node/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,18 +59,29 @@ 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
|
var _a;
|
56
71
|
if (sharedRef && scrollToTop) {
|
57
|
-
(_a = sharedRef.current) == null ? void 0 : _a.scroll({
|
72
|
+
(_a = sharedRef.current) == null ? void 0 : _a.scroll({
|
73
|
+
behavior: "smooth",
|
74
|
+
top: 0
|
75
|
+
});
|
58
76
|
}
|
59
|
-
}, [
|
60
|
-
|
77
|
+
}, [
|
78
|
+
sharedRef,
|
79
|
+
scrollToTop
|
80
|
+
]);
|
81
|
+
return /* @__PURE__ */ import_react.default.createElement(CardContentExRoot, {
|
82
|
+
ref: sharedRef,
|
83
|
+
...props
|
84
|
+
});
|
61
85
|
});
|
62
86
|
CardContentExWithRef.displayName = "CardContentEx";
|
63
87
|
var CardContentEx = CardContentExWithRef;
|
@@ -65,22 +89,18 @@ var CardContentEx = CardContentExWithRef;
|
|
65
89
|
// src/components/CardEx.tsx
|
66
90
|
var import_material2 = require("@mui/material");
|
67
91
|
var import_react_shared2 = require("@xyo-network/react-shared");
|
68
|
-
var import_react2 = require("react");
|
69
|
-
var
|
70
|
-
var CardExWithRef = (0, import_react2.forwardRef)(({ style, gradient, ...props }, ref) => {
|
92
|
+
var import_react2 = __toESM(require("react"), 1);
|
93
|
+
var CardExWithRef = /* @__PURE__ */ (0, import_react2.forwardRef)(({ style, gradient, ...props }, ref) => {
|
71
94
|
const { styles } = (0, import_react_shared2.useGradientStyles)();
|
72
95
|
const gradientStyle = gradient === "border" ? styles.border : gradient === "background" ? styles.background : {};
|
73
|
-
return /* @__PURE__ */ (
|
74
|
-
|
75
|
-
|
76
|
-
style
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
...props
|
82
|
-
}
|
83
|
-
);
|
96
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_material2.Card, {
|
97
|
+
style: {
|
98
|
+
...gradientStyle,
|
99
|
+
...style
|
100
|
+
},
|
101
|
+
ref,
|
102
|
+
...props
|
103
|
+
});
|
84
104
|
});
|
85
105
|
CardExWithRef.displayName = "CardEx";
|
86
106
|
var CardEx = CardExWithRef;
|
@@ -90,88 +110,125 @@ var import_icons_material = require("@mui/icons-material");
|
|
90
110
|
var import_material3 = require("@mui/material");
|
91
111
|
var import_react_flexbox = require("@xylabs/react-flexbox");
|
92
112
|
var import_react_shared3 = require("@xyo-network/react-shared");
|
93
|
-
var import_react3 = require("react");
|
113
|
+
var import_react3 = __toESM(require("react"), 1);
|
94
114
|
var import_react_router_dom = require("react-router-dom");
|
95
|
-
var
|
96
|
-
var FullWidthCard = ({ cardIsButton, desc, href, media, name, small, to, ...props }) => {
|
115
|
+
var FullWidthCard = /* @__PURE__ */ __name(({ cardIsButton, desc, href, media, name, small, to, ...props }) => {
|
97
116
|
const theme = (0, import_material3.useTheme)();
|
98
117
|
const [raised, setRaised] = (0, import_react3.useState)(false);
|
99
118
|
const navigate = (0, import_react_router_dom.useNavigate)();
|
100
119
|
const isMobile = (0, import_react_shared3.useIsMobile)();
|
101
|
-
const localRouteChange = (to2) => {
|
120
|
+
const localRouteChange = /* @__PURE__ */ __name((to2) => {
|
102
121
|
to2 ? navigate(to2) : navigate("/404");
|
103
|
-
};
|
104
|
-
const externalRouteChange = (href2) => {
|
122
|
+
}, "localRouteChange");
|
123
|
+
const externalRouteChange = /* @__PURE__ */ __name((href2) => {
|
105
124
|
href2 ? window.open(href2) : navigate("/404");
|
106
|
-
};
|
107
|
-
return /* @__PURE__ */ (
|
108
|
-
|
109
|
-
{
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
backgroundColor: (0, import_material3.alpha)(theme.palette.primary.light, 0.05)
|
125
|
+
}, "externalRouteChange");
|
126
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_material3.Card, {
|
127
|
+
elevation: raised ? 3 : 0,
|
128
|
+
style: {
|
129
|
+
height: "100%",
|
130
|
+
width: "100%"
|
131
|
+
},
|
132
|
+
...props,
|
133
|
+
sx: {
|
134
|
+
"&:hover": {
|
135
|
+
cursor: "pointer"
|
118
136
|
},
|
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
|
-
|
152
|
-
|
137
|
+
"backgroundColor": (0, import_material3.alpha)(theme.palette.primary.light, 0.05)
|
138
|
+
},
|
139
|
+
onMouseEnter: /* @__PURE__ */ __name(() => isMobile ? null : cardIsButton ? setRaised(true) : null, "onMouseEnter"),
|
140
|
+
onMouseLeave: /* @__PURE__ */ __name(() => isMobile ? null : cardIsButton ? setRaised(false) : null, "onMouseLeave"),
|
141
|
+
onClick: /* @__PURE__ */ __name(() => cardIsButton ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null, "onClick")
|
142
|
+
}, media ? /* @__PURE__ */ import_react3.default.createElement(import_material3.CardMedia, {
|
143
|
+
component: "img",
|
144
|
+
height: "100",
|
145
|
+
image: media,
|
146
|
+
alt: ""
|
147
|
+
}) : null, /* @__PURE__ */ import_react3.default.createElement(import_material3.CardContent, null, /* @__PURE__ */ import_react3.default.createElement(import_material3.Grid, {
|
148
|
+
container: true,
|
149
|
+
alignItems: "center",
|
150
|
+
paddingY: 2,
|
151
|
+
paddingX: 2
|
152
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_material3.Grid, {
|
153
|
+
item: true,
|
154
|
+
xs: 12,
|
155
|
+
md: 6
|
156
|
+
}, typeof name === "string" ? /* @__PURE__ */ import_react3.default.createElement(import_material3.Typography, {
|
157
|
+
fontWeight: 700,
|
158
|
+
variant: "h2",
|
159
|
+
textAlign: "left",
|
160
|
+
paddingBottom: 1
|
161
|
+
}, name) : name), /* @__PURE__ */ import_react3.default.createElement(import_material3.Grid, {
|
162
|
+
item: true,
|
163
|
+
xs: 12,
|
164
|
+
md: 5
|
165
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_material3.Typography, {
|
166
|
+
variant: "body1",
|
167
|
+
fontWeight: 400,
|
168
|
+
textAlign: "left"
|
169
|
+
}, desc)), /* @__PURE__ */ import_react3.default.createElement(import_material3.Grid, {
|
170
|
+
item: true,
|
171
|
+
xs: 1,
|
172
|
+
display: isMobile ? "none" : "flex",
|
173
|
+
justifyContent: "center"
|
174
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_material3.Zoom, {
|
175
|
+
in: raised
|
176
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_material3.IconButton, {
|
177
|
+
color: "primary",
|
178
|
+
size: small ? "small" : "medium",
|
179
|
+
onClick: /* @__PURE__ */ __name(() => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"), "onClick"),
|
180
|
+
disableFocusRipple: true,
|
181
|
+
disableRipple: true,
|
182
|
+
disableTouchRipple: true
|
183
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_icons_material.ArrowForwardRounded, {
|
184
|
+
fontSize: small ? "small" : "medium"
|
185
|
+
})))))), /* @__PURE__ */ import_react3.default.createElement(import_material3.CardActions, {
|
186
|
+
sx: {
|
187
|
+
display: {
|
188
|
+
md: isMobile ? "flex" : "none"
|
189
|
+
}
|
153
190
|
}
|
154
|
-
|
155
|
-
|
191
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_flexbox.FlexGrowCol, {
|
192
|
+
alignItems: "flex-end"
|
193
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_material3.IconButton, {
|
194
|
+
color: "primary",
|
195
|
+
size: small ? "small" : "medium",
|
196
|
+
onClick: /* @__PURE__ */ __name(() => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"), "onClick"),
|
197
|
+
disableFocusRipple: true,
|
198
|
+
disableRipple: true,
|
199
|
+
disableTouchRipple: true
|
200
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_icons_material.ArrowForwardRounded, {
|
201
|
+
fontSize: small ? "small" : "medium"
|
202
|
+
})))));
|
203
|
+
}, "FullWidthCard");
|
156
204
|
|
157
205
|
// src/components/PageCard.tsx
|
158
206
|
var import_icons_material2 = require("@mui/icons-material");
|
159
207
|
var import_material4 = require("@mui/material");
|
160
208
|
var import_react_shared4 = require("@xyo-network/react-shared");
|
161
|
-
var import_react4 = require("react");
|
162
|
-
var
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
209
|
+
var import_react4 = __toESM(require("react"), 1);
|
210
|
+
var PageCardWithRef = /* @__PURE__ */ (0, import_react4.forwardRef)(({ subheader, title, onRefresh, children, action, style, ...props }, ref) => {
|
211
|
+
return /* @__PURE__ */ import_react4.default.createElement(CardEx, {
|
212
|
+
style: {
|
213
|
+
backgroundColor: "transparent",
|
214
|
+
position: "relative",
|
215
|
+
...style
|
216
|
+
},
|
217
|
+
elevation: 0,
|
218
|
+
ref,
|
219
|
+
...props
|
220
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_material4.CardHeader, {
|
221
|
+
title: /* @__PURE__ */ import_react4.default.createElement(import_react_shared4.TypographyEx, {
|
222
|
+
variant: "h5",
|
223
|
+
gutterBottom: true
|
224
|
+
}, title),
|
225
|
+
subheader: /* @__PURE__ */ import_react4.default.createElement(import_react_shared4.TypographyEx, {
|
226
|
+
variant: "subtitle1"
|
227
|
+
}, subheader),
|
228
|
+
action: action ?? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, onRefresh ? /* @__PURE__ */ import_react4.default.createElement(import_material4.IconButton, {
|
229
|
+
onClick: /* @__PURE__ */ __name(() => onRefresh == null ? void 0 : onRefresh(), "onClick")
|
230
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_icons_material2.Refresh, null)) : null)
|
231
|
+
}), children);
|
175
232
|
});
|
176
233
|
PageCardWithRef.displayName = "PageCard";
|
177
234
|
var PageCard = PageCardWithRef;
|
@@ -181,71 +238,75 @@ var import_icons_material3 = require("@mui/icons-material");
|
|
181
238
|
var import_material5 = require("@mui/material");
|
182
239
|
var import_react_flexbox2 = require("@xylabs/react-flexbox");
|
183
240
|
var import_react_shared5 = require("@xyo-network/react-shared");
|
184
|
-
var import_react5 = require("react");
|
241
|
+
var import_react5 = __toESM(require("react"), 1);
|
185
242
|
var import_react_router_dom2 = require("react-router-dom");
|
186
|
-
var
|
187
|
-
var SimpleCard = ({
|
188
|
-
desc,
|
189
|
-
iconImage,
|
190
|
-
interactionVariant = "card",
|
191
|
-
headline,
|
192
|
-
href,
|
193
|
-
media,
|
194
|
-
small,
|
195
|
-
subtitle,
|
196
|
-
sx,
|
197
|
-
to,
|
198
|
-
...props
|
199
|
-
}) => {
|
243
|
+
var SimpleCard = /* @__PURE__ */ __name(({ desc, iconImage, interactionVariant = "card", headline, href, media, small, subtitle, sx, to, ...props }) => {
|
200
244
|
const theme = (0, import_material5.useTheme)();
|
201
245
|
const [raised, setRaised] = (0, import_react5.useState)(false);
|
202
246
|
const navigate = (0, import_react_router_dom2.useNavigate)();
|
203
247
|
const isMobile = (0, import_react_shared5.useIsMobile)();
|
204
|
-
const localRouteChange = (to2) => {
|
248
|
+
const localRouteChange = /* @__PURE__ */ __name((to2) => {
|
205
249
|
to2 ? navigate(to2) : navigate("/404");
|
206
|
-
};
|
207
|
-
const externalRouteChange = (href2) => {
|
250
|
+
}, "localRouteChange");
|
251
|
+
const externalRouteChange = /* @__PURE__ */ __name((href2) => {
|
208
252
|
href2 ? window.open(href2) : navigate("/404");
|
209
|
-
};
|
210
|
-
return /* @__PURE__ */ (
|
211
|
-
|
212
|
-
{
|
213
|
-
|
214
|
-
|
215
|
-
"&:hover": {
|
216
|
-
cursor: interactionVariant == "button" ? "pointer" : null
|
217
|
-
},
|
218
|
-
backgroundColor: (0, import_material5.alpha)(theme.palette.primary.light, 0.05),
|
219
|
-
...sx
|
253
|
+
}, "externalRouteChange");
|
254
|
+
return /* @__PURE__ */ import_react5.default.createElement(CardEx, {
|
255
|
+
elevation: raised ? 3 : 0,
|
256
|
+
sx: {
|
257
|
+
"&:hover": {
|
258
|
+
cursor: interactionVariant == "button" ? "pointer" : null
|
220
259
|
},
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
color: raised ? "secondary" : "primary",
|
237
|
-
size: small ? "small" : "medium",
|
238
|
-
onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
|
239
|
-
disableFocusRipple: true,
|
240
|
-
disableRipple: true,
|
241
|
-
disableTouchRipple: true,
|
242
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_icons_material3.ArrowForwardRounded, { fontSize: small ? "small" : "medium" })
|
243
|
-
}
|
244
|
-
) }) }) : null
|
245
|
-
]
|
260
|
+
"backgroundColor": (0, import_material5.alpha)(theme.palette.primary.light, 0.05),
|
261
|
+
...sx
|
262
|
+
},
|
263
|
+
onMouseEnter: /* @__PURE__ */ __name(() => isMobile ? null : interactionVariant == "button" ? setRaised(true) : null, "onMouseEnter"),
|
264
|
+
onMouseLeave: /* @__PURE__ */ __name(() => isMobile ? null : interactionVariant == "button" ? setRaised(false) : null, "onMouseLeave"),
|
265
|
+
onClick: /* @__PURE__ */ __name(() => interactionVariant == "button" ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null, "onClick"),
|
266
|
+
...props
|
267
|
+
}, media ? /* @__PURE__ */ import_react5.default.createElement(import_material5.CardMedia, {
|
268
|
+
component: "img",
|
269
|
+
height: "100",
|
270
|
+
image: media,
|
271
|
+
alt: ""
|
272
|
+
}) : null, /* @__PURE__ */ import_react5.default.createElement(import_material5.CardContent, {
|
273
|
+
sx: {
|
274
|
+
height: "100%"
|
246
275
|
}
|
247
|
-
|
248
|
-
|
276
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_react_flexbox2.FlexCol, {
|
277
|
+
width: "100%",
|
278
|
+
alignItems: "flex-start"
|
279
|
+
}, iconImage ? /* @__PURE__ */ import_react5.default.createElement("img", {
|
280
|
+
src: iconImage,
|
281
|
+
height: "40px",
|
282
|
+
style: {
|
283
|
+
paddingBottom: "8px"
|
284
|
+
}
|
285
|
+
}) : null, typeof headline === "string" ? /* @__PURE__ */ import_react5.default.createElement(import_material5.Typography, {
|
286
|
+
variant: small ? "body1" : "h6",
|
287
|
+
textAlign: "left",
|
288
|
+
gutterBottom: true
|
289
|
+
}, headline) : headline, subtitle ? /* @__PURE__ */ import_react5.default.createElement(import_material5.Typography, {
|
290
|
+
variant: "subtitle2",
|
291
|
+
textAlign: "left",
|
292
|
+
gutterBottom: true
|
293
|
+
}, subtitle) : null, /* @__PURE__ */ import_react5.default.createElement(import_material5.Typography, {
|
294
|
+
variant: small ? "caption" : "body1",
|
295
|
+
textAlign: "left",
|
296
|
+
gutterBottom: true
|
297
|
+
}, desc))), interactionVariant == "button" ? /* @__PURE__ */ import_react5.default.createElement(import_material5.CardActions, null, /* @__PURE__ */ import_react5.default.createElement(import_react_flexbox2.FlexGrowCol, {
|
298
|
+
alignItems: "flex-end"
|
299
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_material5.IconButton, {
|
300
|
+
color: raised ? "secondary" : "primary",
|
301
|
+
size: small ? "small" : "medium",
|
302
|
+
onClick: /* @__PURE__ */ __name(() => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"), "onClick"),
|
303
|
+
disableFocusRipple: true,
|
304
|
+
disableRipple: true,
|
305
|
+
disableTouchRipple: true
|
306
|
+
}, /* @__PURE__ */ import_react5.default.createElement(import_icons_material3.ArrowForwardRounded, {
|
307
|
+
fontSize: small ? "small" : "medium"
|
308
|
+
})))) : null);
|
309
|
+
}, "SimpleCard");
|
249
310
|
// Annotate the CommonJS export names for ESM import in node:
|
250
311
|
0 && (module.exports = {
|
251
312
|
CardContentEx,
|
package/dist/node/index.cjs.map
CHANGED
@@ -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;AAA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,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
|
+
{"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;AA7BZ;AA8BI,QAAIF,aAAaJ,aAAa;AAC5BI,sBAAUG,YAAVH,mBAAmBI,OAAO;QAAEC,UAAU;QAAUC,KAAK;MAAE;IACzD;EACF,GAAG;IAACN;IAAWJ;GAAY;AAE3B,SAAO,6BAAAW,QAAA,cAAC3B,mBAAAA;IAAkBmB,KAAKC;IAAY,GAAGF;;AAChD,CAAA;AAEAJ,qBA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AAU;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/node/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/node/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/node/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
|