umwd-components 0.1.38 → 0.1.39

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,70 @@
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
+
17
+ function WebsitePlaceholder({
18
+ title,
19
+ announcement,
20
+ logo
21
+ }) {
22
+ const theme = material.useTheme();
23
+ console.log(theme.palette.primary.main);
24
+ const handleKeydown = e => {
25
+ console.log(e);
26
+ };
27
+ return /*#__PURE__*/React.createElement(material.Box, {
28
+ sx: {
29
+ display: "grid",
30
+ justifyItems: "center",
31
+ alignItems: "center",
32
+ backgroundColor: theme.palette.primary.main,
33
+ height: "100vh",
34
+ width: "100vw",
35
+ overflow: "hidden",
36
+ position: "fixed",
37
+ top: 0,
38
+ left: 0,
39
+ zIndex: 1000,
40
+ isolation: "isolate"
41
+ },
42
+ onKeyDown: e => {
43
+ handleKeydown(e);
44
+ }
45
+ }, /*#__PURE__*/React.createElement(material.Typography, {
46
+ variant: "h1",
47
+ align: "center"
48
+ }, title), logo?.url && /*#__PURE__*/React.createElement(Image, {
49
+ src: logo.url,
50
+ alt: logo.alt || "logo",
51
+ width: logo.width || "200",
52
+ height: logo.height || "200"
53
+ }), /*#__PURE__*/React.createElement(material.Typography, {
54
+ variant: "h3",
55
+ align: "center"
56
+ }, announcement));
57
+ }
58
+ WebsitePlaceholder.propTypes = {
59
+ title: PropTypes.string.isRequired,
60
+ announcement: PropTypes.string.isRequired,
61
+ logo: PropTypes.shape({
62
+ src: PropTypes.string.isRequired,
63
+ alt: PropTypes.string,
64
+ width: PropTypes.string,
65
+ height: PropTypes.string
66
+ }),
67
+ backgroundColor: PropTypes.string
68
+ };
69
+
70
+ 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,66 @@
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
+
13
+ function WebsitePlaceholder({
14
+ title,
15
+ announcement,
16
+ logo
17
+ }) {
18
+ const theme = useTheme();
19
+ console.log(theme.palette.primary.main);
20
+ const handleKeydown = e => {
21
+ console.log(e);
22
+ };
23
+ return /*#__PURE__*/React.createElement(Box, {
24
+ sx: {
25
+ display: "grid",
26
+ justifyItems: "center",
27
+ alignItems: "center",
28
+ backgroundColor: theme.palette.primary.main,
29
+ height: "100vh",
30
+ width: "100vw",
31
+ overflow: "hidden",
32
+ position: "fixed",
33
+ top: 0,
34
+ left: 0,
35
+ zIndex: 1000,
36
+ isolation: "isolate"
37
+ },
38
+ onKeyDown: e => {
39
+ handleKeydown(e);
40
+ }
41
+ }, /*#__PURE__*/React.createElement(Typography, {
42
+ variant: "h1",
43
+ align: "center"
44
+ }, title), logo?.url && /*#__PURE__*/React.createElement(Image, {
45
+ src: logo.url,
46
+ alt: logo.alt || "logo",
47
+ width: logo.width || "200",
48
+ height: logo.height || "200"
49
+ }), /*#__PURE__*/React.createElement(Typography, {
50
+ variant: "h3",
51
+ align: "center"
52
+ }, announcement));
53
+ }
54
+ WebsitePlaceholder.propTypes = {
55
+ title: PropTypes.string.isRequired,
56
+ announcement: PropTypes.string.isRequired,
57
+ logo: PropTypes.shape({
58
+ src: PropTypes.string.isRequired,
59
+ alt: PropTypes.string,
60
+ width: PropTypes.string,
61
+ height: PropTypes.string
62
+ }),
63
+ backgroundColor: PropTypes.string
64
+ };
65
+
66
+ 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.39",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -0,0 +1,67 @@
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
+
8
+ function WebsitePlaceholder({ title, announcement, logo }) {
9
+ const theme = useTheme();
10
+
11
+ console.log(theme.palette.primary.main);
12
+
13
+ const handleKeydown = (e) => {
14
+ console.log(e);
15
+ };
16
+
17
+ return (
18
+ <Box
19
+ sx={{
20
+ display: "grid",
21
+ justifyItems: "center",
22
+ alignItems: "center",
23
+ backgroundColor: theme.palette.primary.main,
24
+ height: "100vh",
25
+ width: "100vw",
26
+ overflow: "hidden",
27
+ position: "fixed",
28
+ top: 0,
29
+ left: 0,
30
+ zIndex: 1000,
31
+ isolation: "isolate",
32
+ }}
33
+ onKeyDown={(e) => {
34
+ handleKeydown(e);
35
+ }}
36
+ >
37
+ <Typography variant="h1" align="center">
38
+ {title}
39
+ </Typography>
40
+ {logo?.url && (
41
+ <Image
42
+ src={logo.url}
43
+ alt={logo.alt || "logo"}
44
+ width={logo.width || "200"}
45
+ height={logo.height || "200"}
46
+ />
47
+ )}
48
+ <Typography variant="h3" align="center">
49
+ {announcement}
50
+ </Typography>
51
+ </Box>
52
+ );
53
+ }
54
+
55
+ WebsitePlaceholder.propTypes = {
56
+ title: PropTypes.string.isRequired,
57
+ announcement: PropTypes.string.isRequired,
58
+ logo: PropTypes.shape({
59
+ src: PropTypes.string.isRequired,
60
+ alt: PropTypes.string,
61
+ width: PropTypes.string,
62
+ height: PropTypes.string,
63
+ }),
64
+ backgroundColor: PropTypes.string,
65
+ };
66
+
67
+ 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,38 @@
1
+ import WebsitePlaceholder from "../components/WebsitePlaceholder";
2
+ import React from "react";
3
+
4
+ export default {
5
+ title: "UMWD/WebsitePlaceholder",
6
+ component: WebsitePlaceholder,
7
+ // argTypes: { numberOfChildren: { type: "number" } },
8
+ };
9
+
10
+ const Template = ({ title, announcement, logo, ...args }) => (
11
+ <WebsitePlaceholder title={title} announcement={announcement} logo={logo} />
12
+ );
13
+
14
+ export const HelloWorld = Template.bind({});
15
+
16
+ export const HelloMars = Template.bind({});
17
+
18
+ HelloWorld.args = {
19
+ title: "A New Website Near You!",
20
+ logo: {
21
+ url: "https://via.placeholder.com/850",
22
+ width: 850,
23
+ height: 850,
24
+ alt: "Hello World",
25
+ },
26
+ announcement: "Coming Soon!",
27
+ backgroundColor: "lightgrey",
28
+ };
29
+
30
+ HelloMars.args = {
31
+ title: "A Martian Near You!",
32
+ logo: {
33
+ url: "https://via.placeholder.com/850",
34
+ alt: "Hello Mars",
35
+ },
36
+ announcement: "In cinama's this summer!",
37
+ backgroundColor: "slategrey",
38
+ };