umwd-components 0.1.134 → 0.1.136
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/ColumnsSection.js +4 -2
- package/dist/cjs/components/ContactForm.js +4 -2
- package/dist/cjs/components/FeaturesSection.js +4 -2
- package/dist/cjs/components/FleetSection.js +2 -1
- package/dist/cjs/components/HeroSection.js +5 -8
- package/dist/cjs/components/IconSection.js +4 -2
- package/dist/cjs/components/PersonaliaSection.js +4 -2
- package/dist/cjs/components/ScrollNavbar.js +14 -6
- package/dist/cjs/components/TextImageSection.js +6 -2
- package/dist/cjs/lib/utils.js +0 -29
- package/dist/esm/components/ColumnsSection.js +4 -2
- package/dist/esm/components/ContactForm.js +4 -2
- package/dist/esm/components/FeaturesSection.js +4 -2
- package/dist/esm/components/FleetSection.js +2 -1
- package/dist/esm/components/HeroSection.js +6 -9
- package/dist/esm/components/IconSection.js +4 -2
- package/dist/esm/components/PersonaliaSection.js +4 -2
- package/dist/esm/components/ScrollNavbar.js +14 -6
- package/dist/esm/components/TextImageSection.js +6 -2
- package/dist/esm/lib/utils.js +1 -29
- package/package.json +1 -1
- package/public/AMH/desktop_wallpaper@0.25x.png +0 -0
- package/src/components/ColumnsSection.tsx +4 -2
- package/src/components/ContactForm.tsx +4 -2
- package/src/components/FeaturesSection.tsx +4 -2
- package/src/components/FleetSection.tsx +3 -1
- package/src/components/HeroSection.tsx +13 -9
- package/src/components/IconSection.tsx +4 -2
- package/src/components/PersonaliaSection.tsx +4 -2
- package/src/components/ScrollNavbar.tsx +12 -5
- package/src/components/TextImageSection.tsx +9 -3
- package/src/stories/Page.stories.js +9 -1
|
@@ -16,7 +16,8 @@ function ColumnsSection(_ref) {
|
|
|
16
16
|
} = _ref;
|
|
17
17
|
const {
|
|
18
18
|
column,
|
|
19
|
-
maxWidth
|
|
19
|
+
maxWidth,
|
|
20
|
+
sx = {}
|
|
20
21
|
} = data;
|
|
21
22
|
|
|
22
23
|
// TODO make suitable for multiple column layouts
|
|
@@ -24,7 +25,8 @@ function ColumnsSection(_ref) {
|
|
|
24
25
|
return /*#__PURE__*/React.createElement(material.Container, {
|
|
25
26
|
maxWidth: maxWidth || "lg",
|
|
26
27
|
sx: {
|
|
27
|
-
my: 1
|
|
28
|
+
my: 1,
|
|
29
|
+
...sx
|
|
28
30
|
}
|
|
29
31
|
}, /*#__PURE__*/React.createElement(material.Grid, {
|
|
30
32
|
container: true,
|
|
@@ -18,7 +18,8 @@ function ContactForm(_ref) {
|
|
|
18
18
|
data
|
|
19
19
|
} = _ref;
|
|
20
20
|
const {
|
|
21
|
-
maxWidth
|
|
21
|
+
maxWidth,
|
|
22
|
+
sx = {}
|
|
22
23
|
} = data;
|
|
23
24
|
const [formValues, setFormValues] = React.useState({
|
|
24
25
|
name: "",
|
|
@@ -129,7 +130,8 @@ function ContactForm(_ref) {
|
|
|
129
130
|
return /*#__PURE__*/React.createElement(material.Container, {
|
|
130
131
|
maxWidth: maxWidth ? maxWidth : "lg",
|
|
131
132
|
sx: {
|
|
132
|
-
my: 1
|
|
133
|
+
my: 1,
|
|
134
|
+
...sx
|
|
133
135
|
}
|
|
134
136
|
}, /*#__PURE__*/React.createElement(material.Stack, {
|
|
135
137
|
spacing: 2,
|
|
@@ -16,13 +16,15 @@ function FeatureSection(_ref) {
|
|
|
16
16
|
} = _ref;
|
|
17
17
|
const {
|
|
18
18
|
feature,
|
|
19
|
-
maxWidth
|
|
19
|
+
maxWidth,
|
|
20
|
+
sx = {}
|
|
20
21
|
} = data;
|
|
21
22
|
const theme = material.useTheme();
|
|
22
23
|
return /*#__PURE__*/React.createElement(material.Container, {
|
|
23
24
|
maxWidth: maxWidth || "lg",
|
|
24
25
|
sx: {
|
|
25
|
-
my: 1
|
|
26
|
+
my: 1,
|
|
27
|
+
...sx
|
|
26
28
|
}
|
|
27
29
|
}, /*#__PURE__*/React.createElement(material.Stack, {
|
|
28
30
|
spacing: 2,
|
|
@@ -10,7 +10,6 @@ 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');
|
|
14
13
|
|
|
15
14
|
function HeroSection(_ref) {
|
|
16
15
|
let {
|
|
@@ -22,10 +21,9 @@ function HeroSection(_ref) {
|
|
|
22
21
|
bgImage,
|
|
23
22
|
logoImage,
|
|
24
23
|
link,
|
|
25
|
-
maxWidth
|
|
24
|
+
maxWidth,
|
|
25
|
+
sx = {}
|
|
26
26
|
} = data;
|
|
27
|
-
const theme = material.useTheme();
|
|
28
|
-
const glassColor = utils.setOpacity(theme.palette.background.paper, 0.45);
|
|
29
27
|
return /*#__PURE__*/React.createElement("header", {
|
|
30
28
|
style: {
|
|
31
29
|
position: "relative",
|
|
@@ -41,7 +39,8 @@ function HeroSection(_ref) {
|
|
|
41
39
|
width: "100%",
|
|
42
40
|
overflow: "hidden",
|
|
43
41
|
minHeight: "600px",
|
|
44
|
-
py: 6
|
|
42
|
+
py: 6,
|
|
43
|
+
...sx
|
|
45
44
|
}
|
|
46
45
|
}, bgImage && /*#__PURE__*/React.createElement(StrapiImage.StrapiImage, {
|
|
47
46
|
alt: "Background",
|
|
@@ -64,9 +63,7 @@ function HeroSection(_ref) {
|
|
|
64
63
|
}, /*#__PURE__*/React.createElement(material.Paper, {
|
|
65
64
|
sx: {
|
|
66
65
|
px: 2,
|
|
67
|
-
py:
|
|
68
|
-
backdropFilter: "blur(4px)",
|
|
69
|
-
backgroundColor: glassColor
|
|
66
|
+
py: 2
|
|
70
67
|
}
|
|
71
68
|
}, /*#__PURE__*/React.createElement(material.Stack, {
|
|
72
69
|
spacing: 5,
|
|
@@ -16,12 +16,14 @@ function IconSection(_ref) {
|
|
|
16
16
|
} = _ref;
|
|
17
17
|
const {
|
|
18
18
|
icon,
|
|
19
|
-
maxWidth
|
|
19
|
+
maxWidth,
|
|
20
|
+
sx = {}
|
|
20
21
|
} = data;
|
|
21
22
|
return /*#__PURE__*/React.createElement(material.Container, {
|
|
22
23
|
maxWidth: maxWidth || "lg",
|
|
23
24
|
sx: {
|
|
24
|
-
my: 1
|
|
25
|
+
my: 1,
|
|
26
|
+
...sx
|
|
25
27
|
}
|
|
26
28
|
}, /*#__PURE__*/React.createElement(material.Grid, {
|
|
27
29
|
container: true,
|
|
@@ -20,13 +20,15 @@ function PersonaliaSection(_ref) {
|
|
|
20
20
|
} = _ref;
|
|
21
21
|
const {
|
|
22
22
|
partner,
|
|
23
|
-
maxWidth
|
|
23
|
+
maxWidth,
|
|
24
|
+
sx = {}
|
|
24
25
|
} = data;
|
|
25
26
|
material.useTheme();
|
|
26
27
|
return /*#__PURE__*/React.createElement(material.Container, {
|
|
27
28
|
maxWidth: maxWidth || "lg",
|
|
28
29
|
sx: {
|
|
29
|
-
my: 1
|
|
30
|
+
my: 1,
|
|
31
|
+
...sx
|
|
30
32
|
}
|
|
31
33
|
}, /*#__PURE__*/React.createElement(material.Grid, {
|
|
32
34
|
container: true,
|
|
@@ -29,7 +29,8 @@ function ScrollNavbar(_ref) {
|
|
|
29
29
|
pages,
|
|
30
30
|
tabs,
|
|
31
31
|
maxWidth,
|
|
32
|
-
minHeight
|
|
32
|
+
minHeight,
|
|
33
|
+
sx = {}
|
|
33
34
|
} = data;
|
|
34
35
|
const [mobileNavOpen, setMobileNavOpen] = React.useState(false);
|
|
35
36
|
const [currentTab, setCurrentTab] = React.useState(0);
|
|
@@ -43,7 +44,8 @@ function ScrollNavbar(_ref) {
|
|
|
43
44
|
return /*#__PURE__*/React.createElement(material.AppBar, {
|
|
44
45
|
position: "sticky",
|
|
45
46
|
sx: {
|
|
46
|
-
backgroundColor: theme.palette.primary.main
|
|
47
|
+
backgroundColor: theme.palette.primary.main,
|
|
48
|
+
...sx
|
|
47
49
|
}
|
|
48
50
|
}, /*#__PURE__*/React.createElement(material.Container, {
|
|
49
51
|
maxWidth: maxWidth
|
|
@@ -86,8 +88,14 @@ function ScrollNavbar(_ref) {
|
|
|
86
88
|
}
|
|
87
89
|
}, site_title) : /*#__PURE__*/React.createElement(React.Fragment, null, site_title)))), /*#__PURE__*/React.createElement(material.Box, {
|
|
88
90
|
sx: {
|
|
89
|
-
display:
|
|
90
|
-
|
|
91
|
+
display: {
|
|
92
|
+
xs: "none",
|
|
93
|
+
md: "flex"
|
|
94
|
+
},
|
|
95
|
+
width: {
|
|
96
|
+
xs: "0px",
|
|
97
|
+
md: "30px"
|
|
98
|
+
}
|
|
91
99
|
}
|
|
92
100
|
}), pages && pages.length > 0 && /*#__PURE__*/React.createElement(material.Box, {
|
|
93
101
|
sx: {
|
|
@@ -164,7 +172,7 @@ function ScrollNavbar(_ref) {
|
|
|
164
172
|
height: logo.height || 32,
|
|
165
173
|
alt: logo.alternativeText || "site logo",
|
|
166
174
|
style: {
|
|
167
|
-
maxHeight: "
|
|
175
|
+
maxHeight: "55px",
|
|
168
176
|
width: "auto",
|
|
169
177
|
height: "auto"
|
|
170
178
|
}
|
|
@@ -244,7 +252,7 @@ function ScrollNavbar(_ref) {
|
|
|
244
252
|
width: logo.width || 32,
|
|
245
253
|
height: logo.height || 32,
|
|
246
254
|
style: {
|
|
247
|
-
maxHeight: "
|
|
255
|
+
maxHeight: "55px",
|
|
248
256
|
width: "auto",
|
|
249
257
|
height: "auto"
|
|
250
258
|
}
|
|
@@ -36,17 +36,21 @@ function TextImageSection(_ref) {
|
|
|
36
36
|
text,
|
|
37
37
|
image,
|
|
38
38
|
reverse = false,
|
|
39
|
-
maxWidth
|
|
39
|
+
maxWidth,
|
|
40
|
+
sx = {}
|
|
40
41
|
} = data;
|
|
41
42
|
|
|
42
43
|
/* TODO Text_content should deal with linebreaks,
|
|
43
44
|
reading up upon mui-markdown docs is advised */
|
|
44
45
|
|
|
46
|
+
/* TODO Replace with blocks */
|
|
47
|
+
|
|
45
48
|
const theme = material.useTheme();
|
|
46
49
|
return /*#__PURE__*/React.createElement(material.Container, {
|
|
47
50
|
maxWidth: maxWidth ? maxWidth : "lg",
|
|
48
51
|
sx: {
|
|
49
|
-
my: 1
|
|
52
|
+
my: 1,
|
|
53
|
+
...sx
|
|
50
54
|
}
|
|
51
55
|
}, /*#__PURE__*/React.createElement(material.Paper, {
|
|
52
56
|
sx: {
|
package/dist/cjs/lib/utils.js
CHANGED
|
@@ -23,35 +23,6 @@ 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
|
-
}
|
|
54
26
|
|
|
55
27
|
exports.getStrapiMedia = getStrapiMedia;
|
|
56
28
|
exports.getStrapiURL = getStrapiURL;
|
|
57
|
-
exports.setOpacity = setOpacity;
|
|
@@ -14,7 +14,8 @@ function ColumnsSection(_ref) {
|
|
|
14
14
|
} = _ref;
|
|
15
15
|
const {
|
|
16
16
|
column,
|
|
17
|
-
maxWidth
|
|
17
|
+
maxWidth,
|
|
18
|
+
sx = {}
|
|
18
19
|
} = data;
|
|
19
20
|
|
|
20
21
|
// TODO make suitable for multiple column layouts
|
|
@@ -22,7 +23,8 @@ function ColumnsSection(_ref) {
|
|
|
22
23
|
return /*#__PURE__*/React__default.createElement(Container, {
|
|
23
24
|
maxWidth: maxWidth || "lg",
|
|
24
25
|
sx: {
|
|
25
|
-
my: 1
|
|
26
|
+
my: 1,
|
|
27
|
+
...sx
|
|
26
28
|
}
|
|
27
29
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
28
30
|
container: true,
|
|
@@ -14,7 +14,8 @@ function ContactForm(_ref) {
|
|
|
14
14
|
data
|
|
15
15
|
} = _ref;
|
|
16
16
|
const {
|
|
17
|
-
maxWidth
|
|
17
|
+
maxWidth,
|
|
18
|
+
sx = {}
|
|
18
19
|
} = data;
|
|
19
20
|
const [formValues, setFormValues] = React__default.useState({
|
|
20
21
|
name: "",
|
|
@@ -125,7 +126,8 @@ function ContactForm(_ref) {
|
|
|
125
126
|
return /*#__PURE__*/React__default.createElement(Container, {
|
|
126
127
|
maxWidth: maxWidth ? maxWidth : "lg",
|
|
127
128
|
sx: {
|
|
128
|
-
my: 1
|
|
129
|
+
my: 1,
|
|
130
|
+
...sx
|
|
129
131
|
}
|
|
130
132
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
131
133
|
spacing: 2,
|
|
@@ -14,13 +14,15 @@ function FeatureSection(_ref) {
|
|
|
14
14
|
} = _ref;
|
|
15
15
|
const {
|
|
16
16
|
feature,
|
|
17
|
-
maxWidth
|
|
17
|
+
maxWidth,
|
|
18
|
+
sx = {}
|
|
18
19
|
} = data;
|
|
19
20
|
const theme = useTheme();
|
|
20
21
|
return /*#__PURE__*/React__default.createElement(Container, {
|
|
21
22
|
maxWidth: maxWidth || "lg",
|
|
22
23
|
sx: {
|
|
23
|
-
my: 1
|
|
24
|
+
my: 1,
|
|
25
|
+
...sx
|
|
24
26
|
}
|
|
25
27
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
26
28
|
spacing: 2,
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
import React__default from 'react';
|
|
8
8
|
import Link from 'next/link';
|
|
9
|
-
import {
|
|
9
|
+
import { Box, Container, Paper, Stack, Typography, Button } from '@mui/material';
|
|
10
10
|
import { StrapiImage } from './StrapiImage.js';
|
|
11
|
-
import { setOpacity } from '../lib/utils.js';
|
|
12
11
|
|
|
13
12
|
function HeroSection(_ref) {
|
|
14
13
|
let {
|
|
@@ -20,10 +19,9 @@ function HeroSection(_ref) {
|
|
|
20
19
|
bgImage,
|
|
21
20
|
logoImage,
|
|
22
21
|
link,
|
|
23
|
-
maxWidth
|
|
22
|
+
maxWidth,
|
|
23
|
+
sx = {}
|
|
24
24
|
} = data;
|
|
25
|
-
const theme = useTheme();
|
|
26
|
-
const glassColor = setOpacity(theme.palette.background.paper, 0.45);
|
|
27
25
|
return /*#__PURE__*/React__default.createElement("header", {
|
|
28
26
|
style: {
|
|
29
27
|
position: "relative",
|
|
@@ -39,7 +37,8 @@ function HeroSection(_ref) {
|
|
|
39
37
|
width: "100%",
|
|
40
38
|
overflow: "hidden",
|
|
41
39
|
minHeight: "600px",
|
|
42
|
-
py: 6
|
|
40
|
+
py: 6,
|
|
41
|
+
...sx
|
|
43
42
|
}
|
|
44
43
|
}, bgImage && /*#__PURE__*/React__default.createElement(StrapiImage, {
|
|
45
44
|
alt: "Background",
|
|
@@ -62,9 +61,7 @@ function HeroSection(_ref) {
|
|
|
62
61
|
}, /*#__PURE__*/React__default.createElement(Paper, {
|
|
63
62
|
sx: {
|
|
64
63
|
px: 2,
|
|
65
|
-
py:
|
|
66
|
-
backdropFilter: "blur(4px)",
|
|
67
|
-
backgroundColor: glassColor
|
|
64
|
+
py: 2
|
|
68
65
|
}
|
|
69
66
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
70
67
|
spacing: 5,
|
|
@@ -14,12 +14,14 @@ function IconSection(_ref) {
|
|
|
14
14
|
} = _ref;
|
|
15
15
|
const {
|
|
16
16
|
icon,
|
|
17
|
-
maxWidth
|
|
17
|
+
maxWidth,
|
|
18
|
+
sx = {}
|
|
18
19
|
} = data;
|
|
19
20
|
return /*#__PURE__*/React__default.createElement(Container, {
|
|
20
21
|
maxWidth: maxWidth || "lg",
|
|
21
22
|
sx: {
|
|
22
|
-
my: 1
|
|
23
|
+
my: 1,
|
|
24
|
+
...sx
|
|
23
25
|
}
|
|
24
26
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
25
27
|
container: true,
|
|
@@ -18,13 +18,15 @@ function PersonaliaSection(_ref) {
|
|
|
18
18
|
} = _ref;
|
|
19
19
|
const {
|
|
20
20
|
partner,
|
|
21
|
-
maxWidth
|
|
21
|
+
maxWidth,
|
|
22
|
+
sx = {}
|
|
22
23
|
} = data;
|
|
23
24
|
useTheme();
|
|
24
25
|
return /*#__PURE__*/React__default.createElement(Container, {
|
|
25
26
|
maxWidth: maxWidth || "lg",
|
|
26
27
|
sx: {
|
|
27
|
-
my: 1
|
|
28
|
+
my: 1,
|
|
29
|
+
...sx
|
|
28
30
|
}
|
|
29
31
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
30
32
|
container: true,
|
|
@@ -25,7 +25,8 @@ function ScrollNavbar(_ref) {
|
|
|
25
25
|
pages,
|
|
26
26
|
tabs,
|
|
27
27
|
maxWidth,
|
|
28
|
-
minHeight
|
|
28
|
+
minHeight,
|
|
29
|
+
sx = {}
|
|
29
30
|
} = data;
|
|
30
31
|
const [mobileNavOpen, setMobileNavOpen] = useState(false);
|
|
31
32
|
const [currentTab, setCurrentTab] = useState(0);
|
|
@@ -39,7 +40,8 @@ function ScrollNavbar(_ref) {
|
|
|
39
40
|
return /*#__PURE__*/React__default.createElement(AppBar, {
|
|
40
41
|
position: "sticky",
|
|
41
42
|
sx: {
|
|
42
|
-
backgroundColor: theme.palette.primary.main
|
|
43
|
+
backgroundColor: theme.palette.primary.main,
|
|
44
|
+
...sx
|
|
43
45
|
}
|
|
44
46
|
}, /*#__PURE__*/React__default.createElement(Container, {
|
|
45
47
|
maxWidth: maxWidth
|
|
@@ -82,8 +84,14 @@ function ScrollNavbar(_ref) {
|
|
|
82
84
|
}
|
|
83
85
|
}, site_title) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, site_title)))), /*#__PURE__*/React__default.createElement(Box, {
|
|
84
86
|
sx: {
|
|
85
|
-
display:
|
|
86
|
-
|
|
87
|
+
display: {
|
|
88
|
+
xs: "none",
|
|
89
|
+
md: "flex"
|
|
90
|
+
},
|
|
91
|
+
width: {
|
|
92
|
+
xs: "0px",
|
|
93
|
+
md: "30px"
|
|
94
|
+
}
|
|
87
95
|
}
|
|
88
96
|
}), pages && pages.length > 0 && /*#__PURE__*/React__default.createElement(Box, {
|
|
89
97
|
sx: {
|
|
@@ -160,7 +168,7 @@ function ScrollNavbar(_ref) {
|
|
|
160
168
|
height: logo.height || 32,
|
|
161
169
|
alt: logo.alternativeText || "site logo",
|
|
162
170
|
style: {
|
|
163
|
-
maxHeight: "
|
|
171
|
+
maxHeight: "55px",
|
|
164
172
|
width: "auto",
|
|
165
173
|
height: "auto"
|
|
166
174
|
}
|
|
@@ -240,7 +248,7 @@ function ScrollNavbar(_ref) {
|
|
|
240
248
|
width: logo.width || 32,
|
|
241
249
|
height: logo.height || 32,
|
|
242
250
|
style: {
|
|
243
|
-
maxHeight: "
|
|
251
|
+
maxHeight: "55px",
|
|
244
252
|
width: "auto",
|
|
245
253
|
height: "auto"
|
|
246
254
|
}
|
|
@@ -32,17 +32,21 @@ function TextImageSection(_ref) {
|
|
|
32
32
|
text,
|
|
33
33
|
image,
|
|
34
34
|
reverse = false,
|
|
35
|
-
maxWidth
|
|
35
|
+
maxWidth,
|
|
36
|
+
sx = {}
|
|
36
37
|
} = data;
|
|
37
38
|
|
|
38
39
|
/* TODO Text_content should deal with linebreaks,
|
|
39
40
|
reading up upon mui-markdown docs is advised */
|
|
40
41
|
|
|
42
|
+
/* TODO Replace with blocks */
|
|
43
|
+
|
|
41
44
|
const theme = useTheme();
|
|
42
45
|
return /*#__PURE__*/React__default.createElement(Container, {
|
|
43
46
|
maxWidth: maxWidth ? maxWidth : "lg",
|
|
44
47
|
sx: {
|
|
45
|
-
my: 1
|
|
48
|
+
my: 1,
|
|
49
|
+
...sx
|
|
46
50
|
}
|
|
47
51
|
}, /*#__PURE__*/React__default.createElement(Paper, {
|
|
48
52
|
sx: {
|
package/dist/esm/lib/utils.js
CHANGED
|
@@ -21,33 +21,5 @@ function getStrapiMedia(url) {
|
|
|
21
21
|
if (url.startsWith("http") || url.startsWith("//")) return url;
|
|
22
22
|
return "".concat(getStrapiURL()).concat(url);
|
|
23
23
|
}
|
|
24
|
-
function setOpacity(color, opacity) {
|
|
25
|
-
// Clamp opacity between 0 and 1
|
|
26
|
-
opacity = Math.min(Math.max(opacity, 0), 1);
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
const match = color.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i);
|
|
30
|
-
if (match) {
|
|
31
|
-
// Hex color
|
|
32
|
-
const [, r, g, b, alpha = "FF"] = match;
|
|
33
|
-
return "rgba(".concat(parseInt(r, 16), ", ").concat(parseInt(g, 16), ", ").concat(parseInt(b, 16), ", ").concat(parseInt(alpha, 16) / 255 * opacity, ")");
|
|
34
|
-
} else {
|
|
35
|
-
// Parse RGB or RGBA manually
|
|
36
|
-
const rgbMatch = color.match(/^rgb\((\d+)(?:,(\d+))?(?:,(\d+))?\)$/i);
|
|
37
|
-
const rgbaMatch = color.match(/^rgba\((\d+)(?:,(\d+))?(?:,(\d+))?(?:,([.\d]+))?\)$/i);
|
|
38
|
-
if (rgbMatch) {
|
|
39
|
-
// RGB format
|
|
40
|
-
const [, red, green, blue] = rgbMatch;
|
|
41
|
-
return "rgba(".concat(red, ", ").concat(green, ", ").concat(blue, ", ").concat(opacity, ")");
|
|
42
|
-
} else if (rgbaMatch) {
|
|
43
|
-
// RGBA format
|
|
44
|
-
const [, red, green, blue, alpha] = rgbaMatch;
|
|
45
|
-
return "rgba(".concat(red, ", ").concat(green, ", ").concat(blue, ", ").concat(alpha || opacity, ")"); // Use provided opacity if alpha is missing
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// If parsing fails, return original color
|
|
50
|
-
return color;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { getStrapiMedia, getStrapiURL, setOpacity };
|
|
25
|
+
export { getStrapiMedia, getStrapiURL };
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
Paper,
|
|
10
10
|
} from "@mui/material";
|
|
11
11
|
import getIcon from "../lib/getIcon.ts";
|
|
12
|
+
import { SxProps, Theme } from "@mui/material/styles";
|
|
12
13
|
|
|
13
14
|
type MaxWidth = "xs" | "sm" | "md" | "lg" | "xl" | false | undefined;
|
|
14
15
|
|
|
@@ -26,6 +27,7 @@ interface ColumnsSectionProps {
|
|
|
26
27
|
description: string;
|
|
27
28
|
column: ColumnProps[];
|
|
28
29
|
maxWidth: MaxWidth;
|
|
30
|
+
sx?: SxProps<Theme>;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
export function ColumnsSection({
|
|
@@ -33,12 +35,12 @@ export function ColumnsSection({
|
|
|
33
35
|
}: {
|
|
34
36
|
readonly data: ColumnsSectionProps;
|
|
35
37
|
}) {
|
|
36
|
-
const { column, maxWidth } = data;
|
|
38
|
+
const { column, maxWidth, sx = {} } = data;
|
|
37
39
|
|
|
38
40
|
// TODO make suitable for multiple column layouts
|
|
39
41
|
|
|
40
42
|
return (
|
|
41
|
-
<Container maxWidth={maxWidth || "lg"} sx={{ my: 1 }}>
|
|
43
|
+
<Container maxWidth={maxWidth || "lg"} sx={{ my: 1, ...sx }}>
|
|
42
44
|
<Grid container spacing={2}>
|
|
43
45
|
{column.map((column) => {
|
|
44
46
|
const Icon = getIcon(column.icon) as React.ElementType | null;
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Button,
|
|
13
13
|
} from "@mui/material";
|
|
14
14
|
import isEmail from "validator/lib/isEmail";
|
|
15
|
+
import { SxProps, Theme } from "@mui/material/styles";
|
|
15
16
|
|
|
16
17
|
type MaxWidth = "xs" | "sm" | "md" | "lg" | "xl" | false | undefined;
|
|
17
18
|
|
|
@@ -20,10 +21,11 @@ interface ContactFormProps {
|
|
|
20
21
|
__component: string;
|
|
21
22
|
title: string;
|
|
22
23
|
maxWidth: MaxWidth;
|
|
24
|
+
sx?: SxProps<Theme>;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
function ContactForm({ data }: { readonly data: ContactFormProps }) {
|
|
26
|
-
const { maxWidth } = data;
|
|
28
|
+
const { maxWidth, sx = {} } = data;
|
|
27
29
|
|
|
28
30
|
type FormValues = {
|
|
29
31
|
name: string;
|
|
@@ -149,7 +151,7 @@ function ContactForm({ data }: { readonly data: ContactFormProps }) {
|
|
|
149
151
|
};
|
|
150
152
|
|
|
151
153
|
return (
|
|
152
|
-
<Container maxWidth={maxWidth ? maxWidth : "lg"} sx={{ my: 1 }}>
|
|
154
|
+
<Container maxWidth={maxWidth ? maxWidth : "lg"} sx={{ my: 1, ...sx }}>
|
|
153
155
|
<Stack spacing={2} sx={{ width: "100%" }}>
|
|
154
156
|
<Typography variant="h6" align="center">
|
|
155
157
|
Write us
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
useTheme,
|
|
12
12
|
} from "@mui/material";
|
|
13
13
|
import getIcon from "../lib/getIcon.ts";
|
|
14
|
+
import { SxProps, Theme } from "@mui/material/styles";
|
|
14
15
|
|
|
15
16
|
type MaxWidth = "xs" | "sm" | "md" | "lg" | "xl" | false | undefined;
|
|
16
17
|
|
|
@@ -29,6 +30,7 @@ interface FeatureSectionProps {
|
|
|
29
30
|
description: string;
|
|
30
31
|
feature: FeatureProps[];
|
|
31
32
|
maxWidth: MaxWidth;
|
|
33
|
+
sx?: SxProps<Theme>;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
export function FeatureSection({
|
|
@@ -36,12 +38,12 @@ export function FeatureSection({
|
|
|
36
38
|
}: {
|
|
37
39
|
readonly data: FeatureSectionProps;
|
|
38
40
|
}) {
|
|
39
|
-
const { feature, maxWidth } = data;
|
|
41
|
+
const { feature, maxWidth, sx = {} } = data;
|
|
40
42
|
|
|
41
43
|
const theme = useTheme();
|
|
42
44
|
|
|
43
45
|
return (
|
|
44
|
-
<Container maxWidth={maxWidth || "lg"} sx={{ my: 1 }}>
|
|
46
|
+
<Container maxWidth={maxWidth || "lg"} sx={{ my: 1, ...sx }}>
|
|
45
47
|
<Stack
|
|
46
48
|
spacing={2}
|
|
47
49
|
direction={"row"}
|
|
@@ -16,6 +16,7 @@ import { StrapiImage } from "./StrapiImage.tsx";
|
|
|
16
16
|
import RadarIcon from "@mui/icons-material/Radar";
|
|
17
17
|
import SpeedIcon from "@mui/icons-material/Speed";
|
|
18
18
|
import HeightIcon from "@mui/icons-material/Height";
|
|
19
|
+
import { SxProps, Theme } from "@mui/material/styles";
|
|
19
20
|
|
|
20
21
|
type MaxWidth = "xs" | "sm" | "md" | "lg" | "xl" | false | undefined;
|
|
21
22
|
|
|
@@ -48,10 +49,11 @@ interface FleetSectionProps {
|
|
|
48
49
|
description: string;
|
|
49
50
|
airplane: AirplaneProps[];
|
|
50
51
|
maxWidth: MaxWidth;
|
|
52
|
+
sx?: SxProps<Theme>;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
export function FleetSection({ data }: { readonly data: FleetSectionProps }) {
|
|
54
|
-
const { airplane, maxWidth } = data;
|
|
56
|
+
const { airplane, maxWidth, sx = {} } = data;
|
|
55
57
|
|
|
56
58
|
const theme = useTheme();
|
|
57
59
|
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useTheme,
|
|
11
11
|
} from "@mui/material";
|
|
12
12
|
import { StrapiImage } from "./StrapiImage.tsx";
|
|
13
|
-
import {
|
|
13
|
+
import { SxProps, Theme } from "@mui/material/styles";
|
|
14
14
|
|
|
15
15
|
interface ImageProps {
|
|
16
16
|
id: number;
|
|
@@ -37,15 +37,20 @@ interface HeroSectionProps {
|
|
|
37
37
|
logoImage?: ImageProps;
|
|
38
38
|
link: LinkProps;
|
|
39
39
|
maxWidth?: "xs" | "sm" | "md" | "lg" | "xl" | false | undefined;
|
|
40
|
+
sx?: SxProps<Theme>;
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
export function HeroSection({ data }: Readonly<HeroSectionProps>) {
|
|
44
|
-
const {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
const {
|
|
46
|
+
heading,
|
|
47
|
+
subHeading,
|
|
48
|
+
bgImage,
|
|
49
|
+
logoImage,
|
|
50
|
+
link,
|
|
51
|
+
maxWidth,
|
|
52
|
+
sx = {},
|
|
53
|
+
} = data;
|
|
49
54
|
|
|
50
55
|
return (
|
|
51
56
|
<header style={{ position: "relative", padding: 0, margin: 0 }}>
|
|
@@ -59,6 +64,7 @@ export function HeroSection({ data }: Readonly<HeroSectionProps>) {
|
|
|
59
64
|
overflow: "hidden",
|
|
60
65
|
minHeight: "600px",
|
|
61
66
|
py: 6,
|
|
67
|
+
...sx,
|
|
62
68
|
}}
|
|
63
69
|
>
|
|
64
70
|
{bgImage && (
|
|
@@ -80,9 +86,7 @@ export function HeroSection({ data }: Readonly<HeroSectionProps>) {
|
|
|
80
86
|
<Paper
|
|
81
87
|
sx={{
|
|
82
88
|
px: 2,
|
|
83
|
-
py:
|
|
84
|
-
backdropFilter: "blur(4px)",
|
|
85
|
-
backgroundColor: glassColor,
|
|
89
|
+
py: 2,
|
|
86
90
|
}}
|
|
87
91
|
>
|
|
88
92
|
<Stack spacing={5} alignItems="center" justifyContent="center">
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Grid, Card, CardContent, Typography, Container } from "@mui/material";
|
|
3
3
|
import getIcon from "../lib/getIcon.ts";
|
|
4
|
+
import { SxProps, Theme } from "@mui/material/styles";
|
|
4
5
|
|
|
5
6
|
type MaxWidth = "xs" | "sm" | "md" | "lg" | "xl" | false | undefined;
|
|
6
7
|
|
|
@@ -18,13 +19,14 @@ interface IconSectionProps {
|
|
|
18
19
|
description: string;
|
|
19
20
|
icon: IconProps[];
|
|
20
21
|
maxWidth: MaxWidth;
|
|
22
|
+
sx?: SxProps<Theme>;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export function IconSection({ data }: { readonly data: IconSectionProps }) {
|
|
24
|
-
const { icon, maxWidth } = data;
|
|
26
|
+
const { icon, maxWidth, sx = {} } = data;
|
|
25
27
|
|
|
26
28
|
return (
|
|
27
|
-
<Container maxWidth={maxWidth || "lg"} sx={{ my: 1 }}>
|
|
29
|
+
<Container maxWidth={maxWidth || "lg"} sx={{ my: 1, ...sx }}>
|
|
28
30
|
<Grid container spacing={2}>
|
|
29
31
|
{icon.map((icon) => {
|
|
30
32
|
const Icon = getIcon(icon.icon) as React.ElementType | null;
|
|
@@ -16,6 +16,7 @@ import { Email, LinkedIn } from "@mui/icons-material";
|
|
|
16
16
|
import { BlockRendererClient } from "./BlockRendererClient.tsx";
|
|
17
17
|
import { type BlocksContent } from "@strapi/blocks-react-renderer";
|
|
18
18
|
import { MuiLink } from "./MuiLink.tsx";
|
|
19
|
+
import { SxProps, Theme } from "@mui/material/styles";
|
|
19
20
|
|
|
20
21
|
type MaxWidth = "xs" | "sm" | "md" | "lg" | "xl" | false | undefined;
|
|
21
22
|
|
|
@@ -53,6 +54,7 @@ interface PersonaliaSectionProps {
|
|
|
53
54
|
description: string;
|
|
54
55
|
partner?: PartnerProps[];
|
|
55
56
|
maxWidth: MaxWidth;
|
|
57
|
+
sx?: SxProps<Theme>;
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
export function PersonaliaSection({
|
|
@@ -60,12 +62,12 @@ export function PersonaliaSection({
|
|
|
60
62
|
}: {
|
|
61
63
|
readonly data: PersonaliaSectionProps;
|
|
62
64
|
}) {
|
|
63
|
-
const { partner, maxWidth } = data;
|
|
65
|
+
const { partner, maxWidth, sx = {} } = data;
|
|
64
66
|
|
|
65
67
|
const theme = useTheme();
|
|
66
68
|
|
|
67
69
|
return (
|
|
68
|
-
<Container maxWidth={maxWidth || "lg"} sx={{ my: 1 }}>
|
|
70
|
+
<Container maxWidth={maxWidth || "lg"} sx={{ my: 1, ...sx }}>
|
|
69
71
|
<Grid container spacing={2}>
|
|
70
72
|
{partner &&
|
|
71
73
|
partner.map((partner) => {
|
|
@@ -23,6 +23,7 @@ import CloseIcon from "@mui/icons-material/Close";
|
|
|
23
23
|
import MoreVertIcon from "@mui/icons-material/MoreVert";
|
|
24
24
|
import ScrollLink from "./ScrollLink.tsx";
|
|
25
25
|
import { type ReactNode } from "react";
|
|
26
|
+
import { SxProps, Theme } from "@mui/material/styles";
|
|
26
27
|
|
|
27
28
|
interface ImageProps {
|
|
28
29
|
id: number;
|
|
@@ -55,10 +56,11 @@ interface NavbarProps {
|
|
|
55
56
|
tabs: TabInfo[];
|
|
56
57
|
maxWidth: MaxWidth;
|
|
57
58
|
minHeight: string;
|
|
59
|
+
sx?: SxProps<Theme>;
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
function ScrollNavbar({ data }: { readonly data: NavbarProps }) {
|
|
61
|
-
const { site_title, logo, pages, tabs, maxWidth, minHeight } = data;
|
|
63
|
+
const { site_title, logo, pages, tabs, maxWidth, minHeight, sx = {} } = data;
|
|
62
64
|
|
|
63
65
|
const [mobileNavOpen, setMobileNavOpen] = useState(false);
|
|
64
66
|
const [currentTab, setCurrentTab] = useState(0);
|
|
@@ -76,7 +78,7 @@ function ScrollNavbar({ data }: { readonly data: NavbarProps }) {
|
|
|
76
78
|
return (
|
|
77
79
|
<AppBar
|
|
78
80
|
position="sticky"
|
|
79
|
-
sx={{ backgroundColor: theme.palette.primary.main }}
|
|
81
|
+
sx={{ backgroundColor: theme.palette.primary.main, ...sx }}
|
|
80
82
|
>
|
|
81
83
|
<Container maxWidth={maxWidth}>
|
|
82
84
|
<Toolbar
|
|
@@ -132,7 +134,12 @@ function ScrollNavbar({ data }: { readonly data: NavbarProps }) {
|
|
|
132
134
|
</Box>
|
|
133
135
|
</ScrollLink>
|
|
134
136
|
|
|
135
|
-
<Box
|
|
137
|
+
<Box
|
|
138
|
+
sx={{
|
|
139
|
+
display: { xs: "none", md: "flex" },
|
|
140
|
+
width: { xs: "0px", md: "30px" },
|
|
141
|
+
}}
|
|
142
|
+
></Box>
|
|
136
143
|
|
|
137
144
|
{/* Large screen menu */}
|
|
138
145
|
{pages && pages.length > 0 && (
|
|
@@ -206,7 +213,7 @@ function ScrollNavbar({ data }: { readonly data: NavbarProps }) {
|
|
|
206
213
|
width={logo.width || 32}
|
|
207
214
|
height={logo.height || 32}
|
|
208
215
|
alt={logo.alternativeText || "site logo"}
|
|
209
|
-
style={{ maxHeight: "
|
|
216
|
+
style={{ maxHeight: "55px", width: "auto", height: "auto" }}
|
|
210
217
|
/>
|
|
211
218
|
</Box>
|
|
212
219
|
)}
|
|
@@ -275,7 +282,7 @@ function ScrollNavbar({ data }: { readonly data: NavbarProps }) {
|
|
|
275
282
|
width={logo.width || 32}
|
|
276
283
|
height={logo.height || 32}
|
|
277
284
|
style={{
|
|
278
|
-
maxHeight: "
|
|
285
|
+
maxHeight: "55px",
|
|
279
286
|
width: "auto",
|
|
280
287
|
height: "auto",
|
|
281
288
|
}}
|
|
@@ -13,6 +13,7 @@ const MuiMarkdown = React.lazy(
|
|
|
13
13
|
() => import(/* webpackChunkName: "mui-markdown" */ "mui-markdown")
|
|
14
14
|
);
|
|
15
15
|
import { StrapiImage } from "./StrapiImage.tsx";
|
|
16
|
+
import { SxProps, Theme } from "@mui/material/styles";
|
|
16
17
|
|
|
17
18
|
/*
|
|
18
19
|
TODO intregrate this interface into StrapiImage.tsx
|
|
@@ -26,6 +27,8 @@ interface ImageProps {
|
|
|
26
27
|
height: number;
|
|
27
28
|
} */
|
|
28
29
|
|
|
30
|
+
type MaxWidth = "xs" | "sm" | "md" | "lg" | "xl" | false | undefined;
|
|
31
|
+
|
|
29
32
|
interface TextImageSectionProps {
|
|
30
33
|
data: {
|
|
31
34
|
title: string;
|
|
@@ -37,21 +40,24 @@ interface TextImageSectionProps {
|
|
|
37
40
|
alt: string;
|
|
38
41
|
};
|
|
39
42
|
reverse: boolean;
|
|
40
|
-
maxWidth
|
|
43
|
+
maxWidth?: MaxWidth;
|
|
41
44
|
minHeight: string;
|
|
45
|
+
sx?: SxProps<Theme>;
|
|
42
46
|
};
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
function TextImageSection({ data }: Readonly<TextImageSectionProps>) {
|
|
46
|
-
const { title, text, image, reverse = false, maxWidth } = data;
|
|
50
|
+
const { title, text, image, reverse = false, maxWidth, sx = {} } = data;
|
|
47
51
|
|
|
48
52
|
/* TODO Text_content should deal with linebreaks,
|
|
49
53
|
reading up upon mui-markdown docs is advised */
|
|
50
54
|
|
|
55
|
+
/* TODO Replace with blocks */
|
|
56
|
+
|
|
51
57
|
const theme = useTheme();
|
|
52
58
|
|
|
53
59
|
return (
|
|
54
|
-
<Container maxWidth={maxWidth ? maxWidth : "lg"} sx={{ my: 1 }}>
|
|
60
|
+
<Container maxWidth={maxWidth ? maxWidth : "lg"} sx={{ my: 1, ...sx }}>
|
|
55
61
|
<Paper sx={{ p: 2 }}>
|
|
56
62
|
{title && (
|
|
57
63
|
<Typography variant="h1" textAlign="center" sx={{ pb: 2 }}>
|
|
@@ -177,7 +177,7 @@ AMH.args = {
|
|
|
177
177
|
alternativeText: null,
|
|
178
178
|
width: 3841,
|
|
179
179
|
height: 2161,
|
|
180
|
-
url: "/uploads/
|
|
180
|
+
url: "/uploads/desktop_wallpaper_0_5x_e910597d02.png",
|
|
181
181
|
},
|
|
182
182
|
logoImage: {
|
|
183
183
|
id: 9,
|
|
@@ -188,6 +188,14 @@ AMH.args = {
|
|
|
188
188
|
url: "/uploads/Asset_2_c4a9c4a5d1.png",
|
|
189
189
|
},
|
|
190
190
|
link: { id: 1, url: "/contact", text: "Contact us", isExternal: false },
|
|
191
|
+
sx: {
|
|
192
|
+
".MuiPaper-root": {
|
|
193
|
+
py: 7,
|
|
194
|
+
backdropFilter: "blur(3px)",
|
|
195
|
+
backgroundColor: "rgba(255, 255, 255, 0.15)",
|
|
196
|
+
border: "1px solid rgba(255, 255, 255, 0.15)",
|
|
197
|
+
},
|
|
198
|
+
},
|
|
191
199
|
},
|
|
192
200
|
{
|
|
193
201
|
id: 2,
|