@bigbinary/neeto-molecules 1.0.50 → 1.0.52

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-molecules",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "A package of reusable molecular components for neeto products.",
5
5
  "repository": "git@github.com:bigbinary/neeto-molecules.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",
@@ -243,15 +243,19 @@
243
243
  }
244
244
  },
245
245
  "browserSupport": {
246
- "unsupportedBrowserVersion": "You are using {{browserName}} {{browserVersion}}. neeto requires {{browserName}} {{requiredMinBrowserVersion}} or later to perform reliably. <downloadLink></downloadLink><contactUs></contactUs>",
247
- "unsupportedBrowser": "You are using {{browserName}} {{browserVersion}}. neeto requires a modern browser to perform reliably. <contactUs></contactUs>",
246
+ "unsupportedBrowserVersion": {
247
+ "title": "Unsupported Version",
248
+ "description": "You are using {{browserName}} {{browserVersion}}. neeto requires {{browserName}} {{requiredMinBrowserVersion}} or later to perform reliably. <downloadLink></downloadLink><contactUs></contactUs>"
249
+ },
250
+ "unsupportedBrowser": {
251
+ "title": "Unsupported Browser",
252
+ "description": "You are using {{browserName}} {{browserVersion}}. neeto requires a modern browser to perform reliably.<contactUs></contactUs>"
253
+ },
248
254
  "downloadLink": {
249
- "main": "Please <button></button> the latest browser.",
250
- "buttonLabel": "download and install"
255
+ "main": "Please <button>download and install</button> the latest browser."
251
256
  },
252
257
  "contactUs": {
253
- "main": "<button></button> if you need any help.",
254
- "buttonLabel": "Contact us"
258
+ "main": "<button>Contact us</button> if you need any help."
255
259
  },
256
260
  "unknownBrowserMsg": "an unknown browser"
257
261
  },
@@ -1,14 +1,22 @@
1
1
  import React from "react";
2
+ type VersionLimits = {
3
+ softLimit?: number;
4
+ hardLimit?: number;
5
+ };
2
6
  /**
3
7
  *
4
- * A common component that displays a callout message for unsupported browsers.
8
+ * A wrapper that displays a callout message for partially supported browsers (below a soft limit) along with the site content. If the browser is an unsupported version (below a hard limit), it shows a full-page message to update the browser and does not display the site content. If the browser is in the list of unsupported browsers, it displays
9
+ *
10
+ * a full-page message that the browser is unsupported and does not display the site content.
5
11
  *
6
12
  * @example
7
13
  *
8
- * import BrowserSupport from "@bigbinary/neeto-molecules/BrowserSupport";
14
+ * import BrowserSupport from "@bigbinary/neeto-molecules/BrowserSupport";
9
15
  *
10
16
  * const App = () => (
11
- * <BrowserSupport />
17
+ * <BrowserSupport>
18
+ * {children}
19
+ * </BrowserSupport>
12
20
  * <Main />
13
21
  * )
14
22
  * @endexample
@@ -20,38 +28,51 @@ import React from "react";
20
28
  *
21
29
  * <BrowserSupport
22
30
  * overrides={{
23
- * Chrome: 60,
24
- * Safari: 14.1,
31
+ * Chrome: { softLimit: 80, hardLimit: 60 },
32
+ * Safari: { softLimit: 14.1, hardLimit: 13.5 },
25
33
  * }}
34
+ * unsupportedBrowsers={["Firefox"]}
26
35
  * />
27
36
  * @endexample
28
37
  * In the above code we have changed the minimum supported versions of Chrome &
29
38
  *
30
- * Safari. Now if a user has accessed the site using Chrome < 60 or Safari < 14.1
39
+ * Safari. Now if a user has accessed the site using Chrome < 80 or Safari < 14.1
40
+ *
41
+ * the callout message will be displayed. If a user has accessed the site using
42
+ *
43
+ * Chrome < 60 or Safari < 13.5, a message will be displayed to update the browser
31
44
  *
32
- * the callout message will be displayed.
45
+ * and page contents will not be shown. If a user has accessed the site using any
46
+ *
47
+ * version of Firefox, a message will be displayed that the browser is unsupported
48
+ *
49
+ * and page contents will not be shown.
33
50
  *
34
51
  * The default supported browser names and their versions are given below:
35
52
  *
36
- * Any other browser which is not in the above table will be considered as
53
+ * The default unsupported browsers are given below:
54
+ *
55
+ * Any other browser which is not in the above lists will be considered as
37
56
  *
38
- * unsupported.
57
+ * unknown and a corresponding callout will be shown.
39
58
  *
40
59
  */
41
60
  const BrowserSupport: React.FC<{
42
61
  overrides?: {
43
- Chrome?: number;
44
- MicrosoftEdge?: number;
45
- Firefox?: number;
46
- IE?: number;
47
- Opera?: number;
48
- Safari?: number;
49
- AndroidBrowser?: number;
50
- OperaMini?: number;
51
- ChromeMobile?: number;
52
- FirefoxMobile?: number;
53
- UCBrowser?: number;
54
- SamsungInternet?: number;
62
+ Chrome?: VersionLimits;
63
+ MicrosoftEdge?: VersionLimits;
64
+ Firefox?: VersionLimits;
65
+ IE?: VersionLimits;
66
+ Opera?: VersionLimits;
67
+ Safari?: VersionLimits;
68
+ AndroidBrowser?: VersionLimits;
69
+ OperaMini?: VersionLimits;
70
+ ChromeMobile?: VersionLimits;
71
+ FirefoxMobile?: VersionLimits;
72
+ UCBrowser?: VersionLimits;
73
+ SamsungInternet?: VersionLimits;
55
74
  };
75
+ unsupportedBrowsers?: string[];
76
+ children?: React.ReactNode | React.ReactNode[];
56
77
  }>;
57
78
  export default BrowserSupport;