umwd-components 0.1.96 → 0.1.98
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/HeroSection.js +14 -5
- package/dist/cjs/lib/utils.js +29 -0
- package/dist/cjs/node_modules/@strapi/blocks-react-renderer/dist/Block.js +63 -0
- package/dist/cjs/node_modules/@strapi/blocks-react-renderer/dist/BlocksRenderer.js +109 -0
- package/dist/cjs/node_modules/@strapi/blocks-react-renderer/dist/Text.js +37 -0
- package/dist/cjs/src/components/BlockRendererClient.js +94 -0
- package/dist/cjs/src/components/BulletList.js +43 -0
- package/dist/cjs/src/components/Button.js +45 -0
- package/dist/cjs/src/components/ColumnsSection.js +69 -0
- package/dist/cjs/src/components/ContactForm.js +223 -0
- package/dist/cjs/src/components/FeaturesSection.js +100 -0
- package/dist/cjs/src/components/FleetSection.js +153 -0
- package/dist/cjs/src/components/Footer.js +211 -0
- package/dist/cjs/src/components/HeroSection.js +100 -0
- package/dist/cjs/src/components/IconSection.js +67 -0
- package/dist/cjs/src/components/MuiLink.js +23 -0
- package/dist/cjs/src/components/NavBar.js +307 -0
- package/dist/cjs/src/components/Page.js +88 -0
- package/dist/cjs/src/components/PersonaliaSection.js +96 -0
- package/dist/cjs/src/components/Stack.js +37 -0
- package/dist/cjs/src/components/StrapiImage.js +33 -0
- package/dist/cjs/src/components/TextImageSection.js +94 -0
- package/dist/cjs/src/components/WebsitePlaceholder.js +129 -0
- package/dist/cjs/src/components/WhatsAppClickToChatButton.js +78 -0
- package/dist/cjs/src/index.js +31 -0
- package/dist/cjs/src/lib/AmbulanceIcon.js +45 -0
- package/dist/cjs/src/lib/getIcon.js +97 -0
- package/dist/cjs/src/lib/utils.js +57 -0
- package/dist/esm/components/HeroSection.js +15 -6
- package/dist/esm/lib/utils.js +29 -1
- package/dist/esm/node_modules/@strapi/blocks-react-renderer/dist/Block.js +61 -0
- package/dist/esm/node_modules/@strapi/blocks-react-renderer/dist/BlocksRenderer.js +86 -0
- package/dist/esm/node_modules/@strapi/blocks-react-renderer/dist/Text.js +35 -0
- package/dist/esm/src/components/BlockRendererClient.js +90 -0
- package/dist/esm/src/components/BulletList.js +39 -0
- package/dist/esm/src/components/Button.js +41 -0
- package/dist/esm/src/components/ColumnsSection.js +67 -0
- package/dist/esm/src/components/ContactForm.js +219 -0
- package/dist/esm/src/components/FeaturesSection.js +98 -0
- package/dist/esm/src/components/FleetSection.js +151 -0
- package/dist/esm/src/components/Footer.js +207 -0
- package/dist/esm/src/components/HeroSection.js +98 -0
- package/dist/esm/src/components/IconSection.js +65 -0
- package/dist/esm/src/components/MuiLink.js +21 -0
- package/dist/esm/src/components/NavBar.js +303 -0
- package/dist/esm/src/components/Page.js +84 -0
- package/dist/esm/src/components/PersonaliaSection.js +94 -0
- package/dist/esm/src/components/Stack.js +33 -0
- package/dist/esm/src/components/StrapiImage.js +31 -0
- package/dist/esm/src/components/TextImageSection.js +90 -0
- package/dist/esm/src/components/WebsitePlaceholder.js +125 -0
- package/dist/esm/src/components/WhatsAppClickToChatButton.js +74 -0
- package/dist/esm/src/index.js +16 -0
- package/dist/esm/src/lib/AmbulanceIcon.js +22 -0
- package/dist/esm/src/lib/getIcon.js +93 -0
- package/dist/esm/src/lib/utils.js +53 -0
- package/package.json +2 -1
- package/src/components/BlockRendererClient.tsx +52 -0
- package/src/components/HeroSection.tsx +18 -3
- package/src/components/MuiLink.tsx +16 -0
- package/src/components/PersonaliaSection.tsx +52 -37
- package/src/lib/utils.ts +35 -0
- package/src/stories/HeroSection.stories.js +2 -2
- package/src/stories/Page.stories.js +51 -50
|
@@ -10,6 +10,7 @@ var React = require('react');
|
|
|
10
10
|
var Link = require('next/link');
|
|
11
11
|
var material = require('@mui/material');
|
|
12
12
|
var StrapiImage = require('./StrapiImage.js');
|
|
13
|
+
var utils = require('../lib/utils.js');
|
|
13
14
|
|
|
14
15
|
function HeroSection(_ref) {
|
|
15
16
|
let {
|
|
@@ -23,6 +24,9 @@ function HeroSection(_ref) {
|
|
|
23
24
|
link,
|
|
24
25
|
maxWidth
|
|
25
26
|
} = data;
|
|
27
|
+
const theme = material.useTheme();
|
|
28
|
+
console.log(theme.palette.background.paper);
|
|
29
|
+
const glassColor = utils.setOpacity(theme.palette.background.paper, 0.45);
|
|
26
30
|
return /*#__PURE__*/React.createElement("header", {
|
|
27
31
|
style: {
|
|
28
32
|
position: "relative",
|
|
@@ -60,7 +64,10 @@ function HeroSection(_ref) {
|
|
|
60
64
|
}
|
|
61
65
|
}, /*#__PURE__*/React.createElement(material.Paper, {
|
|
62
66
|
sx: {
|
|
63
|
-
|
|
67
|
+
px: 2,
|
|
68
|
+
py: 7,
|
|
69
|
+
backdropFilter: "blur(4px)",
|
|
70
|
+
backgroundColor: glassColor
|
|
64
71
|
}
|
|
65
72
|
}, /*#__PURE__*/React.createElement(material.Stack, {
|
|
66
73
|
spacing: 5,
|
|
@@ -72,11 +79,13 @@ function HeroSection(_ref) {
|
|
|
72
79
|
src: logoImage.url,
|
|
73
80
|
width: logoImage.width || 100
|
|
74
81
|
}), /*#__PURE__*/React.createElement(material.Typography, {
|
|
75
|
-
variant: "
|
|
76
|
-
align: "center"
|
|
82
|
+
variant: "h2",
|
|
83
|
+
align: "center",
|
|
84
|
+
component: "h1"
|
|
77
85
|
}, heading), /*#__PURE__*/React.createElement(material.Typography, {
|
|
78
|
-
variant: "
|
|
79
|
-
align: "center"
|
|
86
|
+
variant: "h4",
|
|
87
|
+
align: "center",
|
|
88
|
+
component: "h2"
|
|
80
89
|
}, subHeading), /*#__PURE__*/React.createElement(Link, {
|
|
81
90
|
href: link.url
|
|
82
91
|
}, /*#__PURE__*/React.createElement(material.Button, {
|
package/dist/cjs/lib/utils.js
CHANGED
|
@@ -23,6 +23,35 @@ function getStrapiMedia(url) {
|
|
|
23
23
|
if (url.startsWith("http") || url.startsWith("//")) return url;
|
|
24
24
|
return "".concat(getStrapiURL()).concat(url);
|
|
25
25
|
}
|
|
26
|
+
function setOpacity(color, opacity) {
|
|
27
|
+
// Clamp opacity between 0 and 1
|
|
28
|
+
opacity = Math.min(Math.max(opacity, 0), 1);
|
|
29
|
+
|
|
30
|
+
// Regex to match various color formats (hex, rgb, rgba)
|
|
31
|
+
const match = color.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i);
|
|
32
|
+
if (match) {
|
|
33
|
+
// Hex color
|
|
34
|
+
const [, r, g, b, alpha = "FF"] = match;
|
|
35
|
+
return "rgba(".concat(parseInt(r, 16), ", ").concat(parseInt(g, 16), ", ").concat(parseInt(b, 16), ", ").concat(parseInt(alpha, 16) / 255 * opacity, ")");
|
|
36
|
+
} else {
|
|
37
|
+
// Parse RGB or RGBA manually
|
|
38
|
+
const rgbMatch = color.match(/^rgb\((\d+)(?:,(\d+))?(?:,(\d+))?\)$/i);
|
|
39
|
+
const rgbaMatch = color.match(/^rgba\((\d+)(?:,(\d+))?(?:,(\d+))?(?:,([.\d]+))?\)$/i);
|
|
40
|
+
if (rgbMatch) {
|
|
41
|
+
// RGB format
|
|
42
|
+
const [, red, green, blue] = rgbMatch;
|
|
43
|
+
return "rgba(".concat(red, ", ").concat(green, ", ").concat(blue, ", ").concat(opacity, ")");
|
|
44
|
+
} else if (rgbaMatch) {
|
|
45
|
+
// RGBA format
|
|
46
|
+
const [, red, green, blue, alpha] = rgbaMatch;
|
|
47
|
+
return "rgba(".concat(red, ", ").concat(green, ", ").concat(blue, ", ").concat(alpha || opacity, ")"); // Use provided opacity if alpha is missing
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// If parsing fails, return original color
|
|
52
|
+
return color;
|
|
53
|
+
}
|
|
26
54
|
|
|
27
55
|
exports.getStrapiMedia = getStrapiMedia;
|
|
28
56
|
exports.getStrapiURL = getStrapiURL;
|
|
57
|
+
exports.setOpacity = setOpacity;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
var React = require('react');
|
|
11
|
+
var BlocksRenderer = require('./BlocksRenderer.js');
|
|
12
|
+
var Text = require('./Text.js');
|
|
13
|
+
|
|
14
|
+
const voidTypes = ["image"];
|
|
15
|
+
const augmentProps = (content) => {
|
|
16
|
+
const { children: childrenNodes, type, ...props } = content;
|
|
17
|
+
if (type === "code") {
|
|
18
|
+
const getPlainText = (children) => {
|
|
19
|
+
return children.reduce((currentPlainText, node) => {
|
|
20
|
+
if (node.type === "text") {
|
|
21
|
+
return currentPlainText.concat(node.text);
|
|
22
|
+
}
|
|
23
|
+
if (node.type === "link") {
|
|
24
|
+
return currentPlainText.concat(getPlainText(node.children));
|
|
25
|
+
}
|
|
26
|
+
return currentPlainText;
|
|
27
|
+
}, "");
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
...props,
|
|
31
|
+
plainText: getPlainText(content.children)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return props;
|
|
35
|
+
};
|
|
36
|
+
const Block = ({ content }) => {
|
|
37
|
+
const { children: childrenNodes, type, ...props } = content;
|
|
38
|
+
const { blocks, missingBlockTypes } = BlocksRenderer.useComponentsContext();
|
|
39
|
+
const BlockComponent = blocks[type];
|
|
40
|
+
if (!BlockComponent) {
|
|
41
|
+
if (!missingBlockTypes.includes(type)) {
|
|
42
|
+
console.warn(`[@strapi/block-react-renderer] No component found for block type "${type}"`);
|
|
43
|
+
missingBlockTypes.push(type);
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
if (voidTypes.includes(type)) {
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BlockComponent, { ...props });
|
|
49
|
+
}
|
|
50
|
+
if (type === "paragraph" && childrenNodes.length === 1 && childrenNodes[0].type === "text" && childrenNodes[0].text === "") {
|
|
51
|
+
return /* @__PURE__ */ jsxRuntime.jsx("br", {});
|
|
52
|
+
}
|
|
53
|
+
const augmentedProps = augmentProps(content);
|
|
54
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BlockComponent, { ...augmentedProps, children: childrenNodes.map((childNode, index) => {
|
|
55
|
+
if (childNode.type === "text") {
|
|
56
|
+
const { type: _type, ...childNodeProps } = childNode;
|
|
57
|
+
return /* @__PURE__ */ React.createElement(Text.Text, { ...childNodeProps, key: index });
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Block, { content: childNode }, index);
|
|
60
|
+
}) });
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.Block = Block;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/*
|
|
3
|
+
* UMWD-Components
|
|
4
|
+
* @copyright Jelle Paulus
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
+
var React = require('react');
|
|
12
|
+
var Block = require('./Block.js');
|
|
13
|
+
|
|
14
|
+
function _interopNamespaceDefault(e) {
|
|
15
|
+
var n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
Object.keys(e).forEach(function (k) {
|
|
18
|
+
if (k !== 'default') {
|
|
19
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return e[k]; }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
n.default = e;
|
|
28
|
+
return Object.freeze(n);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
32
|
+
|
|
33
|
+
const defaultComponents = {
|
|
34
|
+
blocks: {
|
|
35
|
+
paragraph: (props) => /* @__PURE__ */ jsxRuntime.jsx("p", { children: props.children }),
|
|
36
|
+
quote: (props) => /* @__PURE__ */ jsxRuntime.jsx("blockquote", { children: props.children }),
|
|
37
|
+
code: (props) => /* @__PURE__ */ jsxRuntime.jsx("pre", { children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: props.plainText }) }),
|
|
38
|
+
heading: ({ level, children }) => {
|
|
39
|
+
switch (level) {
|
|
40
|
+
case 1:
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h1", { children });
|
|
42
|
+
case 2:
|
|
43
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h2", { children });
|
|
44
|
+
case 3:
|
|
45
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h3", { children });
|
|
46
|
+
case 4:
|
|
47
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h4", { children });
|
|
48
|
+
case 5:
|
|
49
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h5", { children });
|
|
50
|
+
case 6:
|
|
51
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h6", { children });
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
link: (props) => /* @__PURE__ */ jsxRuntime.jsx("a", { href: props.url, children: props.children }),
|
|
55
|
+
list: (props) => {
|
|
56
|
+
if (props.format === "ordered") {
|
|
57
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ol", { children: props.children });
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", { children: props.children });
|
|
60
|
+
},
|
|
61
|
+
"list-item": (props) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: props.children }),
|
|
62
|
+
image: (props) => /* @__PURE__ */ jsxRuntime.jsx("img", { src: props.image.url, alt: props.image.alternativeText || void 0 })
|
|
63
|
+
},
|
|
64
|
+
modifiers: {
|
|
65
|
+
bold: (props) => /* @__PURE__ */ jsxRuntime.jsx("strong", { children: props.children }),
|
|
66
|
+
italic: (props) => /* @__PURE__ */ jsxRuntime.jsx("em", { children: props.children }),
|
|
67
|
+
underline: (props) => /* @__PURE__ */ jsxRuntime.jsx("u", { children: props.children }),
|
|
68
|
+
strikethrough: (props) => /* @__PURE__ */ jsxRuntime.jsx("del", { children: props.children }),
|
|
69
|
+
code: (props) => /* @__PURE__ */ jsxRuntime.jsx("code", { children: props.children })
|
|
70
|
+
},
|
|
71
|
+
missingBlockTypes: [],
|
|
72
|
+
missingModifierTypes: []
|
|
73
|
+
};
|
|
74
|
+
const ComponentsContext = React__namespace.createContext(defaultComponents);
|
|
75
|
+
const ComponentsProvider = ({ children, value = defaultComponents }) => {
|
|
76
|
+
const memoizedValue = React__namespace.useMemo(() => value, [value]);
|
|
77
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ComponentsContext.Provider, { value: memoizedValue, children });
|
|
78
|
+
};
|
|
79
|
+
function useComponentsContext() {
|
|
80
|
+
return React__namespace.useContext(ComponentsContext);
|
|
81
|
+
}
|
|
82
|
+
const BlocksRenderer = (props) => {
|
|
83
|
+
const blocks = {
|
|
84
|
+
...defaultComponents.blocks,
|
|
85
|
+
...props.blocks
|
|
86
|
+
};
|
|
87
|
+
const modifiers = {
|
|
88
|
+
...defaultComponents.modifiers,
|
|
89
|
+
...props.modifiers
|
|
90
|
+
};
|
|
91
|
+
const missingBlockTypes = React__namespace.useRef([]);
|
|
92
|
+
const missingModifierTypes = React__namespace.useRef([]);
|
|
93
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
94
|
+
ComponentsProvider,
|
|
95
|
+
{
|
|
96
|
+
value: {
|
|
97
|
+
blocks,
|
|
98
|
+
modifiers,
|
|
99
|
+
missingBlockTypes: missingBlockTypes.current,
|
|
100
|
+
missingModifierTypes: missingModifierTypes.current
|
|
101
|
+
},
|
|
102
|
+
children: props.content.map((content, index) => /* @__PURE__ */ jsxRuntime.jsx(Block.Block, { content }, index))
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
exports.BlocksRenderer = BlocksRenderer;
|
|
108
|
+
exports.ComponentsProvider = ComponentsProvider;
|
|
109
|
+
exports.useComponentsContext = useComponentsContext;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
var BlocksRenderer = require('./BlocksRenderer.js');
|
|
11
|
+
|
|
12
|
+
const Text = ({ text, ...modifiers }) => {
|
|
13
|
+
const { modifiers: modifierComponents, missingModifierTypes } = BlocksRenderer.useComponentsContext();
|
|
14
|
+
const modifierNames = Object.keys(modifiers);
|
|
15
|
+
return modifierNames.reduce(
|
|
16
|
+
(children, modifierName) => {
|
|
17
|
+
if (!modifiers[modifierName]) {
|
|
18
|
+
return children;
|
|
19
|
+
}
|
|
20
|
+
const ModifierComponent = modifierComponents[modifierName];
|
|
21
|
+
if (!ModifierComponent) {
|
|
22
|
+
if (!missingModifierTypes.includes(modifierName)) {
|
|
23
|
+
console.warn(
|
|
24
|
+
`[@strapi/block-react-renderer] No component found for modifier "${modifierName}"`
|
|
25
|
+
);
|
|
26
|
+
missingModifierTypes.push(modifierName);
|
|
27
|
+
}
|
|
28
|
+
return children;
|
|
29
|
+
}
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ModifierComponent, { children });
|
|
31
|
+
},
|
|
32
|
+
// By default, return the text without any wrapper to avoid useless nesting
|
|
33
|
+
/* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: text })
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.Text = Text;
|
|
@@ -0,0 +1,94 @@
|
|
|
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 BlocksRenderer = require('../../node_modules/@strapi/blocks-react-renderer/dist/BlocksRenderer.js');
|
|
13
|
+
var material = require('@mui/material');
|
|
14
|
+
|
|
15
|
+
function BlockRendererClient(_ref) {
|
|
16
|
+
let {
|
|
17
|
+
content
|
|
18
|
+
} = _ref;
|
|
19
|
+
if (!content) return null;
|
|
20
|
+
return /*#__PURE__*/React.createElement(BlocksRenderer.BlocksRenderer, {
|
|
21
|
+
content: content,
|
|
22
|
+
blocks: {
|
|
23
|
+
// You can use the default components to set class names...
|
|
24
|
+
paragraph: _ref2 => {
|
|
25
|
+
let {
|
|
26
|
+
children
|
|
27
|
+
} = _ref2;
|
|
28
|
+
return /*#__PURE__*/React.createElement(material.Typography, {
|
|
29
|
+
variant: "body1",
|
|
30
|
+
sx: {
|
|
31
|
+
mb: 2
|
|
32
|
+
}
|
|
33
|
+
}, children);
|
|
34
|
+
},
|
|
35
|
+
// ...or point to a design system
|
|
36
|
+
heading: _ref3 => {
|
|
37
|
+
let {
|
|
38
|
+
children,
|
|
39
|
+
level
|
|
40
|
+
} = _ref3;
|
|
41
|
+
switch (level) {
|
|
42
|
+
case 1:
|
|
43
|
+
return /*#__PURE__*/React.createElement(material.Typography, {
|
|
44
|
+
variant: "h1"
|
|
45
|
+
}, children);
|
|
46
|
+
case 2:
|
|
47
|
+
return /*#__PURE__*/React.createElement(material.Typography, {
|
|
48
|
+
variant: "h2"
|
|
49
|
+
}, children);
|
|
50
|
+
case 3:
|
|
51
|
+
return /*#__PURE__*/React.createElement(material.Typography, {
|
|
52
|
+
variant: "h3"
|
|
53
|
+
}, children);
|
|
54
|
+
case 4:
|
|
55
|
+
return /*#__PURE__*/React.createElement(material.Typography, {
|
|
56
|
+
variant: "h4"
|
|
57
|
+
}, children);
|
|
58
|
+
case 5:
|
|
59
|
+
return /*#__PURE__*/React.createElement(material.Typography, {
|
|
60
|
+
variant: "h5"
|
|
61
|
+
}, children);
|
|
62
|
+
case 6:
|
|
63
|
+
return /*#__PURE__*/React.createElement(material.Typography, {
|
|
64
|
+
variant: "h6"
|
|
65
|
+
}, children);
|
|
66
|
+
default:
|
|
67
|
+
return /*#__PURE__*/React.createElement(material.Typography, {
|
|
68
|
+
variant: "h1"
|
|
69
|
+
}, children);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// For links, you may want to use the component from your router or framework
|
|
73
|
+
// link: ({ children, url }) => <Link to={url}>{children}</Link>,
|
|
74
|
+
},
|
|
75
|
+
modifiers: {
|
|
76
|
+
bold: _ref4 => {
|
|
77
|
+
let {
|
|
78
|
+
children
|
|
79
|
+
} = _ref4;
|
|
80
|
+
return /*#__PURE__*/React.createElement("strong", null, children);
|
|
81
|
+
},
|
|
82
|
+
italic: _ref5 => {
|
|
83
|
+
let {
|
|
84
|
+
children
|
|
85
|
+
} = _ref5;
|
|
86
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
87
|
+
className: "italic"
|
|
88
|
+
}, children);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
exports.default = BlockRendererClient;
|
|
@@ -0,0 +1,43 @@
|
|
|
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 FiberManualRecordIcon = require('@mui/icons-material/FiberManualRecord');
|
|
16
|
+
|
|
17
|
+
function BulletList(_ref) {
|
|
18
|
+
let {
|
|
19
|
+
bullets,
|
|
20
|
+
bulletSVG
|
|
21
|
+
} = _ref;
|
|
22
|
+
console.log("bulletSVG2", bulletSVG);
|
|
23
|
+
return /*#__PURE__*/React.createElement(material.Stack, {
|
|
24
|
+
spacing: 2
|
|
25
|
+
}, bullets.map((bullet, index) => /*#__PURE__*/React.createElement(material.Typography, {
|
|
26
|
+
key: index,
|
|
27
|
+
sx: {
|
|
28
|
+
verticalAlign: "center",
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
justifyContent: "flex-start",
|
|
31
|
+
display: "inline-flex"
|
|
32
|
+
}
|
|
33
|
+
}, bulletSVG ? /*#__PURE__*/React.createElement(material.SvgIcon, {
|
|
34
|
+
sx: {
|
|
35
|
+
mr: 1
|
|
36
|
+
}
|
|
37
|
+
}, bulletSVG) : /*#__PURE__*/React.createElement(FiberManualRecordIcon, null), bullet)));
|
|
38
|
+
}
|
|
39
|
+
BulletList.propTypes = {
|
|
40
|
+
bullets: PropTypes.arrayOf(PropTypes.string).isRequired
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
exports.default = BulletList;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
|
+
|
|
11
|
+
var React = require('react');
|
|
12
|
+
var PropTypes = require('prop-types');
|
|
13
|
+
|
|
14
|
+
function Button(_ref) {
|
|
15
|
+
let {
|
|
16
|
+
label,
|
|
17
|
+
backgroundColor = "red",
|
|
18
|
+
size = "md",
|
|
19
|
+
onClick
|
|
20
|
+
} = _ref;
|
|
21
|
+
let scale = 1;
|
|
22
|
+
if (size === "sm") {
|
|
23
|
+
scale = 0.75;
|
|
24
|
+
}
|
|
25
|
+
if (size === "lg") {
|
|
26
|
+
scale = 1.25;
|
|
27
|
+
}
|
|
28
|
+
const style = {
|
|
29
|
+
backgroundColor,
|
|
30
|
+
padding: "".concat(0.5 * scale, "rem ").concat(1 * scale, "rem"),
|
|
31
|
+
border: "none"
|
|
32
|
+
};
|
|
33
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
34
|
+
style: style,
|
|
35
|
+
onClick: onClick
|
|
36
|
+
}, label);
|
|
37
|
+
}
|
|
38
|
+
Button.propTypes = {
|
|
39
|
+
label: PropTypes.string,
|
|
40
|
+
backgroundColor: PropTypes.string,
|
|
41
|
+
size: PropTypes.oneOf(["sm", "md", "lg"]),
|
|
42
|
+
onClick: PropTypes.func
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.default = Button;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
var React = require('react');
|
|
10
|
+
var material = require('@mui/material');
|
|
11
|
+
var getIcon = require('../lib/getIcon.js');
|
|
12
|
+
|
|
13
|
+
function ColumnsSection(_ref) {
|
|
14
|
+
let {
|
|
15
|
+
data
|
|
16
|
+
} = _ref;
|
|
17
|
+
const {
|
|
18
|
+
column,
|
|
19
|
+
maxWidth
|
|
20
|
+
} = data;
|
|
21
|
+
|
|
22
|
+
// TODO make suitable for multiple column layouts
|
|
23
|
+
|
|
24
|
+
return /*#__PURE__*/React.createElement(material.Container, {
|
|
25
|
+
maxWidth: maxWidth || "lg",
|
|
26
|
+
sx: {
|
|
27
|
+
my: 1
|
|
28
|
+
}
|
|
29
|
+
}, /*#__PURE__*/React.createElement(material.Grid, {
|
|
30
|
+
container: true,
|
|
31
|
+
spacing: 2
|
|
32
|
+
}, column.map(column => {
|
|
33
|
+
const Icon = getIcon.default(column.icon);
|
|
34
|
+
return /*#__PURE__*/React.createElement(material.Grid, {
|
|
35
|
+
item: true,
|
|
36
|
+
xs: 12,
|
|
37
|
+
md: 6,
|
|
38
|
+
key: column.id
|
|
39
|
+
}, /*#__PURE__*/React.createElement(material.Paper, {
|
|
40
|
+
sx: {
|
|
41
|
+
p: 2,
|
|
42
|
+
height: "100%"
|
|
43
|
+
}
|
|
44
|
+
}, /*#__PURE__*/React.createElement(material.Typography, {
|
|
45
|
+
variant: "h5",
|
|
46
|
+
sx: {
|
|
47
|
+
mb: 2,
|
|
48
|
+
display: "flex",
|
|
49
|
+
justifyContent: "flex-start",
|
|
50
|
+
alignItems: "center"
|
|
51
|
+
}
|
|
52
|
+
}, Icon !== null && /*#__PURE__*/React.createElement(Icon, {
|
|
53
|
+
sx: {
|
|
54
|
+
mr: 2,
|
|
55
|
+
mt: 0.2,
|
|
56
|
+
width: "50px",
|
|
57
|
+
height: "50px",
|
|
58
|
+
fill: "currentColor",
|
|
59
|
+
stroke: "none"
|
|
60
|
+
}
|
|
61
|
+
}), column.heading), /*#__PURE__*/React.createElement(material.Typography, {
|
|
62
|
+
variant: "body2",
|
|
63
|
+
color: "text.secondary",
|
|
64
|
+
component: "div"
|
|
65
|
+
}, column.text)));
|
|
66
|
+
})));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
exports.ColumnsSection = ColumnsSection;
|