@visns-studio/visns-components 4.4.5 → 4.4.6

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.
@@ -16,6 +16,32 @@ const CustomFetch = (
16
16
  'Content-Type': 'application/json',
17
17
  };
18
18
 
19
+ const MAX_PAYLOAD_SIZE = 4.5 * 1024 * 1024; // 4.5MB in bytes
20
+
21
+ // Estimate headers size
22
+ const headersSize = JSON.stringify(headers).length;
23
+
24
+ // Estimate cookies size (if any)
25
+ const cookies = document.cookie;
26
+ const cookiesSize = cookies ? cookies.length : 0;
27
+
28
+ // Check payload size
29
+ const payloadSize = new Blob([JSON.stringify(formData)]).size;
30
+ const totalRequestSize = payloadSize + headersSize + cookiesSize;
31
+
32
+ console.info(totalRequestSize);
33
+
34
+ if (totalRequestSize > MAX_PAYLOAD_SIZE) {
35
+ const errorMessage =
36
+ 'The request is too large. Please try again with a smaller payload.';
37
+ if (errorCallback) {
38
+ errorCallback(errorMessage);
39
+ } else {
40
+ toast.error(errorMessage);
41
+ }
42
+ return Promise.reject(new Error(errorMessage));
43
+ }
44
+
19
45
  if (method.toUpperCase() === 'PUT' || method.toUpperCase() === 'PATCH') {
20
46
  formData = {
21
47
  ...formData,
@@ -1,3 +1,5 @@
1
+ import '../styles/global.css';
2
+
1
3
  import React, { useEffect, useRef, useState } from 'react';
2
4
  import DatePicker from 'react-datepicker';
3
5
  import _ from 'lodash';
@@ -1,3 +1,5 @@
1
+ import '../../styles/global.css';
2
+
1
3
  import React, { useState } from 'react';
2
4
  import { Link, useLocation } from 'react-router-dom';
3
5
  import Reveal from 'react-reveal/Reveal';
@@ -1,3 +1,5 @@
1
+ import '../../styles/global.css';
2
+
1
3
  import React, { useState } from 'react';
2
4
  import Reveal from 'react-reveal/Reveal';
3
5
  import { toast } from 'react-toastify';
@@ -1,3 +1,5 @@
1
+ import '../../styles/global.css';
2
+
1
3
  import React, { useState } from 'react';
2
4
  import { useNavigate, useParams } from 'react-router-dom';
3
5
  import { toast } from 'react-toastify';
@@ -1,3 +1,5 @@
1
+ import '../../styles/global.css';
2
+
1
3
  import React, { useCallback, useEffect, useRef, useState } from 'react';
2
4
  import { Link, useParams } from 'react-router-dom';
3
5
  import moment from 'moment';
@@ -1,3 +1,5 @@
1
+ import '../../styles/global.css';
2
+
1
3
  import React, { useCallback, useEffect, useRef, useState } from 'react';
2
4
  import { Outlet } from 'react-router-dom';
3
5
  import { toast } from 'react-toastify';
@@ -1,3 +1,55 @@
1
+ @import '@fontsource/barlow/index.css';
2
+ @import '@fontsource/barlow/300.css';
3
+ @import '@fontsource/barlow/700.css';
4
+
5
+ /* Apply the crop mixin manually */
6
+ .crop::before {
7
+ content: '';
8
+ display: block;
9
+ height: 0;
10
+ width: 0;
11
+ margin-top: calc((1 - 1.25) * 0.5em);
12
+ }
13
+
14
+ body {
15
+ font-size: 100%;
16
+ background: var(--tertiary-color);
17
+ font-family: 'Barlow', sans-serif;
18
+ font-weight: 300;
19
+ font-style: normal;
20
+ letter-spacing: 0.018em;
21
+ }
22
+
23
+ .loginbg {
24
+ background: var(--tertiary-color);
25
+ }
26
+
27
+ h1,
28
+ h2,
29
+ h3,
30
+ h4,
31
+ h5 {
32
+ font-size: 1.675em;
33
+ color: var(--primary-color);
34
+ font-weight: 700;
35
+ font-style: normal;
36
+ }
37
+
38
+ p {
39
+ font-weight: 300;
40
+ font-style: normal;
41
+ margin: 0 0 calc(var(--padding) / 2); /* Replace with actual padding value */
42
+ color: var(--paragraph-color);
43
+ }
44
+
45
+ p::before {
46
+ content: '';
47
+ display: block;
48
+ height: 0;
49
+ width: 0;
50
+ margin-top: calc((1 - 1.25) * 0.5em);
51
+ }
52
+
1
53
  textarea,
2
54
  select,
3
55
  input[type]:not([type='search']):not([type='url']):not([type='hidden']):not(
@@ -18,7 +70,6 @@ input[type]:not([type='search']):not([type='url']):not([type='hidden']):not(
18
70
  background: rgba(white, 0.5);
19
71
  color: var(--paragraph-color);
20
72
  transition: border 0.15s linear;
21
- font-size: 1.25em;
22
73
 
23
74
  &:hover {
24
75
  border: 1px solid var(--primary-color);
package/package.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
+ "@fontsource/barlow": "^5.0.13",
3
4
  "@inovua/reactdatagrid-community": "^5.10.2",
4
5
  "@nivo/bar": "^0.87.0",
5
6
  "@nivo/core": "^0.87.0",
@@ -13,7 +14,7 @@
13
14
  "axios": "^1.7.2",
14
15
  "dayjs": "^1.11.11",
15
16
  "file-saver": "^2.0.5",
16
- "framer-motion": "^11.2.14",
17
+ "framer-motion": "^11.3.4",
17
18
  "html-react-parser": "^5.1.10",
18
19
  "lodash": "^4.17.21",
19
20
  "lodash.debounce": "^4.0.8",
@@ -57,7 +58,7 @@
57
58
  "react-dom": "^17.0.1"
58
59
  },
59
60
  "name": "@visns-studio/visns-components",
60
- "version": "4.4.5",
61
+ "version": "4.4.6",
61
62
  "description": "Various packages to assist in the development of our Custom Applications.",
62
63
  "main": "index.js",
63
64
  "scripts": {