@campxdev/react-blueprint 1.8.8 → 1.8.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/react-blueprint",
3
- "version": "1.8.8",
3
+ "version": "1.8.9",
4
4
  "main": "./export.ts",
5
5
  "dependencies": {
6
6
  "@emotion/react": "^11.13.3",
@@ -1,8 +1,9 @@
1
1
  import { Alert as MuiAlert, AlertProps as MuiAlertProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
2
3
  import { Icons, Typography } from '../../export';
3
4
 
4
5
  export type AlertProps = {
5
- message: string;
6
+ message: string | ReactNode;
6
7
  } & MuiAlertProps;
7
8
 
8
9
  const getIcon = (severity: MuiAlertProps['severity']) => {
@@ -21,7 +22,11 @@ const getIcon = (severity: MuiAlertProps['severity']) => {
21
22
  export const Alert = ({ severity, message, ...rest }: AlertProps) => {
22
23
  return (
23
24
  <MuiAlert severity={severity} icon={getIcon(severity)} {...rest}>
24
- <Typography variant="caption">{message}</Typography>
25
+ {typeof message == 'string' ? (
26
+ <Typography variant="caption">{message}</Typography>
27
+ ) : (
28
+ message
29
+ )}
25
30
  </MuiAlert>
26
31
  );
27
32
  };
File without changes