umwd-components 0.1.12 → 0.1.13

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.
@@ -0,0 +1,44 @@
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({
15
+ label,
16
+ backgroundColor = "red",
17
+ size = "md",
18
+ onClick
19
+ }) {
20
+ let scale = 1;
21
+ if (size === "sm") {
22
+ scale = 0.75;
23
+ }
24
+ if (size === "lg") {
25
+ scale = 1.25;
26
+ }
27
+ const style = {
28
+ backgroundColor,
29
+ padding: `${0.5 * scale}rem ${1 * scale}rem`,
30
+ border: "none"
31
+ };
32
+ return /*#__PURE__*/React.createElement("button", {
33
+ style: style,
34
+ onClick: onClick
35
+ }, label);
36
+ }
37
+ Button.propTypes = {
38
+ label: PropTypes.string,
39
+ backgroundColor: PropTypes.string,
40
+ size: PropTypes.oneOf(["sm", "md", "lg"]),
41
+ onClick: PropTypes.func
42
+ };
43
+
44
+ exports.default = Button;
@@ -0,0 +1,29 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ // Ported from Alexander Haniotis' code here: https://codepen.io/haniotis/pen/KwvYLO
10
+ // import React from "react";
11
+
12
+ const Checkmark = () => {
13
+ return /*#__PURE__*/React.createElement("svg", {
14
+ className: "checkmark",
15
+ viewBox: "0 0 52 52"
16
+ }, /*#__PURE__*/React.createElement("circle", {
17
+ className: "checkmark__circle",
18
+ cx: "26",
19
+ cy: "26",
20
+ r: "25",
21
+ fill: "none"
22
+ }), /*#__PURE__*/React.createElement("path", {
23
+ className: "checkmark__check",
24
+ fill: "none",
25
+ d: "M14.1 27.2l7.1 7.2 16.7-16.8"
26
+ }));
27
+ };
28
+
29
+ exports.Checkmark = Checkmark;
@@ -0,0 +1,239 @@
1
+ "use client";
2
+ /*
3
+ * UMWD-Components
4
+ * @copyright Jelle Paulus
5
+ * @license MIT
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ var React$1 = require('react');
11
+ var Link = require('next/link');
12
+ var material = require('@mui/material');
13
+ var CloseIcon = require('@mui/icons-material/Close');
14
+ var MoreVertIcon = require('@mui/icons-material/MoreVert');
15
+
16
+ const NavBar = ({
17
+ site_title,
18
+ logo,
19
+ pages
20
+ }) => {
21
+ // handleMobileMenu
22
+
23
+ const [mobileNavOpen, setMobileNavOpen] = React$1.useState(false);
24
+ const handleOpenMobileMenu = e => {
25
+ setMobileNavOpen(true);
26
+ };
27
+ const handleCloseMobileMenu = e => {
28
+ setMobileNavOpen(false);
29
+ };
30
+ return /*#__PURE__*/React.createElement(material.AppBar, {
31
+ position: "sticky"
32
+ }, /*#__PURE__*/React.createElement(material.Container, {
33
+ maxWidth: "xl"
34
+ }, /*#__PURE__*/React.createElement(material.Toolbar, {
35
+ disableGutters: true,
36
+ sx: {
37
+ py: 1
38
+ }
39
+ }, /*#__PURE__*/React.createElement(Link, {
40
+ href: "/",
41
+ style: {
42
+ textDecoration: "none",
43
+ color: "unset"
44
+ }
45
+ }, /*#__PURE__*/React.createElement(material.Box, {
46
+ sx: {
47
+ display: {
48
+ xs: "none",
49
+ md: "flex"
50
+ },
51
+ cursor: "pointer",
52
+ alignItems: "center"
53
+ }
54
+ }, /*#__PURE__*/React.createElement(material.Box, {
55
+ sx: {
56
+ display: "flex",
57
+ mr: 1
58
+ }
59
+ }, /*#__PURE__*/React.createElement("img", {
60
+ src: logo.url,
61
+ width: logo.width || "32px",
62
+ height: logo.height || "32px",
63
+ alt: "site logo",
64
+ style: {
65
+ maxWidth: "60px",
66
+ maxHeight: "60px"
67
+ }
68
+ })), site_title !== undefined && /*#__PURE__*/React.createElement(material.Typography, {
69
+ variant: "h6",
70
+ noWrap: true,
71
+ component: "h1",
72
+ sx: {
73
+ display: "flex",
74
+ textDecoration: "none"
75
+ }
76
+ }, site_title))), /*#__PURE__*/React.createElement(material.Box, {
77
+ sx: {
78
+ flexGrow: 1,
79
+ display: {
80
+ xs: "none",
81
+ md: "flex"
82
+ },
83
+ alignItems: "center"
84
+ }
85
+ }, pages.map(page => {
86
+ return /*#__PURE__*/React.createElement(material.Button, {
87
+ key: page.name,
88
+ onClick: () => page.action(),
89
+ sx: {
90
+ my: 2,
91
+ color: "primary.contrastText",
92
+ display: "block"
93
+ }
94
+ }, page.name);
95
+ })), /*#__PURE__*/React.createElement(Link, {
96
+ href: "/",
97
+ style: {
98
+ textDecoration: "none",
99
+ color: "unset"
100
+ }
101
+ }, /*#__PURE__*/React.createElement(material.Box, {
102
+ sx: {
103
+ display: {
104
+ xs: "flex",
105
+ md: "none"
106
+ },
107
+ alignItems: "center"
108
+ }
109
+ }, logo.url !== undefined && /*#__PURE__*/React.createElement(material.Box, {
110
+ sx: {
111
+ display: "flex",
112
+ mr: 1
113
+ }
114
+ }, /*#__PURE__*/React.createElement("img", {
115
+ src: logo.url,
116
+ width: logo.width || "32px",
117
+ height: logo.height || "32px",
118
+ alt: logo.alt || "site logo",
119
+ style: {
120
+ maxWidth: "60px",
121
+ maxHeight: "60px"
122
+ }
123
+ })), site_title !== undefined && /*#__PURE__*/React.createElement(material.Typography, {
124
+ variant: "h5",
125
+ noWrap: true,
126
+ component: "h1",
127
+ sx: {
128
+ display: "flex",
129
+ flexGrow: 1
130
+ }
131
+ }, site_title))), /*#__PURE__*/React.createElement(material.Box, {
132
+ sx: {
133
+ display: {
134
+ xs: "flex",
135
+ md: "none"
136
+ },
137
+ flexGrow: 1
138
+ }
139
+ }), /*#__PURE__*/React.createElement(material.Box, {
140
+ sx: {
141
+ flexGrow: 0,
142
+ display: {
143
+ xs: "flex",
144
+ md: "none"
145
+ }
146
+ }
147
+ }, /*#__PURE__*/React.createElement(material.Button, {
148
+ onClick: handleOpenMobileMenu,
149
+ sx: {
150
+ width: "40px",
151
+ height: "40px",
152
+ borderRadius: "50%",
153
+ p: 0,
154
+ minWidth: "unset",
155
+ color: "primary.contrastText",
156
+ boxShadow: "0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"
157
+ }
158
+ }, /*#__PURE__*/React.createElement(MoreVertIcon, {
159
+ sx: {
160
+ color: "primary.contrastText"
161
+ }
162
+ })), /*#__PURE__*/React.createElement(material.Dialog, {
163
+ fullScreen: true,
164
+ open: mobileNavOpen,
165
+ onClose: handleCloseMobileMenu
166
+ }, /*#__PURE__*/React.createElement(material.AppBar, {
167
+ position: "sticky"
168
+ }, /*#__PURE__*/React.createElement(material.Container, {
169
+ maxWidth: "xl"
170
+ }, /*#__PURE__*/React.createElement(material.Toolbar, {
171
+ disableGutters: true,
172
+ sx: {
173
+ py: 1,
174
+ justifyContent: "space-between"
175
+ }
176
+ }, /*#__PURE__*/React.createElement(Link, {
177
+ href: "/",
178
+ style: {
179
+ textDecoration: "none",
180
+ color: "unset"
181
+ }
182
+ }, /*#__PURE__*/React.createElement(material.Box, {
183
+ sx: {
184
+ display: "flex",
185
+ flexDirection: "row",
186
+ alignItems: "center"
187
+ }
188
+ }, /*#__PURE__*/React.createElement(material.Box, {
189
+ sx: {
190
+ display: "flex",
191
+ mr: 1
192
+ }
193
+ }, /*#__PURE__*/React.createElement("img", {
194
+ src: logo.url,
195
+ alt: logo.alt || "logo",
196
+ width: logo.width || "32px",
197
+ height: logo.height || "32px",
198
+ style: {
199
+ maxWidth: "60px",
200
+ maxHeight: "60px"
201
+ }
202
+ })), /*#__PURE__*/React.createElement(material.Typography, {
203
+ variant: "h5",
204
+ noWrap: true,
205
+ component: "h1",
206
+ sx: {
207
+ display: "flex",
208
+ flexGrow: 1
209
+ }
210
+ }, site_title !== undefined && site_title))), /*#__PURE__*/React.createElement(material.Button, {
211
+ onClick: handleCloseMobileMenu,
212
+ sx: {
213
+ width: "40px",
214
+ height: "40px",
215
+ borderRadius: "50%",
216
+ p: 0,
217
+ minWidth: "unset",
218
+ color: "primary.contrastText",
219
+ boxShadow: "0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"
220
+ },
221
+ "aria-label": "close"
222
+ }, /*#__PURE__*/React.createElement(CloseIcon, {
223
+ sx: {
224
+ color: "primary.contrastText"
225
+ }
226
+ }))))), /*#__PURE__*/React.createElement(material.List, null, pages.map(page => {
227
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(material.ListItem, {
228
+ key: page.name,
229
+ onClick: () => {
230
+ page.action();
231
+ handleCloseMobileMenu();
232
+ }
233
+ }, /*#__PURE__*/React.createElement(material.ListItemText, {
234
+ primary: page.name
235
+ })), /*#__PURE__*/React.createElement(material.Divider, null));
236
+ })))))));
237
+ };
238
+
239
+ exports.NavBar = NavBar;
@@ -0,0 +1,21 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
10
+ var React = require('react');
11
+ var material = require('@mui/material');
12
+
13
+ const NoteTextField = props => {
14
+ return /*#__PURE__*/React.createElement(material.TextField, _rollupPluginBabelHelpers.extends({}, props, {
15
+ sx: {
16
+ background: "linear-gradient(45deg, rgba(251,246,137,1) 30%, rgba(252,242,138,1) 90%)"
17
+ }
18
+ }));
19
+ };
20
+
21
+ exports.NoteTextField = NoteTextField;
@@ -0,0 +1,28 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ var Xmark = require('../Xmark/Xmark.js');
10
+ var Checkmark = require('../Checkmark/Checkmark.js');
11
+ var React = require('react');
12
+
13
+ const Requirement = ({
14
+ value,
15
+ requirement
16
+ }) => {
17
+ const [isValid, setIsValid] = React.useState();
18
+ React.useEffect(() => {
19
+ setIsValid(requirement.validator(value));
20
+ }, [value, requirement]);
21
+ return /*#__PURE__*/React.createElement("div", {
22
+ className: "requirement"
23
+ }, isValid ? /*#__PURE__*/React.createElement(Checkmark.Checkmark, null) : /*#__PURE__*/React.createElement(Xmark.Xmark, null), /*#__PURE__*/React.createElement("p", {
24
+ className: isValid ? "valid" : "invalid"
25
+ }, requirement.text));
26
+ };
27
+
28
+ exports.Requirement = Requirement;
@@ -0,0 +1,30 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ require('../../styles.css.js');
10
+ var Requirement = require('../Requirement/Requirement.js');
11
+ var React = require('react');
12
+
13
+ const Requirements = ({
14
+ value,
15
+ requirements,
16
+ onValidChange
17
+ }) => {
18
+ const validChangeCb = React.useCallback(onValidChange, []);
19
+ React.useEffect(() => {
20
+ validChangeCb(requirements.every(r => r.validator(value)));
21
+ }, [value, requirements, validChangeCb]);
22
+ return requirements.map((r, index) => /*#__PURE__*/React.createElement(Requirement.Requirement, {
23
+ key: index,
24
+ value: value,
25
+ requirement: r,
26
+ onValidChange: onValidChange
27
+ }));
28
+ };
29
+
30
+ exports.Requirements = Requirements;
@@ -0,0 +1,36 @@
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 Stack({
15
+ children,
16
+ spacing = 2,
17
+ direction = "row",
18
+ wrap = false
19
+ }) {
20
+ const style = {
21
+ display: "flex",
22
+ gap: `${spacing * 0.25}rem`,
23
+ flexWrap: wrap ? "wrap" : "nowrap",
24
+ flexDirection: direction
25
+ };
26
+ return /*#__PURE__*/React.createElement("div", {
27
+ style: style
28
+ }, children);
29
+ }
30
+ Stack.propTypes = {
31
+ spacing: PropTypes.number,
32
+ wrap: PropTypes.bool,
33
+ direction: PropTypes.oneOf(["row", "column"])
34
+ };
35
+
36
+ exports.default = Stack;
@@ -0,0 +1,27 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ // import React from "react";
10
+
11
+ const Xmark = () => {
12
+ return /*#__PURE__*/React.createElement("svg", {
13
+ x: "0px",
14
+ y: "0px",
15
+ width: "15px",
16
+ height: "15px",
17
+ viewBox: "0 0 122.879 122.879",
18
+ enableBackground: "new 0 0 122.879 122.879"
19
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
20
+ fillRule: "evenodd",
21
+ clipRule: "evenodd",
22
+ fill: "#FF4141",
23
+ d: "M61.44,0c33.933,0,61.439,27.507,61.439,61.439 s-27.506,61.439-61.439,61.439C27.507,122.879,0,95.372,0,61.439S27.507,0,61.44,0L61.44,0z M73.451,39.151 c2.75-2.793,7.221-2.805,9.986-0.027c2.764,2.776,2.775,7.292,0.027,10.083L71.4,61.445l12.076,12.249 c2.729,2.77,2.689,7.257-0.08,10.022c-2.773,2.765-7.23,2.758-9.955-0.013L61.446,71.54L49.428,83.728 c-2.75,2.793-7.22,2.805-9.986,0.027c-2.763-2.776-2.776-7.293-0.027-10.084L51.48,61.434L39.403,49.185 c-2.728-2.769-2.689-7.256,0.082-10.022c2.772-2.765,7.229-2.758,9.953,0.013l11.997,12.165L73.451,39.151L73.451,39.151z"
24
+ })));
25
+ };
26
+
27
+ exports.Xmark = Xmark;
@@ -0,0 +1,21 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ var Requirements = require('./components/Requirements/Requirements.js');
10
+ var NoteTextField = require('./components/NoteTextField/NoteTextField.js');
11
+ var Button = require('./components/Button.js');
12
+ var Stack = require('./components/Stack.js');
13
+ var NavBar = require('./components/NavBar/NavBar.js');
14
+
15
+
16
+
17
+ exports.Requirements = Requirements.Requirements;
18
+ exports.NoteTextField = NoteTextField.NoteTextField;
19
+ exports.Button = Button.default;
20
+ exports.Stack = Stack.default;
21
+ exports.NavBar = NavBar.NavBar;
@@ -0,0 +1,16 @@
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 styleInject = require('C:/Users/jelle/Desktop/AP_projects/umwd-components/node_modules/style-inject/dist/style-inject.es.js');
12
+
13
+ var css_248z = ".requirement{align-items:center;display:flex;height:35px}.requirement p{font-family:sans-serif;font-size:14px;font-weight:700;margin-left:10px}.invalid{color:red}.valid{color:#7ac142}.checkmark{stroke-width:5;stroke:#fff;stroke-miterlimit:10;animation:fill .4s ease-in-out .4s forwards,scale .3s ease-in-out .9s both;border-radius:50%;box-shadow:inset 0 0 0 #7ac142;display:block;height:15px;width:15px}.checkmark__circle{stroke-dasharray:166;stroke-dashoffset:166;stroke-width:2;stroke-miterlimit:10;stroke:#7ac142;fill:none;animation:stroke .6s cubic-bezier(.65,0,.45,1) forwards}.checkmark__check{stroke-dasharray:48;stroke-dashoffset:48;animation:stroke .2s cubic-bezier(.65,0,.45,1) .5s forwards;transform-origin:50% 50%}@keyframes stroke{to{stroke-dashoffset:0}}@keyframes scale{0%,to{transform:none}50%{transform:scale3d(1.1,1.1,1)}}@keyframes fill{to{box-shadow:inset 0 0 0 30px #7ac142}}";
14
+ styleInject(css_248z);
15
+
16
+ exports.default = css_248z;
@@ -0,0 +1,40 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ import React from 'react';
8
+ import PropTypes from 'prop-types';
9
+
10
+ function Button({
11
+ label,
12
+ backgroundColor = "red",
13
+ size = "md",
14
+ onClick
15
+ }) {
16
+ let scale = 1;
17
+ if (size === "sm") {
18
+ scale = 0.75;
19
+ }
20
+ if (size === "lg") {
21
+ scale = 1.25;
22
+ }
23
+ const style = {
24
+ backgroundColor,
25
+ padding: `${0.5 * scale}rem ${1 * scale}rem`,
26
+ border: "none"
27
+ };
28
+ return /*#__PURE__*/React.createElement("button", {
29
+ style: style,
30
+ onClick: onClick
31
+ }, label);
32
+ }
33
+ Button.propTypes = {
34
+ label: PropTypes.string,
35
+ backgroundColor: PropTypes.string,
36
+ size: PropTypes.oneOf(["sm", "md", "lg"]),
37
+ onClick: PropTypes.func
38
+ };
39
+
40
+ export { Button as default };
@@ -0,0 +1,27 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ // Ported from Alexander Haniotis' code here: https://codepen.io/haniotis/pen/KwvYLO
8
+ // import React from "react";
9
+
10
+ const Checkmark = () => {
11
+ return /*#__PURE__*/React.createElement("svg", {
12
+ className: "checkmark",
13
+ viewBox: "0 0 52 52"
14
+ }, /*#__PURE__*/React.createElement("circle", {
15
+ className: "checkmark__circle",
16
+ cx: "26",
17
+ cy: "26",
18
+ r: "25",
19
+ fill: "none"
20
+ }), /*#__PURE__*/React.createElement("path", {
21
+ className: "checkmark__check",
22
+ fill: "none",
23
+ d: "M14.1 27.2l7.1 7.2 16.7-16.8"
24
+ }));
25
+ };
26
+
27
+ export { Checkmark };
@@ -0,0 +1,237 @@
1
+ "use client";
2
+ /*
3
+ * UMWD-Components
4
+ * @copyright Jelle Paulus
5
+ * @license MIT
6
+ */
7
+
8
+ import { useState } from 'react';
9
+ import Link from 'next/link';
10
+ import { AppBar, Container, Toolbar, Box, Typography, Button, Dialog, List, ListItem, ListItemText, Divider } from '@mui/material';
11
+ import CloseIcon from '@mui/icons-material/Close';
12
+ import MoreVertIcon from '@mui/icons-material/MoreVert';
13
+
14
+ const NavBar = ({
15
+ site_title,
16
+ logo,
17
+ pages
18
+ }) => {
19
+ // handleMobileMenu
20
+
21
+ const [mobileNavOpen, setMobileNavOpen] = useState(false);
22
+ const handleOpenMobileMenu = e => {
23
+ setMobileNavOpen(true);
24
+ };
25
+ const handleCloseMobileMenu = e => {
26
+ setMobileNavOpen(false);
27
+ };
28
+ return /*#__PURE__*/React.createElement(AppBar, {
29
+ position: "sticky"
30
+ }, /*#__PURE__*/React.createElement(Container, {
31
+ maxWidth: "xl"
32
+ }, /*#__PURE__*/React.createElement(Toolbar, {
33
+ disableGutters: true,
34
+ sx: {
35
+ py: 1
36
+ }
37
+ }, /*#__PURE__*/React.createElement(Link, {
38
+ href: "/",
39
+ style: {
40
+ textDecoration: "none",
41
+ color: "unset"
42
+ }
43
+ }, /*#__PURE__*/React.createElement(Box, {
44
+ sx: {
45
+ display: {
46
+ xs: "none",
47
+ md: "flex"
48
+ },
49
+ cursor: "pointer",
50
+ alignItems: "center"
51
+ }
52
+ }, /*#__PURE__*/React.createElement(Box, {
53
+ sx: {
54
+ display: "flex",
55
+ mr: 1
56
+ }
57
+ }, /*#__PURE__*/React.createElement("img", {
58
+ src: logo.url,
59
+ width: logo.width || "32px",
60
+ height: logo.height || "32px",
61
+ alt: "site logo",
62
+ style: {
63
+ maxWidth: "60px",
64
+ maxHeight: "60px"
65
+ }
66
+ })), site_title !== undefined && /*#__PURE__*/React.createElement(Typography, {
67
+ variant: "h6",
68
+ noWrap: true,
69
+ component: "h1",
70
+ sx: {
71
+ display: "flex",
72
+ textDecoration: "none"
73
+ }
74
+ }, site_title))), /*#__PURE__*/React.createElement(Box, {
75
+ sx: {
76
+ flexGrow: 1,
77
+ display: {
78
+ xs: "none",
79
+ md: "flex"
80
+ },
81
+ alignItems: "center"
82
+ }
83
+ }, pages.map(page => {
84
+ return /*#__PURE__*/React.createElement(Button, {
85
+ key: page.name,
86
+ onClick: () => page.action(),
87
+ sx: {
88
+ my: 2,
89
+ color: "primary.contrastText",
90
+ display: "block"
91
+ }
92
+ }, page.name);
93
+ })), /*#__PURE__*/React.createElement(Link, {
94
+ href: "/",
95
+ style: {
96
+ textDecoration: "none",
97
+ color: "unset"
98
+ }
99
+ }, /*#__PURE__*/React.createElement(Box, {
100
+ sx: {
101
+ display: {
102
+ xs: "flex",
103
+ md: "none"
104
+ },
105
+ alignItems: "center"
106
+ }
107
+ }, logo.url !== undefined && /*#__PURE__*/React.createElement(Box, {
108
+ sx: {
109
+ display: "flex",
110
+ mr: 1
111
+ }
112
+ }, /*#__PURE__*/React.createElement("img", {
113
+ src: logo.url,
114
+ width: logo.width || "32px",
115
+ height: logo.height || "32px",
116
+ alt: logo.alt || "site logo",
117
+ style: {
118
+ maxWidth: "60px",
119
+ maxHeight: "60px"
120
+ }
121
+ })), site_title !== undefined && /*#__PURE__*/React.createElement(Typography, {
122
+ variant: "h5",
123
+ noWrap: true,
124
+ component: "h1",
125
+ sx: {
126
+ display: "flex",
127
+ flexGrow: 1
128
+ }
129
+ }, site_title))), /*#__PURE__*/React.createElement(Box, {
130
+ sx: {
131
+ display: {
132
+ xs: "flex",
133
+ md: "none"
134
+ },
135
+ flexGrow: 1
136
+ }
137
+ }), /*#__PURE__*/React.createElement(Box, {
138
+ sx: {
139
+ flexGrow: 0,
140
+ display: {
141
+ xs: "flex",
142
+ md: "none"
143
+ }
144
+ }
145
+ }, /*#__PURE__*/React.createElement(Button, {
146
+ onClick: handleOpenMobileMenu,
147
+ sx: {
148
+ width: "40px",
149
+ height: "40px",
150
+ borderRadius: "50%",
151
+ p: 0,
152
+ minWidth: "unset",
153
+ color: "primary.contrastText",
154
+ boxShadow: "0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"
155
+ }
156
+ }, /*#__PURE__*/React.createElement(MoreVertIcon, {
157
+ sx: {
158
+ color: "primary.contrastText"
159
+ }
160
+ })), /*#__PURE__*/React.createElement(Dialog, {
161
+ fullScreen: true,
162
+ open: mobileNavOpen,
163
+ onClose: handleCloseMobileMenu
164
+ }, /*#__PURE__*/React.createElement(AppBar, {
165
+ position: "sticky"
166
+ }, /*#__PURE__*/React.createElement(Container, {
167
+ maxWidth: "xl"
168
+ }, /*#__PURE__*/React.createElement(Toolbar, {
169
+ disableGutters: true,
170
+ sx: {
171
+ py: 1,
172
+ justifyContent: "space-between"
173
+ }
174
+ }, /*#__PURE__*/React.createElement(Link, {
175
+ href: "/",
176
+ style: {
177
+ textDecoration: "none",
178
+ color: "unset"
179
+ }
180
+ }, /*#__PURE__*/React.createElement(Box, {
181
+ sx: {
182
+ display: "flex",
183
+ flexDirection: "row",
184
+ alignItems: "center"
185
+ }
186
+ }, /*#__PURE__*/React.createElement(Box, {
187
+ sx: {
188
+ display: "flex",
189
+ mr: 1
190
+ }
191
+ }, /*#__PURE__*/React.createElement("img", {
192
+ src: logo.url,
193
+ alt: logo.alt || "logo",
194
+ width: logo.width || "32px",
195
+ height: logo.height || "32px",
196
+ style: {
197
+ maxWidth: "60px",
198
+ maxHeight: "60px"
199
+ }
200
+ })), /*#__PURE__*/React.createElement(Typography, {
201
+ variant: "h5",
202
+ noWrap: true,
203
+ component: "h1",
204
+ sx: {
205
+ display: "flex",
206
+ flexGrow: 1
207
+ }
208
+ }, site_title !== undefined && site_title))), /*#__PURE__*/React.createElement(Button, {
209
+ onClick: handleCloseMobileMenu,
210
+ sx: {
211
+ width: "40px",
212
+ height: "40px",
213
+ borderRadius: "50%",
214
+ p: 0,
215
+ minWidth: "unset",
216
+ color: "primary.contrastText",
217
+ boxShadow: "0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"
218
+ },
219
+ "aria-label": "close"
220
+ }, /*#__PURE__*/React.createElement(CloseIcon, {
221
+ sx: {
222
+ color: "primary.contrastText"
223
+ }
224
+ }))))), /*#__PURE__*/React.createElement(List, null, pages.map(page => {
225
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListItem, {
226
+ key: page.name,
227
+ onClick: () => {
228
+ page.action();
229
+ handleCloseMobileMenu();
230
+ }
231
+ }, /*#__PURE__*/React.createElement(ListItemText, {
232
+ primary: page.name
233
+ })), /*#__PURE__*/React.createElement(Divider, null));
234
+ })))))));
235
+ };
236
+
237
+ export { NavBar };
@@ -0,0 +1,19 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import React from 'react';
9
+ import { TextField } from '@mui/material';
10
+
11
+ const NoteTextField = props => {
12
+ return /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
13
+ sx: {
14
+ background: "linear-gradient(45deg, rgba(251,246,137,1) 30%, rgba(252,242,138,1) 90%)"
15
+ }
16
+ }));
17
+ };
18
+
19
+ export { NoteTextField };
@@ -0,0 +1,26 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ import { Xmark } from '../Xmark/Xmark.js';
8
+ import { Checkmark } from '../Checkmark/Checkmark.js';
9
+ import React, { useState, useEffect } from 'react';
10
+
11
+ const Requirement = ({
12
+ value,
13
+ requirement
14
+ }) => {
15
+ const [isValid, setIsValid] = useState();
16
+ useEffect(() => {
17
+ setIsValid(requirement.validator(value));
18
+ }, [value, requirement]);
19
+ return /*#__PURE__*/React.createElement("div", {
20
+ className: "requirement"
21
+ }, isValid ? /*#__PURE__*/React.createElement(Checkmark, null) : /*#__PURE__*/React.createElement(Xmark, null), /*#__PURE__*/React.createElement("p", {
22
+ className: isValid ? "valid" : "invalid"
23
+ }, requirement.text));
24
+ };
25
+
26
+ export { Requirement };
@@ -0,0 +1,28 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ import '../../styles.css.js';
8
+ import { Requirement } from '../Requirement/Requirement.js';
9
+ import React, { useCallback, useEffect } from 'react';
10
+
11
+ const Requirements = ({
12
+ value,
13
+ requirements,
14
+ onValidChange
15
+ }) => {
16
+ const validChangeCb = useCallback(onValidChange, []);
17
+ useEffect(() => {
18
+ validChangeCb(requirements.every(r => r.validator(value)));
19
+ }, [value, requirements, validChangeCb]);
20
+ return requirements.map((r, index) => /*#__PURE__*/React.createElement(Requirement, {
21
+ key: index,
22
+ value: value,
23
+ requirement: r,
24
+ onValidChange: onValidChange
25
+ }));
26
+ };
27
+
28
+ export { Requirements };
@@ -0,0 +1,32 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ import React from 'react';
8
+ import PropTypes from 'prop-types';
9
+
10
+ function Stack({
11
+ children,
12
+ spacing = 2,
13
+ direction = "row",
14
+ wrap = false
15
+ }) {
16
+ const style = {
17
+ display: "flex",
18
+ gap: `${spacing * 0.25}rem`,
19
+ flexWrap: wrap ? "wrap" : "nowrap",
20
+ flexDirection: direction
21
+ };
22
+ return /*#__PURE__*/React.createElement("div", {
23
+ style: style
24
+ }, children);
25
+ }
26
+ Stack.propTypes = {
27
+ spacing: PropTypes.number,
28
+ wrap: PropTypes.bool,
29
+ direction: PropTypes.oneOf(["row", "column"])
30
+ };
31
+
32
+ export { Stack as default };
@@ -0,0 +1,25 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ // import React from "react";
8
+
9
+ const Xmark = () => {
10
+ return /*#__PURE__*/React.createElement("svg", {
11
+ x: "0px",
12
+ y: "0px",
13
+ width: "15px",
14
+ height: "15px",
15
+ viewBox: "0 0 122.879 122.879",
16
+ enableBackground: "new 0 0 122.879 122.879"
17
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
18
+ fillRule: "evenodd",
19
+ clipRule: "evenodd",
20
+ fill: "#FF4141",
21
+ d: "M61.44,0c33.933,0,61.439,27.507,61.439,61.439 s-27.506,61.439-61.439,61.439C27.507,122.879,0,95.372,0,61.439S27.507,0,61.44,0L61.44,0z M73.451,39.151 c2.75-2.793,7.221-2.805,9.986-0.027c2.764,2.776,2.775,7.292,0.027,10.083L71.4,61.445l12.076,12.249 c2.729,2.77,2.689,7.257-0.08,10.022c-2.773,2.765-7.23,2.758-9.955-0.013L61.446,71.54L49.428,83.728 c-2.75,2.793-7.22,2.805-9.986,0.027c-2.763-2.776-2.776-7.293-0.027-10.084L51.48,61.434L39.403,49.185 c-2.728-2.769-2.689-7.256,0.082-10.022c2.772-2.765,7.229-2.758,9.953,0.013l11.997,12.165L73.451,39.151L73.451,39.151z"
22
+ })));
23
+ };
24
+
25
+ export { Xmark };
@@ -0,0 +1,11 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ export { Requirements } from './components/Requirements/Requirements.js';
8
+ export { NoteTextField } from './components/NoteTextField/NoteTextField.js';
9
+ export { default as Button } from './components/Button.js';
10
+ export { default as Stack } from './components/Stack.js';
11
+ export { NavBar } from './components/NavBar/NavBar.js';
@@ -0,0 +1,12 @@
1
+ /*
2
+ * UMWD-Components
3
+ * @copyright Jelle Paulus
4
+ * @license MIT
5
+ */
6
+
7
+ import styleInject from 'C:/Users/jelle/Desktop/AP_projects/umwd-components/node_modules/style-inject/dist/style-inject.es.js';
8
+
9
+ var css_248z = ".requirement{align-items:center;display:flex;height:35px}.requirement p{font-family:sans-serif;font-size:14px;font-weight:700;margin-left:10px}.invalid{color:red}.valid{color:#7ac142}.checkmark{stroke-width:5;stroke:#fff;stroke-miterlimit:10;animation:fill .4s ease-in-out .4s forwards,scale .3s ease-in-out .9s both;border-radius:50%;box-shadow:inset 0 0 0 #7ac142;display:block;height:15px;width:15px}.checkmark__circle{stroke-dasharray:166;stroke-dashoffset:166;stroke-width:2;stroke-miterlimit:10;stroke:#7ac142;fill:none;animation:stroke .6s cubic-bezier(.65,0,.45,1) forwards}.checkmark__check{stroke-dasharray:48;stroke-dashoffset:48;animation:stroke .2s cubic-bezier(.65,0,.45,1) .5s forwards;transform-origin:50% 50%}@keyframes stroke{to{stroke-dashoffset:0}}@keyframes scale{0%,to{transform:none}50%{transform:scale3d(1.1,1.1,1)}}@keyframes fill{to{box-shadow:inset 0 0 0 30px #7ac142}}";
10
+ styleInject(css_248z);
11
+
12
+ export { css_248z as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/cjs/src/index.js",
6
6
  "module": "dist/esm/src/index.js",
package/rollup.config.mjs CHANGED
@@ -19,6 +19,7 @@ const outputOptions = {
19
19
 
20
20
  export default [
21
21
  {
22
+ external: [/node_modules/],
22
23
  input: "./src/index.js",
23
24
  output: [
24
25
  {
@@ -44,7 +45,7 @@ export default [
44
45
  exclude: "node_modules/**",
45
46
  presets: ["@babel/preset-react"],
46
47
  }),
47
- external(),
48
+ // external(),
48
49
  resolve(),
49
50
  preserveDirectives(),
50
51
  /* useClient(), */
@@ -1,5 +1,5 @@
1
1
  // Ported from Alexander Haniotis' code here: https://codepen.io/haniotis/pen/KwvYLO
2
- import React from "react";
2
+ // import React from "react";
3
3
 
4
4
  export const Checkmark = () => {
5
5
  return (
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ // import React from "react";
2
2
 
3
3
  export const Xmark = () => {
4
4
  return (