@oneblink/apps-react 1.0.0 → 1.0.1-beta.1
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.
@@ -1,16 +1,12 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { Typography, Grid, Container } from '@mui/material';
|
3
|
-
import { styled } from '@mui/material/styles';
|
2
|
+
import { Typography, Grid, Container, useTheme, styled } from '@mui/material';
|
4
3
|
function LargeIconMessage({ IconComponent, title, variant, gutterTop, gutterBottom, children, action, className, }) {
|
5
|
-
const
|
6
|
-
|
7
|
-
fontSize: theme.spacing(16),
|
8
|
-
}));
|
9
|
-
}, [IconComponent]);
|
4
|
+
const theme = useTheme();
|
5
|
+
const fontSize = React.useMemo(() => theme.spacing(16), [theme]);
|
10
6
|
return (React.createElement(Container, { maxWidth: "sm", className: className || 'ob-large-icon-message' },
|
11
7
|
React.createElement(StyledIconContainer, { gutterTop: gutterTop },
|
12
|
-
React.createElement(
|
13
|
-
React.createElement(Typography, { variant: "h5", align: "center", gutterBottom: true, color: variant }, title),
|
8
|
+
React.createElement(IconComponent, { color: variant, style: { fontSize } })),
|
9
|
+
React.createElement(Typography, { variant: "h5", align: "center", gutterBottom: true, color: `${variant}.main` }, title),
|
14
10
|
children ? (React.createElement(StyledTypography, { align: "center", variant: "body2", paragraph: !!action, gutterBottom: !action && gutterBottom }, children)) : null,
|
15
11
|
action && (React.createElement(StyledGrid, { container: true, justifyContent: "center", gutterBottom: gutterBottom }, action))));
|
16
12
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LargeIconMessage.js","sourceRoot":"","sources":["../../../src/components/messages/LargeIconMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,
|
1
|
+
{"version":3,"file":"LargeIconMessage.js","sourceRoot":"","sources":["../../../src/components/messages/LargeIconMessage.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AQ,gBAAgB,CAAC,CAAA;AAElD,MAAM,mBAAmB,GAAG,MAAM,CAAC,KAAK,EAAE;IACxC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,WAAW;CAClD,CAAC,CAEC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5B,SAAS,EAAE,QAAQ;IACnB,GAAG,CAAC,SAAS;QACX,CAAC,CAAC;YACE,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;SAC7B;QACH,CAAC,CAAC,EAAE,CAAC;CACR,CAAC,CAAC,CAAA;AAEH,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,EAAE;IAC1C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc;CACrD,CAAC,CAA0C,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IACxE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;CAC5D,CAAC,CAAC,CAAA;AAEH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE;IAC9B,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,cAAc;CACrD,CAAC,CAA6B,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IAC3D,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;CAC5D,CAAC,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport { Typography, Grid, Container, useTheme, styled } from '@mui/material'\nimport { CommonProps } from '@mui/material/OverridableComponent'\n\ntype Variant = 'primary' | 'success' | 'error' | 'warning'\nexport type Props = {\n IconComponent: React.ComponentType<{\n color: Variant\n style: React.CSSProperties\n }>\n title: string\n variant: Variant\n gutterTop?: boolean\n gutterBottom?: boolean\n children?: React.ReactNode\n action?: React.ReactNode\n className?: CommonProps['className']\n}\n\nfunction LargeIconMessage({\n IconComponent,\n title,\n variant,\n gutterTop,\n gutterBottom,\n children,\n action,\n className,\n}: Props) {\n const theme = useTheme()\n\n const fontSize = React.useMemo(() => theme.spacing(16), [theme])\n\n return (\n <Container maxWidth=\"sm\" className={className || 'ob-large-icon-message'}>\n <StyledIconContainer gutterTop={gutterTop}>\n <IconComponent color={variant} style={{ fontSize }} />\n </StyledIconContainer>\n <Typography\n variant=\"h5\"\n align=\"center\"\n gutterBottom\n color={`${variant}.main`}\n >\n {title}\n </Typography>\n {children ? (\n <StyledTypography\n align=\"center\"\n variant=\"body2\"\n paragraph={!!action}\n gutterBottom={!action && gutterBottom}\n >\n {children}\n </StyledTypography>\n ) : null}\n {action && (\n <StyledGrid\n container\n justifyContent=\"center\"\n gutterBottom={gutterBottom}\n >\n {action}\n </StyledGrid>\n )}\n </Container>\n )\n}\n\nexport default React.memo<Props>(LargeIconMessage)\n\nconst StyledIconContainer = styled('div', {\n shouldForwardProp: (prop) => prop !== 'gutterTop',\n})<{\n gutterTop?: boolean\n}>(({ theme, gutterTop }) => ({\n textAlign: 'center',\n ...(gutterTop\n ? {\n paddingTop: theme.spacing(4),\n }\n : {}),\n}))\n\nconst StyledTypography = styled(Typography, {\n shouldForwardProp: (prop) => prop !== 'gutterBottom',\n})<React.ComponentProps<typeof Typography>>(({ theme, gutterBottom }) => ({\n ...(gutterBottom ? { marginBottom: theme.spacing(4) } : {}),\n}))\n\nconst StyledGrid = styled(Grid, {\n shouldForwardProp: (prop) => prop !== 'gutterBottom',\n})<{ gutterBottom?: boolean }>(({ theme, gutterBottom }) => ({\n ...(gutterBottom ? { marginBottom: theme.spacing(4) } : {}),\n}))\n"]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@oneblink/apps-react",
|
3
3
|
"description": "Helper functions for OneBlink apps in ReactJS.",
|
4
|
-
"version": "1.0.
|
4
|
+
"version": "1.0.1-beta.1",
|
5
5
|
"author": "OneBlink <developers@oneblink.io> (https://oneblink.io)",
|
6
6
|
"bugs": {
|
7
7
|
"url": "https://github.com/oneblink/apps-react/issues"
|