@bigbinary/neeto-molecules 0.0.1
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/README.md +60 -0
- package/dist/BrowserSupport.cjs.js +1727 -0
- package/dist/BrowserSupport.cjs.js.map +1 -0
- package/dist/BrowserSupport.js +1721 -0
- package/dist/BrowserSupport.js.map +1 -0
- package/dist/Columns.cjs.js +191 -0
- package/dist/Columns.cjs.js.map +1 -0
- package/dist/Columns.js +184 -0
- package/dist/Columns.js.map +1 -0
- package/dist/Container.cjs.js +1277 -0
- package/dist/Container.cjs.js.map +1 -0
- package/dist/Container.js +1271 -0
- package/dist/Container.js.map +1 -0
- package/dist/CopyToClipboardButton.cjs.js +78 -0
- package/dist/CopyToClipboardButton.cjs.js.map +1 -0
- package/dist/CopyToClipboardButton.js +72 -0
- package/dist/CopyToClipboardButton.js.map +1 -0
- package/dist/CustomDomain.cjs.js +680 -0
- package/dist/CustomDomain.cjs.js.map +1 -0
- package/dist/CustomDomain.js +654 -0
- package/dist/CustomDomain.js.map +1 -0
- package/dist/CustomDomainDashboard.cjs.js +2306 -0
- package/dist/CustomDomainDashboard.cjs.js.map +1 -0
- package/dist/CustomDomainDashboard.js +2279 -0
- package/dist/CustomDomainDashboard.js.map +1 -0
- package/dist/DateFormat.cjs.js +51 -0
- package/dist/DateFormat.cjs.js.map +1 -0
- package/dist/DateFormat.js +45 -0
- package/dist/DateFormat.js.map +1 -0
- package/dist/DateRangeFilter.cjs.js +236 -0
- package/dist/DateRangeFilter.cjs.js.map +1 -0
- package/dist/DateRangeFilter.js +229 -0
- package/dist/DateRangeFilter.js.map +1 -0
- package/dist/DynamicVariables.cjs.js +112 -0
- package/dist/DynamicVariables.cjs.js.map +1 -0
- package/dist/DynamicVariables.js +106 -0
- package/dist/DynamicVariables.js.map +1 -0
- package/dist/EmailPreview.cjs.js +102 -0
- package/dist/EmailPreview.cjs.js.map +1 -0
- package/dist/EmailPreview.js +96 -0
- package/dist/EmailPreview.js.map +1 -0
- package/dist/ErrorPage.cjs.js +208 -0
- package/dist/ErrorPage.cjs.js.map +1 -0
- package/dist/ErrorPage.js +184 -0
- package/dist/ErrorPage.js.map +1 -0
- package/dist/Header.cjs.js +219 -0
- package/dist/Header.cjs.js.map +1 -0
- package/dist/Header.js +213 -0
- package/dist/Header.js.map +1 -0
- package/dist/IconPicker.cjs.js +1307 -0
- package/dist/IconPicker.cjs.js.map +1 -0
- package/dist/IconPicker.js +1301 -0
- package/dist/IconPicker.js.map +1 -0
- package/dist/IntegrationCard.cjs.js +75 -0
- package/dist/IntegrationCard.cjs.js.map +1 -0
- package/dist/IntegrationCard.js +69 -0
- package/dist/IntegrationCard.js.map +1 -0
- package/dist/IntegrationDisconnectAlert.cjs.js +81 -0
- package/dist/IntegrationDisconnectAlert.cjs.js.map +1 -0
- package/dist/IntegrationDisconnectAlert.js +75 -0
- package/dist/IntegrationDisconnectAlert.js.map +1 -0
- package/dist/IntegrationWalkthroughModal.cjs.js +42 -0
- package/dist/IntegrationWalkthroughModal.cjs.js.map +1 -0
- package/dist/IntegrationWalkthroughModal.js +36 -0
- package/dist/IntegrationWalkthroughModal.js.map +1 -0
- package/dist/IpRestriction.cjs.js +3764 -0
- package/dist/IpRestriction.cjs.js.map +1 -0
- package/dist/IpRestriction.js +3738 -0
- package/dist/IpRestriction.js.map +1 -0
- package/dist/KeyboardShortcuts.cjs.js +2242 -0
- package/dist/KeyboardShortcuts.cjs.js.map +1 -0
- package/dist/KeyboardShortcuts.js +2235 -0
- package/dist/KeyboardShortcuts.js.map +1 -0
- package/dist/LoginPage.cjs.js +618 -0
- package/dist/LoginPage.cjs.js.map +1 -0
- package/dist/LoginPage.js +593 -0
- package/dist/LoginPage.js.map +1 -0
- package/dist/MenuBar.cjs.js +31044 -0
- package/dist/MenuBar.cjs.js.map +1 -0
- package/dist/MenuBar.js +31038 -0
- package/dist/MenuBar.js.map +1 -0
- package/dist/NeetoWidget.cjs.js +3369 -0
- package/dist/NeetoWidget.cjs.js.map +1 -0
- package/dist/NeetoWidget.js +3343 -0
- package/dist/NeetoWidget.js.map +1 -0
- package/dist/PageLoader.cjs.js +158 -0
- package/dist/PageLoader.cjs.js.map +1 -0
- package/dist/PageLoader.js +134 -0
- package/dist/PageLoader.js.map +1 -0
- package/dist/PhoneNumber.cjs.js +7021 -0
- package/dist/PhoneNumber.cjs.js.map +1 -0
- package/dist/PhoneNumber.js +6989 -0
- package/dist/PhoneNumber.js.map +1 -0
- package/dist/PublishBlock.cjs.js +189 -0
- package/dist/PublishBlock.cjs.js.map +1 -0
- package/dist/PublishBlock.js +183 -0
- package/dist/PublishBlock.js.map +1 -0
- package/dist/Rename.cjs.js +306 -0
- package/dist/Rename.cjs.js.map +1 -0
- package/dist/Rename.js +300 -0
- package/dist/Rename.js.map +1 -0
- package/dist/ResponsiveDevicePicker.cjs.js +260 -0
- package/dist/ResponsiveDevicePicker.cjs.js.map +1 -0
- package/dist/ResponsiveDevicePicker.js +254 -0
- package/dist/ResponsiveDevicePicker.js.map +1 -0
- package/dist/Schedule.cjs.js +952 -0
- package/dist/Schedule.cjs.js.map +1 -0
- package/dist/Schedule.js +921 -0
- package/dist/Schedule.js.map +1 -0
- package/dist/Scrollable.cjs.js +184 -0
- package/dist/Scrollable.cjs.js.map +1 -0
- package/dist/Scrollable.js +178 -0
- package/dist/Scrollable.js.map +1 -0
- package/dist/ShareViaEmail.cjs.js +2992 -0
- package/dist/ShareViaEmail.cjs.js.map +1 -0
- package/dist/ShareViaEmail.js +2966 -0
- package/dist/ShareViaEmail.js.map +1 -0
- package/dist/ShareViaLink.cjs.js +1385 -0
- package/dist/ShareViaLink.cjs.js.map +1 -0
- package/dist/ShareViaLink.js +1360 -0
- package/dist/ShareViaLink.js.map +1 -0
- package/dist/Sidebar.cjs.js +32222 -0
- package/dist/Sidebar.cjs.js.map +1 -0
- package/dist/Sidebar.js +32196 -0
- package/dist/Sidebar.js.map +1 -0
- package/dist/SubHeader.cjs.js +272 -0
- package/dist/SubHeader.cjs.js.map +1 -0
- package/dist/SubHeader.js +265 -0
- package/dist/SubHeader.js.map +1 -0
- package/dist/TableWrapper.cjs.js +87 -0
- package/dist/TableWrapper.cjs.js.map +1 -0
- package/dist/TableWrapper.js +81 -0
- package/dist/TableWrapper.js.map +1 -0
- package/dist/ThemeSidebar.cjs.js +13618 -0
- package/dist/ThemeSidebar.cjs.js.map +1 -0
- package/dist/ThemeSidebar.js +13593 -0
- package/dist/ThemeSidebar.js.map +1 -0
- package/dist/TimeFormat.cjs.js +53 -0
- package/dist/TimeFormat.cjs.js.map +1 -0
- package/dist/TimeFormat.js +47 -0
- package/dist/TimeFormat.js.map +1 -0
- package/dist/TimezoneMismatchModal.cjs.js +176 -0
- package/dist/TimezoneMismatchModal.cjs.js.map +1 -0
- package/dist/TimezoneMismatchModal.js +168 -0
- package/dist/TimezoneMismatchModal.js.map +1 -0
- package/package.json +185 -0
- package/src/translations/en.json +449 -0
- package/types/BrowserSupport.d.ts +86 -0
- package/types/Columns.d.ts +53 -0
- package/types/Container.d.ts +35 -0
- package/types/CopyToClipboardButton.d.ts +21 -0
- package/types/CustomDomain.d.ts +19 -0
- package/types/CustomDomainDashboard.d.ts +33 -0
- package/types/DateFormat.d.ts +18 -0
- package/types/DateRangeFilter.d.ts +52 -0
- package/types/DynamicVariables.d.ts +45 -0
- package/types/EmailPreview.d.ts +41 -0
- package/types/ErrorPage.d.ts +15 -0
- package/types/Header.d.ts +30 -0
- package/types/IconPicker.d.ts +43 -0
- package/types/IntegrationCard.d.ts +45 -0
- package/types/IntegrationDisconnectAlert.d.ts +37 -0
- package/types/IntegrationWalkthroughModal.d.ts +31 -0
- package/types/IpRestriction.d.ts +23 -0
- package/types/KeyboardShortcuts.d.ts +147 -0
- package/types/LoginPage.d.ts +43 -0
- package/types/MenuBar.d.ts +125 -0
- package/types/NeetoWidget.d.ts +41 -0
- package/types/PageLoader.d.ts +38 -0
- package/types/PhoneNumber.d.ts +106 -0
- package/types/PublishBlock.d.ts +84 -0
- package/types/Rename.d.ts +60 -0
- package/types/ResponsiveDevicePicker.d.ts +30 -0
- package/types/Schedule.d.ts +132 -0
- package/types/Scrollable.d.ts +28 -0
- package/types/ShareViaEmail.d.ts +99 -0
- package/types/ShareViaLink.d.ts +117 -0
- package/types/Sidebar.d.ts +63 -0
- package/types/SubHeader.d.ts +97 -0
- package/types/TableWrapper.d.ts +38 -0
- package/types/TimeFormat.d.ts +17 -0
- package/types/TimezoneMismatchModal.d.ts +39 -0
- package/types/themeSidebar.d.ts +80 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type VersionLimits = {
|
|
3
|
+
softLimit?: number;
|
|
4
|
+
hardLimit?: number;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* A wrapper that displays a callout message for partially supported browsers
|
|
9
|
+
*
|
|
10
|
+
* (below a soft limit) along with the site content. If the browser is an
|
|
11
|
+
*
|
|
12
|
+
* unsupported version (below a hard limit), it shows a full-page message to update
|
|
13
|
+
*
|
|
14
|
+
* the browser and does not display the site content. If the browser is in the list
|
|
15
|
+
*
|
|
16
|
+
* of unsupported browsers, it displays a full-page message that the browser is
|
|
17
|
+
*
|
|
18
|
+
* unsupported and does not display the site content.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
*
|
|
22
|
+
* import BrowserSupport from "@bigbinary/neeto-molecules/BrowserSupport";
|
|
23
|
+
*
|
|
24
|
+
* const App = () => (
|
|
25
|
+
* <BrowserSupport>
|
|
26
|
+
* {children}
|
|
27
|
+
* </BrowserSupport>
|
|
28
|
+
* <Main />
|
|
29
|
+
* )
|
|
30
|
+
* @endexample
|
|
31
|
+
* Minimum supported browser version of a specific browser can be changed using the
|
|
32
|
+
*
|
|
33
|
+
* overrides prop like so:
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
*
|
|
37
|
+
* <BrowserSupport
|
|
38
|
+
* overrides={{
|
|
39
|
+
* Chrome: { softLimit: 80, hardLimit: 60 },
|
|
40
|
+
* Safari: { softLimit: 14.1, hardLimit: 13.5 },
|
|
41
|
+
* }}
|
|
42
|
+
* unsupportedBrowsers={["Firefox"]}
|
|
43
|
+
* />
|
|
44
|
+
* @endexample
|
|
45
|
+
* In the above code we have changed the minimum supported versions of Chrome &
|
|
46
|
+
*
|
|
47
|
+
* Safari. Now if a user has accessed the site using Chrome < 80 or Safari < 14.1
|
|
48
|
+
*
|
|
49
|
+
* the callout message will be displayed. If a user has accessed the site using
|
|
50
|
+
*
|
|
51
|
+
* Chrome < 60 or Safari < 13.5, a message will be displayed to update the browser
|
|
52
|
+
*
|
|
53
|
+
* and page contents will not be shown. If a user has accessed the site using any
|
|
54
|
+
*
|
|
55
|
+
* version of Firefox, a message will be displayed that the browser is unsupported
|
|
56
|
+
*
|
|
57
|
+
* and page contents will not be shown.
|
|
58
|
+
*
|
|
59
|
+
* The default supported browser names and their versions are given below:
|
|
60
|
+
*
|
|
61
|
+
* The default unsupported browsers are given below:
|
|
62
|
+
*
|
|
63
|
+
* Any other browser which is not in the above lists will be considered as unknown
|
|
64
|
+
*
|
|
65
|
+
* and a corresponding callout will be shown.
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
const BrowserSupport: React.FC<{
|
|
69
|
+
overrides?: {
|
|
70
|
+
Chrome?: VersionLimits;
|
|
71
|
+
MicrosoftEdge?: VersionLimits;
|
|
72
|
+
Firefox?: VersionLimits;
|
|
73
|
+
IE?: VersionLimits;
|
|
74
|
+
Opera?: VersionLimits;
|
|
75
|
+
Safari?: VersionLimits;
|
|
76
|
+
AndroidBrowser?: VersionLimits;
|
|
77
|
+
OperaMini?: VersionLimits;
|
|
78
|
+
ChromeMobile?: VersionLimits;
|
|
79
|
+
FirefoxMobile?: VersionLimits;
|
|
80
|
+
UCBrowser?: VersionLimits;
|
|
81
|
+
SamsungInternet?: VersionLimits;
|
|
82
|
+
};
|
|
83
|
+
unsupportedBrowsers?: string[];
|
|
84
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
85
|
+
}>;
|
|
86
|
+
export default BrowserSupport;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CheckboxProps, DropdownProps, InputProps } from "@bigbinary/neetoui";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* It is a helper component that can be used along with the table component to hide
|
|
6
|
+
*
|
|
7
|
+
* and show columns.
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
*
|
|
13
|
+
* import React, { useState } from "react";
|
|
14
|
+
*
|
|
15
|
+
* import { Table } from "@bigbinary/neetoui";
|
|
16
|
+
* import Columns from "@bigbinary/neeto-molecules/Columns";
|
|
17
|
+
*
|
|
18
|
+
* import { DEFAULT_COLUMNS_DATA, DEFAULT_ROW_DATA } from "./constants";
|
|
19
|
+
*
|
|
20
|
+
* const App = () => {
|
|
21
|
+
* const [columns, setColumns] = useState(DEFAULT_COLUMNS_DATA);
|
|
22
|
+
*
|
|
23
|
+
* return (
|
|
24
|
+
* <div>
|
|
25
|
+
* <Columns
|
|
26
|
+
* columnData={DEFAULT_COLUMNS_DATA}
|
|
27
|
+
* localStorageKey="NEETO_APP_FEATURE_HIDDEN_COLUMNS"
|
|
28
|
+
* onChange={setColumns}
|
|
29
|
+
* />
|
|
30
|
+
* <Table rowData={DEFAULT_ROW_DATA} columnData={columns} />
|
|
31
|
+
* </div>
|
|
32
|
+
* );
|
|
33
|
+
* };
|
|
34
|
+
* @endexample
|
|
35
|
+
*/
|
|
36
|
+
const Columns: React.FC<{
|
|
37
|
+
actionBlock?: React.ReactNode;
|
|
38
|
+
checkboxProps?: CheckboxProps;
|
|
39
|
+
columnData: {
|
|
40
|
+
title: string;
|
|
41
|
+
dataIndex: string;
|
|
42
|
+
key: string;
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}[];
|
|
45
|
+
dropdownProps?: DropdownProps;
|
|
46
|
+
fixedColumns?: string[];
|
|
47
|
+
isSearchable?: boolean;
|
|
48
|
+
localStorageKey: string;
|
|
49
|
+
noColumnMessage?: string;
|
|
50
|
+
onChange: (columns: any[]) => any[];
|
|
51
|
+
searchProps?: InputProps;
|
|
52
|
+
}>;
|
|
53
|
+
export default Columns;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A container component to be used as a wrapper for the page content.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* import Container from "@bigbinary/neeto-molecules/Container";
|
|
9
|
+
*
|
|
10
|
+
* const App = () => (
|
|
11
|
+
* <Container>
|
|
12
|
+
* <div>Page content</div>
|
|
13
|
+
* </Container>
|
|
14
|
+
* );
|
|
15
|
+
* @endexample
|
|
16
|
+
* When we are using the container with the header we can use the isHeaderFixed
|
|
17
|
+
*
|
|
18
|
+
* prop to remove the side padding.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
*
|
|
22
|
+
* import Container from "@bigbinary/neeto-molecules/Container";
|
|
23
|
+
*
|
|
24
|
+
* const App = () => (
|
|
25
|
+
* <Container isHeaderFixed>
|
|
26
|
+
* <Header title="Title" />
|
|
27
|
+
* <div>Page content</div>
|
|
28
|
+
* </Container>
|
|
29
|
+
* );
|
|
30
|
+
* @endexample
|
|
31
|
+
*/
|
|
32
|
+
const Container: React.FC<{
|
|
33
|
+
isHeaderFixed?: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
export default Container;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A button that copies the given value to the clipboard.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
*
|
|
8
|
+
* import CopyToClipboardButton from "@bigbinary/neeto-molecules/CopyToClipboardButton";
|
|
9
|
+
*
|
|
10
|
+
* const CopyToClipboardDemo = ({ value }) => (
|
|
11
|
+
* <CopyToClipboardButton label="Copy text" value={value} />
|
|
12
|
+
* );
|
|
13
|
+
* @endexample
|
|
14
|
+
*/
|
|
15
|
+
const CopyToClipboardButton: React.FC<{
|
|
16
|
+
className?: string;
|
|
17
|
+
icon?: string | any;
|
|
18
|
+
label?: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}>;
|
|
21
|
+
export default CopyToClipboardButton;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A common component for managing custom domain. This component can be used when
|
|
5
|
+
*
|
|
6
|
+
* you have a single custom domain.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* import CustomDomain from "@bigbinary/neeto-molecules/CustomDomain";
|
|
11
|
+
*
|
|
12
|
+
* <CustomDomain url="api/v1/admin/custom_domain" iconOnly />;
|
|
13
|
+
* @endexample
|
|
14
|
+
*/
|
|
15
|
+
const CustomDomain: React.FC<{
|
|
16
|
+
url: string;
|
|
17
|
+
iconOnly: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
export default CustomDomain;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A full page common component for managing custom domains. This component can be
|
|
5
|
+
*
|
|
6
|
+
* used when you have multiple associated custom domains.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* import CustomDomainDashboard from "@bigbinary/neeto-molecules/CustomDomainDashboard";
|
|
11
|
+
*
|
|
12
|
+
* const SETTINGS_BREADCRUMBS = [
|
|
13
|
+
* {
|
|
14
|
+
* text: "Settings",
|
|
15
|
+
* link: "/admin/settings",
|
|
16
|
+
* },
|
|
17
|
+
* ];
|
|
18
|
+
*
|
|
19
|
+
* <CustomDomainDashboard
|
|
20
|
+
* headerProps={{ breadcrumbs: SETTINGS_BREADCRUMBS }}
|
|
21
|
+
* url="api/v1/admin/custom_domains"
|
|
22
|
+
* />;
|
|
23
|
+
* @endexample
|
|
24
|
+
* 
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
const CustomDomainDashboard: React.FC<{
|
|
28
|
+
headerProps: {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
};
|
|
31
|
+
url: string;
|
|
32
|
+
}>;
|
|
33
|
+
export default CustomDomainDashboard;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { TooltipProps, TypographyProps } from "@bigbinary/neetoui";
|
|
4
|
+
import {
|
|
5
|
+
timeFormat,
|
|
6
|
+
DateTimeType,
|
|
7
|
+
} from "@bigbinary/neeto-commons-frontend/utils";
|
|
8
|
+
|
|
9
|
+
const DateFormat: {
|
|
10
|
+
[key in Capitalize<keyof typeof timeFormat>]: React.FC<{
|
|
11
|
+
date: DateTimeType;
|
|
12
|
+
timerInterval?: number;
|
|
13
|
+
typographyProps?: Partial<TypographyProps>;
|
|
14
|
+
tooltipProps?: Partial<TooltipProps>;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default DateFormat;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Dayjs } from "dayjs";
|
|
3
|
+
interface TimePeriodType {
|
|
4
|
+
startDate: Dayjs;
|
|
5
|
+
endDate: Dayjs;
|
|
6
|
+
rangeType: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* A common component to manage your date range filters.
|
|
11
|
+
*
|
|
12
|
+
* 
|
|
13
|
+
*
|
|
14
|
+
* 
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* import DateRangeFilter from "@bigbinary/neeto-molecules/DateRangeFilter";
|
|
19
|
+
* const DateRangeFilterActionBlock = (
|
|
20
|
+
* {
|
|
21
|
+
* //pass the necessary props
|
|
22
|
+
* }
|
|
23
|
+
* ) => {
|
|
24
|
+
* const [timePeriod, setTimePeriod] = useState(INITIAL_TIME_PERIOD_VALUE);
|
|
25
|
+
* //INITIAL_TIME_PERIOD_VALUE will be an object with label,value and rangeType as keys
|
|
26
|
+
* return (
|
|
27
|
+
* <DateRangeFilter
|
|
28
|
+
* timePeriod={timePeriod}
|
|
29
|
+
* setTimePeriod={setTimePeriod}
|
|
30
|
+
* timePeriodOptions={[
|
|
31
|
+
* {
|
|
32
|
+
* label: "New filter label",
|
|
33
|
+
* value: {startDate: pass dayjs object , endDate: pass dayjs object , rangeType: "new_range_type"},
|
|
34
|
+
* },
|
|
35
|
+
* ]} // pass this prop only if you want to override default filters available
|
|
36
|
+
* />
|
|
37
|
+
* );
|
|
38
|
+
* };
|
|
39
|
+
* @endexample
|
|
40
|
+
* Note: The value of timePeriod state will contain the startDate, endDate and
|
|
41
|
+
*
|
|
42
|
+
* range_type of the selected filter. This can be passed into the filterParams of
|
|
43
|
+
*
|
|
44
|
+
* your API.
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
const DateRangeFilter: React.FC<{
|
|
48
|
+
timePeriod: TimePeriodType;
|
|
49
|
+
setTimePeriod: React.Dispatch<React.SetStateAction<TimePeriodType>>;
|
|
50
|
+
timePeriodOptions: TimePeriodType[];
|
|
51
|
+
}>;
|
|
52
|
+
export default DateRangeFilter;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DropdownProps } from "@bigbinary/neetoui";
|
|
3
|
+
interface Variable {
|
|
4
|
+
label?: string;
|
|
5
|
+
key?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
category?: string;
|
|
8
|
+
variables?: Omit<Variable, "variables">[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* A common component for using dynamic variables.
|
|
13
|
+
*
|
|
14
|
+
* 
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* import DynamicVariables from "@bigbinary/neeto-molecules/DynamicVariables";
|
|
19
|
+
* import { Input } from "neetoui/formik";
|
|
20
|
+
*
|
|
21
|
+
* const DynamicVariablesDemo = () => {
|
|
22
|
+
* return (
|
|
23
|
+
* <Input
|
|
24
|
+
* label="Input with DynamicVariables"
|
|
25
|
+
* name="subject"
|
|
26
|
+
* suffix={
|
|
27
|
+
* <DynamicVariables
|
|
28
|
+
* dropdownProps={{ buttonStyle: "text" }}
|
|
29
|
+
* variables={EDITOR_VARIABLES}
|
|
30
|
+
* onVariableClick={variable => {
|
|
31
|
+
* console.log(variable);
|
|
32
|
+
* }}
|
|
33
|
+
* />
|
|
34
|
+
* }
|
|
35
|
+
* />
|
|
36
|
+
* );
|
|
37
|
+
* };
|
|
38
|
+
* @endexample
|
|
39
|
+
*/
|
|
40
|
+
const DynamicVariables: React.FC<{
|
|
41
|
+
onVariableClick?: (variable: Variable) => void;
|
|
42
|
+
variables: Variable[];
|
|
43
|
+
dropdownProps?: DropdownProps;
|
|
44
|
+
}>;
|
|
45
|
+
export default DynamicVariables;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A common component to preview emails.
|
|
5
|
+
*
|
|
6
|
+
* 
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* import React from "react";
|
|
11
|
+
* import { useFormikContext } from "formik";
|
|
12
|
+
* import EmailPreview from "@bigbinary/neeto-molecules/EmailPreview";
|
|
13
|
+
* const EmailShare = () => {
|
|
14
|
+
* const { values } = useFormikContext();
|
|
15
|
+
* return (
|
|
16
|
+
* <div>
|
|
17
|
+
* <EmailPreview
|
|
18
|
+
* actionButtonText={values.startSurveyButtonText}
|
|
19
|
+
* body={values.emailBody}
|
|
20
|
+
* subject={values.emailSubject}
|
|
21
|
+
* logo={values.logo}
|
|
22
|
+
* to={values.notifyEmails}
|
|
23
|
+
* from={values.emailsFrom}
|
|
24
|
+
* productName="Form"
|
|
25
|
+
* />
|
|
26
|
+
* </div>
|
|
27
|
+
* );
|
|
28
|
+
* };
|
|
29
|
+
* export default EmailShare;
|
|
30
|
+
* @endexample
|
|
31
|
+
*/
|
|
32
|
+
const EmailPreview: React.FC<{
|
|
33
|
+
to?: string[];
|
|
34
|
+
subject?: string;
|
|
35
|
+
body?: string;
|
|
36
|
+
from?: string;
|
|
37
|
+
logo?: string;
|
|
38
|
+
productName?: string;
|
|
39
|
+
actionButtonText?: string;
|
|
40
|
+
}>;
|
|
41
|
+
export default EmailPreview;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A fallback page for handling 404, 403 and 500 errors.
|
|
5
|
+
*
|
|
6
|
+
* The component also has a "contact us" link that opens the chat widget for
|
|
7
|
+
*
|
|
8
|
+
* further communication.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
const ErrorPage: React.FC<{
|
|
12
|
+
homeUrl?: string;
|
|
13
|
+
status?: number;
|
|
14
|
+
}>;
|
|
15
|
+
export default ErrorPage;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DropdownProps } from "neetoui";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* The Header component can be used to display the page title and an action block
|
|
6
|
+
*
|
|
7
|
+
* to perform the main operations on the page.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* import Header from "@bigbinary/neeto-molecules/Header";
|
|
12
|
+
*
|
|
13
|
+
* const App = () => (
|
|
14
|
+
* <Header title="Heading" actionBlock={<Button label="Primary action" />} />
|
|
15
|
+
* );
|
|
16
|
+
* @endexample
|
|
17
|
+
*/
|
|
18
|
+
const Header: React.FC<{
|
|
19
|
+
title?: React.ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
actionBlock?: React.ReactNode;
|
|
22
|
+
searchProps?: object;
|
|
23
|
+
breadcrumbs?: {
|
|
24
|
+
text: string;
|
|
25
|
+
link: string;
|
|
26
|
+
}[];
|
|
27
|
+
dropdownProps?: DropdownProps;
|
|
28
|
+
menuBarToggle?: (...args: any[]) => any;
|
|
29
|
+
}>;
|
|
30
|
+
export default Header;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A dropdown component that allows you to select an icon from a list of
|
|
5
|
+
*
|
|
6
|
+
* Google icons.
|
|
7
|
+
*
|
|
8
|
+
* 
|
|
9
|
+
*
|
|
10
|
+
* We make use of a feature called ligatures that convert the snake cased name of
|
|
11
|
+
*
|
|
12
|
+
* an icon to an actual icon. It is achieved like so. Note that the classname
|
|
13
|
+
*
|
|
14
|
+
* "material-symbols-rounded" is necessary for this conversion to work.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* <span className="material-symbols-rounded">icon_name</span>
|
|
19
|
+
* @endexample
|
|
20
|
+
* @example
|
|
21
|
+
*
|
|
22
|
+
* import IconPicker from "@bigbinary/neeto-molecules/IconPicker";
|
|
23
|
+
*
|
|
24
|
+
* const App = () => {
|
|
25
|
+
* const [value, setValue] = useState("home");
|
|
26
|
+
* return (
|
|
27
|
+
* <IconPicker
|
|
28
|
+
* value={value}
|
|
29
|
+
* label="Select an icon"
|
|
30
|
+
* onClick={value => setValue(value)}
|
|
31
|
+
* />
|
|
32
|
+
* );
|
|
33
|
+
* };
|
|
34
|
+
* @endexample
|
|
35
|
+
*/
|
|
36
|
+
const IconPicker: React.FC<{
|
|
37
|
+
filled?: boolean;
|
|
38
|
+
value?: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
onClick?: Function;
|
|
41
|
+
className?: string;
|
|
42
|
+
}>;
|
|
43
|
+
export default IconPicker;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IconProps } from "neetoicons";
|
|
2
|
+
import React, { ReactElement } from "react";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* A common component used for integrations across neeto products.
|
|
6
|
+
*
|
|
7
|
+
* 
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* import IntegrationCard from "@bigbinary/neeto-molecules/IntegrationCard";
|
|
12
|
+
*
|
|
13
|
+
* return (
|
|
14
|
+
* <IntegrationCard
|
|
15
|
+
* Icon={SlackIcon}
|
|
16
|
+
* description="Integrate with Slack"
|
|
17
|
+
* isConnected={isConnected}
|
|
18
|
+
* label="Slack"
|
|
19
|
+
* customDropdown={
|
|
20
|
+
* <Dropdown buttonStyle="text" icon={MenuVertical}>
|
|
21
|
+
* <Menu>
|
|
22
|
+
* <MenuItem.Button>Custom Option</MenuItem.Button>
|
|
23
|
+
* </Menu>
|
|
24
|
+
* </Dropdown>
|
|
25
|
+
* }
|
|
26
|
+
* onConnect={handleConnect}
|
|
27
|
+
* onDisconnect={handleDisconnect}
|
|
28
|
+
* onManage={handleManage}
|
|
29
|
+
* />
|
|
30
|
+
* );
|
|
31
|
+
* @endexample
|
|
32
|
+
*/
|
|
33
|
+
const IntegrationCard: React.FC<{
|
|
34
|
+
label: string;
|
|
35
|
+
description: string;
|
|
36
|
+
Icon: React.FC<IconProps>;
|
|
37
|
+
className?: string;
|
|
38
|
+
isConnected: boolean;
|
|
39
|
+
isStatusLoading?: boolean;
|
|
40
|
+
customDropdown?: React.ReactNode;
|
|
41
|
+
onDisconnect?: (...args: any[]) => any;
|
|
42
|
+
onConnect: (...args: any[]) => any;
|
|
43
|
+
onManage?: (...args: any[]) => any;
|
|
44
|
+
}>;
|
|
45
|
+
export default IntegrationCard;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A common component used for disconnect UI of integrations across neeto products.
|
|
5
|
+
*
|
|
6
|
+
* 
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* import IntegrationDisconnectAlert from "@bigbinary/neeto-molecules/IntegrationDisconnectAlert";
|
|
11
|
+
*
|
|
12
|
+
* const Integration = () => {
|
|
13
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
14
|
+
* const [isDisconnecting, setIsDisconnecting] = useState(false);
|
|
15
|
+
*
|
|
16
|
+
* return (
|
|
17
|
+
* <IntegrationDisconnectAlert
|
|
18
|
+
* isOpen={isOpen}
|
|
19
|
+
* isDisconnecting={isDisconnecting}
|
|
20
|
+
* title="Disconnect Slack"
|
|
21
|
+
* message="You will be disconnected from Slack."
|
|
22
|
+
* onClose={() => setIsOpen(false)}
|
|
23
|
+
* onDisconnect={() => console.log("Disconnect the integration")}
|
|
24
|
+
* />
|
|
25
|
+
* );
|
|
26
|
+
* };
|
|
27
|
+
* @endexample
|
|
28
|
+
*/
|
|
29
|
+
const IntegrationDisconnectAlert: React.FC<{
|
|
30
|
+
isOpen: boolean;
|
|
31
|
+
isDisconnecting: boolean;
|
|
32
|
+
title: string;
|
|
33
|
+
message?: string;
|
|
34
|
+
onClose: (...args: any[]) => any;
|
|
35
|
+
onDisconnect: (...args: any[]) => any;
|
|
36
|
+
}>;
|
|
37
|
+
export default IntegrationDisconnectAlert;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A component used to display walkthrough video of integration.
|
|
5
|
+
*
|
|
6
|
+
* 
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* import React, { useState } from "react";
|
|
11
|
+
* import IntegrationWalkthroughModal from "@bigbinary/neeto-molecules/IntegrationWalkthroughModal";
|
|
12
|
+
*
|
|
13
|
+
* const Finish = () => {
|
|
14
|
+
* const [isModalOpen, setIsModalOpen] = useState(true);
|
|
15
|
+
*
|
|
16
|
+
* return (
|
|
17
|
+
* <IntegrationWalkthroughModal
|
|
18
|
+
* isOpen={isModalOpen}
|
|
19
|
+
* onClose={() => setIsModalOpen(false)}
|
|
20
|
+
* videoUrl="https://user-images.githubusercontent.com/39831309/232906732-43e139ac-4af8-4a59-9f4f-e96ebf436f75.mov"
|
|
21
|
+
* />
|
|
22
|
+
* );
|
|
23
|
+
* };
|
|
24
|
+
* @endexample
|
|
25
|
+
*/
|
|
26
|
+
const IntegrationWalkthroughModal: React.FC<{
|
|
27
|
+
videoUrl: string;
|
|
28
|
+
isOpen: boolean;
|
|
29
|
+
onClose: Function;
|
|
30
|
+
}>;
|
|
31
|
+
export default IntegrationWalkthroughModal;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A common component to restrict IPs in neeto applications.
|
|
5
|
+
*
|
|
6
|
+
* 
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* import IpRestriction from "@bigbinary/neeto-molecules/IpRestriction";
|
|
11
|
+
*
|
|
12
|
+
* const IpRestrictionSetting = () => (
|
|
13
|
+
* <Container isHeaderFixed className="w-full">
|
|
14
|
+
* <Header title="IP Restrictions" />
|
|
15
|
+
* <Scrollable className="w-full">
|
|
16
|
+
* <IpRestriction />
|
|
17
|
+
* </Scrollable>
|
|
18
|
+
* </Container>
|
|
19
|
+
* );
|
|
20
|
+
* @endexample
|
|
21
|
+
*/
|
|
22
|
+
const IpRestriction: React.FC<{}>;
|
|
23
|
+
export default IpRestriction;
|