umwd-components 0.1.38 → 0.1.40

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.
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ /*
3
+ * UMWD-Components
4
+ * @copyright Jelle Paulus
5
+ * @license MIT
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var React = require('react');
13
+ var PropTypes = require('prop-types');
14
+ var material = require('@mui/material');
15
+ var Image = require('next/image');
16
+ require('@mui/icons-material');
17
+
18
+ function WebsitePlaceholder({
19
+ title,
20
+ announcement,
21
+ logo
22
+ }) {
23
+ const theme = material.useTheme();
24
+ const [visible, setVisible] = React.useState(true);
25
+ const handleKeydown = e => {
26
+ console.log("handleKeydown", e);
27
+ if (e.key === "W") {
28
+ setVisible(false);
29
+ }
30
+ };
31
+ return /*#__PURE__*/React.createElement(material.Box, {
32
+ sx: [visible && {
33
+ display: "grid",
34
+ justifyItems: "center",
35
+ alignItems: "center",
36
+ backgroundColor: theme.palette.primary.main,
37
+ height: "100vh",
38
+ maxHeight: "100vh",
39
+ width: "100vw",
40
+ overflow: "hidden",
41
+ position: "fixed",
42
+ top: 0,
43
+ left: 0,
44
+ zIndex: 9000,
45
+ isolation: "isolate"
46
+ }],
47
+ onKeyDown: e => handleKeydown()
48
+ }, visible && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(material.Typography, {
49
+ variant: "h1",
50
+ align: "center"
51
+ }, title), logo?.url && /*#__PURE__*/React.createElement(Image, {
52
+ src: logo.url,
53
+ alt: logo.alt || "logo",
54
+ width: logo.width || "200",
55
+ height: logo.height || "200"
56
+ }), /*#__PURE__*/React.createElement(material.Typography, {
57
+ variant: "h3",
58
+ align: "center"
59
+ }, announcement)));
60
+ }
61
+ WebsitePlaceholder.propTypes = {
62
+ title: PropTypes.string.isRequired,
63
+ announcement: PropTypes.string.isRequired,
64
+ logo: PropTypes.shape({
65
+ url: PropTypes.string.isRequired,
66
+ alt: PropTypes.string,
67
+ width: PropTypes.string,
68
+ height: PropTypes.string
69
+ }),
70
+ backgroundColor: PropTypes.string
71
+ };
72
+
73
+ exports.default = WebsitePlaceholder;
package/dist/cjs/index.js CHANGED
@@ -15,6 +15,7 @@ var TextImageBlock = require('./components/TextImageBlock.js');
15
15
  var Page = require('./components/Page.js');
16
16
  var Footer = require('./components/Footer.js');
17
17
  var ContactForm = require('./components/ContactForm.js');
18
+ var WebsitePlaceholder = require('./components/WebsitePlaceholder.js');
18
19
 
19
20
 
20
21
 
@@ -27,3 +28,4 @@ exports.TextImageBlock = TextImageBlock.default;
27
28
  exports.Page = Page.default;
28
29
  exports.Footer = Footer.default;
29
30
  exports.ContactForm = ContactForm.default;
31
+ exports.WebsitePlaceholder = WebsitePlaceholder.default;
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ /*
3
+ * UMWD-Components
4
+ * @copyright Jelle Paulus
5
+ * @license MIT
6
+ */
7
+
8
+ import React from 'react';
9
+ import PropTypes from 'prop-types';
10
+ import { useTheme, Box, Typography } from '@mui/material';
11
+ import Image from 'next/image';
12
+ import '@mui/icons-material';
13
+
14
+ function WebsitePlaceholder({
15
+ title,
16
+ announcement,
17
+ logo
18
+ }) {
19
+ const theme = useTheme();
20
+ const [visible, setVisible] = React.useState(true);
21
+ const handleKeydown = e => {
22
+ console.log("handleKeydown", e);
23
+ if (e.key === "W") {
24
+ setVisible(false);
25
+ }
26
+ };
27
+ return /*#__PURE__*/React.createElement(Box, {
28
+ sx: [visible && {
29
+ display: "grid",
30
+ justifyItems: "center",
31
+ alignItems: "center",
32
+ backgroundColor: theme.palette.primary.main,
33
+ height: "100vh",
34
+ maxHeight: "100vh",
35
+ width: "100vw",
36
+ overflow: "hidden",
37
+ position: "fixed",
38
+ top: 0,
39
+ left: 0,
40
+ zIndex: 9000,
41
+ isolation: "isolate"
42
+ }],
43
+ onKeyDown: e => handleKeydown()
44
+ }, visible && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
45
+ variant: "h1",
46
+ align: "center"
47
+ }, title), logo?.url && /*#__PURE__*/React.createElement(Image, {
48
+ src: logo.url,
49
+ alt: logo.alt || "logo",
50
+ width: logo.width || "200",
51
+ height: logo.height || "200"
52
+ }), /*#__PURE__*/React.createElement(Typography, {
53
+ variant: "h3",
54
+ align: "center"
55
+ }, announcement)));
56
+ }
57
+ WebsitePlaceholder.propTypes = {
58
+ title: PropTypes.string.isRequired,
59
+ announcement: PropTypes.string.isRequired,
60
+ logo: PropTypes.shape({
61
+ url: PropTypes.string.isRequired,
62
+ alt: PropTypes.string,
63
+ width: PropTypes.string,
64
+ height: PropTypes.string
65
+ }),
66
+ backgroundColor: PropTypes.string
67
+ };
68
+
69
+ export { WebsitePlaceholder as default };
package/dist/esm/index.js CHANGED
@@ -13,3 +13,4 @@ export { default as TextImageBlock } from './components/TextImageBlock.js';
13
13
  export { default as Page } from './components/Page.js';
14
14
  export { default as Footer } from './components/Footer.js';
15
15
  export { default as ContactForm } from './components/ContactForm.js';
16
+ export { default as WebsitePlaceholder } from './components/WebsitePlaceholder.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.38",
3
+ "version": "0.1.40",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -0,0 +1,76 @@
1
+ "use client";
2
+
3
+ import React from "react";
4
+ import PropTypes from "prop-types";
5
+ import { Typography, Box, useTheme } from "@mui/material";
6
+ import Image from "next/image";
7
+ import { Visibility } from "@mui/icons-material";
8
+
9
+ function WebsitePlaceholder({ title, announcement, logo }) {
10
+ const theme = useTheme();
11
+
12
+ const [visible, setVisible] = React.useState(true);
13
+
14
+ const handleKeydown = (e) => {
15
+ console.log("handleKeydown", e);
16
+ if (e.key === "W") {
17
+ setVisible(false);
18
+ }
19
+ };
20
+
21
+ return (
22
+ <Box
23
+ sx={[
24
+ visible && {
25
+ display: "grid",
26
+ justifyItems: "center",
27
+ alignItems: "center",
28
+ backgroundColor: theme.palette.primary.main,
29
+ height: "100vh",
30
+ maxHeight: "100vh",
31
+ width: "100vw",
32
+ overflow: "hidden",
33
+ position: "fixed",
34
+ top: 0,
35
+ left: 0,
36
+ zIndex: 9000,
37
+ isolation: "isolate",
38
+ },
39
+ ]}
40
+ onKeyDown={(e) => handleKeydown()}
41
+ >
42
+ {visible && (
43
+ <>
44
+ <Typography variant="h1" align="center">
45
+ {title}
46
+ </Typography>
47
+ {logo?.url && (
48
+ <Image
49
+ src={logo.url}
50
+ alt={logo.alt || "logo"}
51
+ width={logo.width || "200"}
52
+ height={logo.height || "200"}
53
+ />
54
+ )}
55
+ <Typography variant="h3" align="center">
56
+ {announcement}
57
+ </Typography>
58
+ </>
59
+ )}
60
+ </Box>
61
+ );
62
+ }
63
+
64
+ WebsitePlaceholder.propTypes = {
65
+ title: PropTypes.string.isRequired,
66
+ announcement: PropTypes.string.isRequired,
67
+ logo: PropTypes.shape({
68
+ url: PropTypes.string.isRequired,
69
+ alt: PropTypes.string,
70
+ width: PropTypes.string,
71
+ height: PropTypes.string,
72
+ }),
73
+ backgroundColor: PropTypes.string,
74
+ };
75
+
76
+ export default WebsitePlaceholder;
package/src/index.js CHANGED
@@ -8,3 +8,4 @@ export { default as TextImageBlock } from "./components/TextImageBlock";
8
8
  export { default as Page } from "./components/Page";
9
9
  export { default as Footer } from "./components/Footer";
10
10
  export { default as ContactForm } from "./components/ContactForm";
11
+ export { default as WebsitePlaceholder } from "./components/WebsitePlaceholder";
@@ -0,0 +1,47 @@
1
+ import WebsitePlaceholder from "../components/WebsitePlaceholder";
2
+ import React from "react";
3
+ import { Box } from "@mui/material";
4
+
5
+ export default {
6
+ title: "UMWD/WebsitePlaceholder",
7
+ component: WebsitePlaceholder,
8
+ };
9
+
10
+ const Template = ({ title, announcement, logo, ...args }) => (
11
+ <>
12
+ <WebsitePlaceholder title={title} announcement={announcement} logo={logo}>
13
+ <Box sx={{ height: "300px" }}></Box>
14
+ <Box sx={{ height: "300px" }}></Box>
15
+ <Box sx={{ height: "300px" }}></Box>
16
+ <Box sx={{ height: "300px" }}></Box>
17
+ <Box sx={{ height: "300px" }}></Box>
18
+ <Box sx={{ height: "300px" }}></Box>
19
+ </WebsitePlaceholder>
20
+ </>
21
+ );
22
+
23
+ export const HelloWorld = Template.bind({});
24
+
25
+ export const HelloMars = Template.bind({});
26
+
27
+ HelloWorld.args = {
28
+ title: "A New Website Near You!",
29
+ logo: {
30
+ url: "https://via.placeholder.com/850",
31
+ width: 850,
32
+ height: 850,
33
+ alt: "Hello World",
34
+ },
35
+ announcement: "Coming Soon!",
36
+ backgroundColor: "lightgrey",
37
+ };
38
+
39
+ HelloMars.args = {
40
+ title: "A Martian Near You!",
41
+ logo: {
42
+ url: "https://via.placeholder.com/850",
43
+ alt: "Hello Mars",
44
+ },
45
+ announcement: "In cinama's this summer!",
46
+ backgroundColor: "slategrey",
47
+ };