@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.
Files changed (224) hide show
  1. package/dist/browser/components/CardContentEx.d.cts +3 -2
  2. package/dist/browser/components/CardContentEx.d.cts.map +1 -1
  3. package/dist/browser/components/CardContentEx.d.mts +3 -2
  4. package/dist/browser/components/CardContentEx.d.mts.map +1 -1
  5. package/dist/browser/components/CardContentEx.d.ts +3 -2
  6. package/dist/browser/components/CardContentEx.d.ts.map +1 -1
  7. package/dist/browser/components/CardEx.d.cts +3 -2
  8. package/dist/browser/components/CardEx.d.cts.map +1 -1
  9. package/dist/browser/components/CardEx.d.mts +3 -2
  10. package/dist/browser/components/CardEx.d.mts.map +1 -1
  11. package/dist/browser/components/CardEx.d.ts +3 -2
  12. package/dist/browser/components/CardEx.d.ts.map +1 -1
  13. package/dist/browser/components/FullWidthCard/FullWidthCard.d.cts +1 -1
  14. package/dist/browser/components/FullWidthCard/FullWidthCard.d.cts.map +1 -1
  15. package/dist/browser/components/FullWidthCard/FullWidthCard.d.mts +1 -1
  16. package/dist/browser/components/FullWidthCard/FullWidthCard.d.mts.map +1 -1
  17. package/dist/browser/components/FullWidthCard/FullWidthCard.d.ts +1 -1
  18. package/dist/browser/components/FullWidthCard/FullWidthCard.d.ts.map +1 -1
  19. package/dist/browser/components/FullWidthCard/index.d.cts +1 -1
  20. package/dist/browser/components/FullWidthCard/index.d.cts.map +1 -1
  21. package/dist/browser/components/FullWidthCard/index.d.mts +1 -1
  22. package/dist/browser/components/FullWidthCard/index.d.mts.map +1 -1
  23. package/dist/browser/components/FullWidthCard/index.d.ts +1 -1
  24. package/dist/browser/components/FullWidthCard/index.d.ts.map +1 -1
  25. package/dist/browser/components/PageCard.d.cts +3 -3
  26. package/dist/browser/components/PageCard.d.cts.map +1 -1
  27. package/dist/browser/components/PageCard.d.mts +3 -3
  28. package/dist/browser/components/PageCard.d.mts.map +1 -1
  29. package/dist/browser/components/PageCard.d.ts +3 -3
  30. package/dist/browser/components/PageCard.d.ts.map +1 -1
  31. package/dist/browser/components/SimpleCard/SimpleCard.d.cts +2 -2
  32. package/dist/browser/components/SimpleCard/SimpleCard.d.cts.map +1 -1
  33. package/dist/browser/components/SimpleCard/SimpleCard.d.mts +2 -2
  34. package/dist/browser/components/SimpleCard/SimpleCard.d.mts.map +1 -1
  35. package/dist/browser/components/SimpleCard/SimpleCard.d.ts +2 -2
  36. package/dist/browser/components/SimpleCard/SimpleCard.d.ts.map +1 -1
  37. package/dist/browser/components/SimpleCard/index.d.cts +1 -1
  38. package/dist/browser/components/SimpleCard/index.d.cts.map +1 -1
  39. package/dist/browser/components/SimpleCard/index.d.mts +1 -1
  40. package/dist/browser/components/SimpleCard/index.d.mts.map +1 -1
  41. package/dist/browser/components/SimpleCard/index.d.ts +1 -1
  42. package/dist/browser/components/SimpleCard/index.d.ts.map +1 -1
  43. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.cts +2 -1
  44. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.cts.map +1 -1
  45. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.mts +2 -1
  46. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.mts.map +1 -1
  47. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.ts +2 -1
  48. package/dist/browser/components/SimpleCardGrid/SimpleCardGrid.d.ts.map +1 -1
  49. package/dist/browser/components/SimpleCardGrid/index.d.cts +1 -1
  50. package/dist/browser/components/SimpleCardGrid/index.d.cts.map +1 -1
  51. package/dist/browser/components/SimpleCardGrid/index.d.mts +1 -1
  52. package/dist/browser/components/SimpleCardGrid/index.d.mts.map +1 -1
  53. package/dist/browser/components/SimpleCardGrid/index.d.ts +1 -1
  54. package/dist/browser/components/SimpleCardGrid/index.d.ts.map +1 -1
  55. package/dist/browser/components/index.d.cts +5 -5
  56. package/dist/browser/components/index.d.cts.map +1 -1
  57. package/dist/browser/components/index.d.mts +5 -5
  58. package/dist/browser/components/index.d.mts.map +1 -1
  59. package/dist/browser/components/index.d.ts +5 -5
  60. package/dist/browser/components/index.d.ts.map +1 -1
  61. package/dist/browser/index.cjs +207 -146
  62. package/dist/browser/index.cjs.map +1 -1
  63. package/dist/browser/index.d.cts +1 -1
  64. package/dist/browser/index.d.mts +1 -1
  65. package/dist/browser/index.d.ts +1 -1
  66. package/dist/browser/index.mjs +278 -0
  67. package/dist/browser/index.mjs.map +1 -0
  68. package/dist/neutral/components/CardContentEx.d.cts +3 -2
  69. package/dist/neutral/components/CardContentEx.d.cts.map +1 -1
  70. package/dist/neutral/components/CardContentEx.d.mts +3 -2
  71. package/dist/neutral/components/CardContentEx.d.mts.map +1 -1
  72. package/dist/neutral/components/CardContentEx.d.ts +3 -2
  73. package/dist/neutral/components/CardContentEx.d.ts.map +1 -1
  74. package/dist/neutral/components/CardEx.d.cts +3 -2
  75. package/dist/neutral/components/CardEx.d.cts.map +1 -1
  76. package/dist/neutral/components/CardEx.d.mts +3 -2
  77. package/dist/neutral/components/CardEx.d.mts.map +1 -1
  78. package/dist/neutral/components/CardEx.d.ts +3 -2
  79. package/dist/neutral/components/CardEx.d.ts.map +1 -1
  80. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.cts +1 -1
  81. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.cts.map +1 -1
  82. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.mts +1 -1
  83. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.mts.map +1 -1
  84. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.ts +1 -1
  85. package/dist/neutral/components/FullWidthCard/FullWidthCard.d.ts.map +1 -1
  86. package/dist/neutral/components/FullWidthCard/index.d.cts +1 -1
  87. package/dist/neutral/components/FullWidthCard/index.d.cts.map +1 -1
  88. package/dist/neutral/components/FullWidthCard/index.d.mts +1 -1
  89. package/dist/neutral/components/FullWidthCard/index.d.mts.map +1 -1
  90. package/dist/neutral/components/FullWidthCard/index.d.ts +1 -1
  91. package/dist/neutral/components/FullWidthCard/index.d.ts.map +1 -1
  92. package/dist/neutral/components/PageCard.d.cts +3 -3
  93. package/dist/neutral/components/PageCard.d.cts.map +1 -1
  94. package/dist/neutral/components/PageCard.d.mts +3 -3
  95. package/dist/neutral/components/PageCard.d.mts.map +1 -1
  96. package/dist/neutral/components/PageCard.d.ts +3 -3
  97. package/dist/neutral/components/PageCard.d.ts.map +1 -1
  98. package/dist/neutral/components/SimpleCard/SimpleCard.d.cts +2 -2
  99. package/dist/neutral/components/SimpleCard/SimpleCard.d.cts.map +1 -1
  100. package/dist/neutral/components/SimpleCard/SimpleCard.d.mts +2 -2
  101. package/dist/neutral/components/SimpleCard/SimpleCard.d.mts.map +1 -1
  102. package/dist/neutral/components/SimpleCard/SimpleCard.d.ts +2 -2
  103. package/dist/neutral/components/SimpleCard/SimpleCard.d.ts.map +1 -1
  104. package/dist/neutral/components/SimpleCard/index.d.cts +1 -1
  105. package/dist/neutral/components/SimpleCard/index.d.cts.map +1 -1
  106. package/dist/neutral/components/SimpleCard/index.d.mts +1 -1
  107. package/dist/neutral/components/SimpleCard/index.d.mts.map +1 -1
  108. package/dist/neutral/components/SimpleCard/index.d.ts +1 -1
  109. package/dist/neutral/components/SimpleCard/index.d.ts.map +1 -1
  110. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.cts +2 -1
  111. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.cts.map +1 -1
  112. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.mts +2 -1
  113. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.mts.map +1 -1
  114. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.ts +2 -1
  115. package/dist/neutral/components/SimpleCardGrid/SimpleCardGrid.d.ts.map +1 -1
  116. package/dist/neutral/components/SimpleCardGrid/index.d.cts +1 -1
  117. package/dist/neutral/components/SimpleCardGrid/index.d.cts.map +1 -1
  118. package/dist/neutral/components/SimpleCardGrid/index.d.mts +1 -1
  119. package/dist/neutral/components/SimpleCardGrid/index.d.mts.map +1 -1
  120. package/dist/neutral/components/SimpleCardGrid/index.d.ts +1 -1
  121. package/dist/neutral/components/SimpleCardGrid/index.d.ts.map +1 -1
  122. package/dist/neutral/components/index.d.cts +5 -5
  123. package/dist/neutral/components/index.d.cts.map +1 -1
  124. package/dist/neutral/components/index.d.mts +5 -5
  125. package/dist/neutral/components/index.d.mts.map +1 -1
  126. package/dist/neutral/components/index.d.ts +5 -5
  127. package/dist/neutral/components/index.d.ts.map +1 -1
  128. package/dist/neutral/index.cjs +207 -146
  129. package/dist/neutral/index.cjs.map +1 -1
  130. package/dist/neutral/index.d.cts +1 -1
  131. package/dist/neutral/index.d.mts +1 -1
  132. package/dist/neutral/index.d.ts +1 -1
  133. package/dist/neutral/index.mjs +278 -0
  134. package/dist/neutral/index.mjs.map +1 -0
  135. package/dist/node/components/CardContentEx.d.cts +3 -2
  136. package/dist/node/components/CardContentEx.d.cts.map +1 -1
  137. package/dist/node/components/CardContentEx.d.mts +3 -2
  138. package/dist/node/components/CardContentEx.d.mts.map +1 -1
  139. package/dist/node/components/CardContentEx.d.ts +3 -2
  140. package/dist/node/components/CardContentEx.d.ts.map +1 -1
  141. package/dist/node/components/CardEx.d.cts +3 -2
  142. package/dist/node/components/CardEx.d.cts.map +1 -1
  143. package/dist/node/components/CardEx.d.mts +3 -2
  144. package/dist/node/components/CardEx.d.mts.map +1 -1
  145. package/dist/node/components/CardEx.d.ts +3 -2
  146. package/dist/node/components/CardEx.d.ts.map +1 -1
  147. package/dist/node/components/FullWidthCard/FullWidthCard.d.cts +1 -1
  148. package/dist/node/components/FullWidthCard/FullWidthCard.d.cts.map +1 -1
  149. package/dist/node/components/FullWidthCard/FullWidthCard.d.mts +1 -1
  150. package/dist/node/components/FullWidthCard/FullWidthCard.d.mts.map +1 -1
  151. package/dist/node/components/FullWidthCard/FullWidthCard.d.ts +1 -1
  152. package/dist/node/components/FullWidthCard/FullWidthCard.d.ts.map +1 -1
  153. package/dist/node/components/FullWidthCard/index.d.cts +1 -1
  154. package/dist/node/components/FullWidthCard/index.d.cts.map +1 -1
  155. package/dist/node/components/FullWidthCard/index.d.mts +1 -1
  156. package/dist/node/components/FullWidthCard/index.d.mts.map +1 -1
  157. package/dist/node/components/FullWidthCard/index.d.ts +1 -1
  158. package/dist/node/components/FullWidthCard/index.d.ts.map +1 -1
  159. package/dist/node/components/PageCard.d.cts +3 -3
  160. package/dist/node/components/PageCard.d.cts.map +1 -1
  161. package/dist/node/components/PageCard.d.mts +3 -3
  162. package/dist/node/components/PageCard.d.mts.map +1 -1
  163. package/dist/node/components/PageCard.d.ts +3 -3
  164. package/dist/node/components/PageCard.d.ts.map +1 -1
  165. package/dist/node/components/SimpleCard/SimpleCard.d.cts +2 -2
  166. package/dist/node/components/SimpleCard/SimpleCard.d.cts.map +1 -1
  167. package/dist/node/components/SimpleCard/SimpleCard.d.mts +2 -2
  168. package/dist/node/components/SimpleCard/SimpleCard.d.mts.map +1 -1
  169. package/dist/node/components/SimpleCard/SimpleCard.d.ts +2 -2
  170. package/dist/node/components/SimpleCard/SimpleCard.d.ts.map +1 -1
  171. package/dist/node/components/SimpleCard/index.d.cts +1 -1
  172. package/dist/node/components/SimpleCard/index.d.cts.map +1 -1
  173. package/dist/node/components/SimpleCard/index.d.mts +1 -1
  174. package/dist/node/components/SimpleCard/index.d.mts.map +1 -1
  175. package/dist/node/components/SimpleCard/index.d.ts +1 -1
  176. package/dist/node/components/SimpleCard/index.d.ts.map +1 -1
  177. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.cts +2 -1
  178. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.cts.map +1 -1
  179. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.mts +2 -1
  180. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.mts.map +1 -1
  181. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.ts +2 -1
  182. package/dist/node/components/SimpleCardGrid/SimpleCardGrid.d.ts.map +1 -1
  183. package/dist/node/components/SimpleCardGrid/index.d.cts +1 -1
  184. package/dist/node/components/SimpleCardGrid/index.d.cts.map +1 -1
  185. package/dist/node/components/SimpleCardGrid/index.d.mts +1 -1
  186. package/dist/node/components/SimpleCardGrid/index.d.mts.map +1 -1
  187. package/dist/node/components/SimpleCardGrid/index.d.ts +1 -1
  188. package/dist/node/components/SimpleCardGrid/index.d.ts.map +1 -1
  189. package/dist/node/components/index.d.cts +5 -5
  190. package/dist/node/components/index.d.cts.map +1 -1
  191. package/dist/node/components/index.d.mts +5 -5
  192. package/dist/node/components/index.d.mts.map +1 -1
  193. package/dist/node/components/index.d.ts +5 -5
  194. package/dist/node/components/index.d.ts.map +1 -1
  195. package/dist/node/index.cjs +207 -146
  196. package/dist/node/index.cjs.map +1 -1
  197. package/dist/node/index.d.cts +1 -1
  198. package/dist/node/index.d.mts +1 -1
  199. package/dist/node/index.d.ts +1 -1
  200. package/dist/node/index.mjs +279 -0
  201. package/dist/node/index.mjs.map +1 -0
  202. package/package.json +12 -12
  203. package/src/components/CardContentEx.stories.tsx +8 -7
  204. package/src/components/CardContentEx.tsx +1 -1
  205. package/src/components/CardEx.tsx +7 -5
  206. package/src/components/FullWidthCard/FullWidthCard.stories.tsx +3 -3
  207. package/src/components/FullWidthCard/FullWidthCard.tsx +41 -32
  208. package/src/components/FullWidthCard/index.ts +1 -1
  209. package/src/components/PageCard.stories.tsx +6 -5
  210. package/src/components/PageCard.tsx +11 -9
  211. package/src/components/SimpleCard/SimpleCard.stories.tsx +4 -4
  212. package/src/components/SimpleCard/SimpleCard.tsx +65 -53
  213. package/src/components/SimpleCard/index.ts +1 -1
  214. package/src/components/SimpleCardGrid/SimpleCardGrid.stories.tsx +4 -4
  215. package/src/components/SimpleCardGrid/SimpleCardGrid.tsx +2 -1
  216. package/src/components/SimpleCardGrid/index.ts +1 -1
  217. package/src/components/index.ts +5 -5
  218. package/src/index.ts +1 -1
  219. package/dist/browser/index.js +0 -225
  220. package/dist/browser/index.js.map +0 -1
  221. package/dist/neutral/index.js +0 -225
  222. package/dist/neutral/index.js.map +0 -1
  223. package/dist/node/index.js +0 -226
  224. package/dist/node/index.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { Refresh as RefreshIcon } from '@mui/icons-material'
2
2
  import { CardHeader, CardHeaderProps, IconButton } from '@mui/material'
3
3
  import { TypographyEx } from '@xyo-network/react-shared'
4
- import { forwardRef, ReactNode } from 'react'
4
+ import React, { forwardRef, ReactNode } from 'react'
5
5
 
6
- import { CardEx, CardExProps } from './CardEx.js'
6
+ import { CardEx, CardExProps } from './CardEx.tsx'
7
7
 
8
8
  export interface PageCardProps extends CardExProps {
9
9
  action?: ReactNode
@@ -15,20 +15,22 @@ const PageCardWithRef = forwardRef<HTMLDivElement, PageCardProps>(({ subheader,
15
15
  return (
16
16
  <CardEx style={{ backgroundColor: 'transparent', position: 'relative', ...style }} elevation={0} ref={ref} {...props}>
17
17
  <CardHeader
18
- title={
18
+ title={(
19
19
  <TypographyEx variant="h5" gutterBottom>
20
20
  {title}
21
21
  </TypographyEx>
22
- }
22
+ )}
23
23
  subheader={<TypographyEx variant="subtitle1">{subheader}</TypographyEx>}
24
24
  action={
25
25
  action ?? (
26
26
  <>
27
- {onRefresh ?
28
- <IconButton onClick={() => onRefresh?.()}>
29
- <RefreshIcon />
30
- </IconButton>
31
- : null}
27
+ {onRefresh
28
+ ? (
29
+ <IconButton onClick={() => onRefresh?.()}>
30
+ <RefreshIcon />
31
+ </IconButton>
32
+ )
33
+ : null}
32
34
  </>
33
35
  )
34
36
  }
@@ -1,10 +1,11 @@
1
1
  import { Grid } from '@mui/material'
2
2
  import { Meta, StoryFn } from '@storybook/react'
3
+ import React from 'react'
3
4
  import { BrowserRouter } from 'react-router-dom'
4
5
 
5
6
  import CoinbaseWalletIcon from './coinbase-wallet.svg'
6
7
  import MoneyMedia from './money.jpg'
7
- import { SimpleCard } from './SimpleCard.js'
8
+ import { SimpleCard } from './SimpleCard.tsx'
8
9
  const StorybookEntry = {
9
10
  argTypes: {},
10
11
  component: SimpleCard,
@@ -16,7 +17,7 @@ const StorybookEntry = {
16
17
  title: 'shared/SimpleCard',
17
18
  } as Meta<typeof SimpleCard>
18
19
 
19
- const Template: StoryFn<typeof SimpleCard> = (args) => (
20
+ const Template: StoryFn<typeof SimpleCard> = args => (
20
21
  <BrowserRouter>
21
22
  <Grid container spacing={2}>
22
23
  <Grid item xs={12} sm={6} md={3}>
@@ -80,9 +81,8 @@ CardWithAllParameters.args = {
80
81
  }
81
82
 
82
83
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
83
- //@ts-ignore
84
+ // @ts-ignore
84
85
 
85
86
  export { CardWithAllParameters, Default, DefaultMediaCard, DefaultSmallCard, DefaultWithImage, VariantButton }
86
87
 
87
- // eslint-disable-next-line import/no-default-export
88
88
  export default StorybookEntry
@@ -2,10 +2,10 @@ import { ArrowForwardRounded as ArrowForwardRoundedIcon } from '@mui/icons-mater
2
2
  import { alpha, CardActions, CardContent, CardMedia, IconButton, Typography, useTheme } from '@mui/material'
3
3
  import { FlexCol, FlexGrowCol } from '@xylabs/react-flexbox'
4
4
  import { useIsMobile } from '@xyo-network/react-shared'
5
- import { ReactNode, useState } from 'react'
5
+ import React, { ReactNode, useState } from 'react'
6
6
  import { To, useNavigate } from 'react-router-dom'
7
7
 
8
- import { CardEx, CardExProps } from '../CardEx.js'
8
+ import { CardEx, CardExProps } from '../CardEx.tsx'
9
9
 
10
10
  export interface SimpleCardProps extends CardExProps {
11
11
  desc?: ReactNode
@@ -37,9 +37,11 @@ export const SimpleCard: React.FC<SimpleCardProps> = ({
37
37
  const navigate = useNavigate()
38
38
  const isMobile = useIsMobile()
39
39
  const localRouteChange = (to: To | undefined) => {
40
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
40
41
  to ? navigate(to) : navigate('/404')
41
42
  }
42
43
  const externalRouteChange = (href: string | undefined) => {
44
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
43
45
  href ? window.open(href) : navigate('/404')
44
46
  }
45
47
  return (
@@ -49,72 +51,82 @@ export const SimpleCard: React.FC<SimpleCardProps> = ({
49
51
  '&:hover': {
50
52
  cursor: interactionVariant == 'button' ? 'pointer' : null,
51
53
  },
52
- backgroundColor: alpha(theme.palette.primary.light, 0.05),
54
+ 'backgroundColor': alpha(theme.palette.primary.light, 0.05),
53
55
  ...sx,
54
56
  }}
55
57
  onMouseEnter={() =>
56
- isMobile ? null
57
- : interactionVariant == 'button' ? setRaised(true)
58
- : null
59
- }
58
+ isMobile
59
+ ? null
60
+ : interactionVariant == 'button'
61
+ ? setRaised(true)
62
+ : null}
60
63
  onMouseLeave={() =>
61
- isMobile ? null
62
- : interactionVariant == 'button' ? setRaised(false)
63
- : null
64
- }
64
+ isMobile
65
+ ? null
66
+ : interactionVariant == 'button'
67
+ ? setRaised(false)
68
+ : null}
65
69
  onClick={() =>
66
- interactionVariant == 'button' ?
67
- href ? externalRouteChange(href)
68
- : to ? localRouteChange(to)
69
- : navigate('/404')
70
- : null
71
- }
70
+ interactionVariant == 'button'
71
+ ? href
72
+ ? externalRouteChange(href)
73
+ : to
74
+ ? localRouteChange(to)
75
+ : navigate('/404')
76
+ : null}
72
77
  {...props}
73
78
  >
74
- {media ?
75
- <CardMedia component="img" height="100" image={media} alt="" />
76
- : null}
79
+ {media
80
+ ? <CardMedia component="img" height="100" image={media} alt="" />
81
+ : null}
77
82
 
78
83
  <CardContent sx={{ height: '100%' }}>
79
84
  <FlexCol width="100%" alignItems="flex-start">
80
- {iconImage ?
81
- <img src={iconImage} height="40px" style={{ paddingBottom: '8px' }} />
82
- : null}
83
- {typeof headline === 'string' ?
84
- <Typography variant={small ? 'body1' : 'h6'} textAlign="left" gutterBottom>
85
- {headline}
86
- </Typography>
87
- : headline}
88
- {subtitle ?
89
- <Typography variant="subtitle2" textAlign="left" gutterBottom>
90
- {subtitle}
91
- </Typography>
92
- : null}
85
+ {iconImage
86
+ ? <img src={iconImage} height="40px" style={{ paddingBottom: '8px' }} />
87
+ : null}
88
+ {typeof headline === 'string'
89
+ ? (
90
+ <Typography variant={small ? 'body1' : 'h6'} textAlign="left" gutterBottom>
91
+ {headline}
92
+ </Typography>
93
+ )
94
+ : headline}
95
+ {subtitle
96
+ ? (
97
+ <Typography variant="subtitle2" textAlign="left" gutterBottom>
98
+ {subtitle}
99
+ </Typography>
100
+ )
101
+ : null}
93
102
  <Typography variant={small ? 'caption' : 'body1'} textAlign="left" gutterBottom>
94
103
  {desc}
95
104
  </Typography>
96
105
  </FlexCol>
97
106
  </CardContent>
98
- {interactionVariant == 'button' ?
99
- <CardActions>
100
- <FlexGrowCol alignItems="flex-end">
101
- <IconButton
102
- color={raised ? 'secondary' : 'primary'}
103
- size={small ? 'small' : 'medium'}
104
- onClick={() =>
105
- href ? externalRouteChange(href)
106
- : to ? localRouteChange(to)
107
- : navigate('/404')
108
- }
109
- disableFocusRipple
110
- disableRipple
111
- disableTouchRipple
112
- >
113
- <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />
114
- </IconButton>
115
- </FlexGrowCol>
116
- </CardActions>
117
- : null}
107
+ {interactionVariant == 'button'
108
+ ? (
109
+ <CardActions>
110
+ <FlexGrowCol alignItems="flex-end">
111
+ <IconButton
112
+ color={raised ? 'secondary' : 'primary'}
113
+ size={small ? 'small' : 'medium'}
114
+ onClick={() =>
115
+ href
116
+ ? externalRouteChange(href)
117
+ : to
118
+ ? localRouteChange(to)
119
+ : navigate('/404')}
120
+ disableFocusRipple
121
+ disableRipple
122
+ disableTouchRipple
123
+ >
124
+ <ArrowForwardRoundedIcon fontSize={small ? 'small' : 'medium'} />
125
+ </IconButton>
126
+ </FlexGrowCol>
127
+ </CardActions>
128
+ )
129
+ : null}
118
130
  </CardEx>
119
131
  )
120
132
  }
@@ -1 +1 @@
1
- export * from './SimpleCard.js'
1
+ export * from './SimpleCard.tsx'
@@ -1,9 +1,10 @@
1
1
  import { Meta, StoryFn } from '@storybook/react'
2
+ import React from 'react'
2
3
  import { BrowserRouter } from 'react-router-dom'
3
4
 
4
5
  import CoinbaseWalletIcon from './coinbase-wallet.svg'
5
6
  import MoneyMedia from './money.jpg'
6
- import { SimpleCardGrid } from './SimpleCardGrid.js'
7
+ import { SimpleCardGrid } from './SimpleCardGrid.tsx'
7
8
  const StorybookEntry = {
8
9
  argTypes: {},
9
10
  component: SimpleCardGrid,
@@ -15,7 +16,7 @@ const StorybookEntry = {
15
16
  title: 'shared/SimpleCardGrid',
16
17
  } as Meta<typeof SimpleCardGrid>
17
18
 
18
- const Template: StoryFn<typeof SimpleCardGrid> = (args) => (
19
+ const Template: StoryFn<typeof SimpleCardGrid> = args => (
19
20
  <BrowserRouter>
20
21
  <SimpleCardGrid {...args}></SimpleCardGrid>
21
22
  </BrowserRouter>
@@ -69,9 +70,8 @@ Default.args = {
69
70
  }
70
71
 
71
72
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
72
- //@ts-ignore
73
+ // @ts-ignore
73
74
 
74
75
  export { Default }
75
76
 
76
- // eslint-disable-next-line import/no-default-export
77
77
  export default StorybookEntry
@@ -1,6 +1,7 @@
1
1
  import { Grid, GridProps } from '@mui/material'
2
+ import React from 'react'
2
3
 
3
- import { SimpleCard, SimpleCardProps } from '../SimpleCard/index.js'
4
+ import { SimpleCard, SimpleCardProps } from '../SimpleCard/index.ts'
4
5
 
5
6
  export interface SimpleCardGridProps extends GridProps {
6
7
  cards?: SimpleCardProps[]
@@ -1 +1 @@
1
- export * from './SimpleCardGrid.js'
1
+ export * from './SimpleCardGrid.tsx'
@@ -1,5 +1,5 @@
1
- export * from './CardContentEx.js'
2
- export * from './CardEx.js'
3
- export * from './FullWidthCard/index.js'
4
- export * from './PageCard.js'
5
- export * from './SimpleCard/index.js'
1
+ export * from './CardContentEx.tsx'
2
+ export * from './CardEx.tsx'
3
+ export * from './FullWidthCard/index.ts'
4
+ export * from './PageCard.tsx'
5
+ export * from './SimpleCard/index.ts'
package/src/index.ts CHANGED
@@ -1 +1 @@
1
- export * from './components/index.js'
1
+ export * from './components/index.ts'
@@ -1,225 +0,0 @@
1
- // src/components/CardContentEx.tsx
2
- import { CardContent, styled } from "@mui/material";
3
- import { useShareForwardedRef } from "@xyo-network/react-shared";
4
- import { forwardRef, useEffect } from "react";
5
- import { jsx } from "react/jsx-runtime";
6
- var CardContentExRoot = styled(CardContent, {
7
- name: "CardContentEx",
8
- shouldForwardProp: (prop) => !["variant", "removePadding"].includes(prop),
9
- slot: "Root"
10
- })(({ variant, removePadding }) => ({
11
- ...(variant === "scrollable" || removePadding) && {
12
- [":last-child"]: {
13
- paddingBottom: 0
14
- },
15
- overflow: "auto",
16
- paddingTop: 0,
17
- ...removePadding && { padding: 0 }
18
- }
19
- }));
20
- var CardContentExWithRef = forwardRef(({ scrollToTop = 0, refreshRef = 0, ...props }, ref) => {
21
- const sharedRef = useShareForwardedRef(ref, refreshRef);
22
- useEffect(() => {
23
- if (sharedRef && scrollToTop) {
24
- sharedRef.current?.scroll({ behavior: "smooth", top: 0 });
25
- }
26
- }, [sharedRef, scrollToTop]);
27
- return /* @__PURE__ */ jsx(CardContentExRoot, { ref: sharedRef, ...props });
28
- });
29
- CardContentExWithRef.displayName = "CardContentEx";
30
- var CardContentEx = CardContentExWithRef;
31
-
32
- // src/components/CardEx.tsx
33
- import { Card } from "@mui/material";
34
- import { useGradientStyles } from "@xyo-network/react-shared";
35
- import { forwardRef as forwardRef2 } from "react";
36
- import { jsx as jsx2 } from "react/jsx-runtime";
37
- var CardExWithRef = forwardRef2(({ style, gradient, ...props }, ref) => {
38
- const { styles } = useGradientStyles();
39
- const gradientStyle = gradient === "border" ? styles.border : gradient === "background" ? styles.background : {};
40
- return /* @__PURE__ */ jsx2(
41
- Card,
42
- {
43
- style: {
44
- ...gradientStyle,
45
- ...style
46
- },
47
- ref,
48
- ...props
49
- }
50
- );
51
- });
52
- CardExWithRef.displayName = "CardEx";
53
- var CardEx = CardExWithRef;
54
-
55
- // src/components/FullWidthCard/FullWidthCard.tsx
56
- import { ArrowForwardRounded as ArrowForwardRoundedIcon } from "@mui/icons-material";
57
- import { alpha, Card as Card2, CardActions, CardContent as CardContent2, CardMedia, Grid, IconButton, Typography, useTheme, Zoom } from "@mui/material";
58
- import { FlexGrowCol } from "@xylabs/react-flexbox";
59
- import { useIsMobile } from "@xyo-network/react-shared";
60
- import { useState } from "react";
61
- import { useNavigate } from "react-router-dom";
62
- import { jsx as jsx3, jsxs } from "react/jsx-runtime";
63
- var FullWidthCard = ({ cardIsButton, desc, href, media, name, small, to, ...props }) => {
64
- const theme = useTheme();
65
- const [raised, setRaised] = useState(false);
66
- const navigate = useNavigate();
67
- const isMobile = useIsMobile();
68
- const localRouteChange = (to2) => {
69
- to2 ? navigate(to2) : navigate("/404");
70
- };
71
- const externalRouteChange = (href2) => {
72
- href2 ? window.open(href2) : navigate("/404");
73
- };
74
- return /* @__PURE__ */ jsxs(
75
- Card2,
76
- {
77
- elevation: raised ? 3 : 0,
78
- style: { height: "100%", width: "100%" },
79
- ...props,
80
- sx: {
81
- "&:hover": {
82
- cursor: "pointer"
83
- },
84
- backgroundColor: alpha(theme.palette.primary.light, 0.05)
85
- },
86
- onMouseEnter: () => isMobile ? null : cardIsButton ? setRaised(true) : null,
87
- onMouseLeave: () => isMobile ? null : cardIsButton ? setRaised(false) : null,
88
- onClick: () => cardIsButton ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null,
89
- children: [
90
- media ? /* @__PURE__ */ jsx3(CardMedia, { component: "img", height: "100", image: media, alt: "" }) : null,
91
- /* @__PURE__ */ jsx3(CardContent2, { children: /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", paddingY: 2, paddingX: 2, children: [
92
- /* @__PURE__ */ jsx3(Grid, { item: true, xs: 12, md: 6, children: typeof name === "string" ? /* @__PURE__ */ jsx3(Typography, { fontWeight: 700, variant: "h2", textAlign: "left", paddingBottom: 1, children: name }) : name }),
93
- /* @__PURE__ */ jsx3(Grid, { item: true, xs: 12, md: 5, children: /* @__PURE__ */ jsx3(Typography, { variant: "body1", fontWeight: 400, textAlign: "left", children: desc }) }),
94
- /* @__PURE__ */ jsx3(Grid, { item: true, xs: 1, display: isMobile ? "none" : "flex", justifyContent: "center", children: /* @__PURE__ */ jsx3(Zoom, { in: raised, children: /* @__PURE__ */ jsx3(
95
- IconButton,
96
- {
97
- color: "primary",
98
- size: small ? "small" : "medium",
99
- onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
100
- disableFocusRipple: true,
101
- disableRipple: true,
102
- disableTouchRipple: true,
103
- children: /* @__PURE__ */ jsx3(ArrowForwardRoundedIcon, { fontSize: small ? "small" : "medium" })
104
- }
105
- ) }) })
106
- ] }) }),
107
- /* @__PURE__ */ jsx3(CardActions, { sx: { display: { md: isMobile ? "flex" : "none" } }, children: /* @__PURE__ */ jsx3(FlexGrowCol, { alignItems: "flex-end", children: /* @__PURE__ */ jsx3(
108
- IconButton,
109
- {
110
- color: "primary",
111
- size: small ? "small" : "medium",
112
- onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
113
- disableFocusRipple: true,
114
- disableRipple: true,
115
- disableTouchRipple: true,
116
- children: /* @__PURE__ */ jsx3(ArrowForwardRoundedIcon, { fontSize: small ? "small" : "medium" })
117
- }
118
- ) }) })
119
- ]
120
- }
121
- );
122
- };
123
-
124
- // src/components/PageCard.tsx
125
- import { Refresh as RefreshIcon } from "@mui/icons-material";
126
- import { CardHeader, IconButton as IconButton2 } from "@mui/material";
127
- import { TypographyEx } from "@xyo-network/react-shared";
128
- import { forwardRef as forwardRef3 } from "react";
129
- import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
130
- var PageCardWithRef = forwardRef3(({ subheader, title, onRefresh, children, action, style, ...props }, ref) => {
131
- return /* @__PURE__ */ jsxs2(CardEx, { style: { backgroundColor: "transparent", position: "relative", ...style }, elevation: 0, ref, ...props, children: [
132
- /* @__PURE__ */ jsx4(
133
- CardHeader,
134
- {
135
- title: /* @__PURE__ */ jsx4(TypographyEx, { variant: "h5", gutterBottom: true, children: title }),
136
- subheader: /* @__PURE__ */ jsx4(TypographyEx, { variant: "subtitle1", children: subheader }),
137
- action: action ?? /* @__PURE__ */ jsx4(Fragment, { children: onRefresh ? /* @__PURE__ */ jsx4(IconButton2, { onClick: () => onRefresh?.(), children: /* @__PURE__ */ jsx4(RefreshIcon, {}) }) : null })
138
- }
139
- ),
140
- children
141
- ] });
142
- });
143
- PageCardWithRef.displayName = "PageCard";
144
- var PageCard = PageCardWithRef;
145
-
146
- // src/components/SimpleCard/SimpleCard.tsx
147
- import { ArrowForwardRounded as ArrowForwardRoundedIcon2 } from "@mui/icons-material";
148
- import { alpha as alpha2, CardActions as CardActions2, CardContent as CardContent3, CardMedia as CardMedia2, IconButton as IconButton3, Typography as Typography2, useTheme as useTheme2 } from "@mui/material";
149
- import { FlexCol, FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
150
- import { useIsMobile as useIsMobile2 } from "@xyo-network/react-shared";
151
- import { useState as useState2 } from "react";
152
- import { useNavigate as useNavigate2 } from "react-router-dom";
153
- import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
154
- var SimpleCard = ({
155
- desc,
156
- iconImage,
157
- interactionVariant = "card",
158
- headline,
159
- href,
160
- media,
161
- small,
162
- subtitle,
163
- sx,
164
- to,
165
- ...props
166
- }) => {
167
- const theme = useTheme2();
168
- const [raised, setRaised] = useState2(false);
169
- const navigate = useNavigate2();
170
- const isMobile = useIsMobile2();
171
- const localRouteChange = (to2) => {
172
- to2 ? navigate(to2) : navigate("/404");
173
- };
174
- const externalRouteChange = (href2) => {
175
- href2 ? window.open(href2) : navigate("/404");
176
- };
177
- return /* @__PURE__ */ jsxs3(
178
- CardEx,
179
- {
180
- elevation: raised ? 3 : 0,
181
- sx: {
182
- "&:hover": {
183
- cursor: interactionVariant == "button" ? "pointer" : null
184
- },
185
- backgroundColor: alpha2(theme.palette.primary.light, 0.05),
186
- ...sx
187
- },
188
- onMouseEnter: () => isMobile ? null : interactionVariant == "button" ? setRaised(true) : null,
189
- onMouseLeave: () => isMobile ? null : interactionVariant == "button" ? setRaised(false) : null,
190
- onClick: () => interactionVariant == "button" ? href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404") : null,
191
- ...props,
192
- children: [
193
- media ? /* @__PURE__ */ jsx5(CardMedia2, { component: "img", height: "100", image: media, alt: "" }) : null,
194
- /* @__PURE__ */ jsx5(CardContent3, { sx: { height: "100%" }, children: /* @__PURE__ */ jsxs3(FlexCol, { width: "100%", alignItems: "flex-start", children: [
195
- iconImage ? /* @__PURE__ */ jsx5("img", { src: iconImage, height: "40px", style: { paddingBottom: "8px" } }) : null,
196
- typeof headline === "string" ? /* @__PURE__ */ jsx5(Typography2, { variant: small ? "body1" : "h6", textAlign: "left", gutterBottom: true, children: headline }) : headline,
197
- subtitle ? /* @__PURE__ */ jsx5(Typography2, { variant: "subtitle2", textAlign: "left", gutterBottom: true, children: subtitle }) : null,
198
- /* @__PURE__ */ jsx5(Typography2, { variant: small ? "caption" : "body1", textAlign: "left", gutterBottom: true, children: desc })
199
- ] }) }),
200
- interactionVariant == "button" ? /* @__PURE__ */ jsx5(CardActions2, { children: /* @__PURE__ */ jsx5(FlexGrowCol2, { alignItems: "flex-end", children: /* @__PURE__ */ jsx5(
201
- IconButton3,
202
- {
203
- color: raised ? "secondary" : "primary",
204
- size: small ? "small" : "medium",
205
- onClick: () => href ? externalRouteChange(href) : to ? localRouteChange(to) : navigate("/404"),
206
- disableFocusRipple: true,
207
- disableRipple: true,
208
- disableTouchRipple: true,
209
- children: /* @__PURE__ */ jsx5(ArrowForwardRoundedIcon2, { fontSize: small ? "small" : "medium" })
210
- }
211
- ) }) }) : null
212
- ]
213
- }
214
- );
215
- };
216
- export {
217
- CardContentEx,
218
- CardContentExWithRef,
219
- CardEx,
220
- CardExWithRef,
221
- FullWidthCard,
222
- PageCard,
223
- SimpleCard
224
- };
225
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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 { 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,SAAS,aAA+B,cAAc;AACtD,SAAS,4BAA4B;AACrC,SAAS,YAAY,iBAAiB;AAiC7B;AA/BT,IAAM,oBAAoB,OAAO,aAAa;AAAA,EAC5C,MAAM;AAAA,EACN,mBAAmB,CAAC,SAAiB,CAAC,CAAC,WAAW,eAAe,EAAE,SAAS,IAAI;AAAA,EAChF,MAAM;AACR,CAAC,EAAsB,CAAC,EAAE,SAAS,cAAc,OAAO;AAAA,EACtD,IAAK,YAAY,gBAAgB,kBAAkB;AAAA,IACjD,CAAC,aAAa,GAAG;AAAA,MACf,eAAe;AAAA,IACjB;AAAA,IACA,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAI,iBAAiB,EAAE,SAAS,EAAE;AAAA,EACp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C,sBAAsB,WACrB,gBAAAX,KAACY,cAAA,EACC,0BAAAZ,KAACa,cAAA,EAAY,YAAW,YACtB,0BAAAb;AAAA,UAACc;AAAA,UAAA;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,0BAAAd,KAACe,0BAAA,EAAwB,UAAU,QAAQ,UAAU,UAAU;AAAA;AAAA,QACjE,GACF,GACF,IACA;AAAA;AAAA;AAAA,EACJ;AAEJ;","names":["forwardRef","jsx","Card","CardContent","jsx","to","href","IconButton","forwardRef","jsx","jsxs","forwardRef","IconButton","ArrowForwardRoundedIcon","alpha","CardActions","CardContent","CardMedia","IconButton","Typography","useTheme","FlexGrowCol","useIsMobile","useState","useNavigate","jsx","jsxs","useTheme","useState","useNavigate","useIsMobile","to","href","alpha","CardMedia","CardContent","Typography","CardActions","FlexGrowCol","IconButton","ArrowForwardRoundedIcon"]}