umwd-components 0.1.61 → 0.1.63

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
  }
@@ -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
  }
@@ -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.61",
3
+ "version": "0.1.63",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -86,6 +86,7 @@
86
86
  "dependencies": {
87
87
  "@fontsource/material-icons": "^5.0.15",
88
88
  "@fontsource/roboto": "^5.0.12",
89
+ "@mui/types": "^7.2.14",
89
90
  "@rollup/plugin-commonjs": "^25.0.7",
90
91
  "next-router-mock": "^0.9.12",
91
92
  "react": "^18.2.0",
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from "react";
4
4
  import PropTypes from "prop-types";
5
- import TextImageBlock from "./TextImageBlock";
5
+ import TextImageBlock 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} {...block} />;
16
+ return <TextImageBlock key={block.id} data={block} />;
17
17
  default:
18
18
  return null;
19
19
  }
@@ -0,0 +1,91 @@
1
+ "use client";
2
+
3
+ import React from "react";
4
+ import { Box, Container, Paper, Typography, Stack } from "@mui/material";
5
+ import { MuiMarkdown } from "mui-markdown";
6
+ import { StrapiImage } from "./StrapiImage.tsx";
7
+
8
+ type maxWidth = "xs" | "sm" | "md" | "lg" | "xl" | false | string;
9
+
10
+ interface TextImageSectionProps {
11
+ data: {
12
+ title: string;
13
+ text: string;
14
+ image: {
15
+ url: string;
16
+ width: number;
17
+ height: number;
18
+ alt: string;
19
+ };
20
+ reverse: boolean;
21
+ maxWidth: maxWidth;
22
+ minHeight: string;
23
+ };
24
+ }
25
+
26
+ function TextImageSection({ data }: Readonly<TextImageSectionProps>) {
27
+ const { title, text, image, reverse = false, maxWidth } = data;
28
+
29
+ /* TODO Text_content should deal with linebreaks,
30
+ reading up upon mui-markdown docs is advised */
31
+
32
+ return (
33
+ <Container maxWidth={maxWidth} sx={{ my: 1 }}>
34
+ <Paper sx={{ p: 2 }}>
35
+ {title && (
36
+ <Typography
37
+ variant="h1"
38
+ textAlign="center"
39
+ width={"100%"}
40
+ sx={{ pb: 2 }}
41
+ >
42
+ {title}
43
+ </Typography>
44
+ )}
45
+
46
+ <Stack spacing={2} direction={reverse ? "row-reverse" : "row"}>
47
+ {image?.url !== undefined && (
48
+ <Box
49
+ sx={{
50
+ width: text !== null && text !== undefined ? "50%" : "100%",
51
+ height: "100%",
52
+ overflow: "hidden",
53
+ display: "flex",
54
+ alignItems: "center",
55
+ justifyContent: "center",
56
+ }}
57
+ >
58
+ <StrapiImage
59
+ alt={image.alt}
60
+ style={{}}
61
+ height={image.height}
62
+ src={image.url}
63
+ width={image.width}
64
+ />
65
+ </Box>
66
+ )}
67
+
68
+ {text !== null && text !== undefined && (
69
+ <Box
70
+ sx={{
71
+ width:
72
+ image?.url !== null && image?.url !== undefined
73
+ ? "50%"
74
+ : "100%",
75
+ height: "100%",
76
+ overflow: "hidden",
77
+ display: "flex",
78
+ alignItems: "center",
79
+ justifyContent: "center",
80
+ }}
81
+ >
82
+ <MuiMarkdown>{text}</MuiMarkdown>
83
+ </Box>
84
+ )}
85
+ </Stack>
86
+ </Paper>
87
+ </Container>
88
+ );
89
+ }
90
+
91
+ export default TextImageSection;
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",
@@ -0,0 +1,73 @@
1
+ import TextImageSection from "../components/TextImageSection.tsx";
2
+ import React from "react";
3
+
4
+ export default {
5
+ title: "UMWD/TextImageSection",
6
+ component: TextImageSection,
7
+ // argTypes: { numberOfChildren: { type: "number" } },
8
+ };
9
+
10
+ const Template = ({ ...args }) => <TextImageSection data={args} />;
11
+
12
+ export const HelloWorld = Template.bind({});
13
+
14
+ HelloWorld.args = {
15
+ title: "Hello World",
16
+ image: {
17
+ url: "https://via.placeholder.com/850",
18
+ width: 850,
19
+ height: 850,
20
+ alt: "Hello World",
21
+ },
22
+ text: "## Hello World \n **Hello World,** a timeless greeting that transcends boundaries and encapsulates the essence of connectivity in the digital age. From the humble beginnings of computer programming to the interconnected web of today, Hello World stands as the inaugural utterance in the realm of coding. *Hello World,* a phrase that marks the inception of countless software projects, introducing developers to the syntax and structure of a programming language. It symbolizes the first step into a world of algorithms, data structures, and creative problem-solving. Beyond its technical significance, it embodies the spirit of initiation and the commencement of a journey into the vast landscape of software development. <br /> <br /> *Hello World,* a greeting echoed by computer science enthusiasts worldwide, reflecting the universality of technology and the shared experience of navigating the intricacies of code. It bridges the gap between novices and seasoned programmers, serving as a common ground where knowledge is exchanged, challenges are discussed, and innovations are born. <br /> <br /> In a broader context, *Hello World* extends beyond the confines of programming. It serves as a metaphor for embracing new beginnings, fostering connections, and acknowledging the vastness of our global community. In a world increasingly shaped by technology, this simple greeting remains a symbol of the interconnectedness that defines our modern existence.",
23
+ reverse: false,
24
+ };
25
+
26
+ export const HelloMars = Template.bind({});
27
+
28
+ HelloMars.args = {
29
+ title: "Hello Mars",
30
+ image: {
31
+ url: "https://via.placeholder.com/1200",
32
+ width: 600,
33
+ height: 600,
34
+ alt: "Hello Mars",
35
+ },
36
+ text: "**Hello Mars,** \n a distant red planet that has captured the imagination of humanity for centuries. As we gaze upon your mysterious surface from Earth, we can't help but wonder about the secrets you hold. Hello to the vast landscapes of rust-colored terrain, the towering volcanoes, and the enigmatic canyons that weave across your surface. *Hello Mars,* a planet that has been the focus of numerous space missions, each one aiming to unveil the mysteries of your past and present. From the iconic rovers tirelessly traversing your rocky landscapes to the orbiters capturing breathtaking images from above, we extend our greetings to the scientific endeavors that seek to understand your geology, climate, and potential for life. <br /> <br /> *Hello Mars,* a beacon of human exploration and curiosity. The dreams of setting foot on your soil have fueled the aspirations of generations, and with each technological leap, the possibility of humans visiting you becomes more tangible. The prospect of a human settlement on Mars brings excitement, challenges, and the promise of a new chapter in our interplanetary journey. <br /> <br /> *Hello Mars,* a testament to the indomitable human spirit that constantly seeks to push the boundaries of what is possible. As we continue to study, explore, and dream about the mysteries you hold, we are reminded of the vastness of the cosmos and the endless opportunities for discovery that lie beyond our home planet.",
37
+ reverse: true,
38
+ };
39
+
40
+ export const NoTitle = Template.bind({});
41
+
42
+ NoTitle.args = {
43
+ image: {
44
+ url: "https://via.placeholder.com/150",
45
+ width: 150,
46
+ height: 150,
47
+ alt: "Hello Mars",
48
+ },
49
+ text: "**Hello Mars,** \n a distant red planet that has captured the imagination of humanity for centuries. As we gaze upon your mysterious surface from Earth, we can't help but wonder about the secrets you hold. Hello to the vast landscapes of rust-colored terrain, the towering volcanoes, and the enigmatic canyons that weave across your surface. <br /> <br /> *Hello Mars,* a planet that has been the focus of numerous space missions, each one aiming to unveil the mysteries of your past and present. From the iconic rovers tirelessly traversing your rocky landscapes to the orbiters capturing breathtaking images from above, we extend our greetings to the scientific endeavors that seek to understand your geology, climate, and potential for life. <br /> <br /> *Hello Mars,* a beacon of human exploration and curiosity. The dreams of setting foot on your soil have fueled the aspirations of generations, and with each technological leap, the possibility of humans visiting you becomes more tangible. The prospect of a human settlement on Mars brings excitement, challenges, and the promise of a new chapter in our interplanetary journey. <br /> <br /> *Hello Mars,* a testament to the indomitable human spirit that constantly seeks to push the boundaries of what is possible. As we continue to study, explore, and dream about the mysteries you hold, we are reminded of the vastness of the cosmos and the endless opportunities for discovery that lie beyond our home planet.",
50
+ reverse: false,
51
+ maxWidth: "md",
52
+ };
53
+
54
+ export const NoImage = Template.bind({});
55
+
56
+ NoImage.args = {
57
+ title: "Hello Mars",
58
+ text: "## Hello Mars \n **Hello Mars,** a distant red planet that has captured the imagination of humanity for centuries. As we gaze upon your mysterious surface from Earth, we can't help but wonder about the secrets you hold. Hello to the vast landscapes of rust-colored terrain, the towering volcanoes, and the enigmatic canyons that weave across your surface. <br /> <br /> *Hello Mars,* a planet that has been the focus of numerous space missions, each one aiming to unveil the mysteries of your past and present. From the iconic rovers tirelessly traversing your rocky landscapes to the orbiters capturing breathtaking images from above, we extend our greetings to the scientific endeavors that seek to understand your geology, climate, and potential for life. <br /> <br /> *Hello Mars,* a beacon of human exploration and curiosity. The dreams of setting foot on your soil have fueled the aspirations of generations, and with each technological leap, the possibility of humans visiting you becomes more tangible. The prospect of a human settlement on Mars brings excitement, challenges, and the promise of a new chapter in our interplanetary journey. <br /> <br /> *Hello Mars,* a testament to the indomitable human spirit that constantly seeks to push the boundaries of what is possible. As we continue to study, explore, and dream about the mysteries you hold, we are reminded of the vastness of the cosmos and the endless opportunities for discovery that lie beyond our home planet.",
59
+ reverse: false,
60
+ };
61
+
62
+ export const NoText = Template.bind({});
63
+
64
+ NoText.args = {
65
+ title: "Hello Mars",
66
+ image: {
67
+ url: "https://via.placeholder.com/150",
68
+ width: 150,
69
+ height: 150,
70
+ alt: "Hello Mars",
71
+ },
72
+ reverse: true,
73
+ };
@@ -1,168 +0,0 @@
1
- "use client";
2
-
3
- import React from "react";
4
- import { Box, Container, Grid, Paper, Typography, Stack } from "@mui/material";
5
- import Image from "next/image";
6
- import { MuiMarkdown } from "mui-markdown";
7
- import PropTypes from "prop-types";
8
-
9
- function TextImageBlock({ title, text, image, reverse, maxWidth, minHeight }) {
10
- reverse = Boolean(reverse);
11
-
12
- maxWidth = maxWidth || "100%";
13
-
14
- /* TODO Text_content should deal with linebreaks */
15
-
16
- /* return (
17
- <Container maxWidth="lg" sx={{ my: 1 }}>
18
- <Grid
19
- container
20
- sx={[
21
- { margin: "auto", p: 2 },
22
- text === undefined && {
23
- display: "grid",
24
- alignItems: "center",
25
- justifyContent: "center",
26
- },
27
- ]}
28
- component={Paper}
29
- >
30
- {title && (
31
- <Grid
32
- item
33
- xs={12}
34
- sx={{
35
- p: 1,
36
- display: "grid",
37
- alignItems: "center",
38
- justifyContent: "center",
39
- }}
40
- >
41
- <Typography variant="h1">{title}</Typography>
42
- </Grid>
43
- )}
44
-
45
- {image?.url !== undefined && (
46
- <Grid
47
- item
48
- xs={text !== null && text !== undefined ? 6 : 12}
49
- sx={{
50
- padding: "10px",
51
- minHeight: minHeight || "300px",
52
- display: "grid",
53
- alignItems: "center",
54
- justifyContent: "center",
55
- }}
56
- >
57
- <Box
58
- sx={{
59
- width: "100%",
60
- height: "100%",
61
- overflow: "hidden",
62
- display: "flex",
63
- alignItems: "center",
64
- justifyContent: "center",
65
- }}
66
- >
67
- <Image
68
- src={image.url}
69
- width={image.width || 500}
70
- height={image.height || 500}
71
- alt={image.name}
72
- />
73
- </Box>
74
- </Grid>
75
- )}
76
-
77
- {text !== null && text !== undefined && (
78
- <Grid
79
- item
80
- xs={image?.url !== undefined ? 6 : 12}
81
- sx={{
82
- p: 1,
83
- minHeight: minHeight || "300px",
84
- display: "grid",
85
- alignItems: "center",
86
- justifyContent: "center",
87
- }}
88
- >
89
- <MuiMarkdown>{text}</MuiMarkdown>
90
- </Grid>
91
- )}
92
-
93
- </Grid>
94
- </Container>
95
- ); */
96
-
97
- return (
98
- <Container maxWidth="lg" sx={{ my: 1 }}>
99
- <Paper sx={{ p: 2 }}>
100
- {title && (
101
- <Typography
102
- variant="h1"
103
- textAlign="center"
104
- width={"100%"}
105
- sx={{ pb: 2 }}
106
- >
107
- {title}
108
- </Typography>
109
- )}
110
-
111
- <Stack spacing={2} direction={reverse ? "row-reverse" : "row"}>
112
- {image?.url !== undefined && (
113
- <Box
114
- sx={{
115
- width: text !== null && text !== undefined ? "50%" : "100%",
116
- height: "100%",
117
- overflow: "hidden",
118
- display: "flex",
119
- alignItems: "center",
120
- justifyContent: "center",
121
- }}
122
- >
123
- <Image
124
- src={image.url}
125
- width={image.width || 500}
126
- height={image.height || 500}
127
- alt={image.name}
128
- />
129
- </Box>
130
- )}
131
-
132
- {text !== null && text !== undefined && (
133
- <Box
134
- sx={{
135
- width:
136
- image?.url !== null && image?.url !== undefined
137
- ? "50%"
138
- : "100%",
139
- height: "100%",
140
- overflow: "hidden",
141
- display: "flex",
142
- alignItems: "center",
143
- justifyContent: "center",
144
- }}
145
- >
146
- <MuiMarkdown>{text}</MuiMarkdown>
147
- </Box>
148
- )}
149
- </Stack>
150
- </Paper>
151
- </Container>
152
- );
153
- }
154
-
155
- TextImageBlock.propTypes = {
156
- title: PropTypes.string,
157
- text: PropTypes.string,
158
- image: PropTypes.shape({
159
- url: PropTypes.string,
160
- width: PropTypes.number,
161
- height: PropTypes.number,
162
- alt: PropTypes.string,
163
- }),
164
- reverse: PropTypes.bool,
165
- maxWidth: PropTypes.string,
166
- };
167
-
168
- export default TextImageBlock;
@@ -1,77 +0,0 @@
1
- import TextImageBlock from "../components/TextImageBlock";
2
- import React from "react";
3
-
4
- export default {
5
- title: "UMWD/TextImageBlock",
6
- component: TextImageBlock,
7
- // argTypes: { numberOfChildren: { type: "number" } },
8
- };
9
-
10
- const Template = ({ ...args }) => <TextImageBlock {...args} />;
11
-
12
- export const HelloWorld = Template.bind({});
13
-
14
- HelloWorld.args = {
15
- block_title: "Hello World",
16
- image_content: {
17
- url: "https://via.placeholder.com/850",
18
- width: 850,
19
- height: 850,
20
- alt: "Hello World",
21
- },
22
- text_content:
23
- "## Hello World \n **Hello World,** a timeless greeting that transcends boundaries and encapsulates the essence of connectivity in the digital age. From the humble beginnings of computer programming to the interconnected web of today, Hello World stands as the inaugural utterance in the realm of coding. *Hello World,* a phrase that marks the inception of countless software projects, introducing developers to the syntax and structure of a programming language. It symbolizes the first step into a world of algorithms, data structures, and creative problem-solving. Beyond its technical significance, it embodies the spirit of initiation and the commencement of a journey into the vast landscape of software development. <br /> <br /> *Hello World,* a greeting echoed by computer science enthusiasts worldwide, reflecting the universality of technology and the shared experience of navigating the intricacies of code. It bridges the gap between novices and seasoned programmers, serving as a common ground where knowledge is exchanged, challenges are discussed, and innovations are born. <br /> <br /> In a broader context, *Hello World* extends beyond the confines of programming. It serves as a metaphor for embracing new beginnings, fostering connections, and acknowledging the vastness of our global community. In a world increasingly shaped by technology, this simple greeting remains a symbol of the interconnectedness that defines our modern existence.",
24
- reverse: false,
25
- };
26
-
27
- export const HelloMars = Template.bind({});
28
-
29
- HelloMars.args = {
30
- block_title: "Hello Mars",
31
- image_content: {
32
- url: "https://via.placeholder.com/1200",
33
- width: 600,
34
- height: 600,
35
- alt: "Hello Mars",
36
- },
37
- text_content:
38
- "**Hello Mars,** \n a distant red planet that has captured the imagination of humanity for centuries. As we gaze upon your mysterious surface from Earth, we can't help but wonder about the secrets you hold. Hello to the vast landscapes of rust-colored terrain, the towering volcanoes, and the enigmatic canyons that weave across your surface. *Hello Mars,* a planet that has been the focus of numerous space missions, each one aiming to unveil the mysteries of your past and present. From the iconic rovers tirelessly traversing your rocky landscapes to the orbiters capturing breathtaking images from above, we extend our greetings to the scientific endeavors that seek to understand your geology, climate, and potential for life. <br /> <br /> *Hello Mars,* a beacon of human exploration and curiosity. The dreams of setting foot on your soil have fueled the aspirations of generations, and with each technological leap, the possibility of humans visiting you becomes more tangible. The prospect of a human settlement on Mars brings excitement, challenges, and the promise of a new chapter in our interplanetary journey. <br /> <br /> *Hello Mars,* a testament to the indomitable human spirit that constantly seeks to push the boundaries of what is possible. As we continue to study, explore, and dream about the mysteries you hold, we are reminded of the vastness of the cosmos and the endless opportunities for discovery that lie beyond our home planet.",
39
- reverse: true,
40
- };
41
-
42
- export const NoTitle = Template.bind({});
43
-
44
- NoTitle.args = {
45
- image_content: {
46
- url: "https://via.placeholder.com/150",
47
- width: 150,
48
- height: 150,
49
- alt: "Hello Mars",
50
- },
51
- text_content:
52
- "**Hello Mars,** \n a distant red planet that has captured the imagination of humanity for centuries. As we gaze upon your mysterious surface from Earth, we can't help but wonder about the secrets you hold. Hello to the vast landscapes of rust-colored terrain, the towering volcanoes, and the enigmatic canyons that weave across your surface. <br /> <br /> *Hello Mars,* a planet that has been the focus of numerous space missions, each one aiming to unveil the mysteries of your past and present. From the iconic rovers tirelessly traversing your rocky landscapes to the orbiters capturing breathtaking images from above, we extend our greetings to the scientific endeavors that seek to understand your geology, climate, and potential for life. <br /> <br /> *Hello Mars,* a beacon of human exploration and curiosity. The dreams of setting foot on your soil have fueled the aspirations of generations, and with each technological leap, the possibility of humans visiting you becomes more tangible. The prospect of a human settlement on Mars brings excitement, challenges, and the promise of a new chapter in our interplanetary journey. <br /> <br /> *Hello Mars,* a testament to the indomitable human spirit that constantly seeks to push the boundaries of what is possible. As we continue to study, explore, and dream about the mysteries you hold, we are reminded of the vastness of the cosmos and the endless opportunities for discovery that lie beyond our home planet.",
53
- reverse: false,
54
- maxWidth: "900px",
55
- };
56
-
57
- export const NoImage = Template.bind({});
58
-
59
- NoImage.args = {
60
- block_title: "Hello Mars",
61
- text_content:
62
- "## Hello Mars \n **Hello Mars,** a distant red planet that has captured the imagination of humanity for centuries. As we gaze upon your mysterious surface from Earth, we can't help but wonder about the secrets you hold. Hello to the vast landscapes of rust-colored terrain, the towering volcanoes, and the enigmatic canyons that weave across your surface. <br /> <br /> *Hello Mars,* a planet that has been the focus of numerous space missions, each one aiming to unveil the mysteries of your past and present. From the iconic rovers tirelessly traversing your rocky landscapes to the orbiters capturing breathtaking images from above, we extend our greetings to the scientific endeavors that seek to understand your geology, climate, and potential for life. <br /> <br /> *Hello Mars,* a beacon of human exploration and curiosity. The dreams of setting foot on your soil have fueled the aspirations of generations, and with each technological leap, the possibility of humans visiting you becomes more tangible. The prospect of a human settlement on Mars brings excitement, challenges, and the promise of a new chapter in our interplanetary journey. <br /> <br /> *Hello Mars,* a testament to the indomitable human spirit that constantly seeks to push the boundaries of what is possible. As we continue to study, explore, and dream about the mysteries you hold, we are reminded of the vastness of the cosmos and the endless opportunities for discovery that lie beyond our home planet.",
63
- reverse: false,
64
- };
65
-
66
- export const NoText = Template.bind({});
67
-
68
- NoText.args = {
69
- block_title: "Hello Mars",
70
- image_content: {
71
- url: "https://via.placeholder.com/150",
72
- width: 150,
73
- height: 150,
74
- alt: "Hello Mars",
75
- },
76
- reverse: true,
77
- };