@xyo-network/react-card 2.81.10 → 2.83.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. package/dist/browser/index.d.ts +52 -2
  2. package/dist/browser/index.mjs +278 -0
  3. package/dist/browser/index.mjs.map +1 -0
  4. package/package.json +14 -30
  5. package/src/components/CardContentEx.stories.tsx +8 -7
  6. package/src/components/CardContentEx.tsx +1 -1
  7. package/src/components/CardEx.tsx +7 -5
  8. package/src/components/FullWidthCard/FullWidthCard.stories.tsx +3 -3
  9. package/src/components/FullWidthCard/FullWidthCard.tsx +41 -32
  10. package/src/components/FullWidthCard/index.ts +1 -1
  11. package/src/components/PageCard.stories.tsx +6 -5
  12. package/src/components/PageCard.tsx +11 -9
  13. package/src/components/SimpleCard/SimpleCard.stories.tsx +4 -4
  14. package/src/components/SimpleCard/SimpleCard.tsx +65 -53
  15. package/src/components/SimpleCard/index.ts +1 -1
  16. package/src/components/SimpleCardGrid/SimpleCardGrid.stories.tsx +4 -4
  17. package/src/components/SimpleCardGrid/SimpleCardGrid.tsx +2 -1
  18. package/src/components/SimpleCardGrid/index.ts +1 -1
  19. package/src/components/index.ts +5 -5
  20. package/src/index.ts +1 -1
  21. package/xy.config.ts +12 -0
  22. package/dist/browser/components/CardContentEx.d.cts +0 -10
  23. package/dist/browser/components/CardContentEx.d.cts.map +0 -1
  24. package/dist/browser/components/CardContentEx.d.mts +0 -10
  25. package/dist/browser/components/CardContentEx.d.mts.map +0 -1
  26. package/dist/browser/components/CardContentEx.d.ts +0 -10
  27. package/dist/browser/components/CardContentEx.d.ts.map +0 -1
  28. package/dist/browser/components/CardEx.d.cts +0 -7
  29. package/dist/browser/components/CardEx.d.cts.map +0 -1
  30. package/dist/browser/components/CardEx.d.mts +0 -7
  31. package/dist/browser/components/CardEx.d.mts.map +0 -1
  32. package/dist/browser/components/CardEx.d.ts +0 -7
  33. package/dist/browser/components/CardEx.d.ts.map +0 -1
  34. package/dist/browser/components/FullWidthCard/FullWidthCard.d.cts +0 -15
  35. package/dist/browser/components/FullWidthCard/FullWidthCard.d.cts.map +0 -1
  36. package/dist/browser/components/FullWidthCard/FullWidthCard.d.mts +0 -15
  37. package/dist/browser/components/FullWidthCard/FullWidthCard.d.mts.map +0 -1
  38. package/dist/browser/components/FullWidthCard/FullWidthCard.d.ts +0 -15
  39. package/dist/browser/components/FullWidthCard/FullWidthCard.d.ts.map +0 -1
  40. package/dist/browser/components/FullWidthCard/index.d.cts +0 -2
  41. package/dist/browser/components/FullWidthCard/index.d.cts.map +0 -1
  42. package/dist/browser/components/FullWidthCard/index.d.mts +0 -2
  43. package/dist/browser/components/FullWidthCard/index.d.mts.map +0 -1
  44. package/dist/browser/components/FullWidthCard/index.d.ts +0 -2
  45. package/dist/browser/components/FullWidthCard/index.d.ts.map +0 -1
  46. package/dist/browser/components/PageCard.d.cts +0 -10
  47. package/dist/browser/components/PageCard.d.cts.map +0 -1
  48. package/dist/browser/components/PageCard.d.mts +0 -10
  49. package/dist/browser/components/PageCard.d.mts.map +0 -1
  50. package/dist/browser/components/PageCard.d.ts +0 -10
  51. package/dist/browser/components/PageCard.d.ts.map +0 -1
  52. package/dist/browser/components/SimpleCard/SimpleCard.d.cts +0 -16
  53. package/dist/browser/components/SimpleCard/SimpleCard.d.cts.map +0 -1
  54. package/dist/browser/components/SimpleCard/SimpleCard.d.mts +0 -16
  55. package/dist/browser/components/SimpleCard/SimpleCard.d.mts.map +0 -1
  56. package/dist/browser/components/SimpleCard/SimpleCard.d.ts +0 -16
  57. package/dist/browser/components/SimpleCard/SimpleCard.d.ts.map +0 -1
  58. package/dist/browser/components/SimpleCard/index.d.cts +0 -2
  59. package/dist/browser/components/SimpleCard/index.d.cts.map +0 -1
  60. package/dist/browser/components/SimpleCard/index.d.mts +0 -2
  61. package/dist/browser/components/SimpleCard/index.d.mts.map +0 -1
  62. package/dist/browser/components/SimpleCard/index.d.ts +0 -2
  63. package/dist/browser/components/SimpleCard/index.d.ts.map +0 -1
  64. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.cts +0 -7
  65. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.cts.map +0 -1
  66. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.mts +0 -7
  67. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.mts.map +0 -1
  68. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.ts +0 -7
  69. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.ts.map +0 -1
  70. package/dist/browser/components/SimpleCardGrid/index.d.cts +0 -2
  71. package/dist/browser/components/SimpleCardGrid/index.d.cts.map +0 -1
  72. package/dist/browser/components/SimpleCardGrid/index.d.mts +0 -2
  73. package/dist/browser/components/SimpleCardGrid/index.d.mts.map +0 -1
  74. package/dist/browser/components/SimpleCardGrid/index.d.ts +0 -2
  75. package/dist/browser/components/SimpleCardGrid/index.d.ts.map +0 -1
  76. package/dist/browser/components/index.d.cts +0 -6
  77. package/dist/browser/components/index.d.cts.map +0 -1
  78. package/dist/browser/components/index.d.mts +0 -6
  79. package/dist/browser/components/index.d.mts.map +0 -1
  80. package/dist/browser/components/index.d.ts +0 -6
  81. package/dist/browser/components/index.d.ts.map +0 -1
  82. package/dist/browser/index.cjs +0 -248
  83. package/dist/browser/index.cjs.map +0 -1
  84. package/dist/browser/index.d.cts +0 -2
  85. package/dist/browser/index.d.cts.map +0 -1
  86. package/dist/browser/index.d.mts +0 -2
  87. package/dist/browser/index.d.mts.map +0 -1
  88. package/dist/browser/index.d.ts.map +0 -1
  89. package/dist/browser/index.js +0 -225
  90. package/dist/browser/index.js.map +0 -1
  91. package/dist/neutral/components/CardContentEx.d.cts +0 -10
  92. package/dist/neutral/components/CardContentEx.d.cts.map +0 -1
  93. package/dist/neutral/components/CardContentEx.d.mts +0 -10
  94. package/dist/neutral/components/CardContentEx.d.mts.map +0 -1
  95. package/dist/neutral/components/CardContentEx.d.ts +0 -10
  96. package/dist/neutral/components/CardContentEx.d.ts.map +0 -1
  97. package/dist/neutral/components/CardEx.d.cts +0 -7
  98. package/dist/neutral/components/CardEx.d.cts.map +0 -1
  99. package/dist/neutral/components/CardEx.d.mts +0 -7
  100. package/dist/neutral/components/CardEx.d.mts.map +0 -1
  101. package/dist/neutral/components/CardEx.d.ts +0 -7
  102. package/dist/neutral/components/CardEx.d.ts.map +0 -1
  103. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.cts +0 -15
  104. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.cts.map +0 -1
  105. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.mts +0 -15
  106. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.mts.map +0 -1
  107. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.ts +0 -15
  108. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.ts.map +0 -1
  109. package/dist/neutral/components/FullWidthCard/index.d.cts +0 -2
  110. package/dist/neutral/components/FullWidthCard/index.d.cts.map +0 -1
  111. package/dist/neutral/components/FullWidthCard/index.d.mts +0 -2
  112. package/dist/neutral/components/FullWidthCard/index.d.mts.map +0 -1
  113. package/dist/neutral/components/FullWidthCard/index.d.ts +0 -2
  114. package/dist/neutral/components/FullWidthCard/index.d.ts.map +0 -1
  115. package/dist/neutral/components/PageCard.d.cts +0 -10
  116. package/dist/neutral/components/PageCard.d.cts.map +0 -1
  117. package/dist/neutral/components/PageCard.d.mts +0 -10
  118. package/dist/neutral/components/PageCard.d.mts.map +0 -1
  119. package/dist/neutral/components/PageCard.d.ts +0 -10
  120. package/dist/neutral/components/PageCard.d.ts.map +0 -1
  121. package/dist/neutral/components/SimpleCard/SimpleCard.d.cts +0 -16
  122. package/dist/neutral/components/SimpleCard/SimpleCard.d.cts.map +0 -1
  123. package/dist/neutral/components/SimpleCard/SimpleCard.d.mts +0 -16
  124. package/dist/neutral/components/SimpleCard/SimpleCard.d.mts.map +0 -1
  125. package/dist/neutral/components/SimpleCard/SimpleCard.d.ts +0 -16
  126. package/dist/neutral/components/SimpleCard/SimpleCard.d.ts.map +0 -1
  127. package/dist/neutral/components/SimpleCard/index.d.cts +0 -2
  128. package/dist/neutral/components/SimpleCard/index.d.cts.map +0 -1
  129. package/dist/neutral/components/SimpleCard/index.d.mts +0 -2
  130. package/dist/neutral/components/SimpleCard/index.d.mts.map +0 -1
  131. package/dist/neutral/components/SimpleCard/index.d.ts +0 -2
  132. package/dist/neutral/components/SimpleCard/index.d.ts.map +0 -1
  133. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.cts +0 -7
  134. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.cts.map +0 -1
  135. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.mts +0 -7
  136. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.mts.map +0 -1
  137. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.ts +0 -7
  138. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.ts.map +0 -1
  139. package/dist/neutral/components/SimpleCardGrid/index.d.cts +0 -2
  140. package/dist/neutral/components/SimpleCardGrid/index.d.cts.map +0 -1
  141. package/dist/neutral/components/SimpleCardGrid/index.d.mts +0 -2
  142. package/dist/neutral/components/SimpleCardGrid/index.d.mts.map +0 -1
  143. package/dist/neutral/components/SimpleCardGrid/index.d.ts +0 -2
  144. package/dist/neutral/components/SimpleCardGrid/index.d.ts.map +0 -1
  145. package/dist/neutral/components/index.d.cts +0 -6
  146. package/dist/neutral/components/index.d.cts.map +0 -1
  147. package/dist/neutral/components/index.d.mts +0 -6
  148. package/dist/neutral/components/index.d.mts.map +0 -1
  149. package/dist/neutral/components/index.d.ts +0 -6
  150. package/dist/neutral/components/index.d.ts.map +0 -1
  151. package/dist/neutral/index.cjs +0 -248
  152. package/dist/neutral/index.cjs.map +0 -1
  153. package/dist/neutral/index.d.cts +0 -2
  154. package/dist/neutral/index.d.cts.map +0 -1
  155. package/dist/neutral/index.d.mts +0 -2
  156. package/dist/neutral/index.d.mts.map +0 -1
  157. package/dist/neutral/index.d.ts +0 -2
  158. package/dist/neutral/index.d.ts.map +0 -1
  159. package/dist/neutral/index.js +0 -225
  160. package/dist/neutral/index.js.map +0 -1
  161. package/dist/node/components/CardContentEx.d.cts +0 -10
  162. package/dist/node/components/CardContentEx.d.cts.map +0 -1
  163. package/dist/node/components/CardContentEx.d.mts +0 -10
  164. package/dist/node/components/CardContentEx.d.mts.map +0 -1
  165. package/dist/node/components/CardContentEx.d.ts +0 -10
  166. package/dist/node/components/CardContentEx.d.ts.map +0 -1
  167. package/dist/node/components/CardEx.d.cts +0 -7
  168. package/dist/node/components/CardEx.d.cts.map +0 -1
  169. package/dist/node/components/CardEx.d.mts +0 -7
  170. package/dist/node/components/CardEx.d.mts.map +0 -1
  171. package/dist/node/components/CardEx.d.ts +0 -7
  172. package/dist/node/components/CardEx.d.ts.map +0 -1
  173. package/dist/node/components/FullWidthCard/FullWidthCard.d.cts +0 -15
  174. package/dist/node/components/FullWidthCard/FullWidthCard.d.cts.map +0 -1
  175. package/dist/node/components/FullWidthCard/FullWidthCard.d.mts +0 -15
  176. package/dist/node/components/FullWidthCard/FullWidthCard.d.mts.map +0 -1
  177. package/dist/node/components/FullWidthCard/FullWidthCard.d.ts +0 -15
  178. package/dist/node/components/FullWidthCard/FullWidthCard.d.ts.map +0 -1
  179. package/dist/node/components/FullWidthCard/index.d.cts +0 -2
  180. package/dist/node/components/FullWidthCard/index.d.cts.map +0 -1
  181. package/dist/node/components/FullWidthCard/index.d.mts +0 -2
  182. package/dist/node/components/FullWidthCard/index.d.mts.map +0 -1
  183. package/dist/node/components/FullWidthCard/index.d.ts +0 -2
  184. package/dist/node/components/FullWidthCard/index.d.ts.map +0 -1
  185. package/dist/node/components/PageCard.d.cts +0 -10
  186. package/dist/node/components/PageCard.d.cts.map +0 -1
  187. package/dist/node/components/PageCard.d.mts +0 -10
  188. package/dist/node/components/PageCard.d.mts.map +0 -1
  189. package/dist/node/components/PageCard.d.ts +0 -10
  190. package/dist/node/components/PageCard.d.ts.map +0 -1
  191. package/dist/node/components/SimpleCard/SimpleCard.d.cts +0 -16
  192. package/dist/node/components/SimpleCard/SimpleCard.d.cts.map +0 -1
  193. package/dist/node/components/SimpleCard/SimpleCard.d.mts +0 -16
  194. package/dist/node/components/SimpleCard/SimpleCard.d.mts.map +0 -1
  195. package/dist/node/components/SimpleCard/SimpleCard.d.ts +0 -16
  196. package/dist/node/components/SimpleCard/SimpleCard.d.ts.map +0 -1
  197. package/dist/node/components/SimpleCard/index.d.cts +0 -2
  198. package/dist/node/components/SimpleCard/index.d.cts.map +0 -1
  199. package/dist/node/components/SimpleCard/index.d.mts +0 -2
  200. package/dist/node/components/SimpleCard/index.d.mts.map +0 -1
  201. package/dist/node/components/SimpleCard/index.d.ts +0 -2
  202. package/dist/node/components/SimpleCard/index.d.ts.map +0 -1
  203. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.cts +0 -7
  204. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.cts.map +0 -1
  205. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.mts +0 -7
  206. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.mts.map +0 -1
  207. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.ts +0 -7
  208. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.ts.map +0 -1
  209. package/dist/node/components/SimpleCardGrid/index.d.cts +0 -2
  210. package/dist/node/components/SimpleCardGrid/index.d.cts.map +0 -1
  211. package/dist/node/components/SimpleCardGrid/index.d.mts +0 -2
  212. package/dist/node/components/SimpleCardGrid/index.d.mts.map +0 -1
  213. package/dist/node/components/SimpleCardGrid/index.d.ts +0 -2
  214. package/dist/node/components/SimpleCardGrid/index.d.ts.map +0 -1
  215. package/dist/node/components/index.d.cts +0 -6
  216. package/dist/node/components/index.d.cts.map +0 -1
  217. package/dist/node/components/index.d.mts +0 -6
  218. package/dist/node/components/index.d.mts.map +0 -1
  219. package/dist/node/components/index.d.ts +0 -6
  220. package/dist/node/components/index.d.ts.map +0 -1
  221. package/dist/node/index.cjs +0 -259
  222. package/dist/node/index.cjs.map +0 -1
  223. package/dist/node/index.d.cts +0 -2
  224. package/dist/node/index.d.cts.map +0 -1
  225. package/dist/node/index.d.mts +0 -2
  226. package/dist/node/index.d.mts.map +0 -1
  227. package/dist/node/index.d.ts +0 -2
  228. package/dist/node/index.d.ts.map +0 -1
  229. package/dist/node/index.js +0 -226
  230. package/dist/node/index.js.map +0 -1
@@ -1,2 +1,52 @@
1
- export * from './components/index.js';
2
- //# sourceMappingURL=index.d.ts.map
1
+ import { CardContentProps, CardProps, CardHeaderProps } from '@mui/material';
2
+ import React, { ReactNode } from 'react';
3
+ import { To } from 'react-router-dom';
4
+
5
+ type CardContentExProps = CardContentProps & {
6
+ refreshRef?: number;
7
+ removePadding?: boolean;
8
+ scrollToTop?: number;
9
+ variant?: 'scrollable' | 'normal';
10
+ };
11
+ declare const CardContentExWithRef: React.ForwardRefExoticComponent<Omit<CardContentExProps, "ref"> & React.RefAttributes<HTMLDivElement | null>>;
12
+ declare const CardContentEx: React.ForwardRefExoticComponent<Omit<CardContentExProps, "ref"> & React.RefAttributes<HTMLDivElement | null>>;
13
+
14
+ interface CardExProps extends CardProps {
15
+ gradient?: 'border' | 'background';
16
+ }
17
+ declare const CardExWithRef: React.ForwardRefExoticComponent<Omit<CardExProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+ declare const CardEx: React.ForwardRefExoticComponent<Omit<CardExProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
+
20
+ interface FullWidthCardProps extends CardProps {
21
+ cardIsButton?: boolean;
22
+ desc?: ReactNode;
23
+ href?: string;
24
+ linkText?: string;
25
+ media?: string;
26
+ name: ReactNode;
27
+ small?: boolean;
28
+ to?: To;
29
+ }
30
+ declare const FullWidthCard: React.FC<FullWidthCardProps>;
31
+
32
+ interface PageCardProps extends CardExProps {
33
+ action?: ReactNode;
34
+ onRefresh?: () => void;
35
+ subheader?: CardHeaderProps['subheader'];
36
+ }
37
+ declare const PageCard: React.ForwardRefExoticComponent<Omit<PageCardProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
38
+
39
+ interface SimpleCardProps extends CardExProps {
40
+ desc?: ReactNode;
41
+ headline?: ReactNode;
42
+ href?: string;
43
+ iconImage?: string;
44
+ interactionVariant?: 'button' | 'card';
45
+ media?: string;
46
+ small?: boolean;
47
+ subtitle?: string;
48
+ to?: To;
49
+ }
50
+ declare const SimpleCard: React.FC<SimpleCardProps>;
51
+
52
+ export { CardContentEx, type CardContentExProps, CardContentExWithRef, CardEx, type CardExProps, CardExWithRef, FullWidthCard, type FullWidthCardProps, PageCard, type PageCardProps, SimpleCard, type SimpleCardProps };
@@ -0,0 +1,278 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/components/CardContentEx.tsx
5
+ import { CardContent, styled } from "@mui/material";
6
+ import { useShareForwardedRef } from "@xyo-network/react-shared";
7
+ import React, { forwardRef, useEffect } from "react";
8
+ var CardContentExRoot = styled(CardContent, {
9
+ name: "CardContentEx",
10
+ shouldForwardProp: /* @__PURE__ */ __name((prop) => ![
11
+ "variant",
12
+ "removePadding"
13
+ ].includes(prop), "shouldForwardProp"),
14
+ slot: "Root"
15
+ })(({ variant, removePadding }) => ({
16
+ ...(variant === "scrollable" || removePadding) && {
17
+ [":last-child"]: {
18
+ paddingBottom: 0
19
+ },
20
+ overflow: "auto",
21
+ paddingTop: 0,
22
+ ...removePadding && {
23
+ padding: 0
24
+ }
25
+ }
26
+ }));
27
+ var CardContentExWithRef = /* @__PURE__ */ forwardRef(({ scrollToTop = 0, refreshRef = 0, ...props }, ref) => {
28
+ const sharedRef = useShareForwardedRef(ref, refreshRef);
29
+ useEffect(() => {
30
+ if (sharedRef && scrollToTop) {
31
+ sharedRef.current?.scroll({
32
+ behavior: "smooth",
33
+ top: 0
34
+ });
35
+ }
36
+ }, [
37
+ sharedRef,
38
+ scrollToTop
39
+ ]);
40
+ return /* @__PURE__ */ React.createElement(CardContentExRoot, {
41
+ ref: sharedRef,
42
+ ...props
43
+ });
44
+ });
45
+ CardContentExWithRef.displayName = "CardContentEx";
46
+ var CardContentEx = CardContentExWithRef;
47
+
48
+ // src/components/CardEx.tsx
49
+ import { Card } from "@mui/material";
50
+ import { useGradientStyles } from "@xyo-network/react-shared";
51
+ import React2, { forwardRef as forwardRef2 } from "react";
52
+ var CardExWithRef = /* @__PURE__ */ forwardRef2(({ style, gradient, ...props }, ref) => {
53
+ const { styles } = useGradientStyles();
54
+ const gradientStyle = gradient === "border" ? styles.border : gradient === "background" ? styles.background : {};
55
+ return /* @__PURE__ */ React2.createElement(Card, {
56
+ style: {
57
+ ...gradientStyle,
58
+ ...style
59
+ },
60
+ ref,
61
+ ...props
62
+ });
63
+ });
64
+ CardExWithRef.displayName = "CardEx";
65
+ var CardEx = CardExWithRef;
66
+
67
+ // src/components/FullWidthCard/FullWidthCard.tsx
68
+ import { ArrowForwardRounded as ArrowForwardRoundedIcon } from "@mui/icons-material";
69
+ import { alpha, Card as Card2, CardActions, CardContent as CardContent2, CardMedia, Grid, IconButton, Typography, useTheme, Zoom } from "@mui/material";
70
+ import { FlexGrowCol } from "@xylabs/react-flexbox";
71
+ import { useIsMobile } from "@xyo-network/react-shared";
72
+ import React3, { useState } from "react";
73
+ import { useNavigate } from "react-router-dom";
74
+ var FullWidthCard = /* @__PURE__ */ __name(({ cardIsButton, desc, href, media, name, small, to, ...props }) => {
75
+ const theme = useTheme();
76
+ const [raised, setRaised] = useState(false);
77
+ const navigate = useNavigate();
78
+ const isMobile = useIsMobile();
79
+ const localRouteChange = /* @__PURE__ */ __name((to2) => {
80
+ to2 ? navigate(to2) : navigate("/404");
81
+ }, "localRouteChange");
82
+ const externalRouteChange = /* @__PURE__ */ __name((href2) => {
83
+ href2 ? window.open(href2) : navigate("/404");
84
+ }, "externalRouteChange");
85
+ return /* @__PURE__ */ React3.createElement(Card2, {
86
+ elevation: raised ? 3 : 0,
87
+ style: {
88
+ height: "100%",
89
+ width: "100%"
90
+ },
91
+ ...props,
92
+ sx: {
93
+ "&:hover": {
94
+ cursor: "pointer"
95
+ },
96
+ "backgroundColor": alpha(theme.palette.primary.light, 0.05)
97
+ },
98
+ onMouseEnter: /* @__PURE__ */ __name(() => isMobile ? null : cardIsButton ? setRaised(true) : null, "onMouseEnter"),
99
+ onMouseLeave: /* @__PURE__ */ __name(() => isMobile ? null : cardIsButton ? setRaised(false) : null, "onMouseLeave"),
100
+ onClick: /* @__PURE__ */ __name(() => cardIsButton ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null, "onClick")
101
+ }, media ? /* @__PURE__ */ React3.createElement(CardMedia, {
102
+ component: "img",
103
+ height: "100",
104
+ image: media,
105
+ alt: ""
106
+ }) : null, /* @__PURE__ */ React3.createElement(CardContent2, null, /* @__PURE__ */ React3.createElement(Grid, {
107
+ container: true,
108
+ alignItems: "center",
109
+ paddingY: 2,
110
+ paddingX: 2
111
+ }, /* @__PURE__ */ React3.createElement(Grid, {
112
+ item: true,
113
+ xs: 12,
114
+ md: 6
115
+ }, typeof name === "string" ? /* @__PURE__ */ React3.createElement(Typography, {
116
+ fontWeight: 700,
117
+ variant: "h2",
118
+ textAlign: "left",
119
+ paddingBottom: 1
120
+ }, name) : name), /* @__PURE__ */ React3.createElement(Grid, {
121
+ item: true,
122
+ xs: 12,
123
+ md: 5
124
+ }, /* @__PURE__ */ React3.createElement(Typography, {
125
+ variant: "body1",
126
+ fontWeight: 400,
127
+ textAlign: "left"
128
+ }, desc)), /* @__PURE__ */ React3.createElement(Grid, {
129
+ item: true,
130
+ xs: 1,
131
+ display: isMobile ? "none" : "flex",
132
+ justifyContent: "center"
133
+ }, /* @__PURE__ */ React3.createElement(Zoom, {
134
+ in: raised
135
+ }, /* @__PURE__ */ React3.createElement(IconButton, {
136
+ color: "primary",
137
+ size: small ? "small" : "medium",
138
+ onClick: /* @__PURE__ */ __name(() => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"), "onClick"),
139
+ disableFocusRipple: true,
140
+ disableRipple: true,
141
+ disableTouchRipple: true
142
+ }, /* @__PURE__ */ React3.createElement(ArrowForwardRoundedIcon, {
143
+ fontSize: small ? "small" : "medium"
144
+ })))))), /* @__PURE__ */ React3.createElement(CardActions, {
145
+ sx: {
146
+ display: {
147
+ md: isMobile ? "flex" : "none"
148
+ }
149
+ }
150
+ }, /* @__PURE__ */ React3.createElement(FlexGrowCol, {
151
+ alignItems: "flex-end"
152
+ }, /* @__PURE__ */ React3.createElement(IconButton, {
153
+ color: "primary",
154
+ size: small ? "small" : "medium",
155
+ onClick: /* @__PURE__ */ __name(() => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"), "onClick"),
156
+ disableFocusRipple: true,
157
+ disableRipple: true,
158
+ disableTouchRipple: true
159
+ }, /* @__PURE__ */ React3.createElement(ArrowForwardRoundedIcon, {
160
+ fontSize: small ? "small" : "medium"
161
+ })))));
162
+ }, "FullWidthCard");
163
+
164
+ // src/components/PageCard.tsx
165
+ import { Refresh as RefreshIcon } from "@mui/icons-material";
166
+ import { CardHeader, IconButton as IconButton2 } from "@mui/material";
167
+ import { TypographyEx } from "@xyo-network/react-shared";
168
+ import React4, { forwardRef as forwardRef3 } from "react";
169
+ var PageCardWithRef = /* @__PURE__ */ forwardRef3(({ subheader, title, onRefresh, children, action, style, ...props }, ref) => {
170
+ return /* @__PURE__ */ React4.createElement(CardEx, {
171
+ style: {
172
+ backgroundColor: "transparent",
173
+ position: "relative",
174
+ ...style
175
+ },
176
+ elevation: 0,
177
+ ref,
178
+ ...props
179
+ }, /* @__PURE__ */ React4.createElement(CardHeader, {
180
+ title: /* @__PURE__ */ React4.createElement(TypographyEx, {
181
+ variant: "h5",
182
+ gutterBottom: true
183
+ }, title),
184
+ subheader: /* @__PURE__ */ React4.createElement(TypographyEx, {
185
+ variant: "subtitle1"
186
+ }, subheader),
187
+ action: action ?? /* @__PURE__ */ React4.createElement(React4.Fragment, null, onRefresh ? /* @__PURE__ */ React4.createElement(IconButton2, {
188
+ onClick: /* @__PURE__ */ __name(() => onRefresh?.(), "onClick")
189
+ }, /* @__PURE__ */ React4.createElement(RefreshIcon, null)) : null)
190
+ }), children);
191
+ });
192
+ PageCardWithRef.displayName = "PageCard";
193
+ var PageCard = PageCardWithRef;
194
+
195
+ // src/components/SimpleCard/SimpleCard.tsx
196
+ import { ArrowForwardRounded as ArrowForwardRoundedIcon2 } from "@mui/icons-material";
197
+ import { alpha as alpha2, CardActions as CardActions2, CardContent as CardContent3, CardMedia as CardMedia2, IconButton as IconButton3, Typography as Typography2, useTheme as useTheme2 } from "@mui/material";
198
+ import { FlexCol, FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
199
+ import { useIsMobile as useIsMobile2 } from "@xyo-network/react-shared";
200
+ import React5, { useState as useState2 } from "react";
201
+ import { useNavigate as useNavigate2 } from "react-router-dom";
202
+ var SimpleCard = /* @__PURE__ */ __name(({ desc, iconImage, interactionVariant = "card", headline, href, media, small, subtitle, sx, to, ...props }) => {
203
+ const theme = useTheme2();
204
+ const [raised, setRaised] = useState2(false);
205
+ const navigate = useNavigate2();
206
+ const isMobile = useIsMobile2();
207
+ const localRouteChange = /* @__PURE__ */ __name((to2) => {
208
+ to2 ? navigate(to2) : navigate("/404");
209
+ }, "localRouteChange");
210
+ const externalRouteChange = /* @__PURE__ */ __name((href2) => {
211
+ href2 ? window.open(href2) : navigate("/404");
212
+ }, "externalRouteChange");
213
+ return /* @__PURE__ */ React5.createElement(CardEx, {
214
+ elevation: raised ? 3 : 0,
215
+ sx: {
216
+ "&:hover": {
217
+ cursor: interactionVariant == "button" ? "pointer" : null
218
+ },
219
+ "backgroundColor": alpha2(theme.palette.primary.light, 0.05),
220
+ ...sx
221
+ },
222
+ onMouseEnter: /* @__PURE__ */ __name(() => isMobile ? null : interactionVariant == "button" ? setRaised(true) : null, "onMouseEnter"),
223
+ onMouseLeave: /* @__PURE__ */ __name(() => isMobile ? null : interactionVariant == "button" ? setRaised(false) : null, "onMouseLeave"),
224
+ onClick: /* @__PURE__ */ __name(() => interactionVariant == "button" ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null, "onClick"),
225
+ ...props
226
+ }, media ? /* @__PURE__ */ React5.createElement(CardMedia2, {
227
+ component: "img",
228
+ height: "100",
229
+ image: media,
230
+ alt: ""
231
+ }) : null, /* @__PURE__ */ React5.createElement(CardContent3, {
232
+ sx: {
233
+ height: "100%"
234
+ }
235
+ }, /* @__PURE__ */ React5.createElement(FlexCol, {
236
+ width: "100%",
237
+ alignItems: "flex-start"
238
+ }, iconImage ? /* @__PURE__ */ React5.createElement("img", {
239
+ src: iconImage,
240
+ height: "40px",
241
+ style: {
242
+ paddingBottom: "8px"
243
+ }
244
+ }) : null, typeof headline === "string" ? /* @__PURE__ */ React5.createElement(Typography2, {
245
+ variant: small ? "body1" : "h6",
246
+ textAlign: "left",
247
+ gutterBottom: true
248
+ }, headline) : headline, subtitle ? /* @__PURE__ */ React5.createElement(Typography2, {
249
+ variant: "subtitle2",
250
+ textAlign: "left",
251
+ gutterBottom: true
252
+ }, subtitle) : null, /* @__PURE__ */ React5.createElement(Typography2, {
253
+ variant: small ? "caption" : "body1",
254
+ textAlign: "left",
255
+ gutterBottom: true
256
+ }, desc))), interactionVariant == "button" ? /* @__PURE__ */ React5.createElement(CardActions2, null, /* @__PURE__ */ React5.createElement(FlexGrowCol2, {
257
+ alignItems: "flex-end"
258
+ }, /* @__PURE__ */ React5.createElement(IconButton3, {
259
+ color: raised ? "secondary" : "primary",
260
+ size: small ? "small" : "medium",
261
+ onClick: /* @__PURE__ */ __name(() => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"), "onClick"),
262
+ disableFocusRipple: true,
263
+ disableRipple: true,
264
+ disableTouchRipple: true
265
+ }, /* @__PURE__ */ React5.createElement(ArrowForwardRoundedIcon2, {
266
+ fontSize: small ? "small" : "medium"
267
+ })))) : null);
268
+ }, "SimpleCard");
269
+ export {
270
+ CardContentEx,
271
+ CardContentExWithRef,
272
+ CardEx,
273
+ CardExWithRef,
274
+ FullWidthCard,
275
+ PageCard,
276
+ SimpleCard
277
+ };
278
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/CardContentEx.tsx","../../src/components/CardEx.tsx","../../src/components/FullWidthCard/FullWidthCard.tsx","../../src/components/PageCard.tsx","../../src/components/SimpleCard/SimpleCard.tsx"],"sourcesContent":["import { 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,SAASA,aAA+BC,cAAc;AACtD,SAASC,4BAA4B;AACrC,OAAOC,SAASC,YAAYC,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C,IAAI;MAAE6B,QAAQ;IAAO;KAChC,gBAAAb,OAAA,cAACiB,SAAAA;IAAQC,OAAM;IAAOC,YAAW;KAC9B1C,YACG,gBAAAuB,OAAA,cAACoB,OAAAA;IAAIC,KAAK5C;IAAWoC,QAAO;IAAOS,OAAO;MAAEC,eAAe;IAAM;OACjE,MACH,OAAO5C,aAAa,WAEf,gBAAAqB,OAAA,cAACwB,aAAAA;IAAWC,SAAS3C,QAAQ,UAAU;IAAM4C,WAAU;IAAOC,cAAAA;KAC3DhD,QAAAA,IAGLA,UACHI,WAEK,gBAAAiB,OAAA,cAACwB,aAAAA;IAAWC,SAAQ;IAAYC,WAAU;IAAOC,cAAAA;KAC9C5C,QAAAA,IAGL,MACJ,gBAAAiB,OAAA,cAACwB,aAAAA;IAAWC,SAAS3C,QAAQ,YAAY;IAAS4C,WAAU;IAAOC,cAAAA;KAChEnD,IAAAA,CAAAA,CAAAA,GAINE,sBAAsB,WAEjB,gBAAAsB,OAAA,cAAC4B,cAAAA,MACC,gBAAA5B,OAAA,cAAC6B,cAAAA;IAAYV,YAAW;KACtB,gBAAAnB,OAAA,cAAC8B,aAAAA;IACCC,OAAO1C,SAAS,cAAc;IAC9B2C,MAAMlD,QAAQ,UAAU;IACxB4B,SAAS,6BACP9B,OACIiB,oBAAoBjB,IAAAA,IACpBK,KACEW,iBAAiBX,EAAAA,IACjBO,SAAS,MAAA,GALR;IAMTyC,oBAAAA;IACAC,eAAAA;IACAC,oBAAAA;KAEA,gBAAAnC,OAAA,cAACoC,0BAAAA;IAAwBC,UAAUvD,QAAQ,UAAU;UAK7D,IAAA;AAGV,GA9GqD;","names":["CardContent","styled","useShareForwardedRef","React","forwardRef","useEffect","CardContentExRoot","styled","CardContent","name","shouldForwardProp","prop","includes","slot","variant","removePadding","paddingBottom","overflow","paddingTop","padding","CardContentExWithRef","forwardRef","scrollToTop","refreshRef","props","ref","sharedRef","useShareForwardedRef","useEffect","current","scroll","behavior","top","displayName","CardContentEx","Card","useGradientStyles","React","forwardRef","CardExWithRef","style","gradient","props","ref","styles","gradientStyle","border","background","displayName","CardEx","ArrowForwardRounded","ArrowForwardRoundedIcon","alpha","Card","CardActions","CardContent","CardMedia","Grid","IconButton","Typography","useTheme","Zoom","FlexGrowCol","useIsMobile","React","useState","useNavigate","FullWidthCard","cardIsButton","desc","href","media","name","small","to","props","theme","useTheme","raised","setRaised","useState","navigate","useNavigate","isMobile","useIsMobile","localRouteChange","externalRouteChange","window","open","React","Card","elevation","style","height","width","sx","cursor","alpha","palette","primary","light","onMouseEnter","onMouseLeave","onClick","CardMedia","component","image","alt","CardContent","Grid","container","alignItems","paddingY","paddingX","item","xs","md","Typography","fontWeight","variant","textAlign","paddingBottom","display","justifyContent","Zoom","in","IconButton","color","size","disableFocusRipple","disableRipple","disableTouchRipple","ArrowForwardRoundedIcon","fontSize","CardActions","FlexGrowCol","Refresh","RefreshIcon","CardHeader","IconButton","TypographyEx","React","forwardRef","PageCardWithRef","forwardRef","subheader","title","onRefresh","children","action","style","props","ref","React","CardEx","backgroundColor","position","elevation","CardHeader","TypographyEx","variant","gutterBottom","IconButton","onClick","RefreshIcon","displayName","PageCard","ArrowForwardRounded","ArrowForwardRoundedIcon","alpha","CardActions","CardContent","CardMedia","IconButton","Typography","useTheme","FlexCol","FlexGrowCol","useIsMobile","React","useState","useNavigate","SimpleCard","desc","iconImage","interactionVariant","headline","href","media","small","subtitle","sx","to","props","theme","useTheme","raised","setRaised","useState","navigate","useNavigate","isMobile","useIsMobile","localRouteChange","externalRouteChange","window","open","React","CardEx","elevation","cursor","alpha","palette","primary","light","onMouseEnter","onMouseLeave","onClick","CardMedia","component","height","image","alt","CardContent","FlexCol","width","alignItems","img","src","style","paddingBottom","Typography","variant","textAlign","gutterBottom","CardActions","FlexGrowCol","IconButton","color","size","disableFocusRipple","disableRipple","disableTouchRipple","ArrowForwardRoundedIcon","fontSize"]}
package/package.json CHANGED
@@ -10,9 +10,9 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xylabs/react-flexbox": "^3.4.1",
14
- "@xyo-network/react-shared": "^2.81.10",
15
- "react-router-dom": "^6.25.1"
13
+ "@xylabs/react-flexbox": "^3.4.2",
14
+ "@xyo-network/react-shared": "^2.83.0",
15
+ "react-router-dom": "^6.26.0"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "@mui/icons-material": "^5",
@@ -22,42 +22,26 @@
22
22
  "react-dom": "^18"
23
23
  },
24
24
  "devDependencies": {
25
- "@storybook/react": "^7.6.20",
26
- "@xylabs/ts-scripts-yarn3": "^3.12.4",
27
- "@xylabs/tsconfig-react": "^3.12.4",
28
- "@xyo-network/react-storybook": "^2.81.10",
25
+ "@storybook/react": "^8.2.7",
26
+ "@xylabs/ts-scripts-yarn3": "^4.0.0-rc.7",
27
+ "@xylabs/tsconfig-react": "^4.0.0-rc.7",
28
+ "@xyo-network/react-storybook": "^2.83.0",
29
29
  "typescript": "^5.5.4"
30
30
  },
31
31
  "description": "Common React library for all XYO projects that use React",
32
32
  "docs": "dist/docs.json",
33
33
  "exports": {
34
34
  ".": {
35
- "node": {
36
- "import": {
37
- "types": "./dist/node/index.d.mts",
38
- "default": "./dist/node/index.js"
39
- },
40
- "require": {
41
- "types": "./dist/node/index.d.cts",
42
- "default": "./dist/node/index.cjs"
43
- }
35
+ "import": {
36
+ "types": "./dist/browser/index.d.ts",
37
+ "default": "./dist/browser/index.mjs"
44
38
  },
45
- "browser": {
46
- "import": {
47
- "types": "./dist/browser/index.d.mts",
48
- "default": "./dist/browser/index.js"
49
- },
50
- "require": {
51
- "types": "./dist/browser/index.d.cts",
52
- "default": "./dist/browser/index.cjs"
53
- }
54
- },
55
- "default": "./dist/browser/index.js"
39
+ "types": "./dist/browser/index.d.ts",
40
+ "default": "./dist/browser/index.mjs"
56
41
  },
57
42
  "./package.json": "./package.json"
58
43
  },
59
- "main": "dist/browser/index.cjs",
60
- "module": "dist/browser/index.js",
44
+ "module": "dist/browser/index.mjs",
61
45
  "homepage": "https://xyo.network",
62
46
  "keywords": [
63
47
  "xyo",
@@ -79,6 +63,6 @@
79
63
  },
80
64
  "sideEffects": false,
81
65
  "types": "dist/browser/index.d.ts",
82
- "version": "2.81.10",
66
+ "version": "2.83.0",
83
67
  "type": "module"
84
68
  }
@@ -1,12 +1,11 @@
1
- /* eslint-disable import/no-internal-modules */
2
1
  import { Button, Typography } from '@mui/material'
3
2
  import { Decorator, Meta, StoryFn } from '@storybook/react'
4
3
  import { FlexGrowCol } from '@xylabs/react-flexbox'
5
4
  import { WithRefDecorator } from '@xyo-network/react-storybook'
6
- import { useRef, useState } from 'react'
5
+ import React, { useRef, useState } from 'react'
7
6
 
8
- import { CardContentEx } from './CardContentEx.js'
9
- import { PageCard } from './PageCard.js'
7
+ import { CardContentEx } from './CardContentEx.tsx'
8
+ import { PageCard } from './PageCard.tsx'
10
9
 
11
10
  const ScrollableDecorator: Decorator = (Story, args) => {
12
11
  const [scrollToTop, setScrollToTop] = useState(0)
@@ -43,8 +42,11 @@ const Template: StoryFn<typeof CardContentEx> = (props) => {
43
42
  return (
44
43
  <PageCard title="Page Card" subheader="subheader">
45
44
  <CardContentEx {...props}>
46
- {[...Array(100).keys()].map((item) => (
47
- <Typography key={item}>{item}. - Item row</Typography>
45
+ {[...Array(100).keys()].map(item => (
46
+ <Typography key={item}>
47
+ {item}
48
+ . - Item row
49
+ </Typography>
48
50
  ))}
49
51
  </CardContentEx>
50
52
  </PageCard>
@@ -63,5 +65,4 @@ WithVariant.decorators = [ScrollableDecorator]
63
65
 
64
66
  export { Default, WithRef, WithVariant }
65
67
 
66
- // eslint-disable-next-line import/no-default-export
67
68
  export default StorybookEntry
@@ -1,6 +1,6 @@
1
1
  import { CardContent, CardContentProps, styled } from '@mui/material'
2
2
  import { useShareForwardedRef } from '@xyo-network/react-shared'
3
- import { forwardRef, useEffect } from 'react'
3
+ import React, { forwardRef, useEffect } from 'react'
4
4
 
5
5
  const CardContentExRoot = styled(CardContent, {
6
6
  name: 'CardContentEx',
@@ -1,6 +1,6 @@
1
1
  import { Card, CardProps } from '@mui/material'
2
2
  import { useGradientStyles } from '@xyo-network/react-shared'
3
- import { forwardRef } from 'react'
3
+ import React, { forwardRef } from 'react'
4
4
 
5
5
  export interface CardExProps extends CardProps {
6
6
  gradient?: 'border' | 'background'
@@ -8,10 +8,12 @@ export interface CardExProps extends CardProps {
8
8
 
9
9
  export const CardExWithRef = forwardRef<HTMLDivElement, CardExProps>(({ style, gradient, ...props }, ref) => {
10
10
  const { styles } = useGradientStyles()
11
- const gradientStyle =
12
- gradient === 'border' ? styles.border
13
- : gradient === 'background' ? styles.background
14
- : {}
11
+ const gradientStyle
12
+ = gradient === 'border'
13
+ ? styles.border
14
+ : gradient === 'background'
15
+ ? styles.background
16
+ : {}
15
17
  return (
16
18
  <Card
17
19
  style={{
@@ -1,7 +1,8 @@
1
1
  import { Meta, StoryFn } from '@storybook/react'
2
+ import React from 'react'
2
3
  import { BrowserRouter } from 'react-router-dom'
3
4
 
4
- import { FullWidthCard } from './FullWidthCard.js'
5
+ import { FullWidthCard } from './FullWidthCard.tsx'
5
6
  const StorybookEntry = {
6
7
  argTypes: {},
7
8
  component: FullWidthCard,
@@ -13,7 +14,7 @@ const StorybookEntry = {
13
14
  title: 'shared/FullWidthCard',
14
15
  } as Meta<typeof FullWidthCard>
15
16
 
16
- const Template: StoryFn<typeof FullWidthCard> = (args) => (
17
+ const Template: StoryFn<typeof FullWidthCard> = args => (
17
18
  <BrowserRouter>
18
19
  <FullWidthCard {...args}></FullWidthCard>
19
20
  </BrowserRouter>
@@ -30,5 +31,4 @@ Default.args = {
30
31
 
31
32
  export { Default }
32
33
 
33
- // eslint-disable-next-line import/no-default-export
34
34
  export default StorybookEntry