umwd-components 0.1.27 → 0.1.28

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.
@@ -7,12 +7,19 @@ const config = {
7
7
  "@storybook/addon-interactions",
8
8
  ],
9
9
  framework: {
10
- name: '@storybook/nextjs',
10
+ name: "@storybook/nextjs",
11
11
  options: {},
12
12
  },
13
13
  docs: {
14
14
  autodocs: "tag",
15
15
  },
16
- staticDirs: ["..\\public"]
16
+ staticDirs: ["..\\public"],
17
+ webpackFinal: async (config, { configType }) => {
18
+ config.resolve.alias = {
19
+ ...config.resolve.alias,
20
+ "next/navigation": "next-router-mock",
21
+ };
22
+ return config;
23
+ },
17
24
  };
18
25
  export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -75,6 +75,7 @@
75
75
  "react-dom": "^18.2.0"
76
76
  },
77
77
  "dependencies": {
78
+ "next-router-mock": "^0.9.12",
78
79
  "react": "^18.2.0",
79
80
  "react-dnd": "^16.0.1",
80
81
  "react-dnd-html5-backend": "^16.0.1"
@@ -0,0 +1,3 @@
1
+ export default function Home() {
2
+ return <main></main>;
3
+ }
@@ -0,0 +1,202 @@
1
+ import {
2
+ AppBar,
3
+ Container,
4
+ Toolbar,
5
+ Typography,
6
+ Box,
7
+ IconButton,
8
+ Grid,
9
+ Divider,
10
+ Stack,
11
+ } from "@mui/material";
12
+ import Link from "next/link";
13
+ import Image from "next/image";
14
+
15
+ import PropTypes from "prop-types";
16
+
17
+ Footer.propTypes = {
18
+ site_title: PropTypes.string.isRequired,
19
+ site_logo: PropTypes.string,
20
+ company_name: PropTypes.string.isRequired,
21
+ parent_company_name: PropTypes.string,
22
+ company_address: PropTypes.shape({
23
+ street: PropTypes.string,
24
+ street_number: PropTypes.string,
25
+ street_number_addition: PropTypes.string,
26
+ postal_code: PropTypes.string,
27
+ city: PropTypes.string,
28
+ }),
29
+ CoC_number: PropTypes.string.isRequired,
30
+ VAT_number: PropTypes.string.isRequired,
31
+ company_socials: PropTypes.arrayOf(
32
+ PropTypes.shape({
33
+ name: PropTypes.string.isRequired,
34
+ url: PropTypes.string.isRequired,
35
+ icon: PropTypes.elementType,
36
+ })
37
+ ),
38
+ disclaimer_link: PropTypes.string,
39
+ privacypolicy_link: PropTypes.string,
40
+ };
41
+
42
+ function Footer({
43
+ site_title,
44
+ site_logo,
45
+ company_name,
46
+ parent_company_name,
47
+ company_address,
48
+ CoC_number,
49
+ VAT_number,
50
+ company_socials,
51
+ disclaimer_link,
52
+ privacypolicy_link,
53
+ }) {
54
+ return (
55
+ <AppBar position="relative">
56
+ <Container maxWidth="xl">
57
+ <Toolbar disableGutters>
58
+ <Grid container sx={{ p: 2 }} spacing={2}>
59
+ <Grid item xs={12} sm={4} align="center">
60
+ <Link href="/">
61
+ <Box
62
+ sx={{
63
+ display: { xs: "none", md: "flex" },
64
+ cursor: "pointer",
65
+ flexDirection: "column",
66
+ alignItems: "center",
67
+ justifyContent: "center",
68
+ }}
69
+ >
70
+ <Typography variant="h6">{site_title}</Typography>
71
+ {site_logo && (
72
+ <Box>
73
+ <Image
74
+ src={site_logo}
75
+ width={64}
76
+ height={64}
77
+ alt="site logo"
78
+ />
79
+ </Box>
80
+ )}
81
+ </Box>
82
+ </Link>
83
+ </Grid>
84
+ <Grid item xs={12} sm={4} align="center">
85
+ <Typography variant="h6">Contact Information</Typography>
86
+ <Typography variant="h6">{company_name}</Typography>
87
+ {parent_company_name && (
88
+ <Typography variant="h6">By {parent_company_name}</Typography>
89
+ )}
90
+ {company_address && (
91
+ <>
92
+ <Typography variant="body1">
93
+ {company_address.street} {company_address.street_number}{" "}
94
+ {company_address.street_number_addition &&
95
+ company_address.street_number_addition}
96
+ </Typography>
97
+
98
+ <Typography variant="body1">
99
+ {company_address.postal_code} {company_address.city}
100
+ </Typography>
101
+ </>
102
+ )}
103
+
104
+ <Typography variant="body1">CoC: {CoC_number}</Typography>
105
+ <Typography variant="body1">VAT: {VAT_number}</Typography>
106
+
107
+ <Typography variant="body1"></Typography>
108
+ <Typography variant="body1"></Typography>
109
+ </Grid>
110
+ <Grid item xs={12} sm={4} align="center">
111
+ <Typography variant="h6">Socials</Typography>
112
+ {company_socials && (
113
+ <Stack
114
+ spacing={2}
115
+ sx={{ width: "min-content", color: "primary.contrastText" }}
116
+ >
117
+ {company_socials.map((company_social, index) => {
118
+ if (
119
+ company_social.url === undefined ||
120
+ company_social.icon === undefined
121
+ ) {
122
+ return (
123
+ <IconButton color="inherit" href={company_social.url}>
124
+ {company_social.icon}
125
+ </IconButton>
126
+ );
127
+ }
128
+ })}
129
+ </Stack>
130
+ )}
131
+ </Grid>
132
+ <Grid item xs={12}>
133
+ <Divider />
134
+ </Grid>
135
+ {/* important links */}
136
+ {disclaimer_link && (
137
+ <Grid
138
+ item
139
+ xs={12}
140
+ sm={4}
141
+ sx={{
142
+ display: "flex",
143
+ justifyContent: "center",
144
+ alignItems: "center",
145
+ }}
146
+ >
147
+ <Link href={disclaimer_link}>
148
+ <Typography variant="body1">Disclaimer</Typography>
149
+ </Link>
150
+ </Grid>
151
+ )}
152
+ {privacypolicy_link && (
153
+ <Grid
154
+ item
155
+ xs={12}
156
+ sm={4}
157
+ sx={{
158
+ display: "flex",
159
+ justifyContent: "center",
160
+ alignItems: "center",
161
+ }}
162
+ >
163
+ <Link href={privacypolicy_link}>
164
+ <Typography variant="body1">Privacy Policy</Typography>
165
+ </Link>
166
+ </Grid>
167
+ )}
168
+ {/* TODO */}
169
+ {/* <Grid
170
+ item
171
+ xs={12}
172
+ sm={4}
173
+ sx={{
174
+ display: "flex",
175
+ justifyContent: "center",
176
+ alignItems: "center",
177
+ }}
178
+ >
179
+ <CookieConsentButton />
180
+ </Grid> */}
181
+ <Grid item xs={12}>
182
+ <Divider />
183
+ </Grid>
184
+ <Grid
185
+ item
186
+ xs={12}
187
+ sx={{
188
+ display: "flex",
189
+ justifyContent: "center",
190
+ alignItems: "center",
191
+ }}
192
+ >
193
+ <Typography>Made possible by Atelier Paulus</Typography>
194
+ </Grid>
195
+ </Grid>
196
+ </Toolbar>
197
+ </Container>
198
+ </AppBar>
199
+ );
200
+ }
201
+
202
+ export default Footer;
@@ -0,0 +1,72 @@
1
+ import Footer from "../components/Footer";
2
+ import React from "react";
3
+ import thumbnail from "../../public/placeholders/thumbnail_100X100.png";
4
+ import InstagramIcon from "@mui/icons-material/Instagram";
5
+ import LinkedInIcon from "@mui/icons-material/LinkedIn";
6
+ import PublicIcon from "@mui/icons-material/Public";
7
+ import TwitterIcon from "@mui/icons-material/Twitter";
8
+ import FacebookIcon from "@mui/icons-material/Facebook";
9
+
10
+ export default {
11
+ title: "UMWD/Footer",
12
+ component: Footer,
13
+ };
14
+
15
+ const Template = ({ ...args }) => {
16
+ console.log(thumbnail);
17
+ return <Footer {...args} />;
18
+ };
19
+
20
+ export const Orefs = Template.bind({});
21
+
22
+ Orefs.args = {
23
+ site_title: "Orefs",
24
+ site_logo: thumbnail.src,
25
+ company_name: "Orefs",
26
+ parent_company_name: "Orefs",
27
+ company_address: {
28
+ street: "Molenkade",
29
+ street_number: "8",
30
+ street_number_addition: "A",
31
+ postal_code: "1115AB",
32
+ city: "Duivendrecht",
33
+ },
34
+ CoC_number: "12345678",
35
+ VAT_number: "NL123456789B01",
36
+ company_socials: [
37
+ {
38
+ name: "Facebook",
39
+ url: "https://www.facebook.com/",
40
+ icon: <FacebookIcon />,
41
+ },
42
+ ],
43
+ //disclaimer_link: PropTypes.string,
44
+ //privacypolicy_link: PropTypes.string,
45
+ };
46
+
47
+ /*
48
+ Footer.propTypes = {
49
+ site_title: PropTypes.string.isRequired,
50
+ site_logo: PropTypes.string,
51
+ company_name: PropTypes.string.isRequired,
52
+ parent_company_name: PropTypes.string,
53
+ company_address: PropTypes.shape({
54
+ street: PropTypes.string,
55
+ street_number: PropTypes.string,
56
+ street_number_addition: PropTypes.string,
57
+ postal_code: PropTypes.string,
58
+ city: PropTypes.string,
59
+ }),
60
+ CoC_number: PropTypes.string.isRequired,
61
+ VAT_number: PropTypes.string.isRequired,
62
+ company_socials: PropTypes.arrayOf(
63
+ PropTypes.shape({
64
+ name: PropTypes.string.isRequired,
65
+ url: PropTypes.string.isRequired,
66
+ icon: PropTypes.elementType,
67
+ })
68
+ ),
69
+ disclaimer_link: PropTypes.string,
70
+ privacypolicy_link: PropTypes.string,
71
+ };
72
+ */
@@ -1,6 +1,6 @@
1
1
  import NavBar from "../components/NavBar";
2
2
  import React from "react";
3
- import thumbnail from "../../public/placeholders/thumbnail_100X100.png"
3
+ import thumbnail from "../../public/placeholders/thumbnail_100X100.png";
4
4
 
5
5
  export default {
6
6
  title: "UMWD/NavBar",
@@ -9,10 +9,9 @@ export default {
9
9
  };
10
10
 
11
11
  const Template = ({ ...args }) => {
12
- console.log(thumbnail)
13
- return (
14
- <NavBar {...args} />
15
- )};
12
+ console.log(thumbnail);
13
+ return <NavBar {...args} />;
14
+ };
16
15
 
17
16
  export const Orefs = Template.bind({});
18
17
 
@@ -35,5 +34,5 @@ Orefs.args = {
35
34
  link: "/contact",
36
35
  action: () => console.log("Contact"),
37
36
  },
38
- ]
37
+ ],
39
38
  };