@availity/mui-card 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -3
- package/dist/index.mjs +14 -3
- package/package.json +2 -2
- package/src/lib/CardHeader.tsx +19 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.2.7](https://github.com/Availity/element/compare/@availity/mui-card@0.2.6...@availity/mui-card@0.2.7) (2023-12-14)
|
|
6
|
+
|
|
7
|
+
## [0.2.6](https://github.com/Availity/element/compare/@availity/mui-card@0.2.5...@availity/mui-card@0.2.6) (2023-12-04)
|
|
8
|
+
|
|
9
|
+
### Dependency Updates
|
|
10
|
+
|
|
11
|
+
* `mui-button` updated to version `0.6.0`
|
|
5
12
|
## [0.2.5](https://github.com/Availity/element/compare/@availity/mui-card@0.2.4...@availity/mui-card@0.2.5) (2023-11-16)
|
|
6
13
|
|
|
7
14
|
### Dependency Updates
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
- `mui-button` updated to version `0.5.1`
|
|
17
|
+
- `mui-icon` updated to version `0.7.3`
|
|
18
|
+
|
|
11
19
|
## [0.2.4](https://github.com/Availity/element/compare/@availity/mui-card@0.2.3...@availity/mui-card@0.2.4) (2023-11-08)
|
|
12
20
|
|
|
13
21
|
### Dependency Updates
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare const CardContent: ({ children, ...rest }: CardContentProps) => JSX.Elem
|
|
|
23
23
|
interface CardHeaderProps extends Omit<CardHeaderProps$1, 'avatar'> {
|
|
24
24
|
children?: React.ReactNode;
|
|
25
25
|
}
|
|
26
|
-
declare const CardHeader: ({ ...rest }: CardHeaderProps) => JSX.Element;
|
|
26
|
+
declare const CardHeader: ({ titleTypographyProps, subheaderTypographyProps, ...rest }: CardHeaderProps) => JSX.Element;
|
|
27
27
|
|
|
28
28
|
interface CardMediaProps extends CardMediaProps$1 {
|
|
29
29
|
children?: React.ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -71,13 +71,24 @@ var CardContent = ({ children, ...rest }) => {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
// src/lib/CardHeader.tsx
|
|
74
|
+
var import_styles = require("@mui/material/styles");
|
|
74
75
|
var import_material5 = require("@mui/material");
|
|
75
76
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
76
|
-
var CardHeader = ({
|
|
77
|
+
var CardHeader = ({
|
|
78
|
+
titleTypographyProps,
|
|
79
|
+
subheaderTypographyProps,
|
|
80
|
+
...rest
|
|
81
|
+
}) => {
|
|
82
|
+
var _a, _b, _c, _d;
|
|
83
|
+
const theme = (0, import_styles.useTheme)();
|
|
84
|
+
const titleVariant = (_d = (_c = (_b = (_a = theme.components) == null ? void 0 : _a.MuiCardHeader) == null ? void 0 : _b.defaultProps) == null ? void 0 : _c.titleTypographyProps) == null ? void 0 : _d.variant;
|
|
77
85
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material5.CardHeader, {
|
|
78
86
|
...rest,
|
|
79
|
-
titleTypographyProps: {
|
|
80
|
-
|
|
87
|
+
titleTypographyProps: {
|
|
88
|
+
variant: titleVariant,
|
|
89
|
+
...titleTypographyProps
|
|
90
|
+
},
|
|
91
|
+
subheaderTypographyProps: { variant: "subtitle2", ...subheaderTypographyProps }
|
|
81
92
|
});
|
|
82
93
|
};
|
|
83
94
|
|
package/dist/index.mjs
CHANGED
|
@@ -40,13 +40,24 @@ var CardContent = ({ children, ...rest }) => {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
// src/lib/CardHeader.tsx
|
|
43
|
+
import { useTheme } from "@mui/material/styles";
|
|
43
44
|
import { CardHeader as MuiCardHeader } from "@mui/material";
|
|
44
45
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
45
|
-
var CardHeader = ({
|
|
46
|
+
var CardHeader = ({
|
|
47
|
+
titleTypographyProps,
|
|
48
|
+
subheaderTypographyProps,
|
|
49
|
+
...rest
|
|
50
|
+
}) => {
|
|
51
|
+
var _a, _b, _c, _d;
|
|
52
|
+
const theme = useTheme();
|
|
53
|
+
const titleVariant = (_d = (_c = (_b = (_a = theme.components) == null ? void 0 : _a.MuiCardHeader) == null ? void 0 : _b.defaultProps) == null ? void 0 : _c.titleTypographyProps) == null ? void 0 : _d.variant;
|
|
46
54
|
return /* @__PURE__ */ jsx5(MuiCardHeader, {
|
|
47
55
|
...rest,
|
|
48
|
-
titleTypographyProps: {
|
|
49
|
-
|
|
56
|
+
titleTypographyProps: {
|
|
57
|
+
variant: titleVariant,
|
|
58
|
+
...titleTypographyProps
|
|
59
|
+
},
|
|
60
|
+
subheaderTypographyProps: { variant: "subtitle2", ...subheaderTypographyProps }
|
|
50
61
|
});
|
|
51
62
|
};
|
|
52
63
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-card",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Availity MUI Card Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"publish:canary": "yarn npm publish --access public --tag canary"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@availity/mui-button": "^0.
|
|
35
|
+
"@availity/mui-button": "^0.6.0",
|
|
36
36
|
"@availity/mui-icon": "^0.7.3",
|
|
37
37
|
"@mui/material": "^5.14.12",
|
|
38
38
|
"react": "18.2.0",
|
package/src/lib/CardHeader.tsx
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
|
+
import { useTheme } from '@mui/material/styles';
|
|
1
2
|
import { CardHeader as MuiCardHeader, CardHeaderProps as MuiCardHeaderProps } from '@mui/material';
|
|
2
3
|
|
|
3
4
|
export interface CardHeaderProps extends Omit<MuiCardHeaderProps, 'avatar'> {
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
|
-
export const CardHeader = ({
|
|
8
|
+
export const CardHeader = ({
|
|
9
|
+
titleTypographyProps,
|
|
10
|
+
subheaderTypographyProps,
|
|
11
|
+
...rest
|
|
12
|
+
}: CardHeaderProps): JSX.Element => {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* This is ugly, but it allows us to define a default variant while retaining the rest of the
|
|
17
|
+
* titleTypographyProps that the user passed.
|
|
18
|
+
*/
|
|
19
|
+
const titleVariant = theme.components?.MuiCardHeader?.defaultProps?.titleTypographyProps?.variant;
|
|
20
|
+
|
|
8
21
|
return (
|
|
9
22
|
<MuiCardHeader
|
|
10
23
|
{...rest}
|
|
11
|
-
titleTypographyProps={{
|
|
12
|
-
|
|
24
|
+
titleTypographyProps={{
|
|
25
|
+
variant: titleVariant,
|
|
26
|
+
...titleTypographyProps,
|
|
27
|
+
}}
|
|
28
|
+
subheaderTypographyProps={{ variant: 'subtitle2', ...subheaderTypographyProps }}
|
|
13
29
|
/>
|
|
14
30
|
);
|
|
15
31
|
};
|