umwd-components 0.1.239 → 0.1.241

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.
@@ -24,22 +24,7 @@ function HeroSection(_ref) {
24
24
  logoImage,
25
25
  link,
26
26
  maxWidth,
27
- sx = {
28
- ".manipulator": {
29
- position: "absolute",
30
- mt: "-100px",
31
- width: "100%",
32
- zIndex: -1,
33
- display: "flex",
34
- justifyContent: "center",
35
- alignItems: "center",
36
- img: {
37
- objectFit: "contain",
38
- width: "100%",
39
- height: "100%"
40
- }
41
- }
42
- },
27
+ sx = {},
43
28
  glass = false
44
29
  } = data;
45
30
  const theme = material.useTheme();
@@ -127,12 +112,7 @@ function HeroSection(_ref) {
127
112
  }, heading), /*#__PURE__*/React.createElement(material.Box, {
128
113
  className: "spacer",
129
114
  sx: {
130
- height: {
131
- xs: "120px",
132
- sm: "200px",
133
- md: "250px",
134
- lg: "350px"
135
- }
115
+ display: "none"
136
116
  }
137
117
  }), /*#__PURE__*/React.createElement(material.Typography, {
138
118
  variant: "h4",
@@ -12,12 +12,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
12
12
  var React = require('react');
13
13
  var material = require('@mui/material');
14
14
  var PBTextImageSection = require('./page-builder/PBTextImageSection.js');
15
- var HeroSection = require('./HeroSection.js');
15
+ var PBHeroSection = require('./page-builder/PBHeroSection.js');
16
16
  var FeaturesSection = require('./FeaturesSection.js');
17
17
  var FleetSection = require('./FleetSection.js');
18
18
  var IconSection = require('./IconSection.js');
19
19
  var ColumnsSection = require('./ColumnsSection.js');
20
- var ContactForm = require('./ContactForm.js');
20
+ var PBContactForm = require('./page-builder/PBContactForm.js');
21
21
  var PersonaliaSection = require('./PersonaliaSection.js');
22
22
  var PictureBarSection = require('./PictureBarSection.js');
23
23
  var LogoBarSection = require('./LogoBarSection.js');
@@ -35,7 +35,7 @@ const INITIAL_STATE = {
35
35
  function blockRenderer(block) {
36
36
  switch (block.__component) {
37
37
  case "layout.hero-section":
38
- return /*#__PURE__*/React.createElement(HeroSection.HeroSection, {
38
+ return /*#__PURE__*/React.createElement(PBHeroSection.PBHeroSection, {
39
39
  key: block.id,
40
40
  data: block
41
41
  });
@@ -45,7 +45,7 @@ function blockRenderer(block) {
45
45
  data: block
46
46
  });
47
47
  case "layout.contact-section":
48
- return /*#__PURE__*/React.createElement(ContactForm.default, {
48
+ return /*#__PURE__*/React.createElement(PBContactForm.default, {
49
49
  key: block.id,
50
50
  data: block
51
51
  });
@@ -110,17 +110,19 @@ function PageBuilder(_ref) {
110
110
  }
111
111
  }, /*#__PURE__*/React.createElement("form", {
112
112
  action: formAction
113
- }, /*#__PURE__*/React.createElement(material.Box, {
113
+ }, /*#__PURE__*/React.createElement(material.Stack, {
114
+ direction: "row-reverse",
115
+ spacing: 2,
114
116
  sx: {
115
- width: "100%",
116
117
  backgroundColor: "primary.dark",
117
- p: 2
118
+ px: 2,
119
+ py: 1
118
120
  }
119
121
  }, /*#__PURE__*/React.createElement(SubmitButton.SubmitButton, {
120
- text: "submit",
122
+ text: "save changes",
121
123
  loadingText: "loading"
122
124
  }), /*#__PURE__*/React.createElement(StrapiErrors.StrapiErrors, {
123
- error: formState.strapiErrors
125
+ error: formState === null || formState === void 0 ? void 0 : formState.strapiErrors
124
126
  })), /*#__PURE__*/React.createElement(material.Stack, {
125
127
  spacing: 2,
126
128
  sx: {
@@ -29,7 +29,8 @@ function SubmitButton(_ref2) {
29
29
  return /*#__PURE__*/React.createElement(material.Button, {
30
30
  type: "submit",
31
31
  "aria-disabled": status.pending || loading,
32
- disabled: status.pending || loading
32
+ disabled: status.pending || loading,
33
+ variant: "outlined"
33
34
  }, status.pending || loading ? /*#__PURE__*/React.createElement(Loader, {
34
35
  text: loadingText
35
36
  }) : text);
@@ -0,0 +1,136 @@
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 utils = require('../../lib/utils.js');
15
+ var styles = require('@mui/material/styles');
16
+
17
+ function PBContactForm(_ref) {
18
+ let {
19
+ data
20
+ } = _ref;
21
+ const {
22
+ title = "Write us",
23
+ subtitle = "We're open for any suggestion or just to have a chat",
24
+ maxWidth,
25
+ sx = {},
26
+ glass = false
27
+ } = data;
28
+ const theme = styles.useTheme();
29
+ return /*#__PURE__*/React.createElement(material.Container, {
30
+ maxWidth: maxWidth ? maxWidth : "lg",
31
+ sx: {
32
+ my: 1,
33
+ ...sx
34
+ }
35
+ }, /*#__PURE__*/React.createElement(material.Stack, {
36
+ spacing: 2,
37
+ sx: {
38
+ width: "100%"
39
+ }
40
+ }, /*#__PURE__*/React.createElement(material.TextField, {
41
+ id: "title",
42
+ name: "title",
43
+ label: "title",
44
+ defaultValue: title
45
+ // error={formState?.zodErrors?.heading != undefined ? true : false}
46
+ // helperText={formState?.zodErrors?.heading}
47
+ ,
48
+ sx: {
49
+ input: {
50
+ textAlign: "center",
51
+ fontFamily: theme.typography.h6.fontFamily,
52
+ fontWeight: theme.typography.h6.fontWeight,
53
+ fontSize: theme.typography.h6.fontSize
54
+ }
55
+ }
56
+ }), /*#__PURE__*/React.createElement(material.TextField, {
57
+ id: "subtitle",
58
+ name: "subtitle",
59
+ label: "subtitle",
60
+ defaultValue: subtitle
61
+ // error={formState?.zodErrors?.heading != undefined ? true : false}
62
+ // helperText={formState?.zodErrors?.heading}
63
+ ,
64
+ sx: {
65
+ input: {
66
+ textAlign: "center",
67
+ fontFamily: theme.typography.body1.fontFamily,
68
+ fontWeight: theme.typography.body1.fontWeight,
69
+ fontSize: theme.typography.body1.fontSize
70
+ }
71
+ }
72
+ }), /*#__PURE__*/React.createElement(material.Paper, {
73
+ sx: {
74
+ p: 2
75
+ }
76
+ }, /*#__PURE__*/React.createElement(material.Stack, {
77
+ spacing: 2
78
+ }, /*#__PURE__*/React.createElement(material.Typography, {
79
+ variant: "h6"
80
+ }, "Thank you!"), /*#__PURE__*/React.createElement(material.Typography, null, "Your e-mail has been successfully sent!"))), /*#__PURE__*/React.createElement(material.Paper, {
81
+ sx: {
82
+ p: 2
83
+ }
84
+ }, /*#__PURE__*/React.createElement(material.Stack, {
85
+ spacing: 2
86
+ }, /*#__PURE__*/React.createElement(material.Typography, null, "I am sorry, something went wrong, you could email me directly on info@jellepaulus.nl"), /*#__PURE__*/React.createElement(material.Button, {
87
+ variant: "contained"
88
+ }, "try again")))), /*#__PURE__*/React.createElement(material.Paper, {
89
+ sx: {
90
+ p: 2,
91
+ backdropFilter: "blur(3px)",
92
+ backgroundColor: utils.setOpacity(theme.palette.background.paper, glass ? 0.1 : 1),
93
+ border: glass ? "1px solid rgba(255, 255, 255, 0.15)" : "none"
94
+ }
95
+ }, /*#__PURE__*/React.createElement(material.Stack, {
96
+ spacing: 2
97
+ }, /*#__PURE__*/React.createElement(material.TextField, {
98
+ id: "name",
99
+ name: "name",
100
+ label: "Name",
101
+ variant: "outlined",
102
+ disabled: true
103
+ }), /*#__PURE__*/React.createElement(material.TextField, {
104
+ id: "email",
105
+ name: "email",
106
+ label: "Email",
107
+ variant: "outlined",
108
+ disabled: true
109
+ }), /*#__PURE__*/React.createElement(material.TextField, {
110
+ id: "subject",
111
+ name: "subject",
112
+ label: "Subject",
113
+ variant: "outlined",
114
+ disabled: true
115
+ }), /*#__PURE__*/React.createElement(material.TextField, {
116
+ id: "message",
117
+ name: "message",
118
+ label: "Message",
119
+ variant: "outlined",
120
+ multiline: true,
121
+ disabled: true,
122
+ minRows: 5
123
+ }), /*#__PURE__*/React.createElement(material.Stack, {
124
+ direction: "row",
125
+ spacing: 2,
126
+ justifyContent: "end"
127
+ }, /*#__PURE__*/React.createElement(material.Button, {
128
+ disabled: true,
129
+ variant: "outlined"
130
+ }, "Clear"), /*#__PURE__*/React.createElement(material.Button, {
131
+ variant: "contained",
132
+ disabled: true
133
+ }, "Send")))));
134
+ }
135
+
136
+ exports.default = PBContactForm;
@@ -0,0 +1,199 @@
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 StrapiImage = require('../StrapiImage.js');
12
+ var utils = require('../../lib/utils.js');
13
+
14
+ function PBHeroSection(_ref) {
15
+ var _bgImage$id, _logoImage$id;
16
+ let {
17
+ data
18
+ } = _ref;
19
+ const {
20
+ heading,
21
+ subHeading,
22
+ bgImage,
23
+ logoImage,
24
+ link,
25
+ maxWidth,
26
+ sx = {},
27
+ glass = false
28
+ } = data;
29
+ const theme = material.useTheme();
30
+ console.log(theme.typography.button);
31
+
32
+ // const glassColor = setOpacity(theme.palette.background.paper, 0.1);
33
+
34
+ return /*#__PURE__*/React.createElement("header", {
35
+ style: {
36
+ position: "relative",
37
+ padding: 0,
38
+ margin: 0
39
+ }
40
+ }, /*#__PURE__*/React.createElement(material.Box, {
41
+ sx: {
42
+ display: "flex",
43
+ flexDirection: "column",
44
+ alignItems: "center",
45
+ justifyContent: "center",
46
+ width: "100%",
47
+ overflow: "hidden",
48
+ minHeight: "600px",
49
+ py: 6,
50
+ ...sx
51
+ }
52
+ }, bgImage && bgImage.url && /*#__PURE__*/React.createElement(StrapiImage.StrapiImage, {
53
+ id: (_bgImage$id = bgImage.id) === null || _bgImage$id === void 0 ? void 0 : _bgImage$id.toString(),
54
+ alternativeText: "Background",
55
+ style: {
56
+ position: "absolute",
57
+ inset: 0,
58
+ objectFit: "cover",
59
+ width: "100%",
60
+ height: "100%"
61
+ },
62
+ height: bgImage.height || 1080,
63
+ url: bgImage.url,
64
+ width: bgImage.width || 1920
65
+ }), /*#__PURE__*/React.createElement(material.Container, {
66
+ maxWidth: maxWidth || "lg",
67
+ sx: {
68
+ my: 1,
69
+ zIndex: 1
70
+ }
71
+ }, /*#__PURE__*/React.createElement(material.Paper, {
72
+ sx: {
73
+ px: 2,
74
+ py: 7,
75
+ backdropFilter: "blur(3px)",
76
+ backgroundColor: utils.setOpacity(theme.palette.background.paper, glass ? 0.1 : 1),
77
+ border: glass ? "1px solid rgba(255, 255, 255, 0.15)" : "none"
78
+ }
79
+ }, /*#__PURE__*/React.createElement(material.Stack, {
80
+ spacing: 5,
81
+ alignItems: "center",
82
+ justifyContent: "center"
83
+ }, logoImage && logoImage.url !== null && /*#__PURE__*/React.createElement(material.Box, {
84
+ className: "manipulator",
85
+ sx: {
86
+ position: "relative",
87
+ mt: "-100px",
88
+ width: "100%",
89
+ zIndex: -1,
90
+ display: "flex",
91
+ justifyContent: "center",
92
+ alignItems: "center",
93
+ img: {
94
+ objectFit: "contain",
95
+ width: "100%",
96
+ height: "100%"
97
+ }
98
+ }
99
+ }, /*#__PURE__*/React.createElement(StrapiImage.StrapiImage, {
100
+ id: (_logoImage$id = logoImage.id) === null || _logoImage$id === void 0 ? void 0 : _logoImage$id.toString(),
101
+ alternativeText: logoImage.alternativeText,
102
+ height: logoImage.height || 100,
103
+ url: logoImage.url,
104
+ width: logoImage.width || 100,
105
+ style: {
106
+ objectFit: "contain"
107
+ }
108
+ })), /*#__PURE__*/React.createElement(material.TextField, {
109
+ id: "heading",
110
+ name: "heading",
111
+ label: "heading",
112
+ defaultValue: heading,
113
+ variant: "outlined"
114
+ // error={formState?.zodErrors?.heading != undefined ? true : false}
115
+ // helperText={formState?.zodErrors?.heading}
116
+ ,
117
+ sx: {
118
+ input: {
119
+ textAlign: "center",
120
+ fontFamily: theme.typography.h2.fontFamily,
121
+ fontWeight: theme.typography.h2.fontWeight,
122
+ fontSize: theme.typography.h2.fontSize
123
+ }
124
+ }
125
+ }), /*#__PURE__*/React.createElement(material.Box, {
126
+ className: "spacer",
127
+ sx: {
128
+ display: "none"
129
+ }
130
+ }), /*#__PURE__*/React.createElement(material.TextField, {
131
+ id: "subHeading",
132
+ name: "subHeading",
133
+ label: "subHeading",
134
+ defaultValue: subHeading,
135
+ variant: "outlined",
136
+ multiline: true,
137
+ rows: 8
138
+ // error={formState?.zodErrors?.heading != undefined ? true : false}
139
+ // helperText={formState?.zodErrors?.heading}
140
+ ,
141
+ sx: {
142
+ width: "100%",
143
+ "textarea#subHeading": {
144
+ textAlign: "center",
145
+ fontFamily: theme.typography.h4.fontFamily,
146
+ fontWeight: theme.typography.h4.fontWeight,
147
+ fontSize: theme.typography.h4.fontSize,
148
+ lineHeight: theme.typography.h4.lineHeight
149
+ }
150
+ }
151
+ }), /*#__PURE__*/React.createElement(material.Stack, {
152
+ direction: "column",
153
+ spacing: 2,
154
+ sx: {
155
+ p: 1,
156
+ border: "1px dashed white",
157
+ borderRadius: "4px"
158
+ }
159
+ }, /*#__PURE__*/React.createElement(material.TextField, {
160
+ id: "link.text",
161
+ name: "link.text",
162
+ label: "link.text",
163
+ defaultValue: link === null || link === void 0 ? void 0 : link.text
164
+ // error={formState?.zodErrors?.heading != undefined ? true : false}
165
+ // helperText={formState?.zodErrors?.heading}
166
+ ,
167
+ sx: {
168
+ backgroundColor: theme.palette.primary.main,
169
+ borderRadius: "4px",
170
+ input: {
171
+ color: theme.palette.primary.contrastText,
172
+ textAlign: "center",
173
+ fontFamily: theme.typography.button.fontFamily,
174
+ fontWeight: theme.typography.button.fontWeight,
175
+ fontSize: "1.5rem",
176
+ letterSpacing: theme.typography.button.letterSpacing,
177
+ textTransform: theme.typography.button.textTransform
178
+ }
179
+ }
180
+ }), /*#__PURE__*/React.createElement(material.TextField, {
181
+ id: "url",
182
+ name: "url",
183
+ label: "url",
184
+ defaultValue: link === null || link === void 0 ? void 0 : link.url
185
+ // error={formState?.zodErrors?.heading != undefined ? true : false}
186
+ // helperText={formState?.zodErrors?.heading}
187
+ ,
188
+ sx: {
189
+ input: {
190
+ textAlign: "center",
191
+ fontFamily: theme.typography.button.fontFamily,
192
+ fontWeight: theme.typography.button.fontWeight,
193
+ fontSize: theme.typography.button.fontSize
194
+ }
195
+ }
196
+ })))))));
197
+ }
198
+
199
+ exports.PBHeroSection = PBHeroSection;
@@ -39,13 +39,14 @@ const schemaUpdate = zod.z.object({
39
39
  })
40
40
  ), */
41
41
  });
42
- async function updatePageAction(prevState, FormData) {
42
+ async function updatePageAction(prevState, formData) {
43
43
  const validatedFields = schemaUpdate.safeParse({
44
- id: FormData.get("id"),
45
- title: FormData.get("title"),
46
- description: FormData.get("description")
47
- // blocks: FormData.get("blocks"),
44
+ id: formData.get("id"),
45
+ title: formData.get("title"),
46
+ description: formData.get("description")
47
+ // blocks: formData.get("blocks"),
48
48
  });
49
+ console.log(validatedFields);
49
50
  if (!validatedFields.success) {
50
51
  return {
51
52
  ...prevState,
@@ -11,6 +11,7 @@ var utils = require('../../lib/utils.js');
11
11
  const baseUrl = utils.getStrapiURL();
12
12
  async function updatePageService(pageData) {
13
13
  const url = new URL("/api/pages/".concat(pageData.id), baseUrl);
14
+ console.log(url);
14
15
  try {
15
16
  const response = await fetch(url, {
16
17
  method: "POST",
@@ -22,22 +22,7 @@ function HeroSection(_ref) {
22
22
  logoImage,
23
23
  link,
24
24
  maxWidth,
25
- sx = {
26
- ".manipulator": {
27
- position: "absolute",
28
- mt: "-100px",
29
- width: "100%",
30
- zIndex: -1,
31
- display: "flex",
32
- justifyContent: "center",
33
- alignItems: "center",
34
- img: {
35
- objectFit: "contain",
36
- width: "100%",
37
- height: "100%"
38
- }
39
- }
40
- },
25
+ sx = {},
41
26
  glass = false
42
27
  } = data;
43
28
  const theme = useTheme();
@@ -125,12 +110,7 @@ function HeroSection(_ref) {
125
110
  }, heading), /*#__PURE__*/React__default.createElement(Box, {
126
111
  className: "spacer",
127
112
  sx: {
128
- height: {
129
- xs: "120px",
130
- sm: "200px",
131
- md: "250px",
132
- lg: "350px"
133
- }
113
+ display: "none"
134
114
  }
135
115
  }), /*#__PURE__*/React__default.createElement(Typography, {
136
116
  variant: "h4",
@@ -8,12 +8,12 @@
8
8
  import React__default from 'react';
9
9
  import { Box, Stack, TextField } from '@mui/material';
10
10
  import { PBTextImageSection } from './page-builder/PBTextImageSection.js';
11
- import { HeroSection } from './HeroSection.js';
11
+ import { PBHeroSection } from './page-builder/PBHeroSection.js';
12
12
  import { FeatureSection } from './FeaturesSection.js';
13
13
  import { FleetSection } from './FleetSection.js';
14
14
  import { IconSection } from './IconSection.js';
15
15
  import { ColumnsSection } from './ColumnsSection.js';
16
- import ContactForm from './ContactForm.js';
16
+ import PBContactForm from './page-builder/PBContactForm.js';
17
17
  import { PersonaliaSection } from './PersonaliaSection.js';
18
18
  import { PictureBarSection } from './PictureBarSection.js';
19
19
  import { LogoBarSection } from './LogoBarSection.js';
@@ -31,7 +31,7 @@ const INITIAL_STATE = {
31
31
  function blockRenderer(block) {
32
32
  switch (block.__component) {
33
33
  case "layout.hero-section":
34
- return /*#__PURE__*/React__default.createElement(HeroSection, {
34
+ return /*#__PURE__*/React__default.createElement(PBHeroSection, {
35
35
  key: block.id,
36
36
  data: block
37
37
  });
@@ -41,7 +41,7 @@ function blockRenderer(block) {
41
41
  data: block
42
42
  });
43
43
  case "layout.contact-section":
44
- return /*#__PURE__*/React__default.createElement(ContactForm, {
44
+ return /*#__PURE__*/React__default.createElement(PBContactForm, {
45
45
  key: block.id,
46
46
  data: block
47
47
  });
@@ -106,17 +106,19 @@ function PageBuilder(_ref) {
106
106
  }
107
107
  }, /*#__PURE__*/React__default.createElement("form", {
108
108
  action: formAction
109
- }, /*#__PURE__*/React__default.createElement(Box, {
109
+ }, /*#__PURE__*/React__default.createElement(Stack, {
110
+ direction: "row-reverse",
111
+ spacing: 2,
110
112
  sx: {
111
- width: "100%",
112
113
  backgroundColor: "primary.dark",
113
- p: 2
114
+ px: 2,
115
+ py: 1
114
116
  }
115
117
  }, /*#__PURE__*/React__default.createElement(SubmitButton, {
116
- text: "submit",
118
+ text: "save changes",
117
119
  loadingText: "loading"
118
120
  }), /*#__PURE__*/React__default.createElement(StrapiErrors, {
119
- error: formState.strapiErrors
121
+ error: formState === null || formState === void 0 ? void 0 : formState.strapiErrors
120
122
  })), /*#__PURE__*/React__default.createElement(Stack, {
121
123
  spacing: 2,
122
124
  sx: {
@@ -27,7 +27,8 @@ function SubmitButton(_ref2) {
27
27
  return /*#__PURE__*/React__default.createElement(Button, {
28
28
  type: "submit",
29
29
  "aria-disabled": status.pending || loading,
30
- disabled: status.pending || loading
30
+ disabled: status.pending || loading,
31
+ variant: "outlined"
31
32
  }, status.pending || loading ? /*#__PURE__*/React__default.createElement(Loader, {
32
33
  text: loadingText
33
34
  }) : text);