umwd-components 0.1.48 → 0.1.50
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/dist/cjs/components/WebsitePlaceholder.js +6 -1
- package/dist/esm/components/WebsitePlaceholder.js +6 -1
- package/package.json +1 -1
- package/src/components/Card.js +28 -0
- package/src/components/ThreeUp.js +42 -0
- package/src/components/WebsitePlaceholder.js +14 -2
- package/src/stories/ThreeUp.stories.js +35 -0
- package/src/stories/WebsitePlaceholder.stories.js +19 -4
|
@@ -18,6 +18,8 @@ function WebsitePlaceholder({
|
|
|
18
18
|
title,
|
|
19
19
|
announcement,
|
|
20
20
|
logo,
|
|
21
|
+
lmBackgroundUrl,
|
|
22
|
+
dmBackgroundUrl,
|
|
21
23
|
children
|
|
22
24
|
}) {
|
|
23
25
|
const theme = material.useTheme();
|
|
@@ -60,6 +62,8 @@ function WebsitePlaceholder({
|
|
|
60
62
|
justifyItems: "center",
|
|
61
63
|
alignItems: "center",
|
|
62
64
|
backgroundColor: theme.palette.primary.main,
|
|
65
|
+
backgroundImage: `url(${theme.palette.mode === "light" ? lmBackgroundUrl : dmBackgroundUrl})`,
|
|
66
|
+
backgroundSize: "cover",
|
|
63
67
|
height: "100vh",
|
|
64
68
|
maxHeight: "100vh",
|
|
65
69
|
width: "100vw",
|
|
@@ -92,7 +96,8 @@ WebsitePlaceholder.propTypes = {
|
|
|
92
96
|
width: PropTypes.string,
|
|
93
97
|
height: PropTypes.string
|
|
94
98
|
}),
|
|
95
|
-
|
|
99
|
+
lmBackgroundUrl: PropTypes.string,
|
|
100
|
+
dmBackgroundUrl: PropTypes.string
|
|
96
101
|
};
|
|
97
102
|
|
|
98
103
|
exports.default = WebsitePlaceholder;
|
|
@@ -14,6 +14,8 @@ function WebsitePlaceholder({
|
|
|
14
14
|
title,
|
|
15
15
|
announcement,
|
|
16
16
|
logo,
|
|
17
|
+
lmBackgroundUrl,
|
|
18
|
+
dmBackgroundUrl,
|
|
17
19
|
children
|
|
18
20
|
}) {
|
|
19
21
|
const theme = useTheme();
|
|
@@ -56,6 +58,8 @@ function WebsitePlaceholder({
|
|
|
56
58
|
justifyItems: "center",
|
|
57
59
|
alignItems: "center",
|
|
58
60
|
backgroundColor: theme.palette.primary.main,
|
|
61
|
+
backgroundImage: `url(${theme.palette.mode === "light" ? lmBackgroundUrl : dmBackgroundUrl})`,
|
|
62
|
+
backgroundSize: "cover",
|
|
59
63
|
height: "100vh",
|
|
60
64
|
maxHeight: "100vh",
|
|
61
65
|
width: "100vw",
|
|
@@ -88,7 +92,8 @@ WebsitePlaceholder.propTypes = {
|
|
|
88
92
|
width: PropTypes.string,
|
|
89
93
|
height: PropTypes.string
|
|
90
94
|
}),
|
|
91
|
-
|
|
95
|
+
lmBackgroundUrl: PropTypes.string,
|
|
96
|
+
dmBackgroundUrl: PropTypes.string
|
|
92
97
|
};
|
|
93
98
|
|
|
94
99
|
export { WebsitePlaceholder as default };
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import PropTypes from "prop-types";
|
|
5
|
+
import { Button, Card as MuiCard } from "@mui/material";
|
|
6
|
+
import { CardActions, CardContent, CardHeader, CardMedia } from "@mui/material";
|
|
7
|
+
|
|
8
|
+
function Card({ title, subHeader, cardContent, cardLink }) {
|
|
9
|
+
return (
|
|
10
|
+
<MuiCard sx={{ width: "100%" }}>
|
|
11
|
+
<CardHeader title={title} subheader={subHeader}></CardHeader>
|
|
12
|
+
<CardContent>
|
|
13
|
+
{/* ToDo Parse MD*/}
|
|
14
|
+
{cardContent && cardContent}
|
|
15
|
+
</CardContent>
|
|
16
|
+
<CardMedia></CardMedia>
|
|
17
|
+
<CardActions>
|
|
18
|
+
{cardLink && <Button size="small">Learn More</Button>}
|
|
19
|
+
</CardActions>
|
|
20
|
+
</MuiCard>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
Card.propTypes = {
|
|
25
|
+
title: PropTypes.string.isRequired,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default Card;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Card from "./Card";
|
|
5
|
+
import { Stack } from "@mui/material";
|
|
6
|
+
|
|
7
|
+
function ThreeUp({ card1, card2, card3 }) {
|
|
8
|
+
console.log("card1", card1);
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<Stack direction={"row"} spacing={2} justifyContent={"space-between"}>
|
|
12
|
+
{card1 && (
|
|
13
|
+
<Card
|
|
14
|
+
title={card1.title}
|
|
15
|
+
subHeader={card1.subHeader}
|
|
16
|
+
cardContent={card1.cardContent}
|
|
17
|
+
cardLink={card1.cardLink}
|
|
18
|
+
/>
|
|
19
|
+
)}
|
|
20
|
+
{card2 && (
|
|
21
|
+
<Card
|
|
22
|
+
title={card2.title}
|
|
23
|
+
subHeader={card2.subHeader}
|
|
24
|
+
cardContent={card2.cardContent}
|
|
25
|
+
cardLink={card2.cardLink}
|
|
26
|
+
/>
|
|
27
|
+
)}
|
|
28
|
+
{card3 && (
|
|
29
|
+
<Card
|
|
30
|
+
title={card3.title}
|
|
31
|
+
subHeader={card3.subHeader}
|
|
32
|
+
cardContent={card3.cardContent}
|
|
33
|
+
cardLink={card3.cardLink}
|
|
34
|
+
/>
|
|
35
|
+
)}
|
|
36
|
+
</Stack>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ThreeUp.propTypes = {};
|
|
41
|
+
|
|
42
|
+
export default ThreeUp;
|
|
@@ -5,7 +5,14 @@ import PropTypes from "prop-types";
|
|
|
5
5
|
import { Typography, Box, useTheme } from "@mui/material";
|
|
6
6
|
import Image from "next/image";
|
|
7
7
|
|
|
8
|
-
function WebsitePlaceholder({
|
|
8
|
+
function WebsitePlaceholder({
|
|
9
|
+
title,
|
|
10
|
+
announcement,
|
|
11
|
+
logo,
|
|
12
|
+
lmBackgroundUrl,
|
|
13
|
+
dmBackgroundUrl,
|
|
14
|
+
children,
|
|
15
|
+
}) {
|
|
9
16
|
const theme = useTheme();
|
|
10
17
|
|
|
11
18
|
// const [keysPressed, setKeysPressed] = React.useState({});
|
|
@@ -58,6 +65,10 @@ function WebsitePlaceholder({ title, announcement, logo, children }) {
|
|
|
58
65
|
justifyItems: "center",
|
|
59
66
|
alignItems: "center",
|
|
60
67
|
backgroundColor: theme.palette.primary.main,
|
|
68
|
+
backgroundImage: `url(${
|
|
69
|
+
theme.palette.mode === "light" ? lmBackgroundUrl : dmBackgroundUrl
|
|
70
|
+
})`,
|
|
71
|
+
backgroundSize: "cover",
|
|
61
72
|
height: "100vh",
|
|
62
73
|
maxHeight: "100vh",
|
|
63
74
|
width: "100vw",
|
|
@@ -102,7 +113,8 @@ WebsitePlaceholder.propTypes = {
|
|
|
102
113
|
width: PropTypes.string,
|
|
103
114
|
height: PropTypes.string,
|
|
104
115
|
}),
|
|
105
|
-
|
|
116
|
+
lmBackgroundUrl: PropTypes.string,
|
|
117
|
+
dmBackgroundUrl: PropTypes.string,
|
|
106
118
|
};
|
|
107
119
|
|
|
108
120
|
export default WebsitePlaceholder;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import ThreeUp from "../components/ThreeUp";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "UMWD/ThreeUp",
|
|
6
|
+
component: ThreeUp,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Template = ({ card1, card2, card3, ...args }) => (
|
|
10
|
+
<ThreeUp card1={card1} card2={card2} card3={card3} />
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const AMH = Template.bind({});
|
|
14
|
+
|
|
15
|
+
AMH.args = {
|
|
16
|
+
card1: { title: "Card 1" },
|
|
17
|
+
card2: { title: "Card 2" },
|
|
18
|
+
card3: { title: "Card 3" },
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const OREFS = Template.bind({});
|
|
22
|
+
|
|
23
|
+
OREFS.args = {
|
|
24
|
+
card1: { title: "Card 1" },
|
|
25
|
+
card2: { title: "Card 2" },
|
|
26
|
+
card3: { title: "Card 3" },
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const UMWD = Template.bind({});
|
|
30
|
+
|
|
31
|
+
UMWD.args = {
|
|
32
|
+
card1: { title: "Card 1" },
|
|
33
|
+
card2: { title: "Card 2" },
|
|
34
|
+
card3: { title: "Card 3" },
|
|
35
|
+
};
|
|
@@ -7,10 +7,23 @@ export default {
|
|
|
7
7
|
component: WebsitePlaceholder,
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
const Template = ({
|
|
10
|
+
const Template = ({
|
|
11
|
+
title,
|
|
12
|
+
announcement,
|
|
13
|
+
logo,
|
|
14
|
+
lmBackgroundUrl,
|
|
15
|
+
dmBackgroundUrl,
|
|
16
|
+
...args
|
|
17
|
+
}) => {
|
|
11
18
|
return (
|
|
12
19
|
<>
|
|
13
|
-
<WebsitePlaceholder
|
|
20
|
+
<WebsitePlaceholder
|
|
21
|
+
title={title}
|
|
22
|
+
announcement={announcement}
|
|
23
|
+
logo={logo}
|
|
24
|
+
lmBackgroundUrl={lmBackgroundUrl}
|
|
25
|
+
dmBackgroundUrl={dmBackgroundUrl}
|
|
26
|
+
>
|
|
14
27
|
<Box sx={{ height: "300px" }}>
|
|
15
28
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
16
29
|
eiusmod tempor incididunt ut labore et dolore magna aliqua. Convallis
|
|
@@ -149,7 +162,8 @@ HelloWorld.args = {
|
|
|
149
162
|
alt: "Hello World",
|
|
150
163
|
},
|
|
151
164
|
announcement: "Coming Soon!",
|
|
152
|
-
|
|
165
|
+
lmBackgroundUrl: "https://via.placeholder.com/1920x1080",
|
|
166
|
+
dmBackgroundUrl: "https://via.placeholder.com/1920x1080",
|
|
153
167
|
};
|
|
154
168
|
|
|
155
169
|
HelloMars.args = {
|
|
@@ -159,5 +173,6 @@ HelloMars.args = {
|
|
|
159
173
|
alt: "Hello Mars",
|
|
160
174
|
},
|
|
161
175
|
announcement: "In cinama's this summer!",
|
|
162
|
-
|
|
176
|
+
lmBackgroundUrl: "https://via.placeholder.com/1920x1080",
|
|
177
|
+
dmBackgroundUrl: "https://via.placeholder.com/1920x1080",
|
|
163
178
|
};
|