umwd-components 0.1.62 → 0.1.64

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.
@@ -9,10 +9,9 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
13
12
  var React = require('react');
14
13
  var PropTypes = require('prop-types');
15
- var TextImageBlock = require('./TextImageBlock.js');
14
+ var TextImageSection = require('./TextImageSection.js');
16
15
  var HeroSection = require('./HeroSection.js');
17
16
  var FeaturesSection = require('./FeaturesSection.js');
18
17
 
@@ -29,9 +28,10 @@ function blockRenderer(block) {
29
28
  data: block
30
29
  });
31
30
  case "layout.text-image-section":
32
- return /*#__PURE__*/React.createElement(TextImageBlock.default, _rollupPluginBabelHelpers.extends({
33
- key: block.id
34
- }, block));
31
+ return /*#__PURE__*/React.createElement(TextImageSection.default, {
32
+ key: block.id,
33
+ data: block
34
+ });
35
35
  default:
36
36
  return null;
37
37
  }
@@ -13,10 +13,10 @@ var utils = require('../lib/utils.js');
13
13
  function StrapiImage(_ref) {
14
14
  let {
15
15
  src,
16
- alt,
17
- height,
18
- width,
19
- style
16
+ alt = "",
17
+ height = 100,
18
+ width = 100,
19
+ style = {}
20
20
  } = _ref;
21
21
  if (!src) return null;
22
22
  const imageUrl = utils.getStrapiMedia(src);
@@ -0,0 +1,78 @@
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 material = require('@mui/material');
14
+ var muiMarkdown = require('mui-markdown');
15
+ var StrapiImage = require('./StrapiImage.js');
16
+
17
+ function TextImageSection(_ref) {
18
+ let {
19
+ data
20
+ } = _ref;
21
+ const {
22
+ title,
23
+ text,
24
+ image,
25
+ reverse = false,
26
+ maxWidth
27
+ } = data;
28
+
29
+ /* TODO Text_content should deal with linebreaks,
30
+ reading up upon mui-markdown docs is advised */
31
+
32
+ return /*#__PURE__*/React.createElement(material.Container, {
33
+ maxWidth: maxWidth,
34
+ sx: {
35
+ my: 1
36
+ }
37
+ }, /*#__PURE__*/React.createElement(material.Paper, {
38
+ sx: {
39
+ p: 2
40
+ }
41
+ }, title && /*#__PURE__*/React.createElement(material.Typography, {
42
+ variant: "h1",
43
+ textAlign: "center",
44
+ width: "100%",
45
+ sx: {
46
+ pb: 2
47
+ }
48
+ }, title), /*#__PURE__*/React.createElement(material.Stack, {
49
+ spacing: 2,
50
+ direction: reverse ? "row-reverse" : "row"
51
+ }, (image === null || image === void 0 ? void 0 : image.url) !== undefined && /*#__PURE__*/React.createElement(material.Box, {
52
+ sx: {
53
+ width: text !== null && text !== undefined ? "50%" : "100%",
54
+ height: "100%",
55
+ overflow: "hidden",
56
+ display: "flex",
57
+ alignItems: "center",
58
+ justifyContent: "center"
59
+ }
60
+ }, /*#__PURE__*/React.createElement(StrapiImage.StrapiImage, {
61
+ alt: image.alt,
62
+ style: {},
63
+ height: image.height,
64
+ src: image.url,
65
+ width: image.width
66
+ })), text !== null && text !== undefined && /*#__PURE__*/React.createElement(material.Box, {
67
+ sx: {
68
+ width: (image === null || image === void 0 ? void 0 : image.url) !== null && (image === null || image === void 0 ? void 0 : image.url) !== undefined ? "50%" : "100%",
69
+ height: "100%",
70
+ overflow: "hidden",
71
+ display: "flex",
72
+ alignItems: "center",
73
+ justifyContent: "center"
74
+ }
75
+ }, /*#__PURE__*/React.createElement(muiMarkdown.MuiMarkdown, null, text)))));
76
+ }
77
+
78
+ exports.default = TextImageSection;
package/dist/cjs/index.js CHANGED
@@ -9,7 +9,7 @@
9
9
  var Button = require('./components/Button.js');
10
10
  var Stack = require('./components/Stack.js');
11
11
  var NavBar = require('./components/NavBar.js');
12
- var TextImageBlock = require('./components/TextImageBlock.js');
12
+ var TextImageSection = require('./components/TextImageSection.js');
13
13
  var Page = require('./components/Page.js');
14
14
  var Footer = require('./components/Footer.js');
15
15
  var ContactForm = require('./components/ContactForm.js');
@@ -21,7 +21,7 @@ var BulletList = require('./components/BulletList.js');
21
21
  exports.Button = Button.default;
22
22
  exports.Stack = Stack.default;
23
23
  exports.NavBar = NavBar.default;
24
- exports.TextImageBlock = TextImageBlock.default;
24
+ exports.TextImageSection = TextImageSection.default;
25
25
  exports.Page = Page.default;
26
26
  exports.Footer = Footer.default;
27
27
  exports.ContactForm = ContactForm.default;
@@ -5,10 +5,9 @@
5
5
  * @license MIT
6
6
  */
7
7
 
8
- import { extends as _extends } from '../_virtual/_rollupPluginBabelHelpers.js';
9
8
  import React from 'react';
10
9
  import PropTypes from 'prop-types';
11
- import TextImageBlock from './TextImageBlock.js';
10
+ import TextImageSection from './TextImageSection.js';
12
11
  import { HeroSection } from './HeroSection.js';
13
12
  import { FeatureSection } from './FeaturesSection.js';
14
13
 
@@ -25,9 +24,10 @@ function blockRenderer(block) {
25
24
  data: block
26
25
  });
27
26
  case "layout.text-image-section":
28
- return /*#__PURE__*/React.createElement(TextImageBlock, _extends({
29
- key: block.id
30
- }, block));
27
+ return /*#__PURE__*/React.createElement(TextImageSection, {
28
+ key: block.id,
29
+ data: block
30
+ });
31
31
  default:
32
32
  return null;
33
33
  }
@@ -11,10 +11,10 @@ import { getStrapiMedia } from '../lib/utils.js';
11
11
  function StrapiImage(_ref) {
12
12
  let {
13
13
  src,
14
- alt,
15
- height,
16
- width,
17
- style
14
+ alt = "",
15
+ height = 100,
16
+ width = 100,
17
+ style = {}
18
18
  } = _ref;
19
19
  if (!src) return null;
20
20
  const imageUrl = getStrapiMedia(src);
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ /*
3
+ * UMWD-Components
4
+ * @copyright Jelle Paulus
5
+ * @license MIT
6
+ */
7
+
8
+ import React from 'react';
9
+ import { Container, Paper, Typography, Stack, Box } from '@mui/material';
10
+ import { MuiMarkdown } from 'mui-markdown';
11
+ import { StrapiImage } from './StrapiImage.js';
12
+
13
+ function TextImageSection(_ref) {
14
+ let {
15
+ data
16
+ } = _ref;
17
+ const {
18
+ title,
19
+ text,
20
+ image,
21
+ reverse = false,
22
+ maxWidth
23
+ } = data;
24
+
25
+ /* TODO Text_content should deal with linebreaks,
26
+ reading up upon mui-markdown docs is advised */
27
+
28
+ return /*#__PURE__*/React.createElement(Container, {
29
+ maxWidth: maxWidth,
30
+ sx: {
31
+ my: 1
32
+ }
33
+ }, /*#__PURE__*/React.createElement(Paper, {
34
+ sx: {
35
+ p: 2
36
+ }
37
+ }, title && /*#__PURE__*/React.createElement(Typography, {
38
+ variant: "h1",
39
+ textAlign: "center",
40
+ width: "100%",
41
+ sx: {
42
+ pb: 2
43
+ }
44
+ }, title), /*#__PURE__*/React.createElement(Stack, {
45
+ spacing: 2,
46
+ direction: reverse ? "row-reverse" : "row"
47
+ }, (image === null || image === void 0 ? void 0 : image.url) !== undefined && /*#__PURE__*/React.createElement(Box, {
48
+ sx: {
49
+ width: text !== null && text !== undefined ? "50%" : "100%",
50
+ height: "100%",
51
+ overflow: "hidden",
52
+ display: "flex",
53
+ alignItems: "center",
54
+ justifyContent: "center"
55
+ }
56
+ }, /*#__PURE__*/React.createElement(StrapiImage, {
57
+ alt: image.alt,
58
+ style: {},
59
+ height: image.height,
60
+ src: image.url,
61
+ width: image.width
62
+ })), text !== null && text !== undefined && /*#__PURE__*/React.createElement(Box, {
63
+ sx: {
64
+ width: (image === null || image === void 0 ? void 0 : image.url) !== null && (image === null || image === void 0 ? void 0 : image.url) !== undefined ? "50%" : "100%",
65
+ height: "100%",
66
+ overflow: "hidden",
67
+ display: "flex",
68
+ alignItems: "center",
69
+ justifyContent: "center"
70
+ }
71
+ }, /*#__PURE__*/React.createElement(MuiMarkdown, null, text)))));
72
+ }
73
+
74
+ export { TextImageSection as default };
package/dist/esm/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
  export { default as Button } from './components/Button.js';
8
8
  export { default as Stack } from './components/Stack.js';
9
9
  export { default as NavBar } from './components/NavBar.js';
10
- export { default as TextImageBlock } from './components/TextImageBlock.js';
10
+ export { default as TextImageSection } from './components/TextImageSection.js';
11
11
  export { default as Page } from './components/Page.js';
12
12
  export { default as Footer } from './components/Footer.js';
13
13
  export { default as ContactForm } from './components/ContactForm.js';
package/next.config.js CHANGED
@@ -1,15 +1,18 @@
1
1
  // @ts-check
2
-
2
+
3
3
  /** @type {import('next').NextConfig} */
4
4
  const nextConfig = {
5
- /* config options here */
6
- images: {
7
- remotePatterns: [{
8
- protocol: 'https',
9
- hostname: 'www.google.com',
10
- pathname: '/images/**',
11
- } ],
12
- }
13
- }
14
-
15
- module.exports = nextConfig
5
+ /* config options here */
6
+ images: {
7
+ remotePatterns: [
8
+ {
9
+ protocol: "https",
10
+ hostname: "www.google.com",
11
+ pathname: "/images/**",
12
+ },
13
+ { hostname: "localhost", port: "1337" },
14
+ ],
15
+ },
16
+ };
17
+
18
+ module.exports = nextConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.62",
3
+ "version": "0.1.64",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from "react";
4
4
  import PropTypes from "prop-types";
5
- import TextImageBlock from "./TextImageSection.tsx";
5
+ import TextImageSection from "./TextImageSection.tsx";
6
6
  import { HeroSection } from "./HeroSection.tsx";
7
7
  import { FeatureSection } from "./FeaturesSection.tsx";
8
8
 
@@ -13,7 +13,7 @@ function blockRenderer(block) {
13
13
  case "layout.feature-section":
14
14
  return <FeatureSection key={block.id} data={block} />;
15
15
  case "layout.text-image-section":
16
- return <TextImageBlock key={block.id} data={block} />;
16
+ return <TextImageSection key={block.id} data={block} />;
17
17
  default:
18
18
  return null;
19
19
  }
@@ -12,10 +12,10 @@ interface StrapiImageProps {
12
12
 
13
13
  export function StrapiImage({
14
14
  src,
15
- alt,
16
- height,
17
- width,
18
- style,
15
+ alt = "",
16
+ height = 100,
17
+ width = 100,
18
+ style = {},
19
19
  }: Readonly<StrapiImageProps>) {
20
20
  if (!src) return null;
21
21
  const imageUrl = getStrapiMedia(src);
package/src/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
  export { default as Button } from "./components/Button";
8
8
  export { default as Stack } from "./components/Stack";
9
9
  export { default as NavBar } from "./components/NavBar";
10
- export { default as TextImageBlock } from "./components/TextImageBlock";
10
+ export { default as TextImageSection } from "./components/TextImageSection.tsx";
11
11
  export { default as Page } from "./components/Page";
12
12
  export { default as Footer } from "./components/Footer";
13
13
  export { default as ContactForm } from "./components/ContactForm";
@@ -57,7 +57,7 @@ HelloWorld.args = {
57
57
  __component: "layout.text-image-section",
58
58
  title: "Hello Mars",
59
59
  image: {
60
- url: "https://via.placeholder.com/1200",
60
+ url: "/uploads/man_in_circle_icon_6c77b6d3e4.png",
61
61
  width: 600,
62
62
  height: 600,
63
63
  alt: "Hello Mars",