umwd-components 0.1.235 → 0.1.236

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.
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  /*
2
3
  * UMWD-Components
3
4
  * @copyright Jelle Paulus
@@ -22,6 +23,7 @@ var PictureBarSection = require('./PictureBarSection.js');
22
23
  var LogoBarSection = require('./LogoBarSection.js');
23
24
  var reactDom = require('react-dom');
24
25
  var pagebuilderActions = require('../data/actions/pagebuilder-actions.js');
26
+ var SubmitButton = require('./SubmitButton.js');
25
27
 
26
28
  const INITIAL_STATE = {
27
29
  zodErrors: null,
@@ -90,6 +92,7 @@ function PageBuilder(_ref) {
90
92
  data
91
93
  } = _ref;
92
94
  const {
95
+ id,
93
96
  title,
94
97
  description,
95
98
  blocks,
@@ -111,10 +114,10 @@ function PageBuilder(_ref) {
111
114
  backgroundColor: "primary.dark",
112
115
  p: 2
113
116
  }
114
- }, /*#__PURE__*/React.createElement(material.Button, {
115
- variant: "contained",
116
- color: "primary"
117
- }, "Save")), /*#__PURE__*/React.createElement(material.Stack, {
117
+ }, /*#__PURE__*/React.createElement(SubmitButton.SubmitButton, {
118
+ text: "submit",
119
+ loadingText: "loading"
120
+ })), /*#__PURE__*/React.createElement(material.Stack, {
118
121
  spacing: 2,
119
122
  sx: {
120
123
  p: 2
@@ -122,12 +125,10 @@ function PageBuilder(_ref) {
122
125
  }, /*#__PURE__*/React.createElement(material.TextField, {
123
126
  id: "title",
124
127
  name: "title",
125
- value: title,
126
128
  label: "title"
127
129
  }), /*#__PURE__*/React.createElement(material.TextField, {
128
130
  id: "description",
129
131
  name: "description",
130
- value: description,
131
132
  label: "description"
132
133
  })), blocks.map(blockRenderer)));
133
134
  }
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  /*
2
3
  * UMWD-Components
3
4
  * @copyright Jelle Paulus
@@ -5,7 +6,7 @@
5
6
  */
6
7
 
7
8
  import React__default from 'react';
8
- import { Box, Button, Stack, TextField } from '@mui/material';
9
+ import { Box, Stack, TextField } from '@mui/material';
9
10
  import { PBTextImageSection } from './page-builder/PBTextImageSection.js';
10
11
  import { HeroSection } from './HeroSection.js';
11
12
  import { FeatureSection } from './FeaturesSection.js';
@@ -18,6 +19,7 @@ import { PictureBarSection } from './PictureBarSection.js';
18
19
  import { LogoBarSection } from './LogoBarSection.js';
19
20
  import { useFormState } from 'react-dom';
20
21
  import { updatePageAction } from '../data/actions/pagebuilder-actions.js';
22
+ import { SubmitButton } from './SubmitButton.js';
21
23
 
22
24
  const INITIAL_STATE = {
23
25
  zodErrors: null,
@@ -86,6 +88,7 @@ function PageBuilder(_ref) {
86
88
  data
87
89
  } = _ref;
88
90
  const {
91
+ id,
89
92
  title,
90
93
  description,
91
94
  blocks,
@@ -107,10 +110,10 @@ function PageBuilder(_ref) {
107
110
  backgroundColor: "primary.dark",
108
111
  p: 2
109
112
  }
110
- }, /*#__PURE__*/React__default.createElement(Button, {
111
- variant: "contained",
112
- color: "primary"
113
- }, "Save")), /*#__PURE__*/React__default.createElement(Stack, {
113
+ }, /*#__PURE__*/React__default.createElement(SubmitButton, {
114
+ text: "submit",
115
+ loadingText: "loading"
116
+ })), /*#__PURE__*/React__default.createElement(Stack, {
114
117
  spacing: 2,
115
118
  sx: {
116
119
  p: 2
@@ -118,12 +121,10 @@ function PageBuilder(_ref) {
118
121
  }, /*#__PURE__*/React__default.createElement(TextField, {
119
122
  id: "title",
120
123
  name: "title",
121
- value: title,
122
124
  label: "title"
123
125
  }), /*#__PURE__*/React__default.createElement(TextField, {
124
126
  id: "description",
125
127
  name: "description",
126
- value: description,
127
128
  label: "description"
128
129
  })), blocks.map(blockRenderer)));
129
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.235",
3
+ "version": "0.1.236",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import React from "react";
2
3
  import { SxProps, Box, TextField, Stack, Button } from "@mui/material";
3
4
  import { PBTextImageSection } from "./page-builder/PBTextImageSection.tsx";
@@ -12,6 +13,7 @@ import { PictureBarSection } from "./PictureBarSection.tsx";
12
13
  import { LogoBarSection } from "./LogoBarSection.tsx";
13
14
  import { useFormState } from "react-dom";
14
15
  import { updatePageAction } from "../data/actions/pagebuilder-actions.ts";
16
+ import { SubmitButton } from "./SubmitButton.tsx";
15
17
 
16
18
  const INITIAL_STATE = {
17
19
  zodErrors: null,
@@ -49,6 +51,7 @@ function blockRenderer(block: any) {
49
51
  }
50
52
 
51
53
  interface PageBuilderProps {
54
+ id: string;
52
55
  title: string;
53
56
  description: string;
54
57
  blocks: any[];
@@ -60,7 +63,7 @@ export default function PageBuilder({
60
63
  }: {
61
64
  readonly data: PageBuilderProps;
62
65
  }) {
63
- const { title, description, blocks, sx } = data;
66
+ const { id, title, description, blocks, sx } = data;
64
67
  if (!blocks) {
65
68
  return <p>No sections found</p>;
66
69
  }
@@ -71,18 +74,14 @@ export default function PageBuilder({
71
74
  <Box sx={{ ...sx }}>
72
75
  <form action={formAction}>
73
76
  <Box sx={{ width: "100%", backgroundColor: "primary.dark", p: 2 }}>
74
- <Button variant="contained" color="primary">
77
+ {/* <Button variant="contained" color="primary">
75
78
  Save
76
- </Button>
79
+ </Button> */}
80
+ <SubmitButton text="submit" loadingText="loading" />
77
81
  </Box>
78
82
  <Stack spacing={2} sx={{ p: 2 }}>
79
- <TextField id="title" name="title" value={title} label="title" />
80
- <TextField
81
- id="description"
82
- name="description"
83
- value={description}
84
- label="description"
85
- />
83
+ <TextField id="title" name="title" label="title" />
84
+ <TextField id="description" name="description" label="description" />
86
85
  </Stack>
87
86
  {blocks.map(blockRenderer)}
88
87
  </form>